[SDL] Showing a UIViewController on an SDL based iOS project

michelleC michelle at mooncatventures.com
Mon Jul 18 14:33:36 PDT 2011


Yep, I've seen your app , nice.

I originally used multiple windows, but it really breaks (model wise not technically) the ios implementation.

I pretty easy to get hold of the sdl window and add view controllers to it, or get the encapsulated sdl view and add it to a view controller.

Is there any particular reason you used freepascal??

Also I am very interested in your android experience, I am having a great deal of problems with our app because it uses software yuv12 textures, and runs into memory issues very quick.

I have not been able to get sam's open gles 2 renderer to work, which should solve the problems.

Here's one for the road as they say

/* construct our view, passing in SDL's OpenGL configuration data */
	view = [[SDL_uikitopenglview alloc] initWithFrame: [[UIScreen mainScreen] applicationFrame] \
									retainBacking: _this->gl_config.retained_backing \
									rBits: _this->gl_config.red_size \
									gBits: _this->gl_config.green_size \
									bBits: _this->gl_config.blue_size \
									aBits: _this->gl_config.alpha_size \
									depthBits: _this->gl_config.depth_size];
	
	data->view = view;
	
	UINavigationController *localNavigationController;
	RootViewController *rootViewController;
	rootViewController = [[RootViewController alloc] init];
	SDLUIKitDelegate *appDelegate = [SDLUIKitDelegate sharedAppDelegate];
  	localNavigationController = [[UINavigationController alloc] initWithRootViewController:rootViewController];

	//rootViewController.view.opaque = YES;
	localNavigationController.view.alpha = 1.0;	
	localNavigationController.modalPresentationStyle = UIModalPresentationFormSheet;
	[localNavigationController setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];




Vittorio G. wrote:
> That's exactly how I implemented my application; I have subclassed the sdlappuikitdelegate and created my objc frontend, then i call some code that instances a second uiwindow and fills it with a sdl context
> More details here: http://code.google.com/p/hedgewars/source/browse/project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.m (http://code.google.com/p/hedgewars/source/browse/project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.m)
> 
> bye
> Vittorio
> 
> On Sun, Jul 17, 2011 at 11:47 PM, michelleC <michelle at mooncatventures.com (michelle at mooncatventures.com)> wrote:
> 
> >   	 	
> > 
> > Sure, but thats usually how an iphone app is structured, one window but x number of viewcontrollers.
> > 
> > multiple windows don't make sense on the iphone
> > 
> > However I guess you could have two windows and swap between them.
> > 
> > http://code.google.com/p/ffmpeg4iphone/source/browse/WebStreamx/WebStreamXNoLibs/uikit/SDL_uikitappdelegate.m (http://code.google.com/p/ffmpeg4iphone/source/browse/WebStreamx/WebStreamXNoLibs/uikit/SDL_uikitappdelegate.m)
> > SDL mailing list
> > 
> > http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)
> > 
> > 	
> > 
> > 
> > 	
> > 
> > _______________________________________________
> > SDL mailing list
> > SDL at lists.libsdl.org (SDL at lists.libsdl.org)
> > http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)
> > 
> > 
> 





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20110718/d625f4f3/attachment-0008.htm>


More information about the SDL mailing list