Thanks for the reply Robert.  Parsing an error message sounds a bit
risky.  A couple hours after writing that message I found another
solution.  You cannot call

myshader->getPCS(context)->isCompiled();

because getPCS() is protected.  But you can call

myprogram->getPCP(context)->isLinked();

because both those functions are public.

I believe if compiling fails then linking always fails too.  So now my
game can detect which programs have linked and only use the ones with
low enough complexity.  Seems to work fine so far....
--
Terry Welsh  /  mogumbo 'at' gmail.com
www.reallyslick.com  /  www.mogumbo.com


>
> Message: 17
> Date: Thu, 4 Mar 2010 09:06:23 +0000
> From: Robert Osfield <[email protected]>
> To: OpenSceneGraph Users <[email protected]>
> Subject: Re: [osg-users] Did my shader compile successfully?
> Message-ID:
>        <[email protected]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi Terry,
>
> I don't recall a method for programmability getting whether a shader has
> compiled successfully, but you will out a warning output via osg::notify to
> the console if there is an error with compilation or linking.  If you don't
> get an error then things should be fine.  Up you notification level to DEBUG
> via (assuming bash)
>
>  export OSG_NOTIFY_LEVEL=DEBUG
>  runyouapp
>
>
> Robert.
>
> On Thu, Mar 4, 2010 at 6:09 AM, Terry Welsh <[email protected]> wrote:
>
>> I'm certain this sort of thing has been asked before, but I can't seem
>> to find answers in the archives.  I was hoping I could call
>> Shader::isCompiled(), but I need access to Shader::getPCS(), which is
>> protected.  Does this need to be protected?  Do I really need to
>> derive from Program to use this function?  Or is there another way to
>> find out if my shader is compiled that I haven't spotted?
>> --
>> Terry Welsh  /  mogumbo 'at' gmail.com
>> www.reallyslick.com  /  www.mogumbo.com
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to