Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


Xcode 4 on Lion and SDL 1.2.15


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 Jakez   Members   -  Reputation: 103

Like
1Likes
Like

Posted 30 January 2012 - 02:44 AM

Hello everyone.

I just got my first macbook pro, and installed Xcode from mac app store.

I am trying to setup SDL 1.2.15 which was released a few weeks ago. The release explicit says it supports OSX Lion.
I just have a hard time getting it to setup.

I noticed that with 1.2.14, there were templates you could install with xcode. But those seems to be gone with sdl 1.2.15.

I have been scouting the net since its release for information on how other did it, but only found posts were people just said they got it to work and not how.

So I hope for some love from you guys, that someone of you have a template that works with the newest xcode and lion or if someone of you knows a guide how to set it up by creating an empty project.

best regards
Jakez

Sponsor:

#2 szymczyk   Members   -  Reputation: 182

Like
2Likes
Like

Posted 30 January 2012 - 02:27 PM

The old SDL project templates don't work with Xcode 4. The easiest way to go is to start with a Cocoa application project. For more detailed instructions on how to set up SDL with Xcode 4, read the following article:

Using SDL with Xcode 4
Mark Szymczyk
Author of Mac Game Programming and Xcode Tools Sensei
http://www.meandmark.com

#3 Jakez   Members   -  Reputation: 103

Like
0Likes
Like

Posted 30 January 2012 - 04:12 PM

It worked! Thanks a lot, much love.

Besides following the article, I had too change the include in the SDLMain.m from "SDL.h" to "SDL/SDL.h".

Is it your article? then maybe include a final screen shot of how the project looks like when you see the files and folders from xcode, thinks that would have cleared a bit of my confusion :) properly just because my English isn't that well.

But thanks again!

best regards
Jakez

#4 Jakez   Members   -  Reputation: 103

Like
0Likes
Like

Posted 31 January 2012 - 12:40 PM

Does anyone know, why I have too add MyApp.app/Contents/resources/ everytime I try too load something like:

SDL_LoadBMP( "MyApp.app/Contents/Resources/Hello_world.bmp" );

I have too do it no matter what I load. sounds, images and even for .txt files when I use ifstream og ofstream.

Its quite a hazzle, and kinda shot in the foot for portability

#5 szymczyk   Members   -  Reputation: 182

Like
1Likes
Like

Posted 31 January 2012 - 01:37 PM

Change the setupWorkingDirectory: method in SDLMain.m so the working directory is the application bundle's Resources folder. You can find code to change the working directory in the following article:

SDL Tips for Mac OS X

Read the section Changing the Working Directory.
Mark Szymczyk
Author of Mac Game Programming and Xcode Tools Sensei
http://www.meandmark.com

#6 Jakez   Members   -  Reputation: 103

Like
0Likes
Like

Posted 31 January 2012 - 03:05 PM

You hit the spot one more time!

Thanks a lot!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS