General-purpose definitions for Banjo API.
Header file for Bitmap type.
struct bj_bitmap_t bj_bitmap
Typedef for the bj_bitmap struct.
Definition bitmap.h:22
Error structure.
Definition error.h:131
enum bj_event_action_t bj_event_action
Event action type enumeration.
enum bj_key_t bj_key
List of possible keys on a keyboard.
bj_window_button_event_t bj_window_set_button_event(bj_window *p_window, bj_window_button_event_t p_callback)
Set the callback for button events.
int bj_window_get_size(const bj_window *p_window, int *width, int *height)
Retrieve the size of the window.
bj_window_flag_t
A set of flags describing some properties of a bj_window.
Definition window.h:28
void(* bj_window_button_event_t)(bj_window *p_window, int, bj_event_action action, int x, int y)
Callback type for functions called when a mouse button is pressed or released.
Definition window.h:139
bj_window * bj_window_new(const char *p_title, uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint8_t flags)
Create a new bj_window with the specified attributes.
bj_bool bj_window_should_close(bj_window *p_window)
Get the close flag state of a window.
struct bj_window_t bj_window
Opaque typedef for the window type.
Definition window.h:18
void(* bj_window_enter_event_t)(bj_window *p_window, bj_bool enter, int x, int y)
Callback type for functions called when the mouse cursor enters a window.
Definition window.h:116
bj_window_cursor_event_t bj_window_set_cursor_event(bj_window *p_window, bj_window_cursor_event_t p_callback)
Set the callback for cursor events.
void(* bj_window_key_event_t)(bj_window *p_window, bj_event_action action, bj_key key, int scancode)
Callback type for functions called when a keyboard key is pressed or released.
Definition window.h:153
void(* bj_window_cursor_event_t)(bj_window *p_window, int x, int y)
Callback type for functions called when the mouse cursor position changes.
Definition window.h:127
enum bj_window_flag_t bj_window_flag
A set of flags describing some properties of a bj_window.
bj_bitmap * bj_window_get_framebuffer(bj_window *p_window, bj_error **p_error)
Return the framebuffer attached to the window.
void bj_close_on_escape(bj_window *, bj_event_action, bj_key, int)
An event call back for closing the window when escape key is pressed.
void bj_poll_events(void)
Polls all pending events and dispatch them to callbacks.
uint8_t bj_window_get_flags(bj_window *p_window, uint8_t flags)
Get window flags.
void bj_window_set_should_close(bj_window *p_window)
Flag a given window to be closed.
void bj_window_del(bj_window *p_window)
Deletes a bj_window object and releases associated memory.
void bj_window_update_framebuffer(bj_window *p_window)
Copy window's framebuffer onto screen.
bj_window_enter_event_t bj_window_set_enter_event(bj_window *p_window, bj_window_enter_event_t p_callback)
Set the callback for enter events.
bj_window_key_event_t bj_window_set_key_event(bj_window *p_window, bj_window_key_event_t p_callback)
Set the callback for key events.
@ BJ_WINDOW_FLAG_NONE
No Flag.
Definition window.h:29
@ BJ_WINDOW_FLAG_KEY_REPEAT
Key repeat event is enabled (see bj_window_set_key_event).
Definition window.h:31
@ BJ_WINDOW_FLAG_ALL
All flags set.
Definition window.h:32
@ BJ_WINDOW_FLAG_CLOSE
Window should be closed by the application.
Definition window.h:30
All memory-related functions, including custom allocators.