View Single Post
Old 13th April 2009, 22:15   #252  |  Link
ericgur
Registered User
 
Join Date: Dec 2001
Location: Israel
Posts: 34
MadVR 0.4 crash + minor bug

Hi,
First, I'd like to thank you for your iniative creating MadVR.
I wrote a VR for internal company use a year ago and I know the pains....

I came into 2 issues:
When pressing CTRL+ALT+DEL (going into the screen where you can lock your computer or start task manager) and coming back to the desktop, the player crashes. Doesn't matter if in full screen or not. You should check you have a valid D3D device before the call to pd3dDevice->Present().

something like (similar code was found in direct show sample code from Windows SDK):
Code:
    
    HRESULT hr = pd3dDevice->TestCooperativeLevel();
    
    //device not ready!
    if (hr != D3D_OK)
    {
        // If the device was lost, do not render until we get it back
        if (D3DERR_DEVICELOST == hr || D3DERR_DRIVERINTERNALERROR == hr)
        {
            return E_FAIL;
        }

        // Check if the device needs to be reset.
        if( D3DERR_DEVICENOTRESET == hr )
        {
            // Reset the D3D environment
            DestroyD3D9();
            hr = InitializeD3D9();
            if (FAILED(hr))
                return hr;

            hr = pd3dDevice->TestCooperativeLevel();
            if (FAILED(hr))
                return hr;
        }
        else
        {
            ErrMsg("D3D device reported an internal error!\n"
                "Quiting application.\n");
            exit(hr);
        }
    }
Loosing the D3D device can occur as a result of screen savers or when the monitor is tuned off by the VGA driver as well.

The other issue is minor, when MadVR is first launched, no setting are set in the DS property page. Maybe the default scaling algorithm should be set.

My setup
Vista 64 SP1
ZoomPlayer

Last edited by ericgur; 13th April 2009 at 22:26. Reason: updated setup
ericgur is offline   Reply With Quote