25 #ifndef vtkShaderProgram2_h 26 #define vtkShaderProgram2_h 29 #include "vtkRenderingOpenGLModule.h" 87 vtkGetMacro(PrintErrors,
bool);
115 bool HasVertexShaders();
120 bool HasTessellationControlShaders();
125 bool HasTessellationEvaluationShaders();
130 bool HasGeometryShaders();
138 bool HasFragmentShaders();
171 void PrintActiveUniformVariables(ostream &os,
180 void PrintActiveUniformVariablesOnCout();
213 void RestoreFixedPipeline();
233 int GetLastBuildStatus();
240 const char *GetLastLinkLog();
247 const char *GetLastValidateLog();
252 virtual void ReleaseGraphicsResources();
262 int GetAttributeLocation(
const char *
name);
282 bool DisplayListUnderCreationInCompileMode();
299 vtkGetMacro(GeometryTypeIn,
int);
316 vtkGetMacro(GeometryVerticesOut,
int);
332 vtkGetMacro(GeometryTypeOut,
int);
348 int GetUniformLocation(
const char *
name);
358 { this->SetUniform1f(name, &val); }
360 { this->SetUniform1f(this->GetUniformLocation(name), val); }
362 { this->SetUniform2f(this->GetUniformLocation(name), val); }
364 { this->SetUniform3f(this->GetUniformLocation(name), val); }
366 { this->SetUniform4f(this->GetUniformLocation(name), val); }
369 { this->SetUniform1i(name, &val); }
371 { this->SetUniform1i(this->GetUniformLocation(name), val); }
373 { this->SetUniform2i(this->GetUniformLocation(name), val); }
375 { this->SetUniform3i(this->GetUniformLocation(name), val); }
377 { this->SetUniform4i(this->GetUniformLocation(name), val); }
380 { this->SetUniform1f(loc, &val); }
381 void SetUniform1f(
int loc,
float *val);
382 void SetUniform2f(
int loc,
float *val);
383 void SetUniform3f(
int loc,
float *val);
384 void SetUniform4f(
int loc,
float *val);
387 { this->SetUniform1i(loc, &val); }
388 void SetUniform1i(
int loc,
int *val);
389 void SetUniform2i(
int loc,
int *val);
390 void SetUniform3i(
int loc,
int *val);
391 void SetUniform4i(
int loc,
int *val);
399 template<
typename T>
void SetUniform1it(
const char *
name, T *
value);
400 template<
typename T>
void SetUniform2it(
const char *name, T *value);
401 template<
typename T>
void SetUniform3it(
const char *name, T *value);
402 template<
typename T>
void SetUniform4it(
const char *name, T *value);
405 template<
typename T>
void SetUniform1ft(
const char *name, T *value);
406 template<
typename T>
void SetUniform2ft(
const char *name, T *value);
407 template<
typename T>
void SetUniform3ft(
const char *name, T *value);
408 template<
typename T>
void SetUniform4ft(
const char *name, T *value);
410 template<
typename T>
void SetUniform1it(
int loc, T *value);
411 template<
typename T>
void SetUniform2it(
int loc, T *value);
412 template<
typename T>
void SetUniform3it(
int loc, T *value);
413 template<
typename T>
void SetUniform4it(
int loc, T *value);
415 template<
typename T>
void SetUniform1ft(
int loc, T *value);
416 template<
typename T>
void SetUniform2ft(
int loc, T *value);
417 template<
typename T>
void SetUniform3ft(
int loc, T *value);
418 template<
typename T>
void SetUniform4ft(
int loc, T *value);
438 int GetUniformLocationInternal(
const char *name);
474 #define vtkShaderProgram2SetUniformCopyCastMacro(toLetter, toType, num) \ 475 template<typename fromType> \ 476 void vtkShaderProgram2::SetUniform##num##toLetter##t(const char *name, fromType *fvalues) \ 478 toType tvalues[num]; \ 479 for (int i=0; i<num; ++i) \ 481 tvalues[i] = static_cast<toType>(fvalues[i]); \ 483 this->SetUniform##num##toLetter(name, tvalues); \ 485 template<typename fromType> \ 486 void vtkShaderProgram2::SetUniform##num##toLetter##t(int location, fromType *fvalues) \ 488 assert(location!=-1); \ 489 toType tvalues[num]; \ 490 for (int i=0; i<num; ++i) \ 492 tvalues[i] = static_cast<toType>(fvalues[i]); \ 494 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
an ordered 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