src/video/uikit/SDL_uikitvideo.m
author Edward Rudd <urkle@outoforder.cc>
Thu, 25 Apr 2013 18:05:08 -0400
changeset 7111 f4ae9f1233df
parent 7037 3fedf1f25b94
child 7135 20db445af8c7
permissions -rw-r--r--
Allow disabling SDL_IPHONE_KEYBOARD in iOS builds
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2765
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     1
/*
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5518
diff changeset
     2
  Simple DirectMedia Layer
6885
700f1b25f77f Happy New Year!
Sam Lantinga <slouken@libsdl.org>
parents: 6714
diff changeset
     3
  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
2765
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     4
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5518
diff changeset
     5
  This software is provided 'as-is', without any express or implied
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5518
diff changeset
     6
  warranty.  In no event will the authors be held liable for any damages
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5518
diff changeset
     7
  arising from the use of this software.
2765
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     8
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5518
diff changeset
     9
  Permission is granted to anyone to use this software for any purpose,
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5518
diff changeset
    10
  including commercial applications, and to alter it and redistribute it
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5518
diff changeset
    11
  freely, subject to the following restrictions:
2765
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    12
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5518
diff changeset
    13
  1. The origin of this software must not be misrepresented; you must not
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5518
diff changeset
    14
     claim that you wrote the original software. If you use this software
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5518
diff changeset
    15
     in a product, an acknowledgment in the product documentation would be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5518
diff changeset
    16
     appreciated but is not required.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5518
diff changeset
    17
  2. Altered source versions must be plainly marked as such, and must not be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5518
diff changeset
    18
     misrepresented as being the original software.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5518
diff changeset
    19
  3. This notice may not be removed or altered from any source distribution.
2765
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    20
*/
6044
35448a5ea044 Lots of fixes importing SDL source wholesale into a new iOS project
Sam Lantinga <slouken@libsdl.org>
parents: 6019
diff changeset
    21
#include "SDL_config.h"
35448a5ea044 Lots of fixes importing SDL source wholesale into a new iOS project
Sam Lantinga <slouken@libsdl.org>
parents: 6019
diff changeset
    22
35448a5ea044 Lots of fixes importing SDL source wholesale into a new iOS project
Sam Lantinga <slouken@libsdl.org>
parents: 6019
diff changeset
    23
#if SDL_VIDEO_DRIVER_UIKIT
4443
c598e440c87c Implemented display mode functionality for UIKit.
Ryan C. Gordon <icculus@icculus.org>
parents: 3643
diff changeset
    24
c598e440c87c Implemented display mode functionality for UIKit.
Ryan C. Gordon <icculus@icculus.org>
parents: 3643
diff changeset
    25
#import <UIKit/UIKit.h>
c598e440c87c Implemented display mode functionality for UIKit.
Ryan C. Gordon <icculus@icculus.org>
parents: 3643
diff changeset
    26
2765
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    27
#include "SDL_video.h"
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    28
#include "SDL_mouse.h"
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    29
#include "../SDL_sysvideo.h"
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    30
#include "../SDL_pixels_c.h"
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    31
#include "../../events/SDL_events_c.h"
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    32
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    33
#include "SDL_uikitvideo.h"
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    34
#include "SDL_uikitevents.h"
6518
42948831d16e Refactored the UIKit mode code into a separate file so it's cleaner and more consistent with other backends
Sam Lantinga <slouken@libsdl.org>
parents: 6516
diff changeset
    35
#include "SDL_uikitmodes.h"
2765
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    36
#include "SDL_uikitwindow.h"
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    37
#include "SDL_uikitopengles.h"
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    38
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    39
#define UIKITVID_DRIVER_NAME "uikit"
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    40
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    41
/* Initialization/Query functions */
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    42
static int UIKit_VideoInit(_THIS);
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    43
static void UIKit_VideoQuit(_THIS);
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    44
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    45
/* DUMMY driver bootstrap functions */
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    46
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    47
static int
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    48
UIKit_Available(void)
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    49
{
6003
fddf81967e2d Use a consistent source code format in src/video/uikit
Kees Bakker <kees@ijzerbout.nl>
parents: 6001
diff changeset
    50
    return 1;
2765
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    51
}
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    52
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    53
static void UIKit_DeleteDevice(SDL_VideoDevice * device)
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    54
{
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    55
    SDL_free(device);
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    56
}
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    57
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    58
static SDL_VideoDevice *
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    59
UIKit_CreateDevice(int devindex)
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    60
{
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    61
    SDL_VideoDevice *device;
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    62
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    63
    /* Initialize all variables that we clean on shutdown */
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    64
    device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    65
    if (!device) {
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    66
        if (device) {
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    67
            SDL_free(device);
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    68
        }
7037
3fedf1f25b94 Make SDL_SetError and friends unconditionally return -1.
Ryan C. Gordon <icculus@icculus.org>
parents: 6885
diff changeset
    69
        SDL_OutOfMemory();
2765
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    70
        return (0);
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    71
    }
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    72
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    73
    /* Set the function pointers */
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    74
    device->VideoInit = UIKit_VideoInit;
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    75
    device->VideoQuit = UIKit_VideoQuit;
4443
c598e440c87c Implemented display mode functionality for UIKit.
Ryan C. Gordon <icculus@icculus.org>
parents: 3643
diff changeset
    76
    device->GetDisplayModes = UIKit_GetDisplayModes;
2765
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    77
    device->SetDisplayMode = UIKit_SetDisplayMode;
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    78
    device->PumpEvents = UIKit_PumpEvents;
5131
7b7da52e8775 Fixed spacing
Sam Lantinga <slouken@libsdl.org>
parents: 5056
diff changeset
    79
    device->CreateWindow = UIKit_CreateWindow;
6379
8f224d0762ab Fix for the Game Center status window always being behind the SDL window (untested!)
Sam Lantinga <slouken@libsdl.org>
parents: 6292
diff changeset
    80
    device->ShowWindow = UIKit_ShowWindow;
8f224d0762ab Fix for the Game Center status window always being behind the SDL window (untested!)
Sam Lantinga <slouken@libsdl.org>
parents: 6292
diff changeset
    81
    device->HideWindow = UIKit_HideWindow;
6419
b75e82af5ef1 Moved iOS-specific code into uikit target. Fixes crashes in X11 target.
Ryan C. Gordon <icculus@icculus.org>
parents: 6392
diff changeset
    82
    device->RaiseWindow = UIKit_RaiseWindow;
6073
9738f2a8eee4 Fixed creating a fullscreen window on iOS
Sam Lantinga <slouken@libsdl.org>
parents: 6062
diff changeset
    83
    device->SetWindowFullscreen = UIKit_SetWindowFullscreen;
5131
7b7da52e8775 Fixed spacing
Sam Lantinga <slouken@libsdl.org>
parents: 5056
diff changeset
    84
    device->DestroyWindow = UIKit_DestroyWindow;
5056
8b7988f42fcb Added the ability to get the UIKit window through the SDL API.
Sam Lantinga <slouken@libsdl.org>
parents: 4446
diff changeset
    85
    device->GetWindowWMInfo = UIKit_GetWindowWMInfo;
6001
3ae3d1e58d59 Cleanup out trailing whitespace in src/video/uikit
Kees Bakker <kees@ijzerbout.nl>
parents: 5558
diff changeset
    86
6422
fd0ac1b56115 Added SDL_SetWindowBordered() API.
Ryan C. Gordon <icculus@icculus.org>
parents: 6419
diff changeset
    87
    /* !!! FIXME: implement SetWindowBordered */
fd0ac1b56115 Added SDL_SetWindowBordered() API.
Ryan C. Gordon <icculus@icculus.org>
parents: 6419
diff changeset
    88
7111
f4ae9f1233df Allow disabling SDL_IPHONE_KEYBOARD in iOS builds
Edward Rudd <urkle@outoforder.cc>
parents: 7037
diff changeset
    89
#if SDL_IPHONE_KEYBOARD
6392
fa7eb111f994 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6379
diff changeset
    90
    device->SDL_HasScreenKeyboardSupport = UIKit_HasScreenKeyboardSupport;
fa7eb111f994 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6379
diff changeset
    91
    device->SDL_ShowScreenKeyboard = UIKit_ShowScreenKeyboard;
fa7eb111f994 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6379
diff changeset
    92
    device->SDL_HideScreenKeyboard = UIKit_HideScreenKeyboard;
fa7eb111f994 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6379
diff changeset
    93
    device->SDL_IsScreenKeyboardShown = UIKit_IsScreenKeyboardShown;
7111
f4ae9f1233df Allow disabling SDL_IPHONE_KEYBOARD in iOS builds
Edward Rudd <urkle@outoforder.cc>
parents: 7037
diff changeset
    94
#endif
6001
3ae3d1e58d59 Cleanup out trailing whitespace in src/video/uikit
Kees Bakker <kees@ijzerbout.nl>
parents: 5558
diff changeset
    95
5131
7b7da52e8775 Fixed spacing
Sam Lantinga <slouken@libsdl.org>
parents: 5056
diff changeset
    96
    /* OpenGL (ES) functions */
7b7da52e8775 Fixed spacing
Sam Lantinga <slouken@libsdl.org>
parents: 5056
diff changeset
    97
    device->GL_MakeCurrent        = UIKit_GL_MakeCurrent;
7b7da52e8775 Fixed spacing
Sam Lantinga <slouken@libsdl.org>
parents: 5056
diff changeset
    98
    device->GL_SwapWindow        = UIKit_GL_SwapWindow;
7b7da52e8775 Fixed spacing
Sam Lantinga <slouken@libsdl.org>
parents: 5056
diff changeset
    99
    device->GL_CreateContext    = UIKit_GL_CreateContext;
7b7da52e8775 Fixed spacing
Sam Lantinga <slouken@libsdl.org>
parents: 5056
diff changeset
   100
    device->GL_DeleteContext    = UIKit_GL_DeleteContext;
7b7da52e8775 Fixed spacing
Sam Lantinga <slouken@libsdl.org>
parents: 5056
diff changeset
   101
    device->GL_GetProcAddress   = UIKit_GL_GetProcAddress;
7b7da52e8775 Fixed spacing
Sam Lantinga <slouken@libsdl.org>
parents: 5056
diff changeset
   102
    device->GL_LoadLibrary        = UIKit_GL_LoadLibrary;
7b7da52e8775 Fixed spacing
Sam Lantinga <slouken@libsdl.org>
parents: 5056
diff changeset
   103
    device->free = UIKit_DeleteDevice;
2765
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   104
5131
7b7da52e8775 Fixed spacing
Sam Lantinga <slouken@libsdl.org>
parents: 5056
diff changeset
   105
    device->gl_config.accelerated = 1;
7b7da52e8775 Fixed spacing
Sam Lantinga <slouken@libsdl.org>
parents: 5056
diff changeset
   106
2765
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   107
    return device;
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   108
}
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   109
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   110
VideoBootStrap UIKIT_bootstrap = {
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   111
    UIKITVID_DRIVER_NAME, "SDL UIKit video driver",
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   112
    UIKit_Available, UIKit_CreateDevice
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   113
};
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   114
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   115
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   116
int
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   117
UIKit_VideoInit(_THIS)
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   118
{
4443
c598e440c87c Implemented display mode functionality for UIKit.
Ryan C. Gordon <icculus@icculus.org>
parents: 3643
diff changeset
   119
    _this->gl_config.driver_loaded = 1;
2765
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   120
6518
42948831d16e Refactored the UIKit mode code into a separate file so it's cleaner and more consistent with other backends
Sam Lantinga <slouken@libsdl.org>
parents: 6516
diff changeset
   121
    if (UIKit_InitModes(_this) < 0) {
6267
ed2cf4669e55 * On iOS, fix support for the case where [UIScreen scale] is not 1.0 (retina)
Tim Angus <tim@blackcompanystudios.co.uk>
parents: 6138
diff changeset
   122
        return -1;
ed2cf4669e55 * On iOS, fix support for the case where [UIScreen scale] is not 1.0 (retina)
Tim Angus <tim@blackcompanystudios.co.uk>
parents: 6138
diff changeset
   123
    }
2765
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   124
    return 0;
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   125
}
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   126
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   127
void
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   128
UIKit_VideoQuit(_THIS)
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   129
{
6518
42948831d16e Refactored the UIKit mode code into a separate file so it's cleaner and more consistent with other backends
Sam Lantinga <slouken@libsdl.org>
parents: 6516
diff changeset
   130
    UIKit_QuitModes(_this);
2765
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   131
}
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   132
6616
4f272256d172 Added an assert log category, and NSLog support on Mac OS X and iOS
Sam Lantinga <slouken@libsdl.org>
parents: 6518
diff changeset
   133
/*
4f272256d172 Added an assert log category, and NSLog support on Mac OS X and iOS
Sam Lantinga <slouken@libsdl.org>
parents: 6518
diff changeset
   134
 * iOS log support.
4f272256d172 Added an assert log category, and NSLog support on Mac OS X and iOS
Sam Lantinga <slouken@libsdl.org>
parents: 6518
diff changeset
   135
 *
4f272256d172 Added an assert log category, and NSLog support on Mac OS X and iOS
Sam Lantinga <slouken@libsdl.org>
parents: 6518
diff changeset
   136
 * This doesn't really have aything to do with the interfaces of the SDL video
4f272256d172 Added an assert log category, and NSLog support on Mac OS X and iOS
Sam Lantinga <slouken@libsdl.org>
parents: 6518
diff changeset
   137
 *  subsystem, but we need to stuff this into an Objective-C source code file.
4f272256d172 Added an assert log category, and NSLog support on Mac OS X and iOS
Sam Lantinga <slouken@libsdl.org>
parents: 6518
diff changeset
   138
 */
4f272256d172 Added an assert log category, and NSLog support on Mac OS X and iOS
Sam Lantinga <slouken@libsdl.org>
parents: 6518
diff changeset
   139
4f272256d172 Added an assert log category, and NSLog support on Mac OS X and iOS
Sam Lantinga <slouken@libsdl.org>
parents: 6518
diff changeset
   140
void SDL_NSLog(const char *text)
4f272256d172 Added an assert log category, and NSLog support on Mac OS X and iOS
Sam Lantinga <slouken@libsdl.org>
parents: 6518
diff changeset
   141
{
6714
146d1d7ecdc4 Fixed bug 1641 - avoid allocating nsstring from char*
Sam Lantinga <slouken@libsdl.org>
parents: 6654
diff changeset
   142
    NSLog(@"%s", text);
6616
4f272256d172 Added an assert log category, and NSLog support on Mac OS X and iOS
Sam Lantinga <slouken@libsdl.org>
parents: 6518
diff changeset
   143
}
4f272256d172 Added an assert log category, and NSLog support on Mac OS X and iOS
Sam Lantinga <slouken@libsdl.org>
parents: 6518
diff changeset
   144
6044
35448a5ea044 Lots of fixes importing SDL source wholesale into a new iOS project
Sam Lantinga <slouken@libsdl.org>
parents: 6019
diff changeset
   145
#endif /* SDL_VIDEO_DRIVER_UIKIT */
35448a5ea044 Lots of fixes importing SDL source wholesale into a new iOS project
Sam Lantinga <slouken@libsdl.org>
parents: 6019
diff changeset
   146
2765
f55c87ae336b Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   147
/* vi: set ts=4 sw=4 expandtab: */