diff options
| author | Tony Barbour <tony@LunarG.com> | 2015-10-20 12:49:46 -0600 |
|---|---|---|
| committer | Tony Barbour <tony@LunarG.com> | 2015-10-21 16:45:06 -0600 |
| commit | c8a5989b8f2ec4db661b974ffb21eb75a54d9713 (patch) | |
| tree | f610178d031358f22ac3f348115fffbd8d7e2bf8 | |
| parent | 6b6c6aa477339cc6ff8c9fc6906c03de80ddec40 (diff) | |
| download | usermoji-c8a5989b8f2ec4db661b974ffb21eb75a54d9713.tar.xz | |
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
| -rw-r--r-- | demos/cube.c | 3 | ||||
| -rw-r--r-- | 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); |
