Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 7 of 7

Thread: detecting a refresh rate in opengl

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2000
    Location
    Bloomington Indiana, United States of America
    Posts
    12

    detecting a refresh rate in opengl

    I am currently writing a program for a professor at Indiana University ( I am an undergraduate psychology major there). This program simply alternates between two white and black rectangles. However to make these ocellate correctly, I need to have the program find the monitor's refresh rate. Is there a way of doing this in either C or OpenGl? Thanks for your help.

  2. #2
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Jul 2000
    Location
    S41.16.25 E173.16.21
    Posts
    2,609

    Re: detecting a refresh rate in opengl

    AFAIK this is OS specific information
    glut has a command glutGameModeGet(GLUT_GAME_MODE_REFRESH_RATE) but i think this only works if youre in glut game mode to begin with

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2000
    Location
    Bloomington Indiana, United States of America
    Posts
    12

    Re: detecting a refresh rate in opengl

    Could you tell me either where I can get information on getting the refresh rate in windows or simply post it yourself (if you know)? Thanks.

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Aug 2000
    Location
    Cardiff University
    Posts
    668

    Re: detecting a refresh rate in opengl

    Have a look at the drawsprocket toolkit, pretty sure you can do it on that

    gav

  5. #5
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Jul 2000
    Location
    S41.16.25 E173.16.21
    Posts
    2,609

    Re: detecting a refresh rate in opengl

    BOOL EnumDisplaySettings(
    LPCTSTR lpszDeviceName, // display device
    DWORD iModeNum, // graphics mode
    LPDEVMODE lpDevMode // graphics mode settings
    );
    + in lpDevMode theres a var called dmDisplayFrequency
    have a look in windopws halp 4 a more detailed information

  6. #6
    Junior Member Regular Contributor Lucretia's Avatar
    Join Date
    Mar 2000
    Location
    Leeds, West Yorkshire, England
    Posts
    117

    Re: detecting a refresh rate in opengl

    Well, I have tried this and the refresh rate always is 0. In another example I saw it checked it and set it to 60 if it was 0.

    I also did this.

    This is another proiblem with the windows version of OpenGL.

    Luke.
    Luke A. Guest

  7. #7
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    3,115

    Re: detecting a refresh rate in opengl

    In what way is this an OpenGL problem?

    The refresh rate is a problem for the functions dealing with setting displaymode, and that has nothing to do with OpenGL. OpenGL starts when the display/window is ready for rendering.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •