문제

        // Main message loop

        MSG msg;
        ZeroMemory( &msg, sizeof( msg ) );
        while(msg.message!=WM_QUIT)
        {

            if(PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE ) )
            {
                TranslateMessage( &msg );
                DispatchMessage( &msg );
            }
            else
            {
                Render();
            }
        }

The "render" function hasn't been executing

도움이 되었습니까?

해결책

The PeekMessage documentation says this regarding the return value:

If a message is available, the return value is nonzero.

If no messages are available, the return value is zero.

When the message queue is empty, it will indeed return zero, i.e. FALSE. The conclusion therefore is that the message queue is never empty. And the most likely explanation for that is that one of the messages you handle in DispatchMessage leads to that same message being posted to the queue.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top