14#ifndef OSG_SHADERATTRIBUTE
15#define OSG_SHADERATTRIBUTE 1
36 virtual const char*
className()
const {
return "ShaderAttribute"; }
71 typedef std::vector< osg::ref_ptr<osg::Uniform> >
Uniforms;
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
osg::Shader is an application-level abstraction of an OpenGL glShader.
Definition Shader:89
virtual bool getModeUsage(StateAttribute::ModeUsage &usage) const
Return the modes associated with this StateAttribute.
std::vector< osg::ref_ptr< osg::Uniform > > Uniforms
Definition ShaderAttribute:71
virtual bool isSameKindAs(const osg::Object *obj) const
Return true if this and obj are of the same kind of object.
Definition ShaderAttribute:34
virtual void compileGLObjects(State &state) const
Default to nothing to compile - all state is applied immediately.
virtual void apply(State &state) const
apply the OpenGL state attributes.
const Uniform * getUniform(unsigned int i) const
Definition ShaderAttribute:55
void removeShader(unsigned int i)
Definition ShaderAttribute:46
virtual osg::Object * clone(const osg::CopyOp ©op) const
Clone an attribute, with Object* return type.
Definition ShaderAttribute:33
Uniform * getUniform(unsigned int i)
Definition ShaderAttribute:54
unsigned int getNumUniforms() const
Definition ShaderAttribute:53
virtual const char * className() const
Return the name of the attribute's class type.
Definition ShaderAttribute:36
unsigned int getNumShaders() const
Definition ShaderAttribute:47
void removeUniform(unsigned int i)
virtual Type getType() const
Return the Type identifier of the attribute's class type.
Definition ShaderAttribute:43
Type _type
Definition ShaderAttribute:73
ShaderAttribute(const ShaderAttribute &sa, const CopyOp ©op=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy.
unsigned int addShader(Shader *shader)
Definition ShaderAttribute:45
unsigned int addUniform(Uniform *uniform)
const Shader * getShader(unsigned int i) const
Definition ShaderAttribute:49
Uniforms _uniforms
Definition ShaderAttribute:74
virtual void resizeGLObjectBuffers(unsigned int maxSize)
Resize any per context GLObject buffers to specified size.
virtual const char * libraryName() const
Return the name of the attribute's library.
Definition ShaderAttribute:35
virtual ~ShaderAttribute()
virtual void releaseGLObjects(State *state=0) const
Release OpenGL objects in specified graphics context if State object is passed, otherwise release Ope...
virtual osg::Object * cloneType() const
Clone the type of an attribute, with Object* return type.
Shader * getShader(unsigned int i)
Definition ShaderAttribute:48
virtual int compare(const StateAttribute &sa) const
return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
ref_ptr< ShaderComponent > _shaderComponent
Definition StateAttribute:396
Type
Type identifier to differentiate between different state types.
Definition StateAttribute:124
Definition StateAttribute:308
Uniform encapsulates glUniform values.
Definition Uniform:414
#define NULL
Definition Export:55
#define OSG_EXPORT
Definition Export:39