epic: refactor SDL2_Renderer usage to IRenderer and queued texture rendering
- Updated the testing guide to clarify the testing framework's organization and execution methods, improving user understanding. - Refactored CMakeLists to include new platform-specific files, ensuring proper integration of the rendering backend. - Modified main application files to utilize the new IRenderer interface, enhancing flexibility in rendering operations. - Implemented deferred texture management in various components, allowing for more efficient graphics handling and improved performance. - Introduced new methods for texture creation and updates, streamlining the rendering process across the application. - Enhanced logging and error handling in the rendering pipeline to facilitate better debugging and diagnostics.
This commit is contained in:
@@ -6,9 +6,11 @@
|
||||
|
||||
#include "app/emu/snes.h"
|
||||
#include "app/rom.h"
|
||||
#include "imgui/imgui.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace gfx {
|
||||
class IRenderer;
|
||||
} // namespace gfx
|
||||
|
||||
/**
|
||||
* @namespace yaze::emu
|
||||
@@ -39,6 +41,7 @@ class Emulator {
|
||||
public:
|
||||
Emulator() = default;
|
||||
~Emulator() = default;
|
||||
void Initialize(gfx::IRenderer* renderer, const std::vector<uint8_t>& rom_data);
|
||||
void Run(Rom* rom);
|
||||
|
||||
auto snes() -> Snes& { return snes_; }
|
||||
@@ -129,7 +132,9 @@ class Emulator {
|
||||
SDL_AudioDeviceID audio_device_;
|
||||
|
||||
Snes snes_;
|
||||
SDL_Texture* ppu_texture_;
|
||||
bool initialized_ = false;
|
||||
gfx::IRenderer* renderer_ = nullptr;
|
||||
void* ppu_texture_ = nullptr;
|
||||
|
||||
std::vector<uint8_t> rom_data_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user