[osg-users] confused with setTextureAttributeAndModes

Robert Osfield robert.osfield at gmail.com
Fri May 27 01:05:13 PDT 2016

Hi Julien,

The StateSet::set*AttributeAndModes(...) and there for convenience, so
one doesn't have to remember which GL modes are associated with the
attribute being set and to ensure that one line of code is enough to
set things correctly rather then multiple lines.

However, in modern OpenGL where you use uniforms and shaders far more
than old fixed function style StateAttribute the GL modes part takes a
back seat and is something that will be used far less.


On 26 May 2016 at 23:28, Julien Valentin <julienvalentin51 at gmail.com> wrote:
> Hi,
> I had a bug using setTextureAttributeAndModes with a TextureBuffer and realized there are two methods (i used the setTextureAttribute and now all is good)
> Code:
>  /** Set this StateSet to contain specified attribute and override flag.*/
>         void setTextureAttribute(unsigned int unit,StateAttribute *attribute, StateAttribute::OverrideValue value=StateAttribute::OFF);
>         /** Set this StateSet to contain specified attribute and set the associated GLMode's to specified value.*/
>         void setTextureAttributeAndModes(unsigned int unit,StateAttribute *attribute, StateAttribute::GLModeValue value=StateAttribute::ON);
> Can you explain me what are the purpose of both of them?
> Is setTextureAttributeAndModes only there for retrocompatibility?
> Thanks in advance
> Thank you!
> Cheers,
> Julien
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=67245#67245
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

More information about the osg-users mailing list