Header-only software renderer in C99.
Author: Giovanni Santini Mail: giovanni.santini@proton.me License: MIT
Do this:
#define MICRO_DRAW_IMPLEMENTATION
before you include this file in one C or C++ file to create the implementation.
i.e. it should look like this:
#include … #include … #include … #define MICRO_DRAW_IMPLEMENTATION #include “micro-draw.h”
You can tune the library by #defining certain values. See the “Config” comments under “Configuration” below.
To enable PPM related functions, you need to #define MIRO_DRAW_PPM. More info: https://en.wikipedia.org/wiki/Netpbm
The usage is quite straight forward: you supply a data buffer to a micro-draw.h function which will fill the pixels accordingly. For example, you can use this buffer to render a frame on screen, or to save it as an image file, or do whatever you want.
Check out some examples in the test
directory.
The official git repository of micro-draw.h is hosted at:
https://github.com/San7o/micro-draw.h
This is part of a bigger collection of header-only C99 libraries called “micro-headers”, contributions are welcome:
https://github.com/San7o/micro-headers
Conway's Game of Life