Frame-independant-rendering... (timers)

Started by
11 comments, last by max621 23 years, 10 months ago
The above values (anonymous poster) are probably more accurate than the ones I mentioned :-)
Advertisement
Thanks for all your replies Anyoumous poster with the code...
Would "doframe()" be to render the frame? and everything before it to update the scene?
||--------------------------||Black Hole Productionshttp://bhp.nydus.netResident expert on stuffmax621@barrysworld.com||--------------------------||
Here is how I do mine...

        bool notDone = TRUE;while(notDone){  if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)  {    if(msg.message == WM_QUIT)      notDone = FALSE;    TranslateMessage(&msg);    DispatchMessage(&msg);  }  else  {    if(gtimer.istime())    //gtimer is for graphics    {                   //update frames here    }    if(itimer.istime())   //itimer is for input    {              //poll keyboard and mouse    }}    [/source] By the way...my timers are using QueryPerformanceCounter...this seems to work very well for me.So how I use the performance timer is something like:[source]QueryPerformanceFrequency(cps); //i dont remember if it returns                                //or uses argumentctime = cps / fps; //fps is whatever frames per second you wantQueryPerformanceCounter(lasttime);//that WAS the init//here IS the istime()bool istime(){  QueryPerformanceCounter(currenttime);  if(pasttime + ctime >= currenttime)    return TRUE;  else    return FALSE;}    


Edited by - blide on July 20, 2000 2:45:06 AM
-blideblide@mail.com

This topic is closed to new replies.

Advertisement