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];
111 return SDL_SetError(
"iOS GL Load Library just here for compatibility");
123 SDL_UIKit_UpdateBatteryMonitoring();
126 [context.sdlView swapBuffers];
143 EAGLSharegroup *sharegroup = nil;
151 EAGLRenderingAPI api = major;
156 SDL_SetError(
"OpenGL ES %d.%d context could not be created", major, minor);
166 sharegroup =
context.sharegroup;
173 if ([
data.uiwindow.screen respondsToSelector:
@selector(nativeScale)]) {
174 scale =
data.uiwindow.screen.nativeScale;
180 context = [[SDLEAGLContext alloc] initWithAPI:api sharegroup:sharegroup];
189 retainBacking:_this->gl_config.retained_backing
190 rBits:_this->gl_config.red_size
191 gBits:_this->gl_config.green_size
192 bBits:_this->gl_config.blue_size
193 aBits:_this->gl_config.alpha_size
194 depthBits:_this->gl_config.depth_size
195 stencilBits:_this->gl_config.stencil_size
196 sRGB:_this->gl_config.framebuffer_srgb_capable
242 [EAGLContext setCurrentContext:context];
#define SDL_GetWindowSize
#define SDL_GL_GetCurrentContext
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
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLenum GLenum GLenum GLenum scale
GLsizei const GLchar *const * path
GLfloat GLfloat GLfloat GLfloat h
GLubyte GLubyte GLubyte GLubyte w
int UIKit_GL_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context)
void UIKit_GL_RestoreCurrentContext(void)
SDL_GLContext UIKit_GL_CreateContext(_THIS, SDL_Window *window)
int UIKit_GL_LoadLibrary(_THIS, const char *path)
void UIKit_GL_GetDrawableSize(_THIS, SDL_Window *window, int *w, int *h)
void * UIKit_GL_GetProcAddress(_THIS, const char *proc)
void UIKit_GL_DeleteContext(_THIS, SDL_GLContext context)
int UIKit_GL_SwapWindow(_THIS, SDL_Window *window)
SDL_bool UIKit_IsSystemVersionAtLeast(double version)
static SDL_VideoDevice * _this
@ SDL_WINDOW_ALLOW_HIGHDPI
void * SDL_GLContext
An opaque handle to an OpenGL context.
EGLSurface EGLNativeWindowType * window
struct SDL_VideoDevice::@262 gl_config
int share_with_current_context
SDL_uikitviewcontroller * viewcontroller
The type used to identify a window.
static screen_context_t context