aboutsummaryrefslogtreecommitdiff
path: root/app/include
diff options
context:
space:
mode:
Diffstat (limited to 'app/include')
-rw-r--r--app/include/dxwindow.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/app/include/dxwindow.h b/app/include/dxwindow.h
new file mode 100644
index 0000000..14caa36
--- /dev/null
+++ b/app/include/dxwindow.h
@@ -0,0 +1,37 @@
1#pragma once
2
3#include <WinDef.h> // HWND
4
5#include <stdbool.h>
6
7typedef struct Window Window;
8
9/// Initialise the window subsystem.
10///
11/// This function must be called at the start of your application before any
12/// Windows are created.
13bool window_global_init();
14
15/// Terminate the window subsystem.
16///
17/// This function should be called at the end of your application. Any existing
18/// Windows are destroyed and are invalid beyond this call.
19void window_global_quit();
20
21/// Return the last Window error.
22const char* window_get_error();
23
24/// Initialize the window.
25Window* window_init(int width, int height, const char* title);
26
27/// Destroy the window.
28void window_destroy(Window**);
29
30/// Return the Windows handle.
31HWND window_handle(Window*);
32
33/// Update the window, poll for events.
34void window_update(Window*);
35
36/// Return whether the user has requested that the window should be closed.
37bool window_should_close(const Window*);