ACG::SceneGraph::ShaderNode Class Reference

#include <ACG/Scenegraph/ShaderNode.hh>

Inheritance diagram for ACG::SceneGraph::ShaderNode:
Inheritance graph
[legend]
Collaboration diagram for ACG::SceneGraph::ShaderNode:
Collaboration graph
[legend]

List of all members.

Classes

class  ShaderInfo

Public Member Functions

 ShaderNode (BaseNode *_parent=0, const std::string &_name="<ShaderNode>")
 Default constructor. Applies all properties.
virtual ~ShaderNode ()
 Destructor.
 ACG_CLASSNAME (ShaderNode)
void enter (GLState &, DrawModes::DrawMode _drawmode)
 set shader
void leave (GLState &, DrawModes::DrawMode _drawmode)
 disable shader
void enterPick (GLState &, PickTarget _target, DrawModes::DrawMode _drawmode)
 set shader
void leavePick (GLState &, PickTarget _target, DrawModes::DrawMode _drawmode)
 disable shader
void setShaderDir (std::string _shaderDir)
 Sets the shader dir.
std::string shaderDir ()
std::string vertexShaderName (DrawModes::DrawMode _drawmode, bool _pick=false)
std::string fragmentShaderName (DrawModes::DrawMode _drawmode, bool _pick=false)
void setShader (DrawModes::DrawMode _drawmode, std::string _vertexShader, std::string _fragmentShader, std::string _pickVertexShader="", std::string _pickFragmentShader="")
GLSL::PtrProgram getShader (DrawModes::DrawMode _drawmode, bool _pick=false)
 Get the shader for the given drawMode.
bool hasShader (DrawModes::DrawMode _drawmode, bool _pick=false)
 Check if a shader is available for the given drawMode.
DrawModes::DrawMode availableDrawModes () const
 return available draw modes

Private Attributes

std::string shaderDir_
std::map< unsigned int,
ShaderInfo
shaders
std::map< unsigned int,
ShaderInfo
pickShaders

Detailed Description

Set shaders for this node and all its children. All changes will be done in the enter() method undonecd ..cd in the leave() method.

Definition at line 80 of file ShaderNode.hh.


Member Function Documentation

void ACG::SceneGraph::ShaderNode::setShader ( DrawModes::DrawMode  _drawmode,
std::string  _vertexShader,
std::string  _fragmentShader,
std::string  _pickVertexShader = "",
std::string  _pickFragmentShader = "" 
)

Sets a Shader for this draw Mode

Parameters:
_drawmode Set the drawmode for which the shader should be activated
_vertexShader filename of the Vertex Shader within the shader directory
_fragmentShader filename of the Fragment Shader within the shader directory

Definition at line 264 of file ShaderNode.cc.

References ACG::SceneGraph::DrawModes::DrawMode::getIndex(), GLSL::loadFragmentShader(), and GLSL::loadVertexShader().


The documentation for this class was generated from the following files:

acg pic Project OpenFlipper, ©  Computer Graphics Group, RWTH Aachen. Documentation generated using doxygen .