A collection of minimal, cross-platform, standalone C headers for graphics, audio, input, and app framework.
Sokol is a collection of minimal, standalone C headers that provide cross-platform abstractions for graphics rendering, audio playback, window management, and other low-level system APIs. It solves the problem of writing portable applications in C/C++ by offering lightweight wrappers around platform-specific APIs like OpenGL, Metal, D3D11, WebGPU, CoreAudio, WASAPI, and more, with a focus on minimal footprint and ease of integration.
C and C++ developers building cross-platform applications, games, or tools that need lightweight, portable access to graphics, audio, input, and system APIs without heavy dependencies or complex build systems.
Developers choose Sokol for its simplicity, minimal overhead, and cross-platform consistency. Unlike larger frameworks, it provides standalone headers that are easy to integrate, support WebAssembly as a first-class citizen, and follow the STB-style philosophy of being dependency-free and header-only.
minimal cross-platform standalone C headers
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
sokol_gfx.h seamlessly supports GL/GLES3/WebGL2, Metal, D3D11, and WebGPU, allowing developers to write rendering code once and deploy across desktop, mobile, and web with minimal changes.
As standalone STB-style headers, Sokol adds negligible size overhead and avoids complex build systems, making integration straightforward—evident in its emphasis on lightweight C code for easier language binding.
Explicitly designed with WebAssembly as a priority, Sokol provides consistent APIs for web and native platforms, enabling portable applications with minimal footprint on the web, as noted in the README.
Core headers like sokol_gfx.h, sokol_app.h, and sokol_audio.h can be used independently, allowing developers to pick only what they need and reduce bloat in their projects.
Sokol_gfx.h does not include built-in shader cross-translation; developers must use the external sokol-shdc tool for generating shader code, adding an extra step and potential complexity to the workflow.
It wraps low-level APIs without providing higher-level features like scene graphs, advanced rendering techniques, or integrated asset management, requiring more manual implementation from developers.
Written in C, the API may not leverage modern C++ features like RAII or smart pointers, which could be a drawback for C++-focused projects preferring object-oriented or resource-safe patterns.