Banjo API 0.0.1
Multi-purpose C99 API
Loading...
Searching...
No Matches
video.h
1
15#pragma once
16
17#include <banjo/error.h>
18#include <banjo/window.h>
19
20struct bj_video_layer_t;
21struct bj_video_layer_data_t;
22
31typedef void (*bj_window_end_fn_t)(
32 struct bj_video_layer_t* p_layer,
33 bj_error** p_error
34);
35
49typedef bj_window* (*bj_window_create_window_fn_t)(
50 struct bj_video_layer_t* p_layer,
51 const char* title,
52 uint16_t x,
53 uint16_t y,
54 uint16_t width,
55 uint16_t height,
56 uint8_t flags
57);
58
66 struct bj_video_layer_t* p_layer,
67 bj_window* p_window
68);
69
76 struct bj_video_layer_t* p_layer
77);
78
90 struct bj_video_layer_t* p_layer,
91 const bj_window* p_window,
92 int* p_width,
93 int* p_height
94);
95
108typedef bj_bitmap* (*bj_window_create_framebuffer_fn_t)(
109 struct bj_video_layer_t* p_layer,
110 const bj_window* p_window,
111 bj_error** p_error
112);
113
123 struct bj_video_layer_t* p_layer,
124 const bj_window* p_window
125);
126
146
155typedef struct {
156 const char* name;
157 bj_video_layer* (*create)(bj_error** p_error);
159
Recoverable error handling.
struct bj_bitmap_t bj_bitmap
Typedef for the bj_bitmap struct.
Definition bitmap.h:40
Error structure.
Definition error.h:131
bj_window_poll_events_fn_t poll_events
Poll window events.
Definition video.h:139
bj_window_delete_window_fn_t delete_window
Delete a window.
Definition video.h:138
const char * name
Name of the video backend.
Definition video.h:156
bj_window_get_size_fn_t get_window_size
Retrieve window dimensions.
Definition video.h:140
bj_window_create_window_fn_t create_window
Create a window.
Definition video.h:137
bj_window_flush_framebuffer_fn_t flush_window_framebuffer
Present framebuffer.
Definition video.h:142
bj_window_end_fn_t end
Terminate the video layer.
Definition video.h:136
bj_window_create_framebuffer_fn_t create_window_framebuffer
Create a framebuffer.
Definition video.h:141
struct bj_video_layer_data_t * data
Backend-specific data.
Definition video.h:144
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.
Definition video.h:108
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.
Definition video.h:89
struct bj_video_layer_t bj_video_layer
Structure describing a video layer backend.
void(* bj_window_poll_events_fn_t)(struct bj_video_layer_t *p_layer)
Define a function used to poll events for all windows.
Definition video.h:75
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.
Definition video.h:65
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.
Definition video.h:31
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.
Definition video.h:49
void(* bj_window_flush_framebuffer_fn_t)(struct bj_video_layer_t *p_layer, const bj_window *p_window)
Define a function used to present a framebuffer to the window surface.
Definition video.h:122
Structure used to declare a video backend implementation.
Definition video.h:155
Structure describing a video layer backend.
Definition video.h:135
struct bj_window_t bj_window
Opaque typedef for the window type.
Definition window.h:17
Header file for bj_window type.