Displays can be created by a backend, which returns a pix_display_t handle.
More...
Displays can be created by a backend, which returns a pix_display_t handle.
The backends are:
A display is usually backed by a bitmap buffer of a specific pixel format, but how that's implemented is up to the backend.
◆ PIX_DISPLAY_CONTEXT_SIZE
| #define PIX_DISPLAY_CONTEXT_SIZE 64u |
Size in bytes of backend-private state embedded in each display.
Default fits the SDL backend's context, the largest today. Must be defined identically everywhere pix_display_t is used - override by defining PIX_DISPLAY_CONTEXT_SIZE globally at compile time.
Definition at line 45 of file display.h.
◆ PIX_DISPLAY_POOL_CAPACITY
| #define PIX_DISPLAY_POOL_CAPACITY 1u |
Maximum number of concurrently active displays.
Displays come from a small fixed-size pool, not the heap. Override by defining PIX_DISPLAY_POOL_CAPACITY at compile time.
Definition at line 33 of file display.h.
◆ pix_display_draw_t
Draw callback signature.
- Parameters
-
| display | The display being drawn. |
| bitmap | The display's bitmap, already locked for direct pixel access - the callback should draw into it, but never lock/unlock it itself. |
| userdata | Opaque pointer, as passed to pix_display_set_callback(). |
Called internally, from within pix_poll(), whenever this display's backend reports it's due a redraw - never called directly.
Definition at line 60 of file display.h.
◆ pix_display_deinit()
Deinitialize a display and release it back to the pool.
- Parameters
-
| display | The display to deinitialize. Safe to call on NULL. |
◆ pix_display_set_callback()
Register the function that draws this display's contents.
- Parameters
-
| display | The display to set the callback on. A no-op if invalid. |
| callback | Called whenever display is due a redraw, or NULL to clear a previously registered callback. |
| userdata | Opaque pointer passed back to callback unchanged. |