Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Refactored the UIKit mode code into a separate file so it's cleaner a…
…nd more consistent with other backends
  • Loading branch information
slouken committed Sep 30, 2012
1 parent 69e3491 commit 2fd5441
Show file tree
Hide file tree
Showing 10 changed files with 363 additions and 294 deletions.
24 changes: 16 additions & 8 deletions Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj
Expand Up @@ -98,6 +98,8 @@
56ED04E3118A8EFD00A56AA6 /* SDL_syspower.m in Sources */ = {isa = PBXBuildFile; fileRef = 56ED04E2118A8EFD00A56AA6 /* SDL_syspower.m */; };
93CB792313FC5E5200BD3E05 /* SDL_uikitviewcontroller.h in Headers */ = {isa = PBXBuildFile; fileRef = 93CB792213FC5E5200BD3E05 /* SDL_uikitviewcontroller.h */; };
93CB792613FC5F5300BD3E05 /* SDL_uikitviewcontroller.m in Sources */ = {isa = PBXBuildFile; fileRef = 93CB792513FC5F5300BD3E05 /* SDL_uikitviewcontroller.m */; };
AA126AD41617C5E7005ABC8F /* SDL_uikitmodes.h in Headers */ = {isa = PBXBuildFile; fileRef = AA126AD21617C5E6005ABC8F /* SDL_uikitmodes.h */; };
AA126AD51617C5E7005ABC8F /* SDL_uikitmodes.m in Sources */ = {isa = PBXBuildFile; fileRef = AA126AD31617C5E6005ABC8F /* SDL_uikitmodes.m */; };
AA628ADB159369E3005138DD /* SDL_rotate.c in Sources */ = {isa = PBXBuildFile; fileRef = AA628AD9159369E3005138DD /* SDL_rotate.c */; };
AA628ADC159369E3005138DD /* SDL_rotate.h in Headers */ = {isa = PBXBuildFile; fileRef = AA628ADA159369E3005138DD /* SDL_rotate.h */; };
AA7558981595D55500BBD41B /* begin_code.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558651595D55500BBD41B /* begin_code.h */; };
Expand Down Expand Up @@ -349,6 +351,8 @@
56ED04E2118A8EFD00A56AA6 /* SDL_syspower.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDL_syspower.m; path = ../../src/power/uikit/SDL_syspower.m; sourceTree = SOURCE_ROOT; };
93CB792213FC5E5200BD3E05 /* SDL_uikitviewcontroller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitviewcontroller.h; sourceTree = "<group>"; };
93CB792513FC5F5300BD3E05 /* SDL_uikitviewcontroller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitviewcontroller.m; sourceTree = "<group>"; };
AA126AD21617C5E6005ABC8F /* SDL_uikitmodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitmodes.h; sourceTree = "<group>"; };
AA126AD31617C5E6005ABC8F /* SDL_uikitmodes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitmodes.m; sourceTree = "<group>"; };
AA628AD9159369E3005138DD /* SDL_rotate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_rotate.c; sourceTree = "<group>"; };
AA628ADA159369E3005138DD /* SDL_rotate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rotate.h; sourceTree = "<group>"; };
AA7558651595D55500BBD41B /* begin_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = begin_code.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -837,25 +841,27 @@
FD689F090E26E5D900F90B21 /* uikit */ = {
isa = PBXGroup;
children = (
FDC656450E560DF800311C8E /* jumphack.h */,
FDC656440E560DF800311C8E /* jumphack.c */,
FDC656450E560DF800311C8E /* jumphack.h */,
FDC261780E3A3FC8001C4554 /* keyinfotable.h */,
FD689FCD0E26E9D400F90B21 /* SDL_uikitappdelegate.h */,
FD689FCC0E26E9D400F90B21 /* SDL_uikitappdelegate.m */,
FD689F0C0E26E5D900F90B21 /* SDL_uikitevents.h */,
FD689F0D0E26E5D900F90B21 /* SDL_uikitevents.m */,
AA126AD21617C5E6005ABC8F /* SDL_uikitmodes.h */,
AA126AD31617C5E6005ABC8F /* SDL_uikitmodes.m */,
FD689F0E0E26E5D900F90B21 /* SDL_uikitopengles.h */,
FD689F0F0E26E5D900F90B21 /* SDL_uikitopengles.m */,
FD689F160E26E5D900F90B21 /* SDL_uikitopenglview.h */,
FD689F170E26E5D900F90B21 /* SDL_uikitopenglview.m */,
FD689F100E26E5D900F90B21 /* SDL_uikitvideo.h */,
FD689F110E26E5D900F90B21 /* SDL_uikitvideo.m */,
FDC261780E3A3FC8001C4554 /* keyinfotable.h */,
FD0BBFEF0E3933DD00D833B1 /* SDL_uikitview.h */,
FD689F130E26E5D900F90B21 /* SDL_uikitview.m */,
FD689F140E26E5D900F90B21 /* SDL_uikitwindow.h */,
FD689F150E26E5D900F90B21 /* SDL_uikitwindow.m */,
FD689F160E26E5D900F90B21 /* SDL_uikitopenglview.h */,
FD689F170E26E5D900F90B21 /* SDL_uikitopenglview.m */,
FD689FCD0E26E9D400F90B21 /* SDL_uikitappdelegate.h */,
FD689FCC0E26E9D400F90B21 /* SDL_uikitappdelegate.m */,
93CB792213FC5E5200BD3E05 /* SDL_uikitviewcontroller.h */,
93CB792513FC5F5300BD3E05 /* SDL_uikitviewcontroller.m */,
FD689F140E26E5D900F90B21 /* SDL_uikitwindow.h */,
FD689F150E26E5D900F90B21 /* SDL_uikitwindow.m */,
);
path = uikit;
sourceTree = "<group>";
Expand Down Expand Up @@ -1234,6 +1240,7 @@
AA7558C81595D55500BBD41B /* SDL_version.h in Headers */,
AA7558C91595D55500BBD41B /* SDL_video.h in Headers */,
AA7558CA1595D55500BBD41B /* SDL.h in Headers */,
AA126AD41617C5E7005ABC8F /* SDL_uikitmodes.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -1450,6 +1457,7 @@
56EA86FB13E9EC2B002E47EB /* SDL_coreaudio.c in Sources */,
93CB792613FC5F5300BD3E05 /* SDL_uikitviewcontroller.m in Sources */,
AA628ADB159369E3005138DD /* SDL_rotate.c in Sources */,
AA126AD51617C5E7005ABC8F /* SDL_uikitmodes.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
4 changes: 2 additions & 2 deletions src/video/SDL_video.c
Expand Up @@ -623,8 +623,8 @@ SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect)
SDL_GetDisplayBounds(displayIndex-1, rect);
rect->x += rect->w;
}
rect->w = display->desktop_mode.w;
rect->h = display->desktop_mode.h;
rect->w = display->current_mode.w;
rect->h = display->current_mode.h;
}
return 0;
}
Expand Down
49 changes: 49 additions & 0 deletions src/video/uikit/SDL_uikitmodes.h
@@ -0,0 +1,49 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "SDL_config.h"

#ifndef _SDL_uikitmodes_h
#define _SDL_uikitmodes_h

#include "SDL_uikitvideo.h"

typedef struct
{
UIScreen *uiscreen;
CGFloat scale;
} SDL_DisplayData;

typedef struct
{
UIScreenMode *uiscreenmode;
CGFloat scale;
} SDL_DisplayModeData;

extern BOOL SDL_UIKit_supports_multiple_displays;

extern int UIKit_InitModes(_THIS);
extern void UIKit_GetDisplayModes(_THIS, SDL_VideoDisplay * display);
extern int UIKit_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode);
extern void UIKit_QuitModes(_THIS);

#endif /* _SDL_uikitmodes_h */

/* vi: set ts=4 sw=4 expandtab: */

0 comments on commit 2fd5441

Please sign in to comment.