feat: Implement lazy initialization for Emulator and Renderer
- Updated Emulator to support optional lazy initialization of the renderer, enhancing flexibility during runtime. - Introduced a new method in IRenderer for creating textures with specific pixel formats, improving texture management for the emulator. - Refactored texture command processing in Arena to handle empty queues more gracefully. - Enhanced SDL2Renderer to support the new texture creation method, ensuring compatibility with emulator requirements.
This commit is contained in:
@@ -51,6 +51,7 @@ class Emulator {
|
||||
audio_device_ = audio_device;
|
||||
}
|
||||
auto wanted_samples() const -> int { return wanted_samples_; }
|
||||
void set_renderer(gfx::IRenderer* renderer) { renderer_ = renderer; }
|
||||
|
||||
// AI Agent Integration API
|
||||
bool IsEmulatorReady() const { return snes_.running() && !rom_data_.empty(); }
|
||||
@@ -133,6 +134,7 @@ class Emulator {
|
||||
|
||||
Snes snes_;
|
||||
bool initialized_ = false;
|
||||
bool snes_initialized_ = false;
|
||||
gfx::IRenderer* renderer_ = nullptr;
|
||||
void* ppu_texture_ = nullptr;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user