Files
basic1/emulator/game.h
Adolfo Reyna 285dffc32e Add Lua scripting support to desktop emulator
- Created emulator-specific lua_game_emulator.cpp using filesystem instead of FatFS
- Created lua_game_loader_emulator.cpp to scan games/lua_examples directory
- Updated CMakeLists.txt to include Lua 5.4 engine and bindings
- Updated to SFML 3.0 API compatibility (event handling, sprite initialization)
- Updated Game class to use public members for Lua bindings
- Updated GameLauncher to use std::function for lambda captures
- Added continuous 60 FPS rendering for smooth display
- Emulator now loads and runs all three example Lua games
2026-02-07 12:14:33 -05:00

27 lines
832 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; }
// Public members for Lua bindings access
uint16_t width;
uint16_t height;
LowLevelRenderer* renderer;
LowLevelGUI* gui;
InputManager* input_manager;
};
#endif // GAME_H