handle window exits more gracefully and appropriately.

This commit is contained in:
2025-09-15 14:15:40 +02:00
parent 1e10fec9c6
commit dc3abf992b
5 changed files with 41 additions and 8 deletions

View File

@@ -2,5 +2,18 @@
* Licensed under the MIT Licence. See LICENSE for details */
#pragma once
int window_init(void); // initializes the global window, returns non-zero upon failure
void window_loop(void); // performs the window updates
/* Set up the window, enabling OpenGL, and
* configuring the settings that are needed.
* Returns `0` upon success, otherwise `1`. */
int window_init(void);
/* Calls the update loop for the window.
* This function does not exit until the window does. */
void window_loop(void);
/* Requests the window to close (gracefully). */
void window_close(void);
/* Cleans up all resources held by the window.
* If the window is still open, it will be terminated. */
void window_free(void);