diff options
| author | Andre Weissflog <floooh@gmail.com> | 2019-08-06 17:46:37 +0200 |
|---|---|---|
| committer | Andre Weissflog <floooh@gmail.com> | 2019-08-06 17:46:37 +0200 |
| commit | 47ef7df731c6690b47acb6ae2810e74e57b0a5aa (patch) | |
| tree | 56aff1474053f905098e3c5445409a11ad9a736d | |
| parent | 7f125ece147bfe9d022b892e8bf50293801497ab (diff) | |
sokol_app.h d3d11: fix exploding memory usage during window resizeold-pixelformats
| -rw-r--r-- | sokol_app.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sokol_app.h b/sokol_app.h index f683e963..f943f7ee 100644 --- a/sokol_app.h +++ b/sokol_app.h @@ -4060,12 +4060,6 @@ _SOKOL_PRIVATE LRESULT CALLBACK _sapp_win32_wndproc(HWND hWnd, UINT uMsg, WPARAM _sapp_win32_app_event(SAPP_EVENTTYPE_RESTORED); } } - if (_sapp_win32_update_dimensions()) { - #if defined(SOKOL_D3D11) - _sapp_d3d11_resize_default_render_target(); - #endif - _sapp_win32_app_event(SAPP_EVENTTYPE_RESIZED); - } } break; case WM_SETCURSOR: @@ -4291,6 +4285,13 @@ _SOKOL_PRIVATE void _sapp_run(const sapp_desc* desc) { #if defined(SOKOL_GLCORE33) _sapp_wgl_swap_buffers(); #endif + /* check for window resized, this cannot happen in WM_SIZE as it explodes memory usage */ + if (_sapp_win32_update_dimensions()) { + #if defined(SOKOL_D3D11) + _sapp_d3d11_resize_default_render_target(); + #endif + _sapp_win32_app_event(SAPP_EVENTTYPE_RESIZED); + } if (_sapp.quit_requested) { PostMessage(_sapp_win32_hwnd, WM_CLOSE, 0, 0); } |