Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F622419
main.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
875 B
Referenced Files
None
Subscribers
None
main.cpp
View Options
#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
Details
Attached
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)
Attached To
Mode
R78 witchblast
Attached
Detach File
Event Timeline