SDL for Mac
The SDL Package can be installed for all users or just one user.
- The following location is where you can get SDL:
The Package is under the "Runtime Libraries" called:
Avoid the Mac OS X development library unless you intend to explore SDL deeply.
- Save the package somewhere easy to find. I suggest you right click and "Save Link As..." to the Desktop.
- From the included ReadMe.txt:
- To Install:
Copy the SDL.framework to /Library/Frameworks
You may alternatively install it in <Your home directory>/Library/Frameworks
if your access privileges are not high enough.
- Be sure to keep the devel-lite folder somewhere safe.
Set up a SDL Program
- Start XCode
- Create a new Project
- From the list at the left select Application
- From the icons at the right select Cocoa Application
- Click Choose...
- Name your project, select a location to save it and click Save.
- Find and add the SDL.framework.
NOTE: If you don't see it listed with the other frameworks, I
suggest dragging and dropping it to your project group from the folder
you installed it to. If you search for it you will lose your main Framework directory. By default your Framework path should be: /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks
- Find and add the OpenGL.framework.
- Delete main.m and move it to the trash.
- From the devel-lite folder, copy SDLmain.h and SDLmain.m to the project folder and add them to your project as existing files.
- Copy your main C or C++ file to the project folder and add it as an existing file.
For new projects, you can start from this SDL template.
- Try compiling. If you're like me you got a complaint about "SDL.h" in "SDLmain.m". Change the offending line to read:
- Compile again and you're good to go.