ScreenInfo function

General FreeBASIC programming questions.
Ophelius
Posts: 428
Joined: Feb 26, 2006 1:57

ScreenInfo function

Postby Ophelius » Apr 06, 2010 3:46

Is it guaranteed that this function will always return the desktop Refresh rate on any system? If not, is it only certain video cards that will work? Thanks

Edit: Also, is there a way to detect if someone has their Vsync turned on/off? Some video cards have that option and some people prefer to have it turned off. The only way I know is to first detect what refresh rate they have, and time a frame count in a loop with nothing but ScreenSync inside it. If both numbers are within 0-2 of each other, they have vsync turned on. The reason is that if someone has it turned off, I want my program to know so I can force a constant frame-rate with timers because ScreenSync won't regulate the FPS at this point.
MichaelW
Posts: 3500
Joined: May 16, 2006 22:34
Location: USA

Postby MichaelW » Apr 06, 2010 5:40

It seems to me that for a loop that contains only a ScreenSync, the difference in frame rate between vsync-on and vsync-off should be large enough to leave no doubt about the vsync state, without having to compare the frame rate to the refresh rate.
Ophelius
Posts: 428
Joined: Feb 26, 2006 1:57

Postby Ophelius » Apr 06, 2010 5:56

Ahh, good point. Even a 1/10th second test is plenty of time to check that.

Return to “General”

Who is online

Users browsing this forum: antarman and 10 guests