28 #ifndef vtkShaderProgram2_h
29 #define vtkShaderProgram2_h
32 #include "vtkRenderingOpenGLModule.h"
90 vtkGetMacro(PrintErrors,
bool);
118 bool HasVertexShaders();
123 bool HasTessellationControlShaders();
128 bool HasTessellationEvaluationShaders();
133 bool HasGeometryShaders();
141 bool HasFragmentShaders();
174 void PrintActiveUniformVariables(ostream &os,
183 void PrintActiveUniformVariablesOnCout();
216 void RestoreFixedPipeline();
236 int GetLastBuildStatus();
243 const char *GetLastLinkLog();
250 const char *GetLastValidateLog();
255 virtual void ReleaseGraphicsResources();
265 int GetAttributeLocation(
const char *
name);
285 bool DisplayListUnderCreationInCompileMode();
302 vtkGetMacro(GeometryTypeIn,
int);
319 vtkGetMacro(GeometryVerticesOut,
int);
335 vtkGetMacro(GeometryTypeOut,
int);
351 int GetUniformLocation(
const char *
name);
361 { this->SetUniform1f(name, &val); }
363 { this->SetUniform1f(this->GetUniformLocation(name), val); }
365 { this->SetUniform2f(this->GetUniformLocation(name), val); }
367 { this->SetUniform3f(this->GetUniformLocation(name), val); }
369 { this->SetUniform4f(this->GetUniformLocation(name), val); }
372 { this->SetUniform1i(name, &val); }
374 { this->SetUniform1i(this->GetUniformLocation(name), val); }
376 { this->SetUniform2i(this->GetUniformLocation(name), val); }
378 { this->SetUniform3i(this->GetUniformLocation(name), val); }
380 { this->SetUniform4i(this->GetUniformLocation(name), val); }
383 { this->SetUniform1f(loc, &val); }
384 void SetUniform1f(
int loc,
float *val);
385 void SetUniform2f(
int loc,
float *val);
386 void SetUniform3f(
int loc,
float *val);
387 void SetUniform4f(
int loc,
float *val);
390 { this->SetUniform1i(loc, &val); }
391 void SetUniform1i(
int loc,
int *val);
392 void SetUniform2i(
int loc,
int *val);
393 void SetUniform3i(
int loc,
int *val);
394 void SetUniform4i(
int loc,
int *val);
402 template<
typename T>
void SetUniform1it(
const char *
name, T *
value);
403 template<
typename T>
void SetUniform2it(
const char *
name, T *
value);
404 template<
typename T>
void SetUniform3it(
const char *
name, T *
value);
405 template<
typename T>
void SetUniform4it(
const char *
name, T *
value);
408 template<
typename T>
void SetUniform1ft(
const char *
name, T *
value);
409 template<
typename T>
void SetUniform2ft(
const char *
name, T *
value);
410 template<
typename T>
void SetUniform3ft(
const char *
name, T *
value);
411 template<
typename T>
void SetUniform4ft(
const char *
name, T *
value);
413 template<
typename T>
void SetUniform1it(
int loc, T *
value);
414 template<
typename T>
void SetUniform2it(
int loc, T *
value);
415 template<
typename T>
void SetUniform3it(
int loc, T *
value);
416 template<
typename T>
void SetUniform4it(
int loc, T *
value);
418 template<
typename T>
void SetUniform1ft(
int loc, T *
value);
419 template<
typename T>
void SetUniform2ft(
int loc, T *
value);
420 template<
typename T>
void SetUniform3ft(
int loc, T *
value);
421 template<
typename T>
void SetUniform4ft(
int loc, T *
value);
441 int GetUniformLocationInternal(
const char *
name);
477 #define vtkShaderProgram2SetUniformCopyCastMacro(toLetter, toType, num) \
478 template<typename fromType> \
479 void vtkShaderProgram2::SetUniform##num##toLetter##t(const char *name, fromType *fvalues) \
481 toType tvalues[num]; \
482 for (int i=0; i<num; ++i) \
484 tvalues[i] = static_cast<toType>(fvalues[i]); \
486 this->SetUniform##num##toLetter(name, tvalues); \
488 template<typename fromType> \
489 void vtkShaderProgram2::SetUniform##num##toLetter##t(int location, fromType *fvalues) \
491 assert(location!=-1); \
492 toType tvalues[num]; \
493 for (int i=0; i<num; ++i) \
495 tvalues[i] = static_cast<toType>(fvalues[i]); \
497 this->SetUniform##num##toLetter(location, tvalues); \
void SetUniform2f(const char *name, float *val)
void SetUniform3f(const char *name, float *val)
abstract base class for most VTK objects
vtkTimeStamp LastLinkTime
size_t LastLinkLogCapacity
void SetUniform1f(const char *name, float *val)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkWeakPointer< vtkRenderWindow > Context
record modification and/or execution time
void SetUniformi(const char *name, int val)
vtkUniformVariables * UniformVariables
size_t LastValidateLogCapacity
a list of Shader2 objects.
void SetUniform3i(const char *name, int *val)
a simple class to control print indentation
vtkShaderProgram2GeometryInType
#define vtkShaderProgram2SetUniformCopyCastMacro(toLetter, toType, num)
void SetUniformf(const char *name, float val)
Set a uniform value directly.
void SetUniformf(int loc, float val)
void SetUniform4f(const char *name, float *val)
void SetUniform4i(const char *name, int *val)
vtkShaderProgram2GeometryOutType
Interface class for querying and using OpenGL extensions.
void SetUniform2i(const char *name, int *val)
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void SetUniformi(int loc, int val)
create a window for renderers to draw into
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
void SetUniform1i(const char *name, int *val)
vtkShaderProgram2BuildStatus
vtkTimeStamp LastSendUniformsTime
vtkShader2Collection * Shaders