PeekMessage never fails so Render function never runs
I am doing some Direct3D programming in C++ with WINAPI. When I run my app the window gets displayed but nothing gets rendered in it. Upon debugging my code I found that the 'PeekMessage' if statement never fails therefore my Render function never gets executed.
The relevant code is below, can anyone see where I am going wrong?
while (msg.message!= WM_QUIT)
{
if(PeekMessage(&msg, hWnd, 0U, 0U, PM_REMOVE)) {
TranslateMessage(&msg); DispatchMessage(&msg); }
else // render the scene etc
{
if(!RenderScene())
{
return 0;
}
}
}
Many thanks, Law
[650 byte] By [
adamlaw] at [2007-11-19 18:14:26]

# 1 Re: PeekMessage never fails so Render function never runs
I am not sure about it, but you might try this:
if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) > 0)
philkr at 2007-11-9 13:19:47 >
