Check for vSync on/off with DirectX

Posted on 2005-04-24
Last Modified: 2013-12-08

I understand I can set vSync usage (on/off) by DirectX when creating the device (e.g., IDirect3D9::CreateDevice, Parameter D3DPRESENT_PARAMETERS). But this would be overwritten by driver settings, right ? Like, vSync is set to "on" during CreateDevice (full screen app), but the driver has it set to off by the user, thus my game will not use vsync on presentation.

Is there a possibility to check if my Device really runs with vSync turned on or off ?

Thank you.
Question by:MiKo93
    LVL 17

    Accepted Solution

    You're entering a gray area... ;)

    I don't believe there are any methods in DX or GL for detecting the current VSYNC state of the device, just for telling the driver what state you'd PREFER.  If a hard-core game player goes into the driver control panel, advanced settings, and force-overrides the driver to never (or always) VSYNC, that's the USER'S PREFERENCE.  In theory, you shouldn't be able to override it.  Those options were put in for games that say didn't VSYNC but users wanted them to (on really fast machines, to avoid tearing at the cost of FPS), or for games that always locked VSYNC but the users didn't want it (in games that chew up CPU/GPU, and disabling VSYNC gains you FPS in performance with some slight tearing).

    In the old days, vsync was something that you did, not the drivers (the real, real old days).  There's obviously always a vsync, it's whether the driver waits to page-flip for the vretrace to begin -- and with most modern cards, there's just a bit that tells the card when it goes to retrace, do a flip that's been queued up...

    This is the battle between programmers wanting to know how things look/work on a user's system, and a user wanting control over their OWN system. ;)


    Author Comment

    davebytes, thank you for clearing that up

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…
    Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now