These files contain the window related functions for the UIKit video driver. gsoc2008_iphone
authorHolmes Futrell <hfutrell@umail.ucsb.edu>
Thu, 17 Jul 2008 22:45:41 +0000
branchgsoc2008_iphone
changeset 23542e4fea4a4416
parent 2353 07acabba25d9
child 2355 eec14ed2bb18
These files contain the window related functions for the UIKit video driver.
src/video/uikit/SDL_uikitwindow.h
src/video/uikit/SDL_uikitwindow.m
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/video/uikit/SDL_uikitwindow.h	Thu Jul 17 22:45:41 2008 +0000
     1.3 @@ -0,0 +1,34 @@
     1.4 +/*
     1.5 +    SDL - Simple DirectMedia Layer
     1.6 +    Copyright (C) 1997-2006 Sam Lantinga
     1.7 +
     1.8 +    This library is free software; you can redistribute it and/or
     1.9 +    modify it under the terms of the GNU Lesser General Public
    1.10 +    License as published by the Free Software Foundation; either
    1.11 +    version 2.1 of the License, or (at your option) any later version.
    1.12 +
    1.13 +    This library is distributed in the hope that it will be useful,
    1.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.16 +    Lesser General Public License for more details.
    1.17 +
    1.18 +    You should have received a copy of the GNU Lesser General Public
    1.19 +    License along with this library; if not, write to the Free Software
    1.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    1.21 +
    1.22 +    Sam Lantinga
    1.23 +    slouken@libsdl.org
    1.24 +*/
    1.25 +#include "SDL_config.h"
    1.26 +
    1.27 +#ifndef _SDL_uikitwindow_h
    1.28 +#define _SDL_uikitwindow_h
    1.29 +
    1.30 +#include "../SDL_sysvideo.h"
    1.31 +
    1.32 +extern int UIKit_CreateWindow(_THIS, SDL_Window *window);
    1.33 +extern void UIKit_DestroyWindow(_THIS, SDL_Window * window);
    1.34 +
    1.35 +#endif /* _SDL_uikitwindow_h */
    1.36 +
    1.37 +/* vi: set ts=4 sw=4 expandtab: */
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/src/video/uikit/SDL_uikitwindow.m	Thu Jul 17 22:45:41 2008 +0000
     2.3 @@ -0,0 +1,88 @@
     2.4 +/*
     2.5 +    SDL - Simple DirectMedia Layer
     2.6 +    Copyright (C) 1997-2006 Sam Lantinga
     2.7 +
     2.8 +    This library is free software; you can redistribute it and/or
     2.9 +    modify it under the terms of the GNU Lesser General Public
    2.10 +    License as published by the Free Software Foundation; either
    2.11 +    version 2.1 of the License, or (at your option) any later version.
    2.12 +
    2.13 +    This library is distributed in the hope that it will be useful,
    2.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    2.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    2.16 +    Lesser General Public License for more details.
    2.17 +
    2.18 +    You should have received a copy of the GNU Lesser General Public
    2.19 +    License along with this library; if not, write to the Free Software
    2.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    2.21 +
    2.22 +    Sam Lantinga
    2.23 +    slouken@libsdl.org
    2.24 +*/
    2.25 +#include "SDL_config.h"
    2.26 +
    2.27 +/* Dummy SDL video driver implementation; this is just enough to make an
    2.28 + *  SDL-based application THINK it's got a working video driver, for
    2.29 + *  applications that call SDL_Init(SDL_INIT_VIDEO) when they don't need it,
    2.30 + *  and also for use as a collection of stubs when porting SDL to a new
    2.31 + *  platform for which you haven't yet written a valid video driver.
    2.32 + *
    2.33 + * This is also a great way to determine bottlenecks: if you think that SDL
    2.34 + *  is a performance problem for a given platform, enable this driver, and
    2.35 + *  then see if your application runs faster without video overhead.
    2.36 + *
    2.37 + * Initial work by Ryan C. Gordon (icculus@icculus.org). A good portion
    2.38 + *  of this was cut-and-pasted from Stephane Peter's work in the AAlib
    2.39 + *  SDL video driver.  Renamed to "DUMMY" by Sam Lantinga.
    2.40 + */
    2.41 +
    2.42 +#include "SDL_video.h"
    2.43 +#include "SDL_mouse.h"
    2.44 +#include "../SDL_sysvideo.h"
    2.45 +#include "../SDL_pixels_c.h"
    2.46 +#include "../../events/SDL_events_c.h"
    2.47 +
    2.48 +#include "SDL_uikitvideo.h"
    2.49 +#include "SDL_uikitevents.h"
    2.50 +#include "SDL_uikitwindow.h"
    2.51 +#import "SDL_uikitappdelegate.h"
    2.52 +
    2.53 +#import "SDL_uikitopenglview.h"
    2.54 +#import "SDL_renderer_sw.h"
    2.55 +
    2.56 +#include <UIKit/UIKit.h>
    2.57 +#include <Foundation/Foundation.h>
    2.58 +
    2.59 +
    2.60 +
    2.61 +extern UIWindow *uikitWindow;
    2.62 +extern SDL_uikitopenglview *uikitEAGLView;
    2.63 +
    2.64 +int UIKit_CreateWindow(_THIS, SDL_Window *window) {
    2.65 +	
    2.66 +	printf("Create window! UIKIT!\n");
    2.67 +			
    2.68 +	uikitWindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    2.69 +		
    2.70 +	if (window->flags & SDL_WINDOW_BORDERLESS) {
    2.71 +		/* hide status bar */
    2.72 +		[UIApplication sharedApplication].statusBarHidden = YES;
    2.73 +	}
    2.74 +		
    2.75 +	window->flags &= ~SDL_WINDOW_RESIZABLE;		/* window is NEVER resizeable */
    2.76 +	window->flags |= SDL_WINDOW_OPENGL;			/* window is always OpenGL */
    2.77 +	window->flags |= SDL_WINDOW_FULLSCREEN;		/* window is always fullscreen */
    2.78 +	window->flags |= SDL_WINDOW_SHOWN;			/* only one window on iPod touch, always shown */
    2.79 +	window->flags |= SDL_WINDOW_INPUT_FOCUS;	/* always has input focus */
    2.80 +	
    2.81 +	return 1;
    2.82 +	
    2.83 +}
    2.84 +
    2.85 +void UIKit_DestroyWindow(_THIS, SDL_Window * window) {
    2.86 +	;
    2.87 +}
    2.88 +
    2.89 +
    2.90 +
    2.91 +/* vi: set ts=4 sw=4 expandtab: */