diff options
| author | skolb <none@none> | 2009-10-15 13:58:16 -0700 |
|---|---|---|
| committer | skolb <none@none> | 2009-10-15 13:58:16 -0700 |
| commit | e9f7205ba9f4dfb3422759218609b62d61972722 (patch) | |
| tree | e7859943f67b0ab2f8e132cd64c0effbb3462206 /indra/test_apps/llplugintest/llmediaplugintest.cpp | |
| parent | 1b1550f284316b244a10a4a6604fedb5d6b18965 (diff) | |
| parent | 050ae3cf5107140a58f6aeae865d254b74a23d44 (diff) | |
Merge fix for DEV-39832
Diffstat (limited to 'indra/test_apps/llplugintest/llmediaplugintest.cpp')
| -rw-r--r-- | indra/test_apps/llplugintest/llmediaplugintest.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/test_apps/llplugintest/llmediaplugintest.cpp b/indra/test_apps/llplugintest/llmediaplugintest.cpp index f9568a9b5d..ba66b449f3 100644 --- a/indra/test_apps/llplugintest/llmediaplugintest.cpp +++ b/indra/test_apps/llplugintest/llmediaplugintest.cpp @@ -44,6 +44,7 @@ #if __APPLE__ #include <GLUT/glut.h> + #include <CoreFoundation/CoreFoundation.h> #else #define FREEGLUT_STATIC #include "GL/freeglut.h" @@ -2111,6 +2112,25 @@ void glutMouseButton( int button, int state, int x, int y ) // int main( int argc, char* argv[] ) { +#if LL_DARWIN + // Set the current working directory to <application bundle>/Contents/Resources/ + CFURLRef resources_url = CFBundleCopyResourcesDirectoryURL(CFBundleGetMainBundle()); + if(resources_url != NULL) + { + CFStringRef resources_string = CFURLCopyFileSystemPath(resources_url, kCFURLPOSIXPathStyle); + CFRelease(resources_url); + if(resources_string != NULL) + { + char buffer[PATH_MAX] = ""; + if(CFStringGetCString(resources_string, buffer, sizeof(buffer), kCFStringEncodingUTF8)) + { + chdir(buffer); + } + CFRelease(resources_string); + } + } +#endif + glutInit( &argc, argv ); glutInitDisplayMode( GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGB ); |
