🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

directX 9 losing output to window

Started by
5 comments, last by medievil 3 years, 2 months ago

helping work an on an emulator that currently works with Dx9… and for some emulated games, the dx9 window loses connection.. I mean everything.. even intel GPA thinks it is a dead fish and will not attach…, there are no errors, I have stepped through the code , nothign seems amiss… the game will start fine, play copyright and developer videos, play attract video, but as soon as it goes to menu, it dies, if you fumble through the menu and start game, it comes back…
Just looking for general things to look for, I know no one can give a definitive answer..figured someone may have ran across something similar before…

Advertisement

Sounds like a lost device.

There's some discussion of this, including the correct way to handle it, at an older thread here: https://www.gamedev.net/forums/topic/649889-directx-90c-handling-lost-device/

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

it's windowed mode though…. didn't think lost device was applicable (TestCooperativeLevel returns OK as well)

It can still happen; it's not just Alt-Tabbing that causes lost devices - as Microsoft note (my emphasis):

By design, the full set of scenarios that can cause a device to become lost is not specified. Some typical examples include loss of focus, such as when the user presses ALT+TAB or when a system dialog is initialized. Devices can also be lost due to a power management event, or when another application assumes full-screen operation. In addition, any failure from IDirect3DDevice9::Reset puts the device into a lost state.

So one example might be if you've got a windowed program, but another program tries to go fullscreen-exclusive - your windowed program will lose it's device.

Are you testing the HRESULT from your Present call for D3DERR_DEVICELOST? That's the correct way to test for a lost device.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

yea getting error 0x88760874, tracking down whats triggering it is gonna be a loooong process… present in this case is extremely simple…. d3ddevice→present(0,0,0,0)

just an update… resolved… seems the host device was getting recreated when it didn't need to be

device only needed to be created if it was null and that was a missing check…
a simple

If (pd3ddevice != nullptr) {
return;
}

resolved it

This topic is closed to new replies.

Advertisement