RendererSDL3 functional

This commit is contained in:
2025-05-05 16:43:50 -05:00
parent 62b7618ff4
commit 3198b91ebc
5 changed files with 8 additions and 15 deletions

View File

@@ -182,7 +182,6 @@
buildInputs = with pkgs; [
sdl3
glew
];
buildPhase = ''
@@ -191,15 +190,15 @@
modules/ImguiModule/src/*.cpp \
modules/WindowModule/src/*.cpp \
$imgui/backends/imgui_impl_sdl3.cpp \
$imgui/backends/imgui_impl_opengl3.cpp \
$imgui/backends/imgui_impl_sdlrenderer3.cpp \
$imgui/misc/cpp/*.cpp \
$imgui/*.cpp \
-DRENDERER=1 \
-DRENDERER=2 \
-DWINDOW=2 \
-DMAINGUI_DYNAMIC \
-fpic -shared \
-I src -I include -I $imgui -I . \
-lGL -lSDL3 -lGLEW \
-lSDL3 \
-Wall \
-o $name
'';

View File

@@ -58,15 +58,6 @@ namespace Archimedes {
SDL_GL_MakeCurrent(w, gl_context);
SDL_GL_SetSwapInterval(1); // Enable vsync
#elif RENDERER == 2
SDL_Renderer* renderer = SDL_CreateRenderer(window, nullptr);
SDL_SetRenderVSync(renderer, 1);
if (renderer == nullptr)
{
std::cerr << "Error: SDL_CreateRenderer(): " << SDL_GetError() << std::endl;
std::abort();
}
#endif
/*SDL_AddEventWatch([](void* ptr, SDL_Event* e) -> bool {

View File

@@ -41,7 +41,7 @@ void ImguiModule::onLoad() {
window = wm->aquireWindow();
#if RENDERER == 2
renderer = window->getRenderer().renderer;
renderer = window->getRenderer()->getRendererImpl().renderer;
#endif
IMGUI_CHECKVERSION();

View File

@@ -6,6 +6,8 @@
#include "utils/Renderer/Renderer.h"
#include "utils/Window/Window.h"
static_assert(!(WINDOW == 1 && RENDERER == 2), "Window and Renderer are incompatible!\n");
class WindowModule : public Archimedes::Module {
public:
@@ -44,7 +46,9 @@ class WindowModule : public Archimedes::Module {
}
windowRefs++;
#if RENDERER == 1
window->getWindowImpl().restoreContext();
#endif
return window;
}

View File

@@ -3,7 +3,6 @@
void MinimalApp::run() {
for(std::string m : runOrder) {
std::cout << "load" << m << std::endl;
modules[m]->onLoad();
}