This commit is contained in:
2026-02-08 00:32:46 -06:00
parent b97957ec53
commit bad4bd70bc
9 changed files with 42 additions and 445 deletions

View File

@@ -1,3 +1,5 @@
#if WINDOW == 2
#ifndef WINDOW_SDL3
#define WINDOW_SDL3
@@ -15,15 +17,11 @@
namespace Archimedes {
template <class WindowImpl, class RendererImpl>
requires allowed_windows<WindowImpl, RendererImpl>
&& allowed_renderers<RendererImpl>
class Window;
template <class W, class R>
static bool EventCallback(void* ptr, SDL_Event* e) {
WindowData<W, R>& data = *(WindowData<W, R>*) ptr;
WindowData& data = *(WindowData*) ptr;
switch(e->type) {
@@ -68,12 +66,11 @@ namespace Archimedes {
return true;
}
template <class R>
class WindowSDL3 {
public:
WindowSDL3(Window<WindowSDL3<R>, R>* p, const std::function<void(Event*)>& sendEvent) {
WindowSDL3(Window* p, const std::function<void(Event*)>& sendEvent) {
data.window = p;
data.sendEvent = sendEvent;
@@ -157,7 +154,7 @@ namespace Archimedes {
#if RENDERER == 1
SDL_GLContext getContext() { return gl_context; }
#endif
WindowData<WindowSDL3<R>, R> data;
WindowData data;
private:
SDL_Window* w;
@@ -168,6 +165,9 @@ namespace Archimedes {
};
typedef WindowSDL3 WindowImpl;
}
#endif
#endif