• 14
• 12
• 9
• 10
• 13

Render() on WM_PAINT crash

This topic is 4135 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Hi! I'm programming DirectX in C++ under WinXP. My window is shown and updated, D3D object and device created and initialized. After that I use the device to clear the window to a blue color and the present. So far all is well, when run the window plopps up and is blue. But everytime the window is redrawn it goes white. So I try to fix it like this: (in the window procedure:) case WM_PAINT: Device->Clear Device->Present break; But then I can't even run the program because it "encounterd a problem and must exit". If it works in WinMain, why doesn't it work when redrawing? Thanks in advance, /Rayben

Share on other sites
case WM_PAINT:   if(Device)   {      Device->Clear      Device->Present   }   break;