minimal cross-platform standalone C headers
Simple
STB-style
cross-platform libraries for C and C++, written in C.
See what's new (14-Sep-2026: sokol_app.h: changed mouse-locking behaviour on Linux)
Live Samples via WASM (source)
Doom Shareware ported to the Sokol headers (source)
Syntonic Dentiforms Redux demo remaster by Aras Pranckevičius (blog post).
Everybody Wants to Crank the World demo by Aras Pranckevičius, PC/web port via sokol (source).
sokol_gp.h a 2D shape drawing library on top of sokol_gfx.h
NanoVG backend a sokol_gfx backend for the amazing NanoVG library.
Dear ImGui starterkit a self-contained starterkit for writing Dear ImGui apps in C.
qoiview a basic viewer for the new QOI image file format
A 'single-file' Pacman clone in C99, also available in Zig
Soluna, a framework to make 2D games in Lua by @cloudwu
Deep Future: ...and a game implemented with Soluna
Solar Storm, a turn-based scifi artillery game built with Odin and Sokol, released on Steam.
Spanking Runners (Samogonki), arcade racing in a bright and unusual world, released on Steam.
MEG-4 a virtual fantasy console emulator in C89, ported to sokol
A Minigolf game (source).
hIghQube A game demo that used sokol rendering extensively
Senos A music app that uses sokol as backend
'Brick Warrior' - a 1990's Breakout clone ported to Sokol :)
LearnOpenGL examples ported to sokol-gfx (may be outdated) (git repo)
Command line tools (shader compiler)
How to build without a build system: useful details for integrating the Sokol headers into your own project with your favourite C/C++ build system
These are automatically updated on changes to the C headers:
WebAssembly is a 'first-class citizen', one important motivation for the Sokol headers is to provide a collection of cross-platform APIs with a minimal footprint on the web platform while still being useful.
The core headers are standalone and can be used independently from each other.
A blog post with more background info: A Tour of sokol_gfx.h
When a first Sokol integration fails to compile or link, the problem is usually one of the following configuration mismatches:
SOKOL_IMPL (or the per-header SOKOL_*_IMPL define) in exactly one
C or C++ translation unit before including the Sokol headers. Other files
should include the headers without the implementation define.SOKOL_GLCORE, SOKOL_GLES3, SOKOL_D3D11, SOKOL_METAL,
SOKOL_WGPU or SOKOL_VULKAN. The backend define must match the shader code
and any window/context setup code you use.sokol_gfx.h and sokol_app.h are used together, use the same backend
define for both headers. sokol_app.h creates the matching window and 3D API
context; sokol_glue.h then forwards the platform-specific environment via
sglue_environment() and sglue_swapchain().sokol_app.h or Metal must compile the
implementation file as Objective-C or Objective-C++ (.m or .mm, or the
equivalent compiler flag), and link the frameworks listed in the header docs.-s USE_WEBGL2=1 when using
SOKOL_GLES3. WebGPU builds use SOKOL_WGPU and need the WebGPU port/options
described in the sokol_gfx.h header comments.SOKOL_GLCORE uses GLX by default; define
SOKOL_FORCE_EGL if your build intentionally uses EGL instead.#pragma comment(lib, ...) directives. MinGW/MSYS2 builds may need
explicit linker flags such as -ld3d11 for SOKOL_D3D11.sokol-shdc version compatible with the Sokol headers and were generated for
the same backend(s) selected at compile time.For exact per-header compiler and linker requirements, see the comment block at
the top of each Sokol header and the build notes in
sokol-samples.
A minimal cross-platform application-wrapper library:
The vanilla Hello-Triangle using sokol_gfx.h, sokol_app.h and the sokol-shdc shader compiler (shader code not shown):
…A minimal audio-streaming API:
Sporadic input delay on MacOS Tahoe 26.0.1 (1000Hz mouse)
Revamp usage buffer/image usage flags
Customizing Sokol GL shader
Brain dump new resource update api
Resource views update 2
sokol_gfx.h: Feature request fragment-writeable storage buffers
Raspberry Pi error in _sg_gl_create_buffer
sokol_framebuffer.h: post write-api modernizations
Feature Request: Add support for Indirect Draw Calls (sg_draw_indirect)
Windows Resize Event Delay