Hi all, when I run my project, the frame speed varied up and down. I can not understand it !
let me introduce my project here.
My project is programed with SDL & OpenGL, in the main.cpp file, i use the following codes,
while ( !done )
int lasttype = 0, lastbut = 0;
deal with message…
every 3D object is rendered in SuperPG.Draw() function, the function code is as followed:
millis =GetTickCount(); //ï¼ˆmsï¼‰
if (lastmillis) //Global variant initialized as 0
curtime = millis - lastmillis; //
DrawStatus(); //print the fps
lastmillis = millis;
in the DrawStatus() function, i compute the fps:
fps = 1000.0/curtime;
oldfps = fps;
fps = oldfps;
sprintf(fpschar,"%ld", (int) fps);
Who can tell me why the result fps is varied strongly? sometimes 12 frame per second
Does the message pool effect the frame speed? But I never touch the mouse and keyboard since the project start running. Why I can not see a steady fps?
Anybody tell me the reason? Thank you very much.