Banjo API 0.0.1
C99 game development API
|
Data Structures | |
struct | bj_video_layer_t |
struct | bj_video_layer_create_info |
Typedefs | |
typedef void(* | bj_window_end_fn_t) (struct bj_video_layer_t *p_layer, bj_error **p_error) |
typedef bj_window *(* | bj_window_create_window_fn_t) (struct bj_video_layer_t *p_layer, const char *title, uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint8_t flags) |
typedef void(* | bj_window_delete_window_fn_t) (struct bj_video_layer_t *p_layer, bj_window *p_window) |
typedef void(* | bj_window_poll_events_fn_t) (struct bj_video_layer_t *p_layer) |
typedef int(* | bj_window_get_size_fn_t) (struct bj_video_layer_t *p_layer, const bj_window *p_window, int *p_width, int *p_height) |
typedef bj_bitmap *(* | bj_window_create_framebuffer_fn_t) (struct bj_video_layer_t *p_layer, const bj_window *p_window, bj_error **p_error) |
typedef void(* | bj_window_flush_framebuffer_fn_t) (struct bj_video_layer_t *p_layer, const bj_window *p_window) |
typedef struct bj_video_layer_t | bj_video_layer |
Manage window creation and pixel-based drawing.
The video API provides an abstraction for creating and managing platform-specific windows and their framebuffers. It supports event polling, framebuffer rendering, and resizing operations.
Each video backend implements this interface.
struct bj_video_layer_t |
Structure describing a video layer backend.
This contains all the function pointers that define the backend behavior, as well as backend-specific data.
Data Fields | ||
---|---|---|
bj_window_create_window_fn_t | create_window | Create a window. |
bj_window_create_framebuffer_fn_t | create_window_framebuffer | Create a framebuffer. |
struct bj_video_layer_data_t * | data | Backend-specific data. |
bj_window_delete_window_fn_t | delete_window | Delete a window. |
bj_window_end_fn_t | end | Terminate the video layer. |
bj_window_flush_framebuffer_fn_t | flush_window_framebuffer | Present framebuffer. |
bj_window_get_size_fn_t | get_window_size | Retrieve window dimensions. |
bj_window_poll_events_fn_t | poll_events | Poll window events. |
struct bj_video_layer_create_info |
Structure used to declare a video backend implementation.
This is registered during initialization to allow choosing the appropriate video layer at runtime.
Data Fields | ||
---|---|---|
bj_video_layer *(*)(bj_error **p_error) | create | Function to create the backend. |
const char * | name | Name of the video backend. |
typedef struct bj_video_layer_t bj_video_layer |
Structure describing a video layer backend.
This contains all the function pointers that define the backend behavior, as well as backend-specific data.
typedef bj_bitmap *(* bj_window_create_framebuffer_fn_t) (struct bj_video_layer_t *p_layer, const bj_window *p_window, bj_error **p_error) |
Define a function used to create a framebuffer for a window.
The framebuffer is a pixel buffer that can be written to by the application and later flushed to the screen.
p_layer | Pointer to the video layer. |
p_window | Target window. |
p_error | Output error pointer. |
typedef bj_window *(* bj_window_create_window_fn_t) (struct bj_video_layer_t *p_layer, const char *title, uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint8_t flags) |
Define a function used to create a new window.
p_layer | Pointer to the video layer. |
title | Title of the window. |
x | Initial x position of the window. |
y | Initial y position of the window. |
width | Width of the window in pixels. |
height | Height of the window in pixels. |
flags | Window creation flags. |
typedef void(* bj_window_delete_window_fn_t) (struct bj_video_layer_t *p_layer, bj_window *p_window) |
Define a function used to destroy an existing window.
p_layer | Pointer to the video layer. |
p_window | Window to destroy. |
typedef void(* bj_window_end_fn_t) (struct bj_video_layer_t *p_layer, bj_error **p_error) |
Define a function used to terminate a video layer.
This function is called to release all resources associated with the layer.
p_layer | Pointer to the video layer. |
p_error | Output error pointer. |
typedef void(* bj_window_flush_framebuffer_fn_t) (struct bj_video_layer_t *p_layer, const bj_window *p_window) |
typedef int(* bj_window_get_size_fn_t) (struct bj_video_layer_t *p_layer, const bj_window *p_window, int *p_width, int *p_height) |
Define a function used to retrieve the size of a window.
p_layer | Pointer to the video layer. |
p_window | Target window. |
p_width | Output width in pixels. |
p_height | Output height in pixels. |
typedef void(* bj_window_poll_events_fn_t) (struct bj_video_layer_t *p_layer) |
Define a function used to poll events for all windows.
p_layer | Pointer to the video layer. |