summaryrefslogtreecommitdiff
path: root/indra/test_apps/llplugintest/llmediaplugintest.cpp
diff options
context:
space:
mode:
authorRick Pasetto <rick@lindenlab.com>2009-10-13 10:01:25 -0700
committerRick Pasetto <rick@lindenlab.com>2009-10-13 10:01:25 -0700
commit64514057a4daabf068d37db80cbf83fd30e30cf7 (patch)
treed7e52cb1abc09d42ad49c384e6cc8cf47192874d /indra/test_apps/llplugintest/llmediaplugintest.cpp
parent780719c14c6c2921eaf0a6021a4082b5486efafb (diff)
parentf154a3a23f9dad1e4222ad0f90a40f4f79b38508 (diff)
Merge from remote repo
Diffstat (limited to 'indra/test_apps/llplugintest/llmediaplugintest.cpp')
-rw-r--r--indra/test_apps/llplugintest/llmediaplugintest.cpp20
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 );