Jump to content
  • Advertisement
Sign in to follow this  
Lukas Boersma

Problem with minimizing my game

This topic is 4488 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

Hi, I'm working on a small Pong clone using Delphi and my own small 2D engine that's using directx. It may be a dumb question, but I just don't know what this could be... When I'm in fullscreen mode and I minimize the game, the DirectX device seems just to render nothing more when I go back to the game - the only thing I see is the window of my Game. I guess that I did something totally wrong, but I just can't imagine what it is... Do I have to reinitialize the device when going back to the game? As you see, I'm an absolute noob in this stuff, but I hope you can help me. Thanks for any help and sorry for my bad english

Share this post


Link to post
Share on other sites
Advertisement
If it's Direct3D, then it could be a lost device.

If it's DirectDraw, then it could be a lost surface (which is a similar thing except a single resource is in a 'lost' state rather than the whole device).

It's been so long since I did any DirectDraw that I can't remember the full procedure for recovering lost resources!, IIRC there is a Restore() call on the resource interface.


For Direct3D, take a look at the following part of the (C++) SDK documentation:

DirectX Graphics ->
Direct3D 9 ->
Programming Guide ->
Getting Started ->
Direct3D Devices ->
Lost Devices

That details what you need to do to recover from a lost device.

Share this post


Link to post
Share on other sites
Umm...

I tried to call the Reset() method of the device when the device is lost, but it always fails... I allocated all resources with D3DPOOL_MANAGED, and the SDK tells me that I don't have to reinitialize those resources...

Any idea what this could be? Do I have to deallocate all the resources first?

Share this post


Link to post
Share on other sites
What error does it return? If you're using any D3DX sprites or fonts or anything, you need to call their OnLostDevice() member functions (That's the C++ name, not sure what the Delphi name will be)

Share this post


Link to post
Share on other sites
I'm using both, D3DX sprites and fonts...

Directx does not support Delphi directly, I'm working with a wrapper - so the function should be exactly the same.

The Reset() function returns D3DERR_DEVICELOST.

So I'll try to release all the video memory resources using the OnLostDevice() functions of the font and sprite Interfaces... thanks for you help!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!