Banjo API 0.0.1
Multi-purpose C99 API
Loading...
Searching...
No Matches
window.h
Go to the documentation of this file.
1
9
10#pragma once
11
12#include <banjo/api.h>
13#include <banjo/bitmap.h>
14#include <banjo/memory.h>
15
17typedef struct bj_window_t bj_window;
18
33
53 const char* p_title,
54 uint16_t x,
55 uint16_t y,
56 uint16_t width,
57 uint16_t height,
58 uint8_t flags
59);
60
66BANJO_EXPORT void bj_window_del(
67 bj_window* p_window
68);
69
88 bj_window* p_window
89);
90
102 bj_window* p_window
103);
104
118BANJO_EXPORT uint8_t bj_window_get_flags(
119 bj_window* p_window,
120 uint8_t flags
121);
122
152 bj_window* p_window,
153 bj_error** p_error
154);
155
177BANJO_EXPORT int bj_window_get_size(
178 const bj_window* p_window,
179 int* width,
180 int* height
181);
182
199 bj_window* p_window
200);
201
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:40
uint32_t bj_bool
Boolean type used throughout the BJ codebase.
Definition api.h:143
Error structure.
Definition error.h:131
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:27
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:17
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.
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_FLAG_NONE
No Flag.
Definition window.h:28
@ BJ_WINDOW_FLAG_KEY_REPEAT
Key repeat event is enabled (see bj_set_key_callback).
Definition window.h:30
@ BJ_WINDOW_FLAG_ALL
All flags set.
Definition window.h:31
@ BJ_WINDOW_FLAG_CLOSE
Window should be closed by the application.
Definition window.h:29
All memory-related functions, including custom allocators.