src/video/uikit/SDL_uikitwindow.m
branchgsoc2008_iphone
changeset 2354 2e4fea4a4416
child 2399 d904584ea86d
equal deleted inserted replaced
2353:07acabba25d9 2354:2e4fea4a4416
       
     1 /*
       
     2     SDL - Simple DirectMedia Layer
       
     3     Copyright (C) 1997-2006 Sam Lantinga
       
     4 
       
     5     This library is free software; you can redistribute it and/or
       
     6     modify it under the terms of the GNU Lesser General Public
       
     7     License as published by the Free Software Foundation; either
       
     8     version 2.1 of the License, or (at your option) any later version.
       
     9 
       
    10     This library is distributed in the hope that it will be useful,
       
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       
    13     Lesser General Public License for more details.
       
    14 
       
    15     You should have received a copy of the GNU Lesser General Public
       
    16     License along with this library; if not, write to the Free Software
       
    17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
       
    18 
       
    19     Sam Lantinga
       
    20     slouken@libsdl.org
       
    21 */
       
    22 #include "SDL_config.h"
       
    23 
       
    24 /* Dummy SDL video driver implementation; this is just enough to make an
       
    25  *  SDL-based application THINK it's got a working video driver, for
       
    26  *  applications that call SDL_Init(SDL_INIT_VIDEO) when they don't need it,
       
    27  *  and also for use as a collection of stubs when porting SDL to a new
       
    28  *  platform for which you haven't yet written a valid video driver.
       
    29  *
       
    30  * This is also a great way to determine bottlenecks: if you think that SDL
       
    31  *  is a performance problem for a given platform, enable this driver, and
       
    32  *  then see if your application runs faster without video overhead.
       
    33  *
       
    34  * Initial work by Ryan C. Gordon (icculus@icculus.org). A good portion
       
    35  *  of this was cut-and-pasted from Stephane Peter's work in the AAlib
       
    36  *  SDL video driver.  Renamed to "DUMMY" by Sam Lantinga.
       
    37  */
       
    38 
       
    39 #include "SDL_video.h"
       
    40 #include "SDL_mouse.h"
       
    41 #include "../SDL_sysvideo.h"
       
    42 #include "../SDL_pixels_c.h"
       
    43 #include "../../events/SDL_events_c.h"
       
    44 
       
    45 #include "SDL_uikitvideo.h"
       
    46 #include "SDL_uikitevents.h"
       
    47 #include "SDL_uikitwindow.h"
       
    48 #import "SDL_uikitappdelegate.h"
       
    49 
       
    50 #import "SDL_uikitopenglview.h"
       
    51 #import "SDL_renderer_sw.h"
       
    52 
       
    53 #include <UIKit/UIKit.h>
       
    54 #include <Foundation/Foundation.h>
       
    55 
       
    56 
       
    57 
       
    58 extern UIWindow *uikitWindow;
       
    59 extern SDL_uikitopenglview *uikitEAGLView;
       
    60 
       
    61 int UIKit_CreateWindow(_THIS, SDL_Window *window) {
       
    62 	
       
    63 	printf("Create window! UIKIT!\n");
       
    64 			
       
    65 	uikitWindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
       
    66 		
       
    67 	if (window->flags & SDL_WINDOW_BORDERLESS) {
       
    68 		/* hide status bar */
       
    69 		[UIApplication sharedApplication].statusBarHidden = YES;
       
    70 	}
       
    71 		
       
    72 	window->flags &= ~SDL_WINDOW_RESIZABLE;		/* window is NEVER resizeable */
       
    73 	window->flags |= SDL_WINDOW_OPENGL;			/* window is always OpenGL */
       
    74 	window->flags |= SDL_WINDOW_FULLSCREEN;		/* window is always fullscreen */
       
    75 	window->flags |= SDL_WINDOW_SHOWN;			/* only one window on iPod touch, always shown */
       
    76 	window->flags |= SDL_WINDOW_INPUT_FOCUS;	/* always has input focus */
       
    77 	
       
    78 	return 1;
       
    79 	
       
    80 }
       
    81 
       
    82 void UIKit_DestroyWindow(_THIS, SDL_Window * window) {
       
    83 	;
       
    84 }
       
    85 
       
    86 
       
    87 
       
    88 /* vi: set ts=4 sw=4 expandtab: */