|
This thread is locked; no one can reply to it. |
1
2
|
I need a high resolution timer with QPC |
Paul whoknows
Member #5,081
September 2004
|
How should I use Orz's routines? ____ "The unlimited potential has been replaced by the concrete reality of what I programmed today." - Jordan Mechner. |
orz
Member #565
August 2000
|
Quote:
Here are Orz's routines for timing: I think looking at it will definitely solve your problem Paul.
Yeah, that's my timing measurement code. A few caveats: Quote:
thread's title said: That was the title, but your original post said Quote: I found a lot of timer routines using QPC but there is no explanation about how to use these routines in the main loop So I posted code that demonstrated how to use a timer function in a games main loop, independant of whether that timer function used QPC. Though, for usage with QPC, its best with the ints changed to doubles. i.e.
edit: fixed a typo in the code (mispelled since as sicne in one case), added a value of ms_per_tick The only thing necessary (with or without changing the ints to doubles) to make that into a functional QPC-timed game loop is a QPC based timer such as:
edit: Quote:
How should I use Orz's routines? That is the main loop there in my first post, and again in this post. It's untested, but is a demonstration of the concepts. If you want one with delta-timing instead, just ask. Quote: From Pmask libray you have test.c and test2.c which use Orz's timing routines so all your need are filled .
Hm... not necessarily a good idea... (edit: I feel kinda stupid saying that something of mine isn't a good example for some purpose, but really the PMASK tests weren't written with this is mind... perhaps I should clean up test2.c sometime...) |
Paul whoknows
Member #5,081
September 2004
|
Thank you very much! I'll try to implement your routines now! ____ "The unlimited potential has been replaced by the concrete reality of what I programmed today." - Jordan Mechner. |
|
1
2
|