More merry mac musings...
I get the impression (from the osg source) that when a shader is read from
the file it uses raw c++ IO. This means that shaders source that I have put
in my Resources directory in my App bundle (e.g.
OsgTest.app/Contents/Resources/data/shaders/simple.vert) won't read.
I remedied this by using the following snippet of mac code:
// Function
void SetCWDToMainBundle()
{
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle);
char path[PATH_MAX];
if (!CFURLGetFileSystemRepresentation(resourcesURL, TRUE, (UInt8 *)path,
PATH_MAX))
{
// Error
}
CFRelease(resourcesURL);
chdir(path);
}
// In use:
void SetCWDToMainBundle()
v->loadShaderSourceFromFile( "data/shaders/simple.vert" );
f->loadShaderSourceFromFile( "data/shaders/simple.frag" );
Obviously something like that happens in the image and model loading code so
I guess it's easy to fix If you have access (and understanding of!) to the
source code
/Filip
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org