SDL 1.3 and iPhone

Hi guys!
I’m just wondering if anyone has any tutorials or source code for any games they have ported or developed on the iPhone using SDL 1.3 that they’d be willing to share. I’ve been using SDL the whole time whilest studying through university as I love how powerful it is whilst being liberal. I’ve just recently applied for the iOS program and have been tinkering with SDL 1.3 on the iPhone, but have been unable to find any resources to help with learning how to use it.
Currently I’m stuck with a few issues such as: removing the status bar (the plist file seems to not have the option when used with SDL templates) and also handling rotation within the device. I’m also curious as to some good practices when working with the iPhone. I have had a look at other engines and libraries such as cocos2d and cocos2d-x but I don’t like how restricting to the coder they feel especially with the style I have been taught to create game objects etc.

Thanks!

You might find some insight in DarkPlaces (GPL):
http://svn.icculus.org/twilight/trunk/darkplaces/vid_sdl.c?view=markup

This currently supports compiling as SDL 1.2, SDL 1.3 using legacy (SDL_SetVideoMode) API, and SDL 1.3 using modern (SDL_CreateWindow) API, it also supports iPhoneOS.

Take a look at things having to do with IPHONEOS and SETVIDEOMODE and SDL_MAJOR_VERSION and SDL_MINOR_VERSION checks, this should illustrate the 1.3 API details related to iPhoneOS.

Sorry if there’s anything confusing in there, it’s always a work in progress, and supports a desktop platforms with certain specific hacks for better behavior (mostly MacOSX mouse acceleration and
such, and window icons are a bit troublesome using the 1.2 API as well).

Now to answer your specific question about the statusbar - I recommend reading README.iphoneos in the SDL sources, it explains many things.On 03/09/2011 02:49 PM, Leott87 wrote:

Hi guys!
I’m just wondering if anyone has any tutorials or source code for any games they have ported or developed on the iPhone using SDL 1.3 that they’d be willing to share. I’ve been using SDL the whole
time whilest studying through university as I love how powerful it is whilst being liberal. I’ve just recently applied for the iOS program and have been tinkering with SDL 1.3 on the iPhone, but have
been unable to find any resources to help with learning how to use it.
Currently I’m stuck with a few issues such as: removing the status bar (the plist file seems to not have the option when used with SDL templates) and also handling rotation within the device. I’m also
curious as to some good practices when working with the iPhone. I have had a look at other engines and libraries such as cocos2d and cocos2d-x but I don’t like how restricting to the coder they feel
especially with the style I have been taught to create game objects etc.

Thanks!


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


LordHavoc
Author of DarkPlaces Quake1 engine - http://icculus.org/twilight/darkplaces
Co-designer of Nexuiz - http://alientrap.org/nexuiz
"War does not prove who is right, it proves who is left." - Unknown
"Any sufficiently advanced technology is indistinguishable from a rigged demo." - James Klass
"A game is a series of interesting choices." - Sid Meier

Thank you forest, I’ve had a look at the code you sent and also the demo’s a bit more and am starting to understand it a little better now.
:smiley:

you can also checkout
http://code.google.com/p/hedgewars/source/browse/#hg%2Fproject_files%2FHedgewarsMobile
even though we run things a little differently with an objc frontend :slight_smile:

bye
VittorioOn Thu, Mar 10, 2011 at 4:55 PM, Leott87 wrote:

Thank you forest, I’ve had a look at the code you sent and also the
demo’s a bit more and am starting to understand it a little better now.
[image: Very Happy]


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org