[DXUT] DXUTIsVsyncEnabled() returns wrong value

Started by
0 comments, last by punkcoders 10 years, 7 months ago

I have a strange result:

- when vsync is ON, DXUTIsVsyncEnabled() returns FALSE

- when vsync is OFF, DXUTIsVsyncEnabled() returns TRUE

I read the source:


bool WINAPI DXUTIsVsyncEnabled()
{
    DXUTDeviceSettings* pDS = GetDXUTState().GetCurrentDeviceSettings();
    if( pDS )
    {
        if( DXUTIsD3D9( pDS ) )
            return ( pDS->d3d9.pp.PresentationInterval == D3DPRESENT_INTERVAL_IMMEDIATE );
        else
            return ( pDS->d3d10.SyncInterval == 0 );
    }
    else
    {
        return true;
    }
};

Microsoft developers seem to have made a big error

They should have called it DXUTIsVsyncDisabled()

( or they should have returned a != test ... )

I hope this error has been fixed in later versions...

Is there a more direct way to get the presentation interval of a d3d9 device ?

Advertisement

ok i found it...

i made this instead:


IDirect3DSwapChain9 * chain;
pd3dDevice->GetSwapChain(0,&chain);
D3DPRESENT_PARAMETERS pp;
chain->GetPresentParameters(&pp);
chain->Release();
return ( pp.PresentationInterval != D3DPRESENT_INTERVAL_IMMEDIATE );

This topic is closed to new replies.

Advertisement