Jump to content

View more

Image of the Day

#ld38 #screenshotsaturday Mimosa Fizz action gif #2 https://t.co/TUzdppvfUL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Updating the screen when the main window is moved.

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 SikCiv   Members   

122
Like
Likes
Like

Posted 22 December 1999 - 06:20 AM

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?


#2 Machaira   Moderators   

1033
Like
Likes
Like

Posted 21 December 1999 - 06:35 PM

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


#3 CJ   Members   

122
Like
Likes
Like

Posted 22 December 1999 - 06:20 AM

It's also the usual way to do it as far as I know. Be sure to use WM_ACTIVATEAPP




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.