#include <vtkShaderProgram2.h>
vtkShaderProgram2 represents an implementation of the programmable OpenGL pipeline. It consists of a list of vtkShader2 object. Each vtkShader2 is a piece of source code associated with one of the shader units (vertex, fragment, geometry).
Definition at line 51 of file vtkShaderProgram2.h.
vtkShaderProgram2::vtkShaderProgram2 | ( | ) | [protected] |
virtual vtkShaderProgram2::~vtkShaderProgram2 | ( | ) | [protected, virtual] |
static vtkShaderProgram2* vtkShaderProgram2::New | ( | ) | [static] |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkObject.
virtual const char* vtkShaderProgram2::GetClassName | ( | ) | [virtual] |
Reimplemented from vtkObject.
static int vtkShaderProgram2::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 vtkShaderProgram2::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 vtkShaderProgram2* vtkShaderProgram2::SafeDownCast | ( | vtkObject * | o | ) | [static] |
Reimplemented from vtkObject.
void vtkShaderProgram2::PrintSelf | ( | ostream & | os, | |
vtkIndent | indent | |||
) | [virtual] |
static bool vtkShaderProgram2::IsSupported | ( | vtkOpenGLRenderWindow * | context | ) | [static] |
Returns if the context supports the required extensions.
static bool vtkShaderProgram2::LoadExtensions | ( | vtkOpenGLRenderWindow * | context | ) | [static] |
Returns if the context supports the required extensions.
virtual bool vtkShaderProgram2::GetPrintErrors | ( | ) | [virtual] |
Tell if vtkErrorMacro should be called when there is a build error or not. It is useful to switch it to false when building a shader is a way to test if some OpenGL implementation support it or not. Initial value is true. Build errors are always reported in the status flags and log whatever is the value of PrintErrors flag.
virtual void vtkShaderProgram2::SetPrintErrors | ( | bool | ) | [virtual] |
Tell if vtkErrorMacro should be called when there is a build error or not. It is useful to switch it to false when building a shader is a way to test if some OpenGL implementation support it or not. Initial value is true. Build errors are always reported in the status flags and log whatever is the value of PrintErrors flag.
void vtkShaderProgram2::SetContext | ( | vtkOpenGLRenderWindow * | context | ) |
Get/Set the context. This does not increase the reference count of the context to avoid reference loops. SetContext() may raise an error is the OpenGL context does not support the required OpenGL extensions.
virtual vtkOpenGLRenderWindow* vtkShaderProgram2::GetContext | ( | ) | [virtual] |
Get/Set the context. This does not increase the reference count of the context to avoid reference loops. SetContext() may raise an error is the OpenGL context does not support the required OpenGL extensions.
virtual vtkShader2Collection* vtkShaderProgram2::GetShaders | ( | ) | [virtual] |
The list of shaders. Initially, the list is empty.
bool vtkShaderProgram2::HasVertexShaders | ( | ) |
Tells if at least one of the shaders is a vertex shader. If yes, it means the vertex processing of the fixed-pipeline is bypassed. If no, it means the vertex processing of the fixed-pipeline is used.
bool vtkShaderProgram2::HasTessellationControlShaders | ( | ) |
Tells if at least one of the shaders is a tessellation control shader.
bool vtkShaderProgram2::HasTessellationEvaluationShaders | ( | ) |
Tells if at least one of the shaders is a tessellation evaluation shader.
bool vtkShaderProgram2::HasGeometryShaders | ( | ) |
Tells if at least one of the shaders is a geometry shader.
bool vtkShaderProgram2::HasFragmentShaders | ( | ) |
Tells if at least one of the shaders is a fragment shader. If yes, it means the fragment processing of the fixed-pipeline is bypassed. If no, it means the fragment processing of the fixed-pipeline is used.
bool vtkShaderProgram2::IsValid | ( | ) |
Tell if the shader program is valid with the current OpenGL state.
void vtkShaderProgram2::Build | ( | ) |
If not done yet, compile all the shaders and link the program. The status of the build can then be query with GetLastBuildStatus() and GetLastLinkLog().
void vtkShaderProgram2::SendUniforms | ( | ) |
Send the uniform variables values to the program.
void vtkShaderProgram2::PrintActiveUniformVariables | ( | ostream & | os, | |
vtkIndent | indent | |||
) |
Introspection. Return the list of active uniform variables of the program.
void vtkShaderProgram2::PrintActiveUniformVariablesOnCout | ( | ) |
Call PrintActiveUniformVariables on cout. Useful for calling inside gdb.
bool vtkShaderProgram2::IsUsed | ( | ) |
Tell if the program is the one currently used by OpenGL.
void vtkShaderProgram2::Use | ( | ) |
Use the shader program. It saves the current shader program or fixed-pipeline in use. It also set the uniform variables.
current_context_matches: this->GetContext()->IsCurrent()
void vtkShaderProgram2::Restore | ( | ) |
Restore the previous shader program (or fixed-pipeline).
void vtkShaderProgram2::RestoreFixedPipeline | ( | ) |
Force the current shader program to be the fixed-pipeline. Warning: this call will be compiled if called inside a display list creation.
int vtkShaderProgram2::GetLastBuildStatus | ( | ) |
Tells if the last build: failed during compilation of one of the shader, fails during link of the program or succeeded to link the program. Initial value is VTK_SHADER_PROGRAM2_COMPILE_FAILED.
const char* vtkShaderProgram2::GetLastLinkLog | ( | ) |
Return the log of the last link as a string. Initial value is the empty string ""=''.
const char* vtkShaderProgram2::GetLastValidateLog | ( | ) |
Return the log of the last call to IsValid as a string. Initial value is the empty string ""=''.
virtual void vtkShaderProgram2::ReleaseGraphicsResources | ( | ) | [virtual] |
Release OpenGL resource (program id and sub-resources).
int vtkShaderProgram2::GetAttributeLocation | ( | const char * | name | ) |
Returns the generic attribute location. The shader must be bound before calling this.
built: this->GetLastBuildStatus()==VTK_SHADER_PROGRAM2_LINK_SUCCEEDED
virtual vtkUniformVariables* vtkShaderProgram2::GetUniformVariables | ( | ) | [virtual] |
Get/Set the list of uniform variables values. Initial value is an empty list (not null pointer).
virtual void vtkShaderProgram2::SetUniformVariables | ( | vtkUniformVariables * | variables | ) | [virtual] |
Get/Set the list of uniform variables values. Initial value is an empty list (not null pointer).
bool vtkShaderProgram2::DisplayListUnderCreationInCompileMode | ( | ) |
Tells if a display list is under construction with GL_COMPILE mode. Return false if there is no display list under construction of if the mode is GL_COMPILE_AND_EXECUTE. Used internally and provided as a public method for whoever find it useful.
unsigned int vtkShaderProgram2::Id [protected] |
Definition at line 189 of file vtkShaderProgram2.h.
unsigned int vtkShaderProgram2::SavedId [protected] |
Definition at line 190 of file vtkShaderProgram2.h.
vtkTimeStamp vtkShaderProgram2::LastLinkTime [protected] |
Definition at line 192 of file vtkShaderProgram2.h.
vtkTimeStamp vtkShaderProgram2::LastSendUniformsTime [protected] |
Definition at line 193 of file vtkShaderProgram2.h.
vtkShaderProgram2Uniforms* vtkShaderProgram2::Uniforms [protected] |
Definition at line 195 of file vtkShaderProgram2.h.
vtkShader2Collection* vtkShaderProgram2::Shaders [protected] |
Definition at line 196 of file vtkShaderProgram2.h.
int vtkShaderProgram2::LastBuildStatus [protected] |
Definition at line 198 of file vtkShaderProgram2.h.
char* vtkShaderProgram2::LastLinkLog [protected] |
Definition at line 200 of file vtkShaderProgram2.h.
size_t vtkShaderProgram2::LastLinkLogCapacity [protected] |
Definition at line 201 of file vtkShaderProgram2.h.
char* vtkShaderProgram2::LastValidateLog [protected] |
Definition at line 203 of file vtkShaderProgram2.h.
size_t vtkShaderProgram2::LastValidateLogCapacity [protected] |
Definition at line 204 of file vtkShaderProgram2.h.
vtkUniformVariables* vtkShaderProgram2::UniformVariables [protected] |
Definition at line 206 of file vtkShaderProgram2.h.
bool vtkShaderProgram2::PrintErrors [protected] |
Definition at line 208 of file vtkShaderProgram2.h.
vtkOpenGLRenderWindow* vtkShaderProgram2::Context [protected] |
Definition at line 210 of file vtkShaderProgram2.h.
bool vtkShaderProgram2::ExtensionsLoaded [protected] |
Definition at line 211 of file vtkShaderProgram2.h.