-
Notifications
You must be signed in to change notification settings - Fork 25
Writing a Backend
Adrian Pistol edited this page Apr 26, 2018
·
1 revision
Writing a backend for sled is relatively simple.
Create a out_mybackend.c
file in src/modules/
.
Check out the various out
modules already existing. out_dummy
and out_sdl2
for example.
The out plugins should buffer, only updating the matrix when render()
gets called.
The init function, this is where you allocate your buffers and initialize everything necessary to start drawing.
Set the pixel at (x, y)
in the buffer to the color represented by color
.
Clears the buffer, setting it to #000000
/black/turning the pixel off.
Get the width of the matrix.
Get the height of the matrix.
Wait until the desired usec hit.
If you don't need to do anything special, you can just return wait_until_core(desired_usec);
.
Free all the buffers here.