I have the following WNDPROC:
LRESULT CALLBACK window_processing(HWND window, UINT message, WPARAM wPara, LPARAM lParam) {
#if WITH_DEBUG_UI
if(ImGui_ImplWin32_WndProcHandler(window, message, wPara, lParam)) {
return true;
}
#endif
switch(message) {
case WM_QUIT:
PostQuitMessage(0);
close_window();
exit();
return true;
break;
case WM_SIZE: {
auto new_size = get_window_size();
if(app.resize_handler) {
app.resize_handler(new_size.width, new_size.height);
return true;
}
break;
}
case WM_SIZING: {
RECT new_rect = *((LPRECT)(lParam));
GetClientRect(app.wnd, &new_rect);
auto new_size = window_size{std::size_t(new_rect.right - new_rect.left), std::size_t(new_rect.bottom - new_rect.top)};
if(app.resize_handler) {
app.resize_handler(new_size.width, new_size.height);
return true;
}
} break;
}
return DefWindowProc(window, message, wPara, lParam);
}
app.resize_handler
is the following function:
void d3d11_loading_screen_renderer::window_size_changed(const std::size_t w, const std::size_t h) {
std::cout << "W : " << w << " H : " << h << std::endl;
back_buffer_rtv.Reset();
back_buffer.Reset();
swapchain->ResizeBuffers(0, w, h, DXGI_FORMAT_UNKNOWN, 0);
swapchain->GetBuffer(0, __uuidof(ID3D11Texture2D), &back_buffer);
back_buffer_rtv = create_back_buffer_rtv(device.Get(), back_buffer.Get());
back_buffer_viewport = viewport_from_window_size(window_size{w,h});
}
The WM_SIZE
event is correctly handled; When the resizing is finished, the back buffers are correctly resized and refreshed.
But with WM_SIZING
, nothing happens. the back buffer stays the same size, as seen in the following gif:
You can see how it resizes the buffers correctly when i finish resizing, but not during the resizing.
Anyone know what that could cause?
Edit: i dont receive any errors and the received size is correct.