Constant speed gl query

I am currently reworking the sample race code provided with opengl, to now support drawsprockets(fullscreen opengl), inputsprockets, texture mapping, alpha blending etc. and replace the buildings included to allow the user to walk around them, look through windows etc. Because of this, the polygon count can get quite high at times - hence the speed of the game decreases. Does anyone know of a way to keep game speed constant, by allowing opengl to drop/skip frames, or is it just a matter of reducing my poly count? This would be very helpful as at the moment, if the scene is complex, all the users actions become slower.

I’m not sure this will work for you but I found it on the net.

Look under the timers header.


The best way to do this is to track velocity and time for your game objects. Then when your rendering starts to lag, the game objects still move correctly with time, since their position at rendering time is based on their last position + velocity * delta time.