Skip to content

Commit

Permalink
Properly initialize NSApplication on Mac OS X
Browse files Browse the repository at this point in the history
This was previously fixed, but broken again  when we moved main() out
of Core.cpp.

Fixes: bug #514
  • Loading branch information
dscharrer committed Jul 13, 2013
1 parent d3e16b6 commit 518cb2e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/core/Core.cpp
Expand Up @@ -146,15 +146,6 @@ ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.

#include "window/RenderWindow.h"

// Under OS X we want SDLmain to replace the entry point with its own.
// TODO: I don't think this is wanted and we'll need to add the NSApplication setup
// on the Arx Libertatis side instead of SDLmain's.
#if defined(__APPLE__) && defined(__MACH__)
#include <SDL_main.h>
#else
#undef main /* in case SDL.h was already included */
#endif

class TextManager;

using std::min;
Expand Down
11 changes: 11 additions & 0 deletions src/core/Startup.cpp
Expand Up @@ -37,6 +37,17 @@

#include <boost/foreach.hpp>

/*
* Under OS X we want SDLmain to replace the entry point with its own.
* This is needed to initialize NSApplication - otherwise we will later
* crash when trying to use SDL windowing functions.
*/
#if defined(__APPLE__) && defined(__MACH__)
#include <SDL_main.h>
#else
#undef main /* in case SDL.h was already included */
#endif

#include "core/Config.h"
#include "core/Core.h"
#include "core/Version.h"
Expand Down

0 comments on commit 518cb2e

Please sign in to comment.