Advertisement Jump to content
Sign in to follow this  
GiantPaul

Tabbing out, losing device,losing other things

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

Sometimes icq turns on when I launch my program. Is this a lost device same as if I tabbed out? Also sometimes I launch a small window but I'm doing a few things at once and then my program does not respond to mouse clicks but everything else works fine. What was lost this time?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Sometimes icq turns on when I launch my program. Is this a lost device same as if I tabbed out?

Yes. A lost device is the result of the window losing focus, whether it be through minimizing it, alt-tabbing, popups, or just clicking on another window.

Quote:
Also sometimes I launch a small window but I'm doing a few things at once and then my program does not respond to mouse clicks but everything else works fine. What was lost this time?

Are you using DirectInput? Have you Re-aquired your devices?

Share this post


Link to post
Share on other sites
All I do to use mouse and keyboard is:

IDirectInputDevice8Object->Acquire();

And then I read.

Do I need to Reset anything like when I lose the device?

example:

D3DERR_DEVICELOST==IDirect3DDevice8Object->TestCooperativeLevel();

if(D3DERR_DEVICENOTRESET==IDirect3DDevice8Object->TestCooperativeLevel())
{
IDirect3DDevice8Object->Reset();
}

Share this post


Link to post
Share on other sites
Any resources like Buffers and Textures that you created without using the Managed Pool need to be released before reset and recreated after reset. The easiest way to solve this problem is just to put almost everything into the Managed pool, at least Microsoft claims that the managed pool is sufficient for most resources.

You can lose DirectInput devices just like Direct3D ones. You need to check for their loss and reaquire them when you can get access to them again.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!