Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

osgGL2::ShaderObject Class Reference

Inheritance diagram for osgGL2::ShaderObject:

osg::Object osg::Referenced List of all members.

Public Types

enum  Type { VERTEX = GL_VERTEX_SHADER_ARB, FRAGMENT = GL_FRAGMENT_SHADER_ARB, UNKNOWN = -1 }

Public Member Functions

 ShaderObject ()
 ShaderObject (Type type)
 ShaderObject (Type type, const char *sourceText)
 ShaderObject (const ShaderObject &rhs, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
 META_Object (osgGL2, ShaderObject)
int compare (const ShaderObject &sa) const
void setShaderSource (const char *sourceText)
const std::string & getShaderSource () const
bool loadShaderSourceFromFile (const char *fileName)
Type getType () const
const char * getTypename () const
void dirtyShaderObject ()
void build (unsigned int contextID) const
void attach (unsigned int contextID, GLhandleARB progObj) const

Protected Member Functions

virtual ~ShaderObject ()
PerContextShaderObjgetPCSO (unsigned int contextID) const
void addProgObjRef (ProgramObject *progObj)

Protected Attributes

Type _type
std::string _shaderSource
std::vector< ProgramObjectPtr_programObjectList
osg::buffered_value< osg::ref_ptr<
PerContextShaderObj > > 
_pcsoList

Friends

void ProgramObject::addShader (ShaderObject *shadObj)

Classes

class  PerContextShaderObj

Detailed Description

osgGL2::ShaderObject is an application-level abstraction of the OpenGL Shading Language glShaderObject. It is a container to load the shader source code text and manage its compilation. A ShaderObject may be attached to more than one osgGL2::ProgramObject. ShaderObject will automatically manage per-context instancing of the internal objects, if that is necessary for a particular display configuration.


Member Enumeration Documentation

enum osgGL2::ShaderObject::Type
 

Enumerator:
VERTEX 
FRAGMENT 
UNKNOWN 


Constructor & Destructor Documentation

osgGL2::ShaderObject::ShaderObject  ) 
 

osgGL2::ShaderObject::ShaderObject Type  type  ) 
 

osgGL2::ShaderObject::ShaderObject Type  type,
const char *  sourceText
 

osgGL2::ShaderObject::ShaderObject const ShaderObject rhs,
const osg::CopyOp copyop = osg::CopyOp::SHALLOW_COPY
 

Copy constructor using CopyOp to manage deep vs shallow copy.

virtual osgGL2::ShaderObject::~ShaderObject  )  [protected, virtual]
 


Member Function Documentation

void osgGL2::ShaderObject::addProgObjRef ProgramObject progObj  )  [protected]
 

void osgGL2::ShaderObject::attach unsigned int  contextID,
GLhandleARB  progObj
const
 

For a given GL context, attach a glShaderObject to a glProgramObject

void osgGL2::ShaderObject::build unsigned int  contextID  )  const
 

Perform a recompilation of all our PCSOs

int osgGL2::ShaderObject::compare const ShaderObject sa  )  const
 

void osgGL2::ShaderObject::dirtyShaderObject  ) 
 

Mark us as "dirty" and in need of recompilation

PerContextShaderObj* osgGL2::ShaderObject::getPCSO unsigned int  contextID  )  const [protected]
 

const std::string& osgGL2::ShaderObject::getShaderSource  )  const [inline]
 

Retreive the source code text

Type osgGL2::ShaderObject::getType  )  const [inline]
 

Get the ShaderObject type as an enum.

const char* osgGL2::ShaderObject::getTypename  )  const
 

Get the ShaderObject type as a descriptive string.

bool osgGL2::ShaderObject::loadShaderSourceFromFile const char *  fileName  ) 
 

Load the ShaderObject's source code text from a file.

osgGL2::ShaderObject::META_Object osgGL2  ,
ShaderObject 
 

void osgGL2::ShaderObject::setShaderSource const char *  sourceText  ) 
 

Load the ShaderObject's source code text from a string.


Friends And Related Function Documentation

void ProgramObject::addShader ShaderObject shadObj  )  [friend]
 


Member Data Documentation

osg::buffered_value< osg::ref_ptr<PerContextShaderObj> > osgGL2::ShaderObject::_pcsoList [mutable, protected]
 

std::vector< ProgramObjectPtr > osgGL2::ShaderObject::_programObjectList [protected]
 

std::string osgGL2::ShaderObject::_shaderSource [protected]
 

Type osgGL2::ShaderObject::_type [protected]
 


The documentation for this class was generated from the following file:
Generated on Wed Sep 7 11:10:04 2005 for openscenegraph by  doxygen 1.4.4