Page MenuHomePhabricator (Chris)

main.cpp
No OneTemporary

Authored By
Unknown
Size
875 B
Referenced Files
None
Subscribers
None

main.cpp

#include <SFML/Graphics.hpp>
#include "WitchBlastGame.h"
#ifdef __APPLE__
#include "CoreFoundation/CoreFoundation.h"
#endif
int main()
{
#ifdef __APPLE__
// -------------------------------------------------------------------
// http://stackoverflow.com/a/520951/2038264
// This makes relative paths work in C++ in Xcode by changing
// directory to the Resources folder inside the .app bundle
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle);
char path[PATH_MAX];
if (!CFURLGetFileSystemRepresentation(resourcesURL, TRUE, (UInt8 *)path, PATH_MAX))
{
// error!
}
CFRelease(resourcesURL);
chdir(path);
// -------------------------------------------------------------------
#endif
WitchBlastGame game;
game.startGame();
return 0;
}

File Metadata

Mime Type
text/x-c
Expires
Sat, Nov 14, 8:10 PM (23 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
123639
Default Alt Text
main.cpp (875 B)

Event Timeline