Closed DirectuX closed 4 years ago
Good questions!
I would like to target 60FPS, when possible.
Using threads is not possible with thinBASIC, except for using FreeBASIC ones. I would like to keep the game single threaded, for simplicity.
separating logic and render is a good idea, we could have update
and render
routines for it
TBGL already does offer way to fix framerate. We could stick with approach listed in the help file, that is:
' For optimal performance use approach called "dynamic V-Sync",
' featured for example in "Gears Of War" game title
DIM maxFrameRate AS LONG = TBGL_GetVSyncMaxFrameRate()
WHILE TBGL_IsWindow( hWnd ) ' -- Rendering loop start
FrameRate = TBGL_GetFramerate ' -- Retrieve FPS
' -- Condition, if FPS should be more than max, turn VSync on, else off TBGL_UseVSync IIF( FrameRate < maxFrameRate , 0, 1 )
' ... rendering here ...
WEND ' -- Rendering loop end
all ok !
added to the BTB.cts roadmap !
Thank you!
https://github.com/petrSchreiber/BetweenTheBubbles-tb/blob/2448a4ba78c7159cb3efa2a17ad43813004b6596/src/BetweenTheBubbles.tbasic#L28
regarding this comment and the frameRate I've seen here (+200) , do you think we can lower down the refresh rate to , say, 30-60fps, and use the extra idle time for other logics ?
is threading possible ?
Maybe not a good coding practice, or not possible, or not easy, I don't know, but, could we separate the display logic from other tasks ?
In the TBMain loop, we could then check if frameRate > 30 and skip the render, leaving more power for other parts of code ?