23 #if SDL_VIDEO_DRIVER_UIKIT
28 #include "../SDL_sysvideo.h"
29 #include "../../events/SDL_events_c.h"
47 self.window = _window;
63 const CGSize
size = data->
view.bounds.size;
66 w = (
int)(
size.width * displaymodedata->
scale);
75 NSUInteger orientationMask = 0;
77 const char *orientationsCString;
80 NSString *orientationsNSString = [NSString stringWithCString:orientationsCString
81 encoding:NSUTF8StringEncoding];
82 NSArray *orientations = [orientationsNSString componentsSeparatedByCharactersInSet:
83 [NSCharacterSet characterSetWithCharactersInString:@" "]];
85 if ([orientations containsObject:
@"LandscapeLeft"]) {
88 if ([orientations containsObject:
@"LandscapeRight"]) {
91 if ([orientations containsObject:
@"Portrait"]) {
94 if ([orientations containsObject:
@"PortraitUpsideDown"]) {
101 if (self->window->w >= self->window->h) {
104 if (self->window->h >= self->window->w) {
110 if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
113 return orientationMask;
116 - (
BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orient
118 NSUInteger orientationMask = [
self supportedInterfaceOrientations];
119 return (orientationMask & (1 << orient));
GLfloat GLfloat GLfloat GLfloat h
GLvoid **typedef void(GLAPIENTRY *PFNGLGETVERTEXATTRIBDVPROC)(GLuint
int SDL_SendWindowEvent(SDL_Window *window, Uint8 windowevent, int data1, int data2)
void viewDidLayoutSubviews()
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
SDL_DisplayMode current_mode
DECLSPEC const char *SDLCALL SDL_GetHint(const char *name)
Get a hint.
#define SDL_HINT_ORIENTATIONS
A variable controlling which orientations are allowed on iOS.
SDL_VideoDisplay * SDL_GetDisplayForWindow(SDL_Window *window)
GLint GLint GLint GLint GLint w
SDL_uikitopenglview * view
NSUInteger supportedInterfaceOrientations()
typedef BOOL(WINAPI *PFNWGLSETSTEREOEMITTERSTATE3DLPROC)(HDC hDC