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:
scawful
2025-10-07 17:15:11 -04:00
parent 9e6f538520
commit 6c331f1fd0
101 changed files with 1401 additions and 2677 deletions

View File

@@ -4,6 +4,7 @@
#include "app/core/controller.h"
#include "app/core/window.h"
#include "app/gfx/backend/sdl2_renderer.h"
#include "app/gui/style.h"
#include "imgui/backends/imgui_impl_sdl2.h"
#include "imgui/backends/imgui_impl_sdlrenderer2.h"
@@ -56,7 +57,9 @@ void TestEditor::RegisterTests(ImGuiTestEngine* engine) {
int RunIntegrationTest() {
yaze::core::Controller controller;
yaze::core::Window window;
yaze::core::CreateWindow(window, SDL_WINDOW_RESIZABLE);
// Create renderer for test
auto test_renderer = std::make_unique<yaze::gfx::SDL2Renderer>();
yaze::core::CreateWindow(window, test_renderer.get(), SDL_WINDOW_RESIZABLE);
IMGUI_CHECKVERSION();
ImGui::CreateContext();
@@ -74,9 +77,9 @@ int RunIntegrationTest() {
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
// Initialize ImGui for SDL
ImGui_ImplSDL2_InitForSDLRenderer(
controller.window(), yaze::core::Renderer::Get().renderer());
ImGui_ImplSDLRenderer2_Init(yaze::core::Renderer::Get().renderer());
SDL_Renderer* sdl_renderer = static_cast<SDL_Renderer*>(test_renderer->GetBackendRenderer());
ImGui_ImplSDL2_InitForSDLRenderer(controller.window(), sdl_renderer);
ImGui_ImplSDLRenderer2_Init(sdl_renderer);
yaze::test::TestEditor test_editor;
#ifdef IMGUI_ENABLE_TEST_ENGINE