refresh rate on LCDs?
I'm using the following code to setup refresh-sync'd drawing.
Am I correct in assuming 60Hz if I don't have a RefreshRate? Any body know how to get an LCD display refresh rate?
Code:
NSDictionary *displaymode = (NSDictionary*)CGDisplayCurrentMode (kCGDirectMainDisplay);
float refresh = [[displaymode objectForKey:@"RefreshRate"] floatValue];
if (refresh < 60.0f) refresh = 60.0f;
[NSTimer scheduledTimerWithTimeInterval:1.0f/refresh
target:view
selector:@selector(display)
userInfo:nil
repeats:YES];---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
To the best of my knowledge, the refresh rate on LCDs is always 60Hz.
Alex Diener
Alex Diener
not really, LCDs all have different refresh rates (I've heard as low as 45Hz and as high as 72Hz, but I'd expect that range is constantly increasting).
What LCDs don't have is a vertical refresh... all the pixels are always on, and the image is refreshed essentially instantaneously from a snapshot of VRAM. I don't think this prevents tearing though.
So basically what I'm saying is, if you're relying on knowing the refresh rate of the monitor, you're screwed when it comes to LCDs. My question is, why do you care about the refresh rate of the monitor? Set the swap interval to 1 for your context, and let the OS decide how often you should flip. Just run your loop as fast as possible, and let the blocking in SwapBuffers regulate the frequency of the loop.
What LCDs don't have is a vertical refresh... all the pixels are always on, and the image is refreshed essentially instantaneously from a snapshot of VRAM. I don't think this prevents tearing though.
So basically what I'm saying is, if you're relying on knowing the refresh rate of the monitor, you're screwed when it comes to LCDs. My question is, why do you care about the refresh rate of the monitor? Set the swap interval to 1 for your context, and let the OS decide how often you should flip. Just run your loop as fast as possible, and let the blocking in SwapBuffers regulate the frequency of the loop.
OneSadCookie Wrote:My question is, why do you care about the refresh rate of the monitor? Set the swap interval to 1 for your context, and let the OS decide how often you should flip. Just run your loop as fast as possible, and let the blocking in SwapBuffers regulate the frequency of the loop.In single threaded apps, blocking kills the UI. I want the option of having Cocoa widgets, and having them responsive.
---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
Well, you'll still be responsive at 60+ Hz... is that good enough?
If not, you might want to consider doing your rendering from a second thread.
If not, you might want to consider doing your rendering from a second thread.
thanks for the feedback. I'll tinker with it.
---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Separating update rate from render rate | Jar445 | 5 | 3,763 |
Jan 17, 2009 01:43 PM Last Post: AnotherJake |
|
| Resolution, Depth, & Refresh Rate | nabobnick | 1 | 2,134 |
Mar 9, 2005 01:40 PM Last Post: arekkusu |
|
| variable frame rate animation in Cocoa | Damian | 3 | 3,325 |
Jul 16, 2003 06:00 PM Last Post: macboy |
|

