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:
scawful
2025-10-07 17:49:27 -04:00
parent 6c331f1fd0
commit 0c3c8ebca7
7 changed files with 63 additions and 13 deletions

View File

@@ -33,7 +33,7 @@ void Arena::QueueTextureCommand(TextureCommandType type, Bitmap* bitmap) {
}
void Arena::ProcessTextureQueue(IRenderer* renderer) {
if (!renderer_) return;
if (!renderer_ || texture_command_queue_.empty()) return;
for (const auto& command : texture_command_queue_) {
switch (command.type) {