diff options
Diffstat (limited to 'app/include')
| -rw-r--r-- | app/include/dxwindow.h | 37 |
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 | |||
| 7 | typedef 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. | ||
| 13 | bool 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. | ||
| 19 | void window_global_quit(); | ||
| 20 | |||
| 21 | /// Return the last Window error. | ||
| 22 | const char* window_get_error(); | ||
| 23 | |||
| 24 | /// Initialize the window. | ||
| 25 | Window* window_init(int width, int height, const char* title); | ||
| 26 | |||
| 27 | /// Destroy the window. | ||
| 28 | void window_destroy(Window**); | ||
| 29 | |||
| 30 | /// Return the Windows handle. | ||
| 31 | HWND window_handle(Window*); | ||
| 32 | |||
| 33 | /// Update the window, poll for events. | ||
| 34 | void window_update(Window*); | ||
| 35 | |||
| 36 | /// Return whether the user has requested that the window should be closed. | ||
| 37 | bool window_should_close(const Window*); | ||
