medfall

A super great game engine
Log | Files | Refs

commit 943b00d83ba561253e7921413b6fd146129ea75a
parent 667ea257dad4327c90566e59f596bef8d8b3aa69
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sat May 27 02:39:04 +0300

Use glfwWaitEvents in the launcher so it doesn't spin doing nothing

Diffstat:
launcher/main.cc | 12+++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/launcher/main.cc b/launcher/main.cc @@ -262,6 +262,7 @@ static WORK_QUEUE_CALLBACK( lookup_update_server ) { else { updater->state = UPDATER_DNS_FAILED; } + glfwPostEmptyEvent(); } static WORK_QUEUE_CALLBACK( download_remote_version ) { @@ -289,6 +290,7 @@ static WORK_QUEUE_CALLBACK( download_remote_version ) { else { updater->state = UPDATER_VERSION_FAILED; } + glfwPostEmptyEvent(); } static int hex2dec( char hex ) { @@ -381,12 +383,16 @@ static WORK_QUEUE_CALLBACK( download_manifest ) { } updater->state = UPDATER_NEED_UPDATE; + + glfwPostEmptyEvent(); } static HTTP_PROGRESS_CALLBACK( download_progress ) { SCOPED_ACQUIRE( locked_updater ); u64 * entry_bytes_downloaded = ( u64 * ) data; *entry_bytes_downloaded = bytes_downloaded; + + glfwPostEmptyEvent(); } static WORK_QUEUE_CALLBACK( download_file ) { @@ -422,6 +428,8 @@ static WORK_QUEUE_CALLBACK( download_file ) { fclose( f ); file->done = true; + + glfwPostEmptyEvent(); } static WORK_QUEUE_CALLBACK( install_update ) { @@ -460,6 +468,8 @@ static WORK_QUEUE_CALLBACK( install_update ) { Updater * updater = SCOPED_ACQUIRE( locked_updater ); updater->state = UPDATER_READY; + + glfwPostEmptyEvent(); } static void asdf() { @@ -561,7 +571,7 @@ int main() { { asdf(); - glfwPollEvents(); + glfwWaitEvents(); ImGui_ImplGlfwGL3_NewFrame(); double now = get_time();