nim-minifb

nim-MiniFB is a small cross platform library to create a frame buffer that you can draw pixels in

Stars
5

nim-MiniFB

Nim wrapper/port of the cute MiniFB (Mini FrameBuffer) library originally written by Daniel Collin.

The usage in a nutshell:

  • mfbOpen opens a non-resizable window of the specified size.

  • mfbUpdate copies a buffer of 32-bit pixels (in XRGB format) into the window area and displays it. It returns true if ESC was pressed, false otherwise. The buffer must be at least WIDTH * HEIGHT * 4 bytes in size and must be managed by the application.

  • mfbClose closes the window (duh).

See the original documentation here and the test directory for examples.

Works on Windows, Mac OS X and X11 (FreeBSD, Linux, *nix). Most likely fails on platforms where it cannot allocate a 32-bit pixel buffer and probably only supports little-endian architectures (can't test either, sorry).