Quickstart

Clone

git clone --recursive https://github.com/pfrithiofsson/micro.git
cd micro

If you already cloned without --recursive:

git submodule update --init --recursive

Build

cmake -B build
cmake --build build

This builds the static library and all examples.

Run an example

./build/examples/minimal/minimal

Using micro in your project

Copy or submodule the repo, then in your CMakeLists.txt:

cmake_minimum_required(VERSION 3.15)
project(mygame)

add_subdirectory(micro)

add_executable(mygame main.cpp)
target_link_libraries(mygame PRIVATE micro)

Your first program

#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();
        }
    });
}