- Added INPUT_FRAME_TICK event type to input_event.h - Added wants_frame_updates() virtual method to Game base class - Implemented frame tick logic in main loop (basic1.cpp and emulator/main.cpp) - Added Lua bindings: game.set_frame_updates(bool) and INPUT.FRAME_TICK - Updated LuaGame to support frame updates via registry flag - Updated ball.lua to use continuous frame updates for smooth animation - Both hardware and emulator now support continuous animation for physics/games
28 lines
895 B
C++
28 lines
895 B
C++
// Emulator copy of game.h
|
|
#ifndef GAME_H
|
|
#define GAME_H
|
|
#include <stdint.h>
|
|
#include "input_event.h"
|
|
#include "../display/low_level_render.h"
|
|
#include "../display/low_level_gui.h"
|
|
class InputManager;
|
|
class Game {
|
|
public:
|
|
Game(uint16_t width, uint16_t height, LowLevelRenderer* renderer, LowLevelGUI* gui, InputManager* input_manager)
|
|
: width(width), height(height), renderer(renderer), gui(gui), input_manager(input_manager) {}
|
|
virtual ~Game() {}
|
|
virtual void init() = 0;
|
|
virtual bool update(const InputEvent& event) = 0;
|
|
virtual void draw() = 0;
|
|
virtual bool wants_to_exit() const { return false; }
|
|
virtual bool wants_frame_updates() const { return false; }
|
|
|
|
// Public members for Lua bindings access
|
|
uint16_t width;
|
|
uint16_t height;
|
|
LowLevelRenderer* renderer;
|
|
LowLevelGUI* gui;
|
|
InputManager* input_manager;
|
|
};
|
|
#endif // GAME_H
|