You can also make a multithreaded system, it's easy in PureBasic, so you have the main thread that draw (FlipBuffers()...) and a thread that make al the calculation every time step (i.e 25ms)
GetTickCount_() and ElapsedMilliseconds() are not really precise, better use QueryPerformanceCounter() (a bit more difficult but more than µs precision rather than ElapsedMillisecond < ms precision)
sample :
Code: Select all
Procedure ThreadCalculations()
Repeat
oldT = t
Repeat
QueryPerformanceCounter(@t)
Delay(1)
Until t > oldT + #TIMESLEEP
;calculations...
Until end
EndProcedure
Well, i know it's not as simple, but i have not my games sources know with me
and you may encounter problem using strings or accessing same linkedlists in different threads, u have to handle it...