Code: Select all
init_game_stuff()
do while not done
get_inputs()
update_game_state()
update_sound()
update_graphics()
loop
exit_game_stuff()
- get_inputs(), I write a class to collect information on key presses, mouse movement, joystick, etc
- update_game_state(), pure coding stuff, usually not dependent on platform/target
- update_sound(), calls to whatever sound lib I am using
- update_graphics(), typically, if using fbgfx, it is a CLS: draw_stuff(), SCREENSET, sleep(), action
- exit_game_stuff() is the clean-up code
The question is: Has anyone found, even if it is conditional, a game-loop, that works well on all platforms and fbgfx/opengl modes? I typically only test on win32, so if anyone has some experience across all platforms, I'd really like your advice. Thanks.