Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

SikCiv

Updating the screen when the main window is moved.

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Try putting a call to your blitting function in the loop in your WinMain:

code:

while (TRUE)
{
if (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE))
{
if (!GetMessage(&msg, NULL, 0, 0))
return msg.wParam;
TranslateMessage(&msg);
DispatchMessage(&msg);
}
else if (g_bActive)
{
UpdateFrame(hWnd);
}
else
{
// Make sure we go to sleep if we have nothing else to do
WaitMessage();
}

This is from the Stretch DX7 example.

------------------
Breakaway Games

Share this post


Link to post
Share on other sites
Advertisement
With many DX Based games, the still image in the main window (primary surface) disappears into black when the game window is moved out of the screen and back in.

Ive noticed Mortal Kombat 4 updates the image where black usually appears.done?

I tried blitting the screen when WM_PAINT is called, but it seems if I put a function call in WM_PAINT the app causes a fatal error

Anyone know how it is done?

Share this post


Link to post
Share on other sites
It's also the usual way to do it as far as I know. Be sure to use WM_ACTIVATEAPP

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!