SDL Project Stationary for Xcode

Member
Posts: 60
Joined: 2013.03
Post: #1
Hello, I want to install SDL. Well, I already have. But I would like a "project stationary" to choose from when creating a new project/file. I followed Lazyfoo's SDL Tutorial, and it installed fine. Here is what the 1.2.15 (I suppose that's the up to date SDL download...) has in it:

license rtf
SDL.framework
devel lite
readme
universal binary notes

Isn't there supposed to be a project stationary? If not (which that sucks) how do I make an SDL app at the start?

Thanks!
Quote this message in a reply
Member
Posts: 111
Joined: 2002.06
Post: #2
SDL no longer includes Xcode project templates because Apple changed the project template format in Xcode 4, which broke the old SDL project templates. Manually creating Xcode 4 project templates is a pain so SDL doesn't include them.

If you do a search for sdl xcode templates at Github, you can find Xcode 4 project templates for both SDL 1.2 and SDL 2. I haven't used them so I don't know how well they work, but there are templates available.

You can use SDL in Xcode without project templates. SDL is built with Cocoa so you can create a Cocoa application project, remove the .m, .h, and .xib files that come with the project, and add the SDL framework to the project. I have step-by-step instructions for using SDL with Xcode 4 in the following article:

Using SDL with Xcode 4

Mark Szymczyk
http://www.meandmark.com
Quote this message in a reply
Member
Posts: 60
Joined: 2013.03
Post: #3
Thank you!

So, for instance, this is a good set to download? https://github.com/bazzinotti/SDL2-Xcode...0Templates
Quote this message in a reply
Member
Posts: 111
Joined: 2002.06
Post: #4
If you're using SDL 1.2.15, I wouldn't download the template you linked to because that template is for SDL 2. But if you're using SDL 2, it's worth checking out.

Mark Szymczyk
http://www.meandmark.com
Quote this message in a reply
Member
Posts: 60
Joined: 2013.03
Post: #5
(Jul 9, 2013 12:29 PM)szymczyk Wrote:  If you're using SDL 1.2.15, I wouldn't download the template you linked to because that template is for SDL 2. But if you're using SDL 2, it's worth checking out.

I have both. I just figured that the 1.2.15 templates won't work because you said that Apple changed the format.

Well... I assume I have both. The readme for SDL2 said to simply place them in Library/Frameworks, nothing else.
Quote this message in a reply
Member
Posts: 60
Joined: 2013.03
Post: #6
I downloaded a 1.2.15 template set to try out, and it works fine, but the files are in ".mm" format. I have not used SDL at all, is that supposed to be that way? I thought they could be pure C++ (and thus ".cpp" format)?
Quote this message in a reply
Member
Posts: 111
Joined: 2002.06
Post: #7
If you did the Github search I mentioned in my first reply, you would find two Xcode 4 templates: one for SDL 1.2 and one for SDL 2. You can download them both if you want. They were both written for Xcode 4 so they should both work with Xcode 4. The project templates that used to ship with SDL are the ones that were broken.

If you're going to use SDL 1.2, use the SDL 1.2 template. If you're going to use SDL 2, use the SDL 2 template.

I haven't used any SDL Xcode 4 templates so I can't tell you what they're supposed to be like.

The .mm extension means Objective-C++, which allows you to mix C++ and Objective-C code. The Mac version of SDL is written in Objective-C. The person who made the template probably gave some files the .mm extension so they could do some Mac Cocoa setup in Objective-C while allowing you to write your game code in C++.

Mark Szymczyk
http://www.meandmark.com
Quote this message in a reply
Member
Posts: 60
Joined: 2013.03
Post: #8
(Jul 9, 2013 12:55 PM)szymczyk Wrote:  If you did the Github search I mentioned in my first reply, you would find two Xcode 4 templates: one for SDL 1.2 and one for SDL 2. You can download them both if you want. They were both written for Xcode 4 so they should both work with Xcode 4. The project templates that used to ship with SDL are the ones that were broken.

If you're going to use SDL 1.2, use the SDL 1.2 template. If you're going to use SDL 2, use the SDL 2 template.

I haven't used any SDL Xcode 4 templates so I can't tell you what they're supposed to be like.

The .mm extension means Objective-C++, which allows you to mix C++ and Objective-C code. The Mac version of SDL is written in Objective-C. The person who made the template probably gave some files the .mm extension so they could do some Mac Cocoa setup in Objective-C while allowing you to write your game code in C++.

Ok. Thanks.

I am just having some trouble grasping exactly how SDL works - how it is cross platform and what you need to do to use it (ie, using C++ ONLY, compile on each system using SDL - how to do that?). I also am on the fence between playing around with Java, because my end goal is to continue learning programming, but I am very concerned about being 100% (I know, there is no "true" cross compatibility) cross-platform... It comes down to C++ + SDL, Java + LWJGL, C++ + Utility section/class with all platform specific code (which I really don't want to do because I don't want to learn all that), or C# + Unity for being cross-platform...

If you can further explain SDL, or give some suggestions, thanks.
Quote this message in a reply
Moderator
Posts: 700
Joined: 2002.04
Post: #9
@Evan Stallings: I don't know what your level of ability as a programmer is, but if you're interested in an introduction to Java there's this Udacity course – it isn't great, but it is free, and will give you a taste of the language...

(Disclaimer: I'm not a fan of Java, and I recommend C or C++ coupled with SDL and OpenGL for cross-platform game development Wink)

Mark Bishop
--
Student and freelance OS X & iOS developer
Quote this message in a reply
Member
Posts: 60
Joined: 2013.03
Post: #10
(Jul 9, 2013 02:27 PM)sealfin Wrote:  @Evan Stallings: I don't know what your level of ability as a programmer is, but if you're interested in an introduction to Java there's this Udacity course – it isn't great, but it is free, and will give you a taste of the language...

(Disclaimer: I'm not a fan of Java, and I recommend C or C++ coupled with SDL and OpenGL for cross-platform game development Wink)

Thanks. I want to go the C++ and SDL (+OpenGL) route too, but...

I don't understand how SDL works!!

I just need somebody to explain:

How SDL works exactly. If I want to make a Mac and PC game, from my Mac, how and why does it work? What do I need to do to properly set it up and know what the heck I'm doing?

Thanks.
Quote this message in a reply
Member
Posts: 111
Joined: 2002.06
Post: #11
Evan,

AnotherJake and AndyKorth provided good high-level explanations about how SDL works in your (Mac) games without Cocoa!? thread. If you need to know how SDL works at a lower level, I can't help you. The SDL site allows you to access SDL's source code repository so you can see what's going on under the hood.

Mark Szymczyk
http://www.meandmark.com
Quote this message in a reply
Member
Posts: 60
Joined: 2013.03
Post: #12
Ok, that will help me out, thanks.

I think that I am going to revert back to my decision (which I subconsciously abandoned for some reason) of using C# and Unity for a while to get something on the screen and keep me interested, and then move on to SDL and learn more about it.

Thanks for helping and I apologize that this thread turned into yet another series of slightly redundant questions and another slightly repetitive decision in the end on my part. Rasp
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Converting unix SDL project to xcode Dominus 0 4,246 Jan 3, 2011 04:46 AM
Last Post: Dominus
  Debugging in XCode without project? mattz 5 5,932 Dec 5, 2009 01:21 PM
Last Post: bronxbomber92
  I would like to be able to browse an xCode project on my PC aerospaceman 8 7,066 Jun 29, 2009 07:11 PM
Last Post: aerospaceman
  XCode doesn't realize a library has changed unless you force your project to build. XSTNX 6 5,864 Jun 8, 2009 10:25 AM
Last Post: XSTNX
  Xcode 3.0 crashes on project load stevejohnson 7 6,230 Jan 30, 2008 11:12 PM
Last Post: gevapatz