Banjo API 0.0.1
C99 game development API
Loading...
Searching...
No Matches
video.h
Go to the documentation of this file.
1
17#ifndef BJ_VIDEO_H
18#define BJ_VIDEO_H
19
20#include <banjo/error.h>
21#include <banjo/window.h>
22
23struct bj_video_layer_t;
24struct bj_video_layer_data_t;
25
34typedef void (*bj_window_end_fn_t)(
35 struct bj_video_layer_t* p_layer,
36 bj_error** p_error
37);
38
52typedef bj_window* (*bj_window_create_window_fn_t)(
53 struct bj_video_layer_t* p_layer,
54 const char* title,
55 uint16_t x,
56 uint16_t y,
57 uint16_t width,
58 uint16_t height,
59 uint8_t flags
60);
61
69 struct bj_video_layer_t* p_layer,
70 bj_window* p_window
71);
72
79 struct bj_video_layer_t* p_layer
80);
81
93 struct bj_video_layer_t* p_layer,
94 const bj_window* p_window,
95 int* p_width,
96 int* p_height
97);
98
111typedef bj_bitmap* (*bj_window_create_framebuffer_fn_t)(
112 struct bj_video_layer_t* p_layer,
113 const bj_window* p_window,
114 bj_error** p_error
115);
116
126 struct bj_video_layer_t* p_layer,
127 const bj_window* p_window
128);
129
149
158typedef struct {
159 const char* name;
160 bj_video_layer* (*create)(bj_error** p_error);
162
163#endif
Recoverable error handling.
struct bj_bitmap_t bj_bitmap
Typedef for the bj_bitmap struct.
Definition bitmap.h:60
Error structure.
Definition error.h:131
bj_window_poll_events_fn_t poll_events
Poll window events.
Definition video.h:142
bj_window_delete_window_fn_t delete_window
Delete a window.
Definition video.h:141
const char * name
Name of the video backend.
Definition video.h:159
bj_window_get_size_fn_t get_window_size
Retrieve window dimensions.
Definition video.h:143
bj_window_create_window_fn_t create_window
Create a window.
Definition video.h:140
bj_window_flush_framebuffer_fn_t flush_window_framebuffer
Present framebuffer.
Definition video.h:145
bj_window_end_fn_t end
Terminate the video layer.
Definition video.h:139
bj_window_create_framebuffer_fn_t create_window_framebuffer
Create a framebuffer.
Definition video.h:144
struct bj_video_layer_data_t * data
Backend-specific data.
Definition video.h:147
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:111
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:92
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:78
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:68
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:34
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:52
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:125
Structure used to declare a video backend implementation.
Definition video.h:158
Structure describing a video layer backend.
Definition video.h:138
struct bj_window_t bj_window
Opaque typedef for the window type.
Definition window.h:36
Header file for bj_window type.