From 1361c48f59877f1bb8189a27bf38e1983fcbb738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo?= Date: Mon, 23 Dec 2024 23:23:24 -0300 Subject: [PATCH] Use SDL_Window as the WindowHandle in Linux and Android. (#73) --- .../include/ultramodern/renderer_context.hpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/ultramodern/include/ultramodern/renderer_context.hpp b/ultramodern/include/ultramodern/renderer_context.hpp index 86db335..21f377e 100644 --- a/ultramodern/include/ultramodern/renderer_context.hpp +++ b/ultramodern/include/ultramodern/renderer_context.hpp @@ -23,6 +23,8 @@ #include "ultra64.h" #include "config.hpp" +struct SDL_Window; + namespace ultramodern { namespace renderer { @@ -33,14 +35,9 @@ namespace ultramodern { DWORD thread_id = (DWORD)-1; auto operator<=>(const WindowHandle&) const = default; }; -#elif defined(__ANDROID__) - using WindowHandle = ANativeWindow*; -#elif defined(__linux__) - struct WindowHandle { - Display* display; - Window window; - auto operator<=>(const WindowHandle&) const = default; - }; +// TODO add a native window handle option here (Display/Window for x11 and ANativeWindow for Android) as a compile-time option. +#elif defined(__linux__) || defined(__ANDROID__) + using WindowHandle = SDL_Window*; #elif defined(__APPLE__) struct WindowHandle { void* window;