From 35b5cf95a0e98827621da53fd32034304fa81291 Mon Sep 17 00:00:00 2001 From: Susko3 Date: Fri, 20 Dec 2024 17:54:24 +0100 Subject: [PATCH] Implement getting UIKit framebuffer on SDL3 --- osu.Framework/Platform/SDL3/SDL3GraphicsSurface.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/osu.Framework/Platform/SDL3/SDL3GraphicsSurface.cs b/osu.Framework/Platform/SDL3/SDL3GraphicsSurface.cs index 2091e70451..7951a24f6e 100644 --- a/osu.Framework/Platform/SDL3/SDL3GraphicsSurface.cs +++ b/osu.Framework/Platform/SDL3/SDL3GraphicsSurface.cs @@ -156,14 +156,10 @@ private IntPtr getProcAddress(string symbol) if (window.SDLWindowHandle == null) return null; - // TODO: Migrate to SDL3 when https://github.com/libsdl-org/SDL/issues/9430 is resolved - // var wmInfo = window.GetWindowSystemInformation(); - // - // switch (wmInfo.subsystem) - // { - // case SDL_SYSWM_TYPE.SDL_SYSWM_UIKIT: - // return (int)wmInfo.info.uikit.framebuffer; - // } + var props = SDL_GetWindowProperties(window.SDLWindowHandle); + + if (SDL_HasProperty(props, SDL_PROP_WINDOW_UIKIT_OPENGL_FRAMEBUFFER_NUMBER)) + return (int)SDL_GetNumberProperty(props, SDL_PROP_WINDOW_UIKIT_OPENGL_FRAMEBUFFER_NUMBER, 0); return null; }