A minimal, beginner-friendly 2D graphics library for C.
SDL2 is a powerful foundation, but it asks you to manage renderers, surfaces, and event queues before you can draw a circle. Cinder sits on top of SDL2 and collapses that setup into a single header and a straightforward game loop, so a beginner can focus on building something instead of configuring something. It is not a game engine — there are no scenes, no entities, no editor — just a clean API for a window, input, and drawing.
A Cinder program looks like this:
#include <cinder/cinder.h>
int main(void)
{
if (CinderInit(CINDER_SUBSYSTEM_ALL) != CINDER_STATUS_OK)
return 1;
if (CinderCreateWindow(CinderDefaultWindowDesc()) != CINDER_STATUS_OK)
return 1;
while (CinderIsRunning())
{
CinderBeginFrame();
CinderClearBackground(CINDER_BLACK);
CinderEndFrame();
}
CinderQuit(); // cleans up window, renderer, and SDL
return 0;
}Tested on Linux and macOS. Windows support is experimental — MSVC has stricter C compliance requirements that may require source changes.
Install the required libraries before building.
# Ubuntu/Debian
sudo apt install libsdl2-dev libsdl2-image-dev libsdl2-gfx-dev libsdl2-ttf-dev libsdl2-mixer-dev
# Arch
sudo pacman -S sdl2 sdl2_image sdl2_gfx sdl2_ttf sdl2_mixergit clone https://github.com/UniquePython/cinder.git
cd cinder
cmake -B build
cmake --build build -j$(nproc)
sudo cmake --install buildCMake:
find_package(Cinder REQUIRED)
target_link_libraries(your_target PRIVATE Cinder::Cinder)Makefile / manual:
CFLAGS += $(shell pkg-config --cflags cinder)
LIBS += $(shell pkg-config --libs cinder)Raw gcc:
gcc main.c $(pkg-config --cflags --libs cinder) -o myappThen include the header:
#include <cinder/cinder.h>| Module | Header | Description |
|---|---|---|
| Subsystem | cinder/cinder_subsystem.h |
Initialize and shut down Cinder subsystems |
| Window | cinder/cinder_window.h |
Create and destroy the application window |
| Loop | cinder/cinder_loop.h |
Game loop control — begin frame, end frame, quit |
| Input | cinder/cinder_input.h |
Keyboard and mouse state, per-frame and held queries |
| Drawing | cinder/cinder_draw.h |
Lines, circles, triangles, rectangles |
| Textures | cinder/cinder_texture.h |
Load, draw, and destroy image textures |
| Audio | cinder/cinder_audio.h |
Load and play sound effects and music |
| Blend Modes | cinder/cinder_blend.h |
Set blend modes globally or per-texture — none, alpha, additive, multiply |
| Text & Fonts | cinder/cinder_text.h |
Load fonts, draw text, cache rendered text |
| Timers | cinder/cinder_timer.h |
Delta time, FPS, and general-purpose timers |
| RNG | cinder/cinder_rng.h |
PCG32 random number generator — integers, floats, directions, and a global convenience API |
| Math & Types | cinder/cinder_math.h |
Vectors, points, sizes, rectangles, circles and math operations. Linkable without SDL as Cinder::Math |
| Plugins | cinder/cinder_plugin.h |
Register and manage lifecycle plugins with init, update, draw, and shutdown callbacks |
| Error & Logging | cinder/cinder_error.h |
Error state, log callbacks, and the CINDER_LOG macro |
The examples/ directory contains Pong, Snake and Pendulum built with Cinder.
Cinder is licensed under the MIT License.
Cinder was heavily inspired by raylib and its philosophy of making graphics programming simple and accessible.



