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

Author Topic: useless UseVerticalSync()?!?  (Read 2132 times)

0 Members and 1 Guest are viewing this topic.

SvenB

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • http://www.psych.uni-halle.de/sven/
useless UseVerticalSync()?!?
« on: September 12, 2008, 02:22:36 pm »
Hi all,

while testing frame rates I came upon the following problem: changing between UseVerticalSync(true) and UseVerticalSync(false) does not make any difference. On my desktop computer I have a frame rate of 250 Hz (graphics card set to 60 Hz) irrespective of VerticalSync true or false. On my Laptop I have a frame rate of 40 (!) Hz (graphics card set to 60 Hz).


Code: [Select]
 while( Screen0.IsOpened() ) {
        Screen0.UseVerticalSync(true);  // or false
        Clock.Reset() ;
        do {
            Screen0.Draw( Text ) ;
            Framerate = 1.0f / Screen0.GetFrameTime();
            std::sprintf( buf, "Refreshrate %5.2f Hz", Framerate ) ;
            Text2.SetText( buf ) ;
            Screen0.Draw( Text2 ) ;
            Screen0.Display() ;
        } while( Clock.GetElapsedTime() < 5.0f ) ;
      Screen0.Close() ;
    }


Obviously UseVerticalSync does not work. Does anybody have any idea why?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
useless UseVerticalSync()?!?
« Reply #1 on: September 12, 2008, 02:28:49 pm »
v-sync is first controlled by your graphics driver. The option must be set to "let application choose", otherwise it will be forced to on or off whatever you do.
Laurent Gomila - SFML developer

 

anything