20 #ifndef vtkShaderProgram_h
21 #define vtkShaderProgram_h
32 class VertexArrayObject;
51 vtkGetObjectMacro(VertexShader,
vtkShader);
57 vtkGetObjectMacro(FragmentShader,
vtkShader);
63 vtkGetObjectMacro(GeometryShader,
vtkShader);
69 vtkGetMacro(Compiled,
bool);
70 vtkSetMacro(Compiled,
bool);
71 vtkBooleanMacro(Compiled,
bool);
104 void ReleaseGraphicsResources(
vtkWindow *win);
116 bool EnableAttributeArray(
const char *
name);
122 bool DisableAttributeArray(
const char *
name);
139 bool UseAttributeArray(
const char *
name,
int offset,
size_t stride,
140 int elementType,
int elementTupleSize,
141 NormalizeOption normalize);
161 bool SetAttributeArray(
const char *
name,
const T &array,
162 int tupleSize, NormalizeOption normalize);
165 bool SetUniformi(
const char *
name,
int v);
166 bool SetUniformf(
const char *
name,
float v);
167 bool SetUniform2i(
const char *
name,
const int v[2]);
168 bool SetUniform2f(
const char *
name,
const float v[2]);
169 bool SetUniform3f(
const char *
name,
const float v[3]);
170 bool SetUniform4f(
const char *
name,
const float v[4]);
171 bool SetUniform3uc(
const char *
name,
const unsigned char v[3]);
172 bool SetUniform4uc(
const char *
name,
const unsigned char v[4]);
175 bool SetUniformMatrix3x3(
const char *
name,
float *v);
176 bool SetUniformMatrix4x4(
const char *
name,
float *v);
179 bool SetUniform1iv(
const char *
name,
const int count,
const int *f);
180 bool SetUniform1fv(
const char *
name,
const int count,
const float *f);
181 bool SetUniform2fv(
const char *
name,
const int count,
const float (*f)[2]);
182 bool SetUniform3fv(
const char *name,
const int count,
const float (*f)[3]);
183 bool SetUniform4fv(
const char *name,
const int count,
const float (*f)[4]);
184 bool SetUniformMatrix4x4v(
const char *name,
const int count,
float *v);
188 vtkSetMacro(NumberOfOutputs,
unsigned int);
196 static bool Substitute(
206 bool IsUniformUsed(
const char *);
226 bool AttachShader(
const vtkShader *shader);
233 bool DetachShader(
const vtkShader *shader);
236 virtual int CompileShader();
263 bool SetAttributeArrayInternal(
const char *name,
void *buffer,
264 int type,
int tupleSize,
288 friend class VertexArrayObject;
291 int FindAttributeArray(
const char *name);
292 int FindUniform(
const char *name);
int GetHandle() const
Get the handle of the shader program.
abstract base class for most VTK objects
represent and manipulate 4x4 transformation matrices
unsigned int NumberOfOutputs
manage Shader Programs within a context
bool isBound() const
Check if the program is currently bound, or not.
#define VTKRENDERINGOPENGL2_EXPORT
The values range across the limits of the numeric type.
std::map< std::string, bool > UniformsUsed
std::map< std::string, int > Attributes
void SetMD5Hash(const std::string &hash)
window superclass for vtkRenderWindow
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
vtkShader * GeometryShader
vtkShader * FragmentShader
NormalizeOption
Options for attribute normalization.
std::string GetMD5Hash() const
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Vertex or Fragment shader, combined into a ShaderProgram.
std::string GetError() const
Get the error message (empty if none) for the shader program.
std::string replace(std::string source, const std::string &search, const std::string replace, bool all)
represent and manipulate 3x3 transformation matrices
The ShaderProgram uses one or more Shader objects.