Last change
on this file since 11 was
8,
checked in by anonymous, 18 years ago
|
mac ordner
|
-
Property svn:executable set to
*
|
File size:
558 bytes
|
Line | |
---|
1 | #include "macBundlePath.h" |
---|
2 | |
---|
3 | using namespace Ogre; |
---|
4 | |
---|
5 | std::string macBundlePath() |
---|
6 | { |
---|
7 | char path[1024]; |
---|
8 | CFBundleRef mainBundle = CFBundleGetMainBundle(); |
---|
9 | assert(mainBundle); |
---|
10 | |
---|
11 | CFURLRef mainBundleURL = CFBundleCopyBundleURL(mainBundle); |
---|
12 | assert(mainBundleURL); |
---|
13 | |
---|
14 | CFStringRef cfStringRef = CFURLCopyFileSystemPath( mainBundleURL, kCFURLPOSIXPathStyle); |
---|
15 | assert(cfStringRef); |
---|
16 | |
---|
17 | CFStringGetCString(cfStringRef, path, 1024, kCFStringEncodingASCII); |
---|
18 | |
---|
19 | CFRelease(mainBundleURL); |
---|
20 | CFRelease(cfStringRef); |
---|
21 | |
---|
22 | return std::string(path); |
---|
23 | } |
---|
24 | |
---|
Note: See
TracBrowser
for help on using the repository browser.