1

The title says it all.

In my Window.onUpdate function:

void Destiny::WindowsWindow::onUpdate()
{
    MSG msg;
    if (PeekMessageW(&msg, m_Handle, 0, 0, PM_REMOVE)) {
        TranslateMessage(&msg);
        DT_CORE_TRACE("Before DispatchMessageW()");
        DispatchMessageW(&msg);
        DT_CORE_TRACE("After DispatchMessageW()");
    }
}

and this following function gets called when the application starts:

void Application::run() {
    while (m_Running)
    {
        for (Layer* layer : m_LayerStack) {
            layer->onUpdate();
        }

        m_Window->onUpdate();
    }
}

And I was able to track down that the DispatchMessageW function does not return when I'm moving the window around.

Any Ideas on how to solve this?

SunnyMonster
  • 500
  • 5
  • 14
  • 2
    If you break into the debugger, you'll see that the system is in a nested message loop to handle the window drag operation. If you don't like the default drag loop, you can try to write your own that is modeless. (This is rather difficult to do, though, so most people don't bother.) – Raymond Chen Apr 19 '22 at 00:10
  • @RaymondChen Thank you for the reply! Is this typically how people manages this in other games or game engines? And are there some articles or tutorials I can look up on to learn how I might approach that? – SunnyMonster Apr 19 '22 at 00:26
  • Some quick searching turns up https://www.gamedev.net/forums/topic/109605-wm_nclbuttondown-problem/ – Raymond Chen Apr 19 '22 at 01:40
  • I suggest you could refer to the thread: https://stackoverflow.com/questions/3102074/win32-my-application-freezes-while-the-user-resizes-the-window – Jeaninez - MSFT Apr 19 '22 at 01:55

0 Answers0