I do not want to test the device state before EVERY draw primitive, and there is a HUGE chance a user could alt+tab during a DrawPrimitive routine where there are a few calls to drawprimitve, thus crashing hard.
I mean I have many things set up to prevent this, like the game thread sleeps immediatly after loosing focus, or as fast as the WM_LOSTFOCUS message is processed, at that point I need to work out a way to have the thread recreate the dx object, since any threads which creates the dx com should be using it as well as resetting and unloading it. So "whatever goes on in the thread stays in the thread" to quote the obvious.
NO matter how I hard I try I can't seem to picture a way which would correctly prevent any chance of a user pressing alt+tab during a rendering routine and not having it fail...OR!!
Maybe DX9 is nicer than Dx7 and if it can't render it won't crash, it will simply return DeviceLost.




Reply With Quote