I have been thinking about this a lot and don't know if i'm thinking incorrectly.
Most games have one game loop that can be split into three functions. A basic game loop would look something like this:
while(true){
handle_Input();
update();
render();
}
It's good when the handle_Input() and update() function are called as often as possible to create more responsive controls. But there is no point in calling the render() function more often then your monitor refresh rate. You could of course limit the speed of the loop in order to hit your monitor refresh rate but it would make the controls less responsive.
Wouldn't it be better to create two game loops?
The first game loop would call the handle_Input() and update() function as fast as possible, while the second game loop would take the latest frame the first game loop calculated and only call the render() function. The speed at which the secend game loop runs would be limited by the monitor refresh rate. In order for the concept to work, the game loops should be running on separate processor cores.
Wouldn't this create a lot less overhead for both the CPU and GPU by not wasting time on the worthless render() calls? And allow the game to either run with a higher fps count or better graphics? Wouldn't it also allow to give unbalanced systems, which have a weak GPU compared to the CPU, a more playable experience, because the weak GPU would only limit the fps you see but not the handle_Input() and update() calls?
I have never seen somebody implement a concept like which make me think something like this wouldn't work.
GLSurfaceView
toonDrawFrame
inGLSurfaceView.Renderer
?. – Theraot Oct 25 '20 at 23:46