Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Changing refresh rate?

Changing refresh rate?
Thread Tools
Dedicated MacNNer
Join Date: Sep 2000
Status: Offline
Reply With Quote
Nov 18, 2002, 03:08 PM
 
Hi!

I'm trying to write a little C CLI app that changes the refresh rates of my display.

I've experimented with the following:


mode = CGDisplayBestModeForParameters(dspy,8,640,480,& ;exactMatch);
err = CGDisplaySwitchToMode(dspy,mode);

where dspy is the id of the display.
CGDisplaySwitchToMode allows me in this example to switch to a resolution of 640x480 with 8-bits color depth.

But how can I change refresh rate from 60Hz to 50Hz? CGDisplaySwitchToMode doesn't seam to take any more parameters.

Any ideas?
     
Dedicated MacNNer
Join Date: Sep 2000
Status: Offline
Reply With Quote
Nov 18, 2002, 03:34 PM
 
I think I found the correct function. It should be:

mode = CGDisplayBestModeForParametersAndRefreshRate(kCGDi rectMainDisplay,8,640,480,50,&exactMatch);
     
Junior Member
Join Date: Nov 2001
Status: Offline
Reply With Quote
Nov 24, 2002, 03:22 PM
 
Would you be able to make the source code for this tool available?

I'm trying to get started in C development on OSX, and this is exactly the type of utility I'm interested in developing (C code, CLI application, calling into various OSX APIs).

What API is this using? Carbon?

- Mike
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:22 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2