Skip to main content
gamedev.net
🔒 Locked

Simulating a lost device

Started by chdennis Mar 9, 2004 at 4:25 PM 4 replies 1.2k views
Original Post
chdennis
chdennis
When working on a fullscreen app, I can trigger a lost Direct3D device by alt-tab''bing. However, I''d like to test the Reset code in my windowed app - is there a good way to force a lost device? I know my Reset is working, but I''d like to test with an actual lost device.
chdennis
chdennis
> Minimizing should do the trick... I think.

Just tried that again to make sure - didn''t cause a failures/lost device.......
Agony
Agony
This page talks about what can cause a device to become lost. Judging from what it says, I would suggest simply calling Reset() with invalid parameters.


int main() { return *((int*)0); }
"We should have a great fewer disputes in the world if words were taken for what they are, the signs of our ideas nly, and not for things themselves." - John Locke o
chdennis
chdennis
Thanks Agony - sometimes it helps to go back to the manual:

"By design, the full set of scenarios that can cause a device to become lost is not specified. A typical example is a loss of focus, such as when the user presses ALT+TAB or a system dialog is initialized"

Hitting Ctrl+Alt+Del brings up a system dialog, which does the trick - so Ctrl+Alt+Del then Esc is a very quick n'' easy way to lose the device in windowed mode.

Thanks for the input!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.