SDL for Mac

Installing SDL

The SDL Package can be installed for all users or just one user.

Set up a SDL Program

  1. Start XCode
  2. Create a new Project
  3. From the list at the left select Application
  4. From the icons at the right select Cocoa Application
  5. Click Choose...
  6. Name your project, select a location to save it and click Save.
  7. 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
  8. Find and add the OpenGL.framework.
  9. Delete main.m and move it to the trash.
  10. From the devel-lite folder, copy SDLmain.h and SDLmain.m to the project folder and add them to your project as existing files.
  11. 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.
  12. Try compiling. If you're like me you got a complaint about "SDL.h" in "SDLmain.m". Change the offending line to read:
    #include <SDL/SDL.h>
  13. Compile again and you're good to go.