Basic concept of message loop in directx <p>Well I find weird point of message loop.</p> <p>first, lock this code below</p> <pre><code>MSG msg = {0}; while( WM_QUIT != msg.message ) { if( PeekMessage( &amp;msg, NULL, 0, 0, PM_REMOVE ) ) { TranslateMessage( &amp;msg ); DispatchMessage( &amp;msg ); } else { Render(); // Do some rendering } } </code></pre> <p>It is a tutorial of directx and this part is part of message loop.</p> <p>If I click a mouse, It goes to queue as Message.</p> <p>So Input like this should be process in proc function of win api.</p> <p>Now that peekMessage return true, render() will not be called in frame when I clicked.</p> <p>I think code be changed if~else to if~if for render when I click.</p> <p>Can you explain this??</p>