Jump to content
  • Advertisement
Sign in to follow this  
punkcoders

[DXUT] DXUTIsVsyncEnabled() returns wrong value

This topic is 2127 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 ?

Share this post


Link to post
Share on other sites
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 );
Edited by punkcoders

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!