How to delay/pause in OpenGL?

I have a program where I have an object rotating. To my surprise, it is rotating very quickly, and I can’t think of any way to slow it down. Someone mentioned there may be a delay in the OpenGL library. How do I call this? Thank you!

You can use the QueryPerformanceCounter() and QueryPerformanceFrequency() function to make a small delay() function.

another way could be to sync to some timer.

i suppose you’re rotating you object this way:

glLoadIdentity();
glRotatef(rot,0,1,0);
<render>
rot+=1;

or something resembling.

build a function like this:

float get_seconds() {
return timeGetTime()/1000.0;
}

and try this:

glLoadIdentity();
glRotatef(get_seconds()*90,0,1,0);
<render>

regardless of your current fps rate, the object will make a complete turn every 4 seconds. ( 90*4=360 degrees )

Dolo//\ightY