21 #ifndef vtkShaderProgram_h
22 #define vtkShaderProgram_h
24 #include "vtkRenderingOpenGL2Module.h"
34 class VertexArrayObject;
55 vtkGetObjectMacro(VertexShader,
vtkShader);
63 vtkGetObjectMacro(FragmentShader,
vtkShader);
71 vtkGetObjectMacro(GeometryShader,
vtkShader);
87 vtkGetMacro(Compiled,
bool);
88 vtkSetMacro(Compiled,
bool);
89 vtkBooleanMacro(Compiled,
bool);
124 void ReleaseGraphicsResources(
vtkWindow *win);
136 bool EnableAttributeArray(
const char *
name);
142 bool DisableAttributeArray(
const char *
name);
159 bool UseAttributeArray(
const char *
name,
int offset,
size_t stride,
160 int elementType,
int elementTupleSize,
161 NormalizeOption normalize);
181 bool SetAttributeArray(
const char *
name,
const T &array,
182 int tupleSize, NormalizeOption normalize);
185 bool SetUniformi(
const char *
name,
int v);
186 bool SetUniformf(
const char *
name,
float v);
187 bool SetUniform2i(
const char *
name,
const int v[2]);
188 bool SetUniform2f(
const char *
name,
const float v[2]);
189 bool SetUniform3f(
const char *
name,
const float v[3]);
190 bool SetUniform3f(
const char *
name,
const double v[3]);
191 bool SetUniform4f(
const char *
name,
const float v[4]);
192 bool SetUniform3uc(
const char *
name,
const unsigned char v[3]);
193 bool SetUniform4uc(
const char *
name,
const unsigned char v[4]);
196 bool SetUniformMatrix3x3(
const char *
name,
float *v);
197 bool SetUniformMatrix4x4(
const char *
name,
float *v);
200 bool SetUniform1iv(
const char *
name,
const int count,
const int *f);
201 bool SetUniform1fv(
const char *
name,
const int count,
const float *f);
202 bool SetUniform2fv(
const char *
name,
const int count,
const float (*f)[2]);
203 bool SetUniform3fv(
const char *
name,
const int count,
const float (*f)[3]);
204 bool SetUniform4fv(
const char *
name,
const int count,
const float (*f)[4]);
205 bool SetUniformMatrix4x4v(
const char *
name,
const int count,
float *v);
209 vtkSetMacro(NumberOfOutputs,
unsigned int);
222 static bool Substitute(
239 static bool Substitute(
250 bool IsUniformUsed(
const char *);
256 bool IsAttributeUsed(
const char *
name);
268 return strcmp(a, b) < 0;
290 vtkSetStringMacro(FileNamePrefixForDebugging);
291 vtkGetStringMacro(FileNamePrefixForDebugging);
311 int FindUniform(
const char *
name);
312 int FindAttributeArray(
const char *
name);
332 bool AttachShader(
const vtkShader *shader);
339 bool DetachShader(
const vtkShader *shader);
344 virtual int CompileShader();
372 bool SetAttributeArrayInternal(
const char *
name,
void *buffer,
373 int type,
int tupleSize,
376 int VertexShaderHandle;
377 int FragmentShaderHandle;
378 int GeometryShaderHandle;
388 unsigned int NumberOfOutputs;
395 std::map<const char *, int, cmp_str> AttributeLocs;
396 std::map<const char *, int, cmp_str> UniformLocs;
398 std::map<int, vtkMTimeType> UniformGroupMTimes;
400 friend class VertexArrayObject;
406 char* FileNamePrefixForDebugging;