add window_destroy()

main
Dominik Madarász 2024-08-16 11:27:47 +02:00
parent 926a48bc50
commit 92ccaaf25d
6 changed files with 25 additions and 0 deletions

View File

@ -2058,6 +2058,7 @@ enum WINDOW_FLAGS {
};
bool window_create(float scale, unsigned flags);
bool window_create_from_handle(void *handle, float scale, unsigned flags);
void window_destroy();
void window_reload();
int window_frame_begin();
void window_frame_end();

View File

@ -18721,6 +18721,7 @@ enum WINDOW_FLAGS {
API bool window_create(float scale, unsigned flags);
API bool window_create_from_handle(void *handle, float scale, unsigned flags);
API void window_destroy();
API void window_reload();
API int window_frame_begin();
@ -391678,6 +391679,12 @@ bool window_create(float scale, unsigned flags) {
return window_create_from_handle(NULL, scale, flags);
}
void window_destroy() {
if( !window ) return;
glfwSetWindowShouldClose(window, GL_TRUE);
}
static double boot_time = 0;
char* window_stats() {
@ -391857,6 +391864,7 @@ void window_shutdown() {
#endif
window_loop_exit(); // finish emscripten loop automatically
glfwTerminate();
}
}

View File

@ -495,6 +495,12 @@ bool window_create(float scale, unsigned flags) {
return window_create_from_handle(NULL, scale, flags);
}
void window_destroy() {
if( !window ) return;
glfwSetWindowShouldClose(window, GL_TRUE);
}
static double boot_time = 0;
char* window_stats() {
@ -674,6 +680,7 @@ void window_shutdown() {
#endif
window_loop_exit(); // finish emscripten loop automatically
glfwTerminate();
}
}

View File

@ -27,6 +27,7 @@ enum WINDOW_FLAGS {
API bool window_create(float scale, unsigned flags);
API bool window_create_from_handle(void *handle, float scale, unsigned flags);
API void window_destroy();
API void window_reload();
API int window_frame_begin();

View File

@ -26859,6 +26859,12 @@ bool window_create(float scale, unsigned flags) {
return window_create_from_handle(NULL, scale, flags);
}
void window_destroy() {
if( !window ) return;
glfwSetWindowShouldClose(window, GL_TRUE);
}
static double boot_time = 0;
char* window_stats() {
@ -27038,6 +27044,7 @@ void window_shutdown() {
#endif
window_loop_exit(); // finish emscripten loop automatically
glfwTerminate();
}
}

View File

@ -4788,6 +4788,7 @@ enum WINDOW_FLAGS {
API bool window_create(float scale, unsigned flags);
API bool window_create_from_handle(void *handle, float scale, unsigned flags);
API void window_destroy();
API void window_reload();
API int window_frame_begin();