Added migration documentation for iOS window properties

Fixes https://github.com/libsdl-org/SDL/issues/9430
This commit is contained in:
Sam Lantinga
2024-06-06 10:55:09 -07:00
parent 1938d25b7e
commit 5701c4f4bc
3 changed files with 60 additions and 29 deletions
+21 -1
View File
@@ -1613,7 +1613,7 @@ The information previously available in SDL_GetWindowWMInfo() is now available a
if (nswindow) {
...
}
#elif defined(SDL_PLATFORM_LINUX)
#elif defined(__LINUX__)
if (SDL_GetWindowWMInfo(window, &info)) {
if (info.subsystem == SDL_SYSWM_X11) {
Display *xdisplay = info.info.x11.display;
@@ -1629,6 +1629,17 @@ The information previously available in SDL_GetWindowWMInfo() is now available a
}
}
}
#elif defined(__IPHONEOS__)
UIWindow *uiwindow = NULL;
if (SDL_GetWindowWMInfo(window, &info) && info.subsystem == SDL_SYSWM_UIKIT) {
uiwindow = (__bridge UIWindow *)info.info.uikit.window;
}
if (uiwindow) {
GLuint framebuffer = info.info.uikit.framebuffer;
GLuint colorbuffer = info.info.uikit.colorbuffer;
GLuint resolveFramebuffer = info.info.uikit.resolveFramebuffer;
...
}
#endif
```
becomes:
@@ -1657,6 +1668,15 @@ becomes:
...
}
}
#elif defined(SDL_PLATFORM_IOS)
SDL_PropertiesID props = SDL_GetWindowProperties(window);
UIWindow *uiwindow = (__bridge UIWindow *)SDL_GetProperty(props, SDL_PROP_WINDOW_UIKIT_WINDOW_POINTER, NULL);
if (uiwindow) {
GLuint framebuffer = (GLuint)SDL_GetNumberProperty(props, SDL_PROP_WINDOW_UIKIT_OPENGL_FRAMEBUFFER_NUMBER, 0);
GLuint colorbuffer = (GLuint)SDL_GetNumberProperty(props, SDL_PROP_WINDOW_UIKIT_OPENGL_RENDERBUFFER_NUMBER, 0);
GLuint resolveFramebuffer = (GLuint)SDL_GetNumberProperty(props, SDL_PROP_WINDOW_UIKIT_OPENGL_RESOLVE_FRAMEBUFFER_NUMBER, 0);
...
}
#endif
```