|
|
This thread is locked; no one can reply to it.
|
1
2
|
| Setting game speeds the same on all computers |
|
fsDoom
Member #7,690
August 2006
|
Also why are you installing the allegro timer-function anyway if you're not gonna use it |
|
HardTranceFan
Member #7,317
June 2006
|
Quote: What's wrong with the Allegro FAQ? Nothing. I dabbled with OpenGL and SDL before trying Allegro, and the method I described works with C++ using any of these game libraries. Quote: QueryPerformanceFrequency and QueryPerformanceCounter Same idea as CLOCKS_PER_SEC and clock(). If QueryPerformanceFrequency and QueryPerformanceCounter windows specific, that would make them a lot less portable. Jeroen -- |
|
Danex!
Member #7,759
September 2006
|
Ok i looked at the code from FAQ(just a side note that FAQ section looks helpful, i will cunsult it before asking questions next time) but there is a problem, i am already using the code that it provided. Thats how i learned to make programs ha ha ha, so what should i do or add to it, the only thing not in my code that was not in the code before was update_game_logic();, which i have not previously made, is it declared already in the standard library? so i am adding that in in random places and seeing if it works or does anything, if you want to seed where i have already implemented the code just look up a bit in the forum, i posted it. Thankyou for your time. |
|
Kitty Cat
Member #2,815
October 2002
|
Quote: Same idea as CLOCKS_PER_SEC and clock(). Except it doesn't do the same thing. clock() only measures the time your process takes, not the system time/real-time. So that means if you rest or if your process is put to sleep while it waits on IO, clock will slow down. And the time other processes take will slow clock down as well. There is no simple cross-platform way to get system time, with accuracy better th an seconds. clock_gettime(CLOCK_REALTIME, ...) and gettimeofday are standard and can get the system time, but Windows doesn't support them. So to get comparable functionality on Windows, you have to use QueryPerformanceFrequency and QueryPerformanceCounter. Or, since MinGW does try to add POSIX functions Windows doesn't natively support, you could supply patches for those functions and (when they're accepted and applied) use them on any system with GCC. -- |
|
|
1
2
|