VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
vtkShader Class Reference

Vertex or Fragment shader, combined into a ShaderProgram. More...

#include <vtkShader.h>

Inheritance diagram for vtkShader:
Inheritance graph
[legend]
Collaboration diagram for vtkShader:
Collaboration graph
[legend]

List of all members.

Public Types

enum  Type { Vertex, Fragment, Geometry, Unknown }
 Available shader types. More...
typedef vtkObject Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkShaderNewInstance () const
void PrintSelf (ostream &os, vtkIndent indent)
void SetType (Type type)
 Set the shader type.
Type GetType () const
 Get the shader type, typically Vertex or Fragment.
void SetSource (const std::string &source)
 Set the shader source to the supplied string.
std::string GetSource () const
 Get the source for the shader.
std::string GetError () const
 Get the error message (empty if none) for the shader.
int GetHandle () const
 Get the handle of the shader.
bool Compile ()
 Compile the shader.
void Cleanup ()
 Delete the shader.

Static Public Member Functions

static vtkShaderNew ()
static int IsTypeOf (const char *type)
static vtkShaderSafeDownCast (vtkObjectBase *o)

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 vtkShader ()
 ~vtkShader ()

Protected Attributes

Type ShaderType
int Handle
bool Dirty
std::string Source
std::string Error

Detailed Description

Vertex or Fragment shader, combined into a ShaderProgram.

encapsulate a glsl shader

This class creates a Vertex, Fragment or Geometry shader, that can be attached to a ShaderProgram in order to render geometry etc.

vtkShader represents a shader, vertex, fragment, geometry etc

Definition at line 35 of file vtkShader.h.


Member Typedef Documentation

Reimplemented from vtkObject.

Definition at line 39 of file vtkShader.h.


Member Enumeration Documentation

Available shader types.

Enumerator:
Vertex 

Vertex shader.

Fragment 

Fragment shader.

Geometry 

Geometry shader.

Unknown 

Unknown (default)

Definition at line 44 of file vtkShader.h.


Constructor & Destructor Documentation

vtkShader::vtkShader ( ) [protected]
vtkShader::~vtkShader ( ) [protected]

Member Function Documentation

static vtkShader* vtkShader::New ( ) [static]

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

Reimplemented from vtkObject.

static int vtkShader::IsTypeOf ( const char *  name) [static]

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

virtual int vtkShader::IsA ( const char *  name) [virtual]

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

static vtkShader* vtkShader::SafeDownCast ( vtkObjectBase o) [static]

Reimplemented from vtkObject.

virtual vtkObjectBase* vtkShader::NewInstanceInternal ( ) const [protected, virtual]

Reimplemented from vtkObject.

Reimplemented from vtkObject.

void vtkShader::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkObject.

void vtkShader::SetType ( Type  type)

Set the shader type.

Type vtkShader::GetType ( ) const [inline]

Get the shader type, typically Vertex or Fragment.

Definition at line 55 of file vtkShader.h.

void vtkShader::SetSource ( const std::string &  source)

Set the shader source to the supplied string.

std::string vtkShader::GetSource ( ) const [inline]

Get the source for the shader.

Definition at line 61 of file vtkShader.h.

std::string vtkShader::GetError ( void  ) const [inline]

Get the error message (empty if none) for the shader.

Definition at line 64 of file vtkShader.h.

int vtkShader::GetHandle ( ) const [inline]

Get the handle of the shader.

Definition at line 67 of file vtkShader.h.

Compile the shader.

Note:
A valid context must to current in order to compile the shader.

Delete the shader.

Note:
This should only be done once the ShaderProgram is done with the Shader.

Member Data Documentation

Definition at line 84 of file vtkShader.h.

int vtkShader::Handle [protected]

Definition at line 85 of file vtkShader.h.

bool vtkShader::Dirty [protected]

Definition at line 86 of file vtkShader.h.

std::string vtkShader::Source [protected]

Definition at line 88 of file vtkShader.h.

std::string vtkShader::Error [protected]

Definition at line 89 of file vtkShader.h.


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