General-purpose definitions for Banjo API.
Recoverable error handling.
struct bj_render_target bj_render_target
uint32_t bj_bool
Boolean type used throughout the Banjo API.
struct bj_bitmap bj_bitmap
struct bj_window bj_window
Axis-aligned rectangle: a top-left corner plus a width and height.
uint8_t bj_get_window_flags(struct bj_window *window, uint8_t flags)
Get window flags.
void(* bj_window_draw_fn)(struct bj_window *window, struct bj_render_target *target, const struct bj_rect *dirty, void *user_data)
Redraw callback signature.
void bj_set_window_fullscreen(struct bj_window *window, bj_bool enable)
Enter or leave fullscreen on window.
void bj_set_draw_callback(struct bj_window *window, bj_window_draw_fn fn, void *user_data)
Register the redraw callback for window.
static void bj_invalidate_window(struct bj_window *window)
Mark the whole window as needing a repaint.
void bj_set_window_should_close(struct bj_window *window)
Flag a given window to be closed.
bj_bool bj_is_window_fullscreen(struct bj_window *window)
Report whether window is currently fullscreen.
struct bj_window * bj_bind_window(const char *title, uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint8_t flags, struct bj_error **error)
Create a new struct bj_window with the specified attributes.
int bj_get_key(const struct bj_window *window, int key)
Query the current state of a key for a given window.
bj_window_flag
A set of flags describing some properties of a bj_window.
void bj_set_resize_callback(struct bj_window *window, bj_window_resize_fn fn, void *user_data)
Register the resize callback for window.
struct bj_bitmap * bj_render_target_bitmap(struct bj_render_target *target)
Reach the software framebuffer behind a render target.
void(* bj_window_resize_fn)(struct bj_window *window, int width, int height, void *user_data)
Window-resize callback signature.
bj_bool bj_should_close_window(struct bj_window *window)
Get the close flag state of a window.
void bj_unbind_window(struct bj_window *window)
Deletes a struct bj_window object and releases associated memory.
int bj_get_window_size(const struct bj_window *window, int *width, int *height)
Retrieve the size of the window.
void bj_invalidate_rect(struct bj_window *window, const struct bj_rect *rect)
Mark a region of window as needing a repaint.
@ BJ_WINDOW_FLAG_NONE
No Flag.
@ BJ_WINDOW_FLAG_FULLSCREEN
Start the window fullscreen (see bj_set_window_fullscreen).
@ BJ_WINDOW_FLAG_KEY_REPEAT
Key repeat event is enabled (see bj_set_key_callback).
@ BJ_WINDOW_FLAG_RESIZABLE
User may resize the window.
@ BJ_WINDOW_FLAG_ALL
All flags set.
@ BJ_WINDOW_FLAG_CLOSE
Window should be closed by the application.
Axis-aligned rectangle in pixel coordinates.