Advertisement

Looking for VB.NET DX9 (device lost) help

Started by July 12, 2019 07:39 PM
1 comment, last by Adam_42 5 years, 2 months ago

I have an old game (Beyond Protocol) that is written in VB.NET.  The game is aged but works well.  Since the begining, 10 years ago, switching from windowed to full screen, or changing the windowed resolution always pops a critical error on device reset.  I've debugged all I can and have reached a lack of understanding as to where to go from here.

Is there anyone out there with legacy VB.NET and DX9 knowledge that could lend me a hand?

Thanks in advance.

 

== Here is where it errors ==

                Dim uParms As PresentParameters = CreatePresentationParams(mfrmMain)
                If uParms Is Nothing Then Return False
                moDevice.Reset(uParms)

==

the last line pops a object not referenced exception yet moDEvice is valid, with details, and uParams is valid with details.

 

Oddly after several resets it eventually corrects itself.

Lost devices are a pain to handle, mostly because you need to release everything that isn't in the default pool or Reset() will fail. You can enable the debug runtime from the DirectX control panel (which only works on Windows 7 or earlier) to get a better error message.

Your other option is to use D3D9Ex, which avoids almost all lost device issues. See https://docs.microsoft.com/en-gb/windows/win32/direct3d9/dx9lh

This topic is closed to new replies.

Advertisement