Go to the documentation of this file.
20 #ifndef vtkShaderProgram_h
21 #define vtkShaderProgram_h
23 #include "vtkRenderingOpenGL2Module.h"
32 class VertexArrayObject;
140 int elementType,
int elementTupleSize,
260 int type,
int tupleSize,
281 friend class VertexArrayObject;
284 int FindAttributeArray(
const char *
name);
285 int FindUniform(
const char *
name);
bool SetUniform2fv(const char *name, const int count, const float(*f)[2])
#define vtkGetObjectMacro(name, type)
virtual int CompileShader()
void Release()
Releases the shader program from the current context.
std::string GetMD5Hash() const
GLuint GLuint GLsizei count
bool SetUniformMatrix4x4(const char *name, float *v)
NormalizeOption
Options for attribute normalization.
bool Link()
Attempt to link the shader program.
bool SetUniform4f(const char *name, const float v[4])
void PrintSelf(ostream &os, vtkIndent indent)
bool SetAttributeArray(const char *name, const T &array, int tupleSize, NormalizeOption normalize)
Upload the supplied array of tightly packed values to the named attribute.
vtkShader * FragmentShader
#define vtkTypeMacro(thisClass, superclass)
std::string GetError() const
Get the error message (empty if none) for the shader program.
abstract base class for most VTK objects
bool SetUniformf(const char *name, float v)
static vtkShaderProgram * New()
bool UseAttributeArray(const char *name, int offset, size_t stride, int elementType, int elementTupleSize, NormalizeOption normalize)
Use the named attribute array with the bound BufferObject.
represent and manipulate 3x3 transformation matrices
bool Bind()
Bind the program in order to use it.
bool DisableAttributeArray(const char *name)
Disable the named attribute array.
window superclass for vtkRenderWindow
bool SetAttributeArrayInternal(const char *name, void *buffer, int type, int tupleSize, NormalizeOption normalize)
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
GLuint const GLchar * name
bool SetUniform1fv(const char *name, const int count, const float *f)
bool DetachShader(const vtkShader *shader)
Detach the supplied shader from this program.
void SetGeometryShader(vtkShader *)
bool SetUniform2i(const char *name, const int v[2])
bool SetUniformMatrix(const char *name, vtkMatrix4x4 *v)
The ShaderProgram uses one or more Shader objects.
void SetVertexShader(vtkShader *)
std::string replace(std::string source, const std::string &search, const std::string replace, bool all)
a simple class to control print indentation
represent and manipulate 4x4 transformation matrices
@ Normalize
The values range across the limits of the numeric type.
bool SetUniformi(const char *name, int v)
Set the name uniform value to int v.
bool isBound() const
Check if the program is currently bound, or not.
Vertex or Fragment shader, combined into a ShaderProgram.
bool SetUniform4fv(const char *name, const int count, const float(*f)[4])
bool SetUniform3uc(const char *name, const unsigned char v[3])
#define vtkGetMacro(name, type)
manage Shader Programs within a context
bool SetUniformMatrix(const char *name, vtkMatrix3x3 *v)
int GetHandle() const
Get the handle of the shader program.
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkSetMacro(IgnoreDriverBugs, bool)
unsigned int NumberOfOutputs
void SetFragmentShader(vtkShader *)
bool EnableAttributeArray(const char *name)
Enable the named attribute array.
void SetMD5Hash(const std::string &hash)
bool SetUniform2f(const char *name, const float v[2])
bool SetUniform3fv(const char *name, const int count, const float(*f)[3])
bool SetUniformMatrix3x3(const char *name, float *v)
vtkShader * GeometryShader
bool AttachShader(const vtkShader *shader)
Attach the supplied shader to this program.
bool SetUniform4uc(const char *name, const unsigned char v[4])
GLuint GLuint GLsizei GLenum type
GLsizei const GLchar ** string
static bool Substitute(std::string &source, const std::string &search, const std::string replace, bool all=true)
bool SetUniform3f(const char *name, const float v[3])
void ReleaseGraphicsResources(vtkWindow *win)
bool SetUniform1iv(const char *name, const int count, const int *f)
Set the name uniform array to f with count elements.
std::map< std::string, int > Attributes