|
libc8
CHIP-8 utility library
|
Macros | |
| #define | RGB_R(i) ((i >> 12) & 0xFF) |
| #define | RGB_G(i) ((i >> 8) & 0xFF) |
| #define | RGB_B(i) (i & 0xFF) |
Functions | |
| void | c8_deinit_graphics (void) |
| Deinitialize the graphics library. | |
| uint8_t | c8_init_graphics (void) |
| Initialize the graphics library. | |
| void | c8_render (C8_Display *display, int *colors) |
| Render graphics. | |
| int | c8_tick (int *key) |
| Process keypresses and delay based on clockspeed. | |
SDL2 graphics implementation. When SDL2 is defined, overrides weak graphics utility function definitions in graphics.c.
| #define RGB_B | ( | i | ) | (i & 0xFF) |
| #define RGB_G | ( | i | ) | ((i >> 8) & 0xFF) |
| #define RGB_R | ( | i | ) | ((i >> 12) & 0xFF) |
| void c8_deinit_graphics | ( | void | ) |
Deinitialize the graphics library.
Deinitialize graphics system.
| uint8_t c8_init_graphics | ( | void | ) |
Initialize the graphics library.
Initialize graphics system.
| void c8_render | ( | C8_Display * | display, |
| int * | colors | ||
| ) |
Render graphics.
Render the given display to the SDL2 window.
| display | display_t to render |
| colors | colors to render |
| int c8_tick | ( | int * | key | ) |
Process keypresses and delay based on clockspeed.
Grab current keypresses and delay execution to match clockspeed.
If a relevant key is pressed or released (see keyMap in this file), this function will update key accordingly.
| key | pointer to int arr of keys |