PDA

View Full Version : Refresh rate in OpenGL



Traveler
10-04-2006, 04:09 PM
I think Eric mentioned it that we should have our games run at the refresh rate choosen by the user and not default back to 60hz when the resolution changes.

Since my game is suffering from that very problem as well, I tried looking for a solution. Unfortunately without much succes. To this end, I was wondering of someone here knows of a solution.
I'm using plain opengl, no sdl. The setup is pretty much taken from the opengl templates found on either www.sulaco.co.za (http://www.sulaco.co.za) or www.delphigl.de/ (http://www.delphigl.de/)

Thank

Traveler
10-04-2006, 09:31 PM
Got the answer. It was right under my nose :?


procedure TForm1.Button1Click(Sender: TObject);
var
DeviceMode: TDeviceMode;result:integer;
begin
EnumDisplaySettings(nil, Cardinal(-1), DeviceMode);
result:=DeviceMode.dmDisplayFrequency;
showmessage(inttostr(result)+'hz');
end;

In case you ever need it....