sokol
| Kind | ffi-zig |
|---|---|
| Categories | graphics gamedev multimedia |
| Keywords | graphics audio gamedev sokol zig-ffi |
Cross-platform graphics and audio library bindings for Kit using sokol-zig
Files
| File | Description |
|---|---|
kit.toml | Package manifest with metadata and dependencies |
src/main.kit | Gfx, App, GL, Audio, DebugText, and Shape API bindings |
zig/kit_ffi.zig | Kit FFI type conversions and memory management |
zig/sokol_wrapper.zig | Sokol C library wrapper exposing Kit-callable functions |
tests/sokol.test.kit | Module import and constant verification tests |
examples/blend.kit | Alpha blending with multiple overlapping quads |
examples/buffer-offsets.kit | Multiple shapes from a single vertex buffer |
examples/clear.kit | Animated background color cycling |
examples/cube.kit | Rotating 3D cube with colored faces |
examples/debug-text-print.kit | Printf-style formatted text overlay |
examples/debug-text-userfont.kit | Custom font rendering with KC85 charset |
examples/debug-text.kit | Multiple font styles in debug text overlay |
examples/defer-pattern.kit | Resource cleanup with defer statements |
examples/instancing-compute.kit | GPU compute shader for particle positions |
examples/instancing.kit | Thousands of particles with GPU instancing |
examples/mrt.kit | Multiple render targets with debug views |
examples/noninterleaved.kit | Separate position and color vertex buffers |
examples/offscreen.kit | Render-to-texture with donut on cube |
examples/quad.kit | Indexed drawing with a colored quad |
examples/saudio.kit | Real-time square wave audio generation |
examples/sgl-context.kit | Offscreen rendering as texture on 3D cube |
examples/sgl-points.kit | Animated rose curve with color palette |
examples/sgl.kit | Immediate-mode 2D quad and 3D cube rendering |
examples/shapes.kit | Box, sphere, cylinder, torus, and plane primitives |
examples/tex-cube.kit | Rotating cube with checkerboard texture |
examples/triangle.kit | Classic "Hello Triangle" with vertex colors |
examples/vertex-pull.kit | Storage buffer vertex fetch in shader |
LICENSE | MIT license file |
Dependencies
No Kit package dependencies.
Installation
kit add gitlab.com/kit-lang/packages/kit-sokol.gitUsage
import Kit.SokolLicense
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.