sokol

Cross-platform graphics and audio library bindings for Kit using sokol-zig

Files

FileDescription
kit.tomlPackage manifest with metadata and dependencies
src/main.kitGfx, App, GL, Audio, DebugText, and Shape API bindings
zig/kit_ffi.zigKit FFI type conversions and memory management
zig/sokol_wrapper.zigSokol C library wrapper exposing Kit-callable functions
tests/sokol.test.kitModule import and constant verification tests
examples/blend.kitAlpha blending with multiple overlapping quads
examples/buffer-offsets.kitMultiple shapes from a single vertex buffer
examples/clear.kitAnimated background color cycling
examples/cube.kitRotating 3D cube with colored faces
examples/debug-text-print.kitPrintf-style formatted text overlay
examples/debug-text-userfont.kitCustom font rendering with KC85 charset
examples/debug-text.kitMultiple font styles in debug text overlay
examples/defer-pattern.kitResource cleanup with defer statements
examples/instancing-compute.kitGPU compute shader for particle positions
examples/instancing.kitThousands of particles with GPU instancing
examples/mrt.kitMultiple render targets with debug views
examples/noninterleaved.kitSeparate position and color vertex buffers
examples/offscreen.kitRender-to-texture with donut on cube
examples/quad.kitIndexed drawing with a colored quad
examples/saudio.kitReal-time square wave audio generation
examples/sgl-context.kitOffscreen rendering as texture on 3D cube
examples/sgl-points.kitAnimated rose curve with color palette
examples/sgl.kitImmediate-mode 2D quad and 3D cube rendering
examples/shapes.kitBox, sphere, cylinder, torus, and plane primitives
examples/tex-cube.kitRotating cube with checkerboard texture
examples/triangle.kitClassic "Hello Triangle" with vertex colors
examples/vertex-pull.kitStorage buffer vertex fetch in shader
LICENSEMIT license file

Dependencies

No Kit package dependencies.

Installation

kit add gitlab.com/kit-lang/packages/kit-sokol.git

Usage

import Kit.Sokol

License

MIT License - see LICENSE for details.

Exported Functions & Types

SokolError

Sokol error type for typed error handling.

Variants

SokolConfigError {message}
SokolCallbackError {message}
SokolGraphicsError {message}
SokolNotImplementedError {message}

rgb

Create a color from RGB values (0-255).

Int -> Int -> Int -> {r: Float, g: Float, b: Float, a: Float}

rgba

Create a color from RGBA values (0-255).

Int -> Int -> Int -> Int -> {r: Float, g: Float, b: Float, a: Float}

colors

Common colors.