Xcode 6: Embedding Third-Party Frameworks

May 11th, 2015

Filed under: SDL, Xcode | Be the first to comment!

Xcode 6 simplifies copying third-party frameworks to your application bundle. In previous versions of Xcode you had to add a Copy Files build phase to your application target to copy third-party frameworks and libraries to your application bundle. Xcode 6 adds an Embedded Binaries section to the target editor that you can use to copy […]


Creating an OpenGL Context in SDL 2

June 18th, 2013

Filed under: OpenGL, SDL | 5 comments

SDL 2.0 has been released, which changes the way you create OpenGL contexts. This post details the changes so you can convert your old SDL/OpenGL code to SDL 2. If you are new to SDL and OpenGL, you should also read my SDL and OpenGL article, as that article covers some topics that aren’t covered […]


Using SDL with Xcode 4

January 9th, 2012

Filed under: SDL, Xcode | 25 comments

Apple changed the format for project templates in Xcode 4. The format change means the Xcode templates that ship with the Mac version of SDL don’t work in Xcode 4. If you have both Xcode 3 and 4 installed on your Mac, you can create a project that uses SDL in Xcode 3 and open […]


SDL OpenGL Typedef Redefinition Error on Mac OS X 10.7

November 7th, 2011

Filed under: Game Development, Mac Development, OpenGL, SDL | 3 comments

If you build a SDL OpenGL application for Mac OS X using SDL 1.2.14 (using the binary installer at the SDL site) and the Mac OS X 10.7 SDK, you can get the following error: typedef redefinition with different types (‘unsigned int’ vs ‘void *’) The SDL header file SDL_opengl.h and the OpenGL header file […]


New Xcode Project for SDL OpenGL Article

August 16th, 2011

Filed under: SDL | Be the first to comment!

I added a link to the sidebar of my SDL OpenGL article that contains a version of the project updated for Xcode 4.1. The original project had several problems building on Xcode 4.1 that persisted after I modernized the project. The updated version of the project works on Xcode 4.1 and uses the Mac OS […]


Changing Name of Xcode Project Doesn’t Change Name in Menu Bar

March 4th, 2011

Filed under: SDL, Xcode | Be the first to comment!

I recently changed the name of an Xcode SDL project. The change worked except for one problem. The menu bar showed the old project name as the application name. What was strange was the menus in the application menu (About App, Hide App, Quit App) showed the new project name. What was causing the menu […]


Using Xcode to Unit Test SDL Games Written in C++

November 23rd, 2010

Filed under: SDL, Xcode | Be the first to comment!

Suppose you’re using SDL to program a game. You’re writing the game in C++, and you want to write unit tests for your code. Your first instinct would be to use a C++ unit testing framework like googletest or UnitTest++. Your instinct would be correct on Linux and Windows, but the Mac version of SDL […]


Troubleshooting PNG Loading with SDL_image

April 27th, 2010

Filed under: Game Development, SDL | 2 comments

SDL_image is a library that simplifies loading image files for SDL games. One of the more popular image file formats for games is PNG, and SDL_image has support for PNG. On game development message boards, you’ll find many questions from people having trouble loading PNG files with SDL_image. This trouble has two common causes. Cause […]


SDL Tips for Mac OS X

December 29th, 2009

Filed under: Game Development, SDL | 12 comments

SDL’s most compelling feature is its cross-platform compatibility. You can use the same source code to write a game for Linux, Mac OS X, Windows, and any other system SDL supports. When people write a game with SDL on Linux or Windows and try to build a Mac version of your game, they learn that […]


SDL File Loading When Running from Visual C++’s Debugger

February 7th, 2008

Filed under: Game Development, SDL | Be the first to comment!

I was testing some texture loading code on Visual C++ 2005 and 2008. The code compiled fine, but when I ran it from Visual C++’s debugger, it crashed every time. The code crashed because the program could not find my image file so it could not read the file and load the image. But the […]