OVERVIEW
Monorepo/Frameworks & UI/libs/framework
v0.2.0 • ActiveSource Code
libs/framework/

libs/framework

Cross-Platform Application Bootstrap Harness

The core application harness that abstracts GLFW3 window creation, OpenGL context negotiation, event polling, and frame timing. Provides an ergonomic lifecycle interface for building desktop games, developer tools, and rich interactive applications.

Windowing BackendGLFW3 Core
Graphics APIOpenGL 3.3 Core
Timer AccuracyMicrosecond Pacing
MilestoneM7 Stabilized
libs/framework
Frame Budget & Event Loop
Target: 144 FPS (6.94ms per frame)
1. Input Polling (0.2ms)
Raw keyboard & mouse events polled via GLFW3 callbacks
2. Piece Table Mutation (0.4ms)
Append-only buffer edit with instant O(1) undo/redo stack
3. GPU Batched Quad Draw (0.8ms)
Dynamic font atlas textures rendered in single GPU draw call
Graphics Engine Architecture
Piece Table Buffer Engine

Sub-Millisecond Multi-Cursor Editing

Unlike line-array or gap-buffer architectures, the Kale Piece Table holds an immutable original file buffer coupled with an append-only edit buffer. Loading a 100MB file takes under 1ms because no memory copying occurs.

Buffer Type: Immutable File Span + Append-Only Log
Undo/Redo: Zero heap copy • O(1) pointer adjustment
app_main.kl
kale
import "libs/framework/app.kl" as app;

fn main() -> int32 {
    let cfg: app.WindowConfig = app.default_config("Kale Studio", 1280, 720);
    let application: app.Application = app.create(&cfg);
    
    while app.is_running(&application) {
        app.poll_events(&application);
        app.begin_frame(&application);
        
        // Render scene
        draw_dashboard();
        
        app.end_frame(&application);
    }
    
    app.destroy(&application);
    return 0;
}
Compilation & Linker Directives

Deterministic command-line invocations to build, link native dynamic dependencies, and run automated regression tests:

$kale build apps/sample_app/main.kl -o bin/sample.exe -lglfw3 -lopengl32
$./bin/sample.exe
Monorepo Governance

GPG Key 1B917D4779A6102E • Continuous integration with automated symbol verification.

Architectural Capabilities
Zero-Boilerplate Entry Point

One line to initialize window, context, font atlases, and render batchers with graceful error recovery.

Precise Frame Delta Clock

Calculates microsecond delta-times with fixed-step updates and silky smooth variable-rate rendering.

Unified Input Dispatch

Aggregates keyboard scan codes, mouse cursor coordinates, scroll wheels, and window resize events.