From c8a5989b8f2ec4db661b974ffb21eb75a54d9713 Mon Sep 17 00:00:00 2001 From: Tony Barbour Date: Tue, 20 Oct 2015 12:49:46 -0600 Subject: demos: Handle paint events and call RedrawWindow to animate This keeps MessageBoxs from validation on Windows from hanging the demos, while allowing the demo to animate --- demos/cube.c | 3 ++- demos/tri.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/demos/cube.c b/demos/cube.c index a57bf4ff..12de7f54 100644 --- a/demos/cube.c +++ b/demos/cube.c @@ -1814,7 +1814,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, break; case WM_PAINT: demo_run(&demo); - return 0; + break; default: break; } @@ -2536,6 +2536,7 @@ int WINAPI WinMain(HINSTANCE hInstance, TranslateMessage(&msg); DispatchMessage(&msg); } + RedrawWindow(demo.window, NULL, NULL, RDW_INTERNALPAINT); } demo_cleanup(&demo); diff --git a/demos/tri.c b/demos/tri.c index 06321c22..ef9ff42b 100644 --- a/demos/tri.c +++ b/demos/tri.c @@ -1487,7 +1487,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, case WM_PAINT: if (demo.prepared) { demo_run(&demo); - return 0; + break; } default: break; @@ -2193,6 +2193,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, TranslateMessage(&msg); DispatchMessage(&msg); } + RedrawWindow(demo.window, NULL, NULL, RDW_INTERNALPAINT); } demo_cleanup(&demo); -- cgit v1.2.3