Banjo API 0.0.1
C99 game development API
Loading...
Searching...
No Matches
window.h
Go to the documentation of this file.
1
27
28#ifndef BJ_WINDOW_H
29#define BJ_WINDOW_H
30
31#include <banjo/api.h>
32#include <banjo/bitmap.h>
33#include <banjo/memory.h>
34
36typedef struct bj_window_t bj_window;
37
52
72 const char* p_title,
73 uint16_t x,
74 uint16_t y,
75 uint16_t width,
76 uint16_t height,
77 uint8_t flags
78);
79
86 bj_window* p_window
87);
88
107 bj_window* p_window
108);
109
121 bj_window* p_window
122);
123
138 bj_window* p_window,
139 uint8_t flags
140);
141
154 const bj_window* p_window,
155 int key
156);
157
187 bj_window* p_window,
188 bj_error** p_error
189);
190
213 const bj_window* p_window,
214 int* width,
215 int* height
216);
217
234 bj_window* p_window
235);
236
237#endif
246
247#ifndef BJ_WINDOW_H
248#define BJ_WINDOW_H
249
250#include <banjo/api.h>
251#include <banjo/bitmap.h>
252#include <banjo/memory.h>
253
255typedef struct bj_window_t bj_window;
256
265typedef enum bj_window_flag_t {
266 BJ_WINDOW_FLAG_NONE = 0x00,
267 BJ_WINDOW_FLAG_CLOSE = 0x01,
269 BJ_WINDOW_FLAG_ALL = 0xFF,
271
291 const char* p_title,
292 uint16_t x,
293 uint16_t y,
294 uint16_t width,
295 uint16_t height,
296 uint8_t flags
297);
298
305 bj_window* p_window
306);
307
326 bj_window* p_window
327);
328
340 bj_window* p_window
341);
342
357 bj_window* p_window,
358 uint8_t flags
359);
360
373 const bj_window* p_window,
374 int key
375);
376
406 bj_window* p_window,
407 bj_error** p_error
408);
409
432 const bj_window* p_window,
433 int* width,
434 int* height
435);
436
453 bj_window* p_window
454);
455
456#endif
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:60
#define BANJO_EXPORT
Definition api.h:139
uint32_t bj_bool
Boolean type used throughout the Banjo API.
Definition api.h:276
Error structure.
Definition error.h:131
int bj_get_window_size(const bj_window *p_window, int *width, int *height)
Retrieve the size of the window.
void bj_unbind_window(bj_window *p_window)
Deletes a bj_window object and releases associated memory.
bj_window_flag_t
A set of flags describing some properties of a bj_window.
Definition window.h:46
bj_window * bj_bind_window(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.
void bj_update_window_framebuffer(bj_window *p_window)
Copy window's framebuffer onto screen.
bj_bitmap * bj_get_window_framebuffer(bj_window *p_window, bj_error **p_error)
Return the framebuffer attached to the window.
struct bj_window_t bj_window
Opaque typedef for the window type.
Definition window.h:36
enum bj_window_flag_t bj_window_flag
A set of flags describing some properties of a bj_window.
int bj_get_key(const bj_window *p_window, int key)
Query the current state of a key for a given window.
uint8_t bj_get_window_flags(bj_window *p_window, uint8_t flags)
Get window flags.
bj_bool bj_should_close_window(bj_window *p_window)
Get the close flag state of a window.
void bj_set_window_should_close(bj_window *p_window)
Flag a given window to be closed.
@ BJ_WINDOW_FLAG_NONE
No Flag.
Definition window.h:47
@ BJ_WINDOW_FLAG_KEY_REPEAT
Key repeat event is enabled (see bj_set_key_callback).
Definition window.h:49
@ BJ_WINDOW_FLAG_ALL
All flags set.
Definition window.h:50
@ BJ_WINDOW_FLAG_CLOSE
Window should be closed by the application.
Definition window.h:48
All memory-related functions, including custom allocators.