Logo

A modern C++20 library for retro-style game development, built on SDL3.

micro gives you a clean, type-safe API for creating pixel-perfect 2D games with minimal boilerplate. All dependencies ship as submodules — clone and build, nothing else to install.

Motivation

micro is built around a modern C++20 API — expressive, type-safe, hard to misuse — but it never gets in your way. There's no engine, no editor, no framework to learn. Just a window, a renderer, and your code. Under the hood it uses SDL3, the latest major version of the industry-standard cross-platform library.

That makes it particularly well-suited for game jams, prototypes, and anyone who wants to sketch up something visual in minutes rather than hours. Open a window, draw something, iterate. The boilerplate is gone; the fun part starts immediately.

Features

  • 📦 RAII resources — all handles are automatically managed via shared ownership
  • 🖥️ Window & renderer — create a window and draw to it in a few lines
  • 🖼️ Texture & image loading — PNG support with pixel-art scaling built in
  • Sprite batching — draw calls with the same texture are batched automatically
  • ✏️ Primitive drawing — pixels, lines, filled and outline rectangles
  • 🔤 Font rendering — embedded bitmap font, no external assets required
  • ⌨️ Keyboard & mouse input — polling-based, framed around the game loop
  • 📐 Logical resolution — letterbox or stretch to any target resolution
  • 🛡️ Error handling — exceptions with SDL error messages included
  • 🔊 Audio — play sound effects and music with a simple mixer and sound API

Hello world

#include <micro/core.hpp>

int main() {
    return micro::entry([] {
        micro::window win{"Hello", 640, 480};
        micro::renderer rend{win};

        while (win.running()) {
            rend.clear(micro::color::black);
            rend.present();
        }
    });
}

Requirements

  • C++20 compiler (MSVC 2022, GCC 12, Clang 15 or later)
  • CMake 3.15+
  • Git (for submodules)

Getting started

See the Quickstart guide for build instructions and your first project.

License

micro is released under the zlib/libpng license — permissive, OSI-certified, suitable for commercial and closed-source projects.