11. Runt-img integration
The runt-img library is a little pixel art graphics library I wrote in runt a few years ago. The hope here is to make it possible for the runt-img library to write directly to the framebuffer.
11.1. Runt-img draw callback
The runt-img library is driven by a low level draw callback, which is used to draw a single pixel at a particular XY location. Instead of writing to the default buffer, it will write to the graphics framebuffer.
The pointer callback has no user data, so global variables must be accessed inside of it. It must know about:
- The graphics buffer, stored inside of the monolith global data struct - The current color set by runt-img
The monolith struct is retrieved with monolith_data_get
.
The current runt image color (RGBA) can be found with
img_get_current_color
.
# # # #
11.2. Setting the point callback (monolith:gfx-runt-img)
Runt-img must be explicitely bound using the scheme function
monolith:gfx-runt-img
. This can only be done in scheme, because the graphics
stack is built to only work when the scheme system is fully initialized.
prev | home | next