TheRealKaup / KTech

C++ 2D terminal game engine library for GNU/Linux
GNU General Public License v3.0
1 stars 1 forks source link

Return "tick on input" option #75

Closed TheRealKaup closed 4 months ago

TheRealKaup commented 4 months ago

At one point, one could create a game loop that would continue to the next tick after Input::Get() would return. Currently, that is not an option, as:

Also find a way to integrate it alongside invocations.

An alternative would be "render on demand" - only when things change, that could be when the tick had input or invocations.

This is a dependency for TextureCreator.

TheRealKaup commented 4 months ago
// ... in game loop
if (engine.time.invokedThisTick && engine.input.inputThisTick)
{
    ui.Render();
    engine.output.Draw(ui.image);
    engine.output.Print();
}
// ...