A very small C library for putting pixels on the screen, perfect for software raytracing projects.
- Install the relevant libraries and runtimes: see Supported Platforms
- Clone or download the repo. to your project
- Use
add_subdirectory("/path/to/minimal_window")
with correct path - Link to minimal_window:
target_link_libraries(your_target PRIVATE minimal_window)
Alternatively, you can use ExternalProject
, FetchContent
, CPM, or any other method that you are comfortable with, minimal_window is a modern CMake project and should be very easy to include
- Win32 (Windows)
- Wayland (Linux):
Wayland development packages are needed for building (for example on Ubuntu:sudo apt install libwayland-dev wayland-protocols
), you also need a running Wayland session at runtime. You also need pkg-configsudo apt install pkg-config
. - X11 (Linux and macOS):
* Linux: X11 development packages are needed for building (for example on Ubuntu:sudo apt install libx11-dev
), you also need a running X11 session at runtime.
* macOS: XQuartz is needed at runtime. - Native macOS
- GCC
- MSVC
- Apple Clang
- Clang
void minimal_window_create_fixed_size_window(int width, int height);
bool minimal_window_process_events();
void minimal_window_draw_pixel(int x, int y, uint8_t r, uint8_t g, uint8_t b);
void minimal_window_request_update();
#include <minimal_window.h>
int main() {
int width = 800, height = 600;
minimal_window_create_fixed_size_window(width, height);
while (minimal_window_process_events()) {
for (int i = 0; i < width; i++)
for (int j = 0; j < height; j++)
minimal_window_draw_pixel(i, j, 255, 255, 255);
}
return 0;
}
https://github.com/iyadahmed/minimal_window_raytracing/blob/main/main.c