src/video/uikit/SDL_uikitvideo.m
author Holmes Futrell <hfutrell@umail.ucsb.edu>
Sat, 16 Aug 2008 00:18:40 +0000
branchgsoc2008_iphone
changeset 2453 ac67f7719ba8
parent 2451 28286ecb3f15
permissions -rw-r--r--
removed NULL comment ... it's UIKit now, not NULL
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2352
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
     1
/*
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
     2
    SDL - Simple DirectMedia Layer
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
     3
    Copyright (C) 1997-2006 Sam Lantinga
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
     4
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
     5
    This library is free software; you can redistribute it and/or
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
     6
    modify it under the terms of the GNU Lesser General Public
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
     7
    License as published by the Free Software Foundation; either
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
     8
    version 2.1 of the License, or (at your option) any later version.
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
     9
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    10
    This library is distributed in the hope that it will be useful,
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    13
    Lesser General Public License for more details.
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    14
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    15
    You should have received a copy of the GNU Lesser General Public
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    16
    License along with this library; if not, write to the Free Software
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    18
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    19
    Sam Lantinga
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    20
    slouken@libsdl.org
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    21
*/
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    22
#include "SDL_config.h"
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    23
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    24
#include "SDL_video.h"
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    25
#include "SDL_mouse.h"
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    26
#include "../SDL_sysvideo.h"
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    27
#include "../SDL_pixels_c.h"
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    28
#include "../../events/SDL_events_c.h"
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    29
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    30
#include "SDL_uikitvideo.h"
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    31
#include "SDL_uikitevents.h"
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    32
#include "SDL_uikitwindow.h"
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    33
#include "SDL_uikitopengles.h"
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    34
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    35
#include "SDL_renderer_sw.h"
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    36
#include "SDL_renderer_gles.h"
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    37
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    38
#define UIKITVID_DRIVER_NAME "uikit"
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    39
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    40
/* Initialization/Query functions */
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    41
static int UIKit_VideoInit(_THIS);
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    42
static int UIKit_SetDisplayMode(_THIS, SDL_DisplayMode * mode);
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    43
static void UIKit_VideoQuit(_THIS);
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    44
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    45
/* DUMMY driver bootstrap functions */
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    46
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    47
static int
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    48
UIKit_Available(void)
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    49
{
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    50
	return (1);
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    51
}
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    52
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    53
static void UIKit_DeleteDevice(SDL_VideoDevice * device)
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    54
{
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    55
    SDL_free(device);
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    56
}
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    57
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    58
static SDL_VideoDevice *
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    59
UIKit_CreateDevice(int devindex)
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    60
{
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    61
    SDL_VideoDevice *device;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    62
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    63
    /* Initialize all variables that we clean on shutdown */
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    64
    device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    65
    if (!device) {
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    66
        SDL_OutOfMemory();
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    67
        if (device) {
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    68
            SDL_free(device);
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    69
        }
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    70
        return (0);
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    71
    }
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    72
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    73
    /* Set the function pointers */
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    74
    device->VideoInit = UIKit_VideoInit;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    75
    device->VideoQuit = UIKit_VideoQuit;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    76
    device->SetDisplayMode = UIKit_SetDisplayMode;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    77
    device->PumpEvents = UIKit_PumpEvents;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    78
	device->CreateWindow = UIKit_CreateWindow;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    79
	device->DestroyWindow = UIKit_DestroyWindow;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    80
	
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    81
	
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    82
	/* OpenGL (ES) functions */
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    83
	device->GL_MakeCurrent		= UIKit_GL_MakeCurrent;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    84
	device->GL_SwapWindow		= UIKit_GL_SwapWindow;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    85
	device->GL_CreateContext	= UIKit_GL_CreateContext;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    86
	device->GL_DeleteContext    = UIKit_GL_DeleteContext;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    87
	device->GL_GetProcAddress   = UIKit_GL_GetProcAddress;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    88
	device->GL_LoadLibrary	    = UIKit_GL_LoadLibrary;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    89
	device->free = UIKit_DeleteDevice;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    90
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    91
	device->gl_config.accelerated = 1;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    92
	
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    93
    return device;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    94
}
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    95
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    96
VideoBootStrap UIKIT_bootstrap = {
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    97
    UIKITVID_DRIVER_NAME, "SDL UIKit video driver",
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    98
    UIKit_Available, UIKit_CreateDevice
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
    99
};
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   100
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   101
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   102
int
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   103
UIKit_VideoInit(_THIS)
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   104
{
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   105
    SDL_DisplayMode mode;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   106
		
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   107
	_this->gl_config.driver_loaded = 1;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   108
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   109
	SDL_VideoDisplay display;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   110
	SDL_zero(display);
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   111
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   112
    /* Use a 32-bpp desktop mode */
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   113
    SDL_zero(mode);
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   114
	mode.format = SDL_PIXELFORMAT_ABGR8888;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   115
    mode.w = 320;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   116
    mode.h = 480;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   117
    mode.refresh_rate = 0;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   118
    mode.driverdata = NULL;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   119
		
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   120
	display.num_display_modes = 1;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   121
	display.max_display_modes = 1;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   122
	display.display_modes = (SDL_DisplayMode *)SDL_malloc(display.max_display_modes * sizeof(SDL_DisplayMode));
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   123
	
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   124
	display.display_modes[0] = mode;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   125
	display.desktop_mode = mode;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   126
	display.fullscreen_mode = mode;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   127
	display.current_mode = mode;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   128
		
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   129
	SDL_AddVideoDisplay(&display);
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   130
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   131
    /* We're done! */
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   132
    return 0;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   133
}
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   134
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   135
static int
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   136
UIKit_SetDisplayMode(_THIS, SDL_DisplayMode * mode)
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   137
{
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   138
    return 0;
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   139
}
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   140
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   141
void
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   142
UIKit_VideoQuit(_THIS)
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   143
{
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   144
}
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   145
1ecbeff9eb4c SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
   146
/* vi: set ts=4 sw=4 expandtab: */