29 #include "../../SDL_internal.h" 31 #if SDL_VIDEO_DRIVER_UIKIT && (SDL_VIDEO_RENDER_METAL || SDL_VIDEO_VULKAN) 33 #import "../SDL_sysvideo.h" 39 @implementation SDL_uikitmetalview
44 return [CAMetalLayer class];
47 - (instancetype)initWithFrame:(CGRect)frame
50 if ((
self = [super initWithFrame:
frame])) {
51 self.tag = METALVIEW_TAG;
54 self.layer.contentsScale =
scale;
61 - (
void)layoutSubviews
63 [
super layoutSubviews];
75 if ([view isKindOfClass:[SDL_uikitmetalview
class]]) {
76 return (SDL_uikitmetalview *)view;
86 if ([data.
uiwindow.screen respondsToSelector:
@selector(nativeScale)]) {
87 scale = data.
uiwindow.screen.nativeScale;
94 SDL_uikitmetalview *metalview
95 = [[SDL_uikitmetalview alloc] initWithFrame:view.frame
97 [metalview setSDLWindow:window];
103 UIKit_Mtl_GetDrawableSize(
SDL_Window * window,
int *
w,
int *
h)
108 SDL_uikitmetalview* metalview = [view viewWithTag:METALVIEW_TAG];
110 CAMetalLayer *
layer = (CAMetalLayer*)metalview.layer;
113 *w = layer.drawableSize.width;
116 *h = layer.drawableSize.height;
GLenum GLenum GLenum GLenum GLenum scale
GLfloat GLfloat GLfloat GLfloat h
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLuint GLint GLint layer
#define SDL_GetWindowSize
GLubyte GLubyte GLubyte GLubyte w
EGLSurface EGLNativeWindowType * window
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 void
The type used to identify a window.