kiba-engine
window.h
Go to the documentation of this file.
1 
6 #pragma once
7 
9 #include <kiba/defines.h>
10 #include <kiba/gpu/surface.h>
11 
13 typedef struct platform_window {
15  void *state;
17  const char *title;
19  u32 x;
21  u32 y;
23  u32 w;
25  u32 h;
31 
44 KB_API b8 window_create(platform_window *window, const char *title, u32 x, u32 y, u32 w, u32 h, allocator *alloc);
45 
52 KB_API void window_destroy(platform_window *window);
53 
62 KB_API b8 window_poll_events(platform_window *window);
Central header providing allocator functionality.
Global typedefs and macros.
Central allocator structure.
Definition: allocator.h:87
Structure holding information about a window.
Definition: window.h:13
allocator * alloc
Allocator used for on-the-fly allocations.
Definition: window.h:29
void * state
Definition: window.h:15
u32 h
Height of the window in pixels.
Definition: window.h:25
u32 y
y position on the screen.
Definition: window.h:21
gpu_surface surface
Surface to render to using the gpu lib.
Definition: window.h:27
const char * title
Title of the window.
Definition: window.h:17
u32 x
x position on the screen.
Definition: window.h:19
u32 w
Width of the window in pixels.
Definition: window.h:23
KB_API b8 window_poll_events(platform_window *window)
Poll for events emited by the window.
Definition: window.c:197
KB_API b8 window_create(platform_window *window, const char *title, u32 x, u32 y, u32 w, u32 h, allocator *alloc)
Create a platform window.
Definition: window.c:17
struct platform_window platform_window
Structure holding information about a window.
KB_API void window_destroy(platform_window *window)
Destroy platform window and clean up internal state.
Definition: window.c:165