demo cube: Clean up event processing
authorCourtney Goeltzenleuchter <courtney@LunarG.com>
Mon, 10 Nov 2014 18:13:13 +0000 (11:13 -0700)
committerCourtney Goeltzenleuchter <courtney@LunarG.com>
Tue, 2 Dec 2014 21:44:57 +0000 (14:44 -0700)
Will now really wait for an event when paused.
Always update and render after checking for events

demos/cube.c

index c327363aeb0f33ed1f6c7be0f149c4e095d5f1cc..9b7db0777a09722df92d18f85ee9b33a4b705676 100644 (file)
@@ -1189,17 +1189,16 @@ static void demo_run(struct demo *demo)
         if (event) {
             demo_handle_event(demo, event);
             free(event);
-        } else if (!demo->pause){
+        }
 
         // Wait for work to finish before updating MVP.
         xglDeviceWaitIdle(demo->device);
         demo_update_data_buffer(demo);
 
-            demo_draw(demo);
+        demo_draw(demo);
 
-            // Wait for work to finish before updating MVP.
-            xglDeviceWaitIdle(demo->device);
-        }
+        // Wait for work to finish before updating MVP.
+        xglDeviceWaitIdle(demo->device);
     }
 }