21 #include "../../SDL_internal.h"
23 #if SDL_VIDEO_DRIVER_UIKIT
30 #include "../SDL_sysvideo.h"
31 #include "../../events/SDL_keyboard_c.h"
32 #include "../../events/SDL_mouse_c.h"
33 #include "../../power/uikit/SDL_syspower.h"
37 @interface SDLEAGLContext : EAGLContext
44 @implementation SDLEAGLContext
50 [
self.sdlView setSDLWindow:NULL];
61 return dlsym(RTLD_DEFAULT, proc);
71 SDLEAGLContext *eaglcontext = (__bridge SDLEAGLContext *)
context;
73 if (![EAGLContext setCurrentContext:eaglcontext]) {
74 return SDL_SetError(
"Could not make EAGL context current");
78 [eaglcontext.sdlView setSDLWindow:window];
109 return SDL_SetError(
"iOS GL Load Library just here for compatibility");
121 SDL_UIKit_UpdateBatteryMonitoring();
124 [context.sdlView swapBuffers];
141 EAGLSharegroup *sharegroup = nil;
149 EAGLRenderingAPI api = major;
154 SDL_SetError(
"OpenGL ES %d.%d context could not be created", major, minor);
164 sharegroup =
context.sharegroup;
172 if ([
data.uiwindow.screen respondsToSelector:
@selector(nativeScale)]) {
173 scale =
data.uiwindow.screen.nativeScale;
181 context = [[SDLEAGLContext alloc] initWithAPI:api sharegroup:sharegroup];
190 retainBacking:_this->gl_config.retained_backing
191 rBits:_this->gl_config.red_size
192 gBits:_this->gl_config.green_size
193 bBits:_this->gl_config.blue_size
194 aBits:_this->gl_config.alpha_size
195 depthBits:_this->gl_config.depth_size
196 stencilBits:_this->gl_config.stencil_size
197 sRGB:_this->gl_config.framebuffer_srgb_capable
243 [EAGLContext setCurrentContext:context];