[osg-users] Reading shader source on Mac

Filip Wänström filip.wanstrom at tii.se
Mon Sep 8 02:30:25 PDT 2008


That worked fine.
I think it would be a good idea to have similar behavior when loading files
independent of their types. Can someone change the shaders loading code so
that it uses findDataFile instead of the raw c++ IO ?
/Filip


On Mon, Sep 8, 2008 at 10:20 AM, Stephan Maximilian Huber <
ratzfatz at digitalmind.de> wrote:

> Filip Wänström schrieb:
>
>> 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.
>>
>>
> does
>
> std::string filename = osgDB::findDataFile("data/shaders/simple.vert");
> if (!filename.empy()) {
> ....
> }
>
> work? findDataFile should find your files in the resource-path of your app
> bundle automagically. IMHO findDataFile is called by the Registry when
> loading models / images, perhaps this call is missing when loading shaders.
>
> cheers,
> Stephan
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080908/2e85f897/attachment-0003.htm>


More information about the osg-users mailing list