Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Setting refresh rate?  (Read 4431 times)

0 Members and 1 Guest are viewing this topic.

Sivak

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Setting refresh rate?
« on: April 23, 2010, 08:02:44 am »
I wondered if it's possible to set the refresh rate with a render window, particularly in fullscreen.

I've got a CRT and I see games do mixed things with fullscreen.  Some set the rate to be the same as the desktop while others set it to like 59.78...

I just was hoping there'd be an option to set it the same rate always.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Setting refresh rate?
« Reply #1 on: April 23, 2010, 08:38:03 am »
No, SFML simply uses whatever the OS has as a default value (which is the best one I guess). I don't see any reason to be able to select another frequency.
Laurent Gomila - SFML developer

Sivak

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Setting refresh rate?
« Reply #2 on: April 23, 2010, 05:13:57 pm »
Well, being that is is technically able to be set, I think it'd be a nice to have feature in any event.

Maybe in SFML 2?  It shouldn't be too hard to do, right?

Thanks.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Setting refresh rate?
« Reply #3 on: April 23, 2010, 07:30:52 pm »
So I should provide this "feature" because it is possible to implement? I can then add a lot of "features"... ;)
Laurent Gomila - SFML developer

Sivak

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Setting refresh rate?
« Reply #4 on: April 24, 2010, 11:47:32 pm »
Well, the thing is, I'm on a CRT and the fact the refresh rate is slower than the standard vsync game makes it choppy.

I have it at 75 for normal desktop use...  59.78 for fullscreen is too low.

Isn't there anywhere this could be modified?  Thanks.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Setting refresh rate?
« Reply #5 on: April 24, 2010, 11:50:52 pm »
SFML is supposed to pick up the best frequency. Are you sure that you can run fullscreen applications at frequencies higher than 60 Hz?

Maybe there is a bug in the Windows implementation that can be fixed ;)
Laurent Gomila - SFML developer

Ashenwraith

  • Sr. Member
  • ****
  • Posts: 270
    • View Profile
Setting refresh rate?
« Reply #6 on: April 25, 2010, 02:12:45 am »
You need to switch to lcd

CRT gave me so many eye problems at work regardless of the refresh rate.

Sivak

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Setting refresh rate?
« Reply #7 on: April 25, 2010, 04:35:08 am »
Quote from: "Laurent"
SFML is supposed to pick up the best frequency. Are you sure that you can run fullscreen applications at frequencies higher than 60 Hz?

Maybe there is a bug in the Windows implementation that can be fixed ;)


I've looked at a few other games, such as Exceed 2nd and 3rd.  I can actually view the refresh rate in the monitor settings and those had it at 75.  There were others that also went up there.  Even the original Quake went up there, so I know it's doable.  I wish I had other systems to try it on, but I won't be able to for a few days.

Quote

You need to switch to lcd
CRT gave me so many eye problems at work regardless of the refresh rate.


Just cause it's 9 years old doesn't mean it won't work!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Setting refresh rate?
« Reply #8 on: April 25, 2010, 04:28:46 pm »
Ok, we can try something and see if it solves the problem. I can't test the fix myself because I have a LCD screen, so it would be great if you could do this modification, recompile SFML and test it :)

If you're using SFML 1.6, add the following lines of code after line 476 of src/SFML/Window/Win32/WindowImplWin32.cpp
Code: [Select]
   DEVMODE mode;
    mode.dmSize = sizeof(DEVMODE);
    EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &mode);
    DevMode.dmDisplayFrequency = mode.dmDisplayFrequency;
    DevMode.dmFields |= DM_DISPLAYFREQUENCY;

This will use the current desktop frequency for the new fullscreen mode, instead of relying on the default behaviour of the OS.
Laurent Gomila - SFML developer

 

anything