Thanks to all.
To jide: if my app run at 22fps , why it can touch 100fps. if there are something out of my program, my app should be slowed down, not accelerated.
In order to simplify the problem, I only draw a quad 1000 times. all codes in Draw() is followed:
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glPushMatrix();
for (int i=0; i<1000; i++)
{
glColor4f(1.0f, 1.0f, 1.0f, 0.4f);
glPushMatrix();
glBegin(GL_QUADS);
glNormal3f( 0.0f, 0.0f, 1.0f);
glTexCoord2d(0.0,0.0);
glVertex3f( 90.0f, 100, 0.00f);
glTexCoord2d(0.0,1.0);
glVertex3f( 90.0f, -100, 0.00f );
glTexCoord2d(1.0,1.0);
glVertex3f(-90.0f, -100, 0.00f );
glTexCoord2d(1.0,0.0);
glVertex3f(-90.0f, 100, 0.00f );
glEnd();
glPopMatrix();
glColor4f(1,1,1, 1);
//glFlush();
}
glPopMatrix();
in each frame, the periodical thing is treatment of message queue and render all objects in Draw function. so what is the special things?
To zed and RigidBody:
I think the printf function can only slow down my app, it can not vary my frame rate up and down because in each frame i call printf function the same times. and now i just want to track the trace of the fps. so i still use the function. the result is as followed:
30
31
31
31
28
33
31
32
32
31
33
31
30
32
31
32
32
31
32
29
34
31
31
32
32
32
31
31
30
33
31
32
31
31
30
31
32
32
28
33
32
32
30
32
32
32
31
32
31
32
31
32
32
32
32
32
32
33
30
29
34
32
32
32
31
29
27
30
32
27
34
31
32
32
33
31
32
32
32
32
32
29
34
32
31
31
32
32
29
33
33
29
32
31
33
32
31
32
31
22
34
31
32
32
30
29
34
32
33
31
32
30
33
31
32
32
33
31
32
31
32
30
33
29
34
30
32
30
34
27
32
32
32
32
29
34
32
32
30
32
32
32
32
31
32
31
31
32
32
32
28
33
32
30
31
28
30
33
27
33
31
32
30
32
31
32
31
31
31
32
32
31
27
33
33
32
32
32
32
30
30
24
33
33
32
31
33
29
32
32
31
32
32
30
22
32
30
33
32
32
32
32
30
32
31
31
31
32
32
32
32
32
32
28
25
34
32
32
27
34
31
25
33
32
31
32
32
33
31
32
32
32
22
33
31
32
32
31
31
32
30
33
31
32
33
32
22
31
33
29
32
32
27
34
32
31
31
33
22
33
32
32
32
30
33
32
32
33
31
32
28
33
31
32
32
32
31
31
31
31
30
32
31
31
32
30
To my surprise, In the Draw() function, when I add the glFlush()as the above, I can get a stable frame rate as followed:
34
33
34
34
33
34
34
33
34
34
32
32
34
34
33
34
34
30
33
34
32
34
33
35
34
33
34
35
33
34
34
34
33
34
31
33
33
34
34
33
34
34
33
34
34
32
34
34
34
33
34
32
32
32
35
34
33
32
34
34
34
34
34
33
35
32
33
34
34
33
33
34
34
33
34
35
33
34
34
33
33
32
34
33
34
33
34
32
32
32
33
35
34
34
33
34
34
34
34
34
33
34
34
33
33
33
33
33
35
34
34
33
32
34
33
33
34
34
32
33
33
34
31
35
34
33
34
34
33
33
34
34
34
34
34
33
32
34
33
34
34
34
33
34
34
33
34
34
33
33
34
34
31
32
34
33
32
34
34
33
33
35
33
34
34
35
33
34
34
33
34
34
33
34
33
34
33
33
34
33
34
34
34
32
32
34
31
34
34
34
31
34
34
33
34
35
34
33
34
34
32
34
34
33
34
34
34
33
33
33
33
34
35
34
33
34
34
33
33
34
32
32
34
31
33
34
34
34
34
34
34
31
35
34
33
34
34
34
33
34
34
34
34
33
33
34
34
34
31
34
34
33
34
33
33
30
32
34
34
33
35
34
33
34
35
33
34
34
34
33
34
34
31
35
34
33
34
34
33
30
34
33
34
33
33
34
33
33
31
32
30
34
34
33
33
33
34
How the OpenGL function can control the balance of frame rate? How can glflush accelerate my app?
What’s the reason?
Thanks agian!