VTK
vtkShader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4 
5  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
6  All rights reserved.
7  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notice for more information.
12 
13 =========================================================================*/
20 #ifndef vtkShader_h
21 #define vtkShader_h
22 
23 #include "vtkRenderingOpenGL2Module.h" // for export macro
24 #include "vtkObject.h"
25 
26 #include <string> // For member variables.
27 
35 class VTKRENDERINGOPENGL2_EXPORT vtkShader : public vtkObject
36 {
37 public:
38  static vtkShader *New();
40  void PrintSelf(ostream& os, vtkIndent indent);
41 
42 
44  enum Type {
48  Unknown
49  };
50 
52  void SetType(Type type);
53 
55  Type GetType() const { return ShaderType; }
56 
58  void SetSource(const std::string &source);
59 
61  std::string GetSource() const { return Source; }
62 
64  std::string GetError() const { return Error; }
65 
67  int GetHandle() const { return Handle; }
68 
72  bool Compile();
73 
78  void Cleanup();
79 
80 protected:
81  vtkShader();
82  ~vtkShader();
83 
85  int Handle;
86  bool Dirty;
87 
90 
91 private:
92  vtkShader(const vtkShader&); // Not implemented.
93  void operator=(const vtkShader&); // Not implemented.
94 };
95 
96 
97 #endif
Type GetType() const
Get the shader type, typically Vertex or Fragment.
Definition: vtkShader.h:55
GLuint GLuint GLsizei GLenum type
Definition: vtkgl.h:11315
abstract base class for most VTK objects
Definition: vtkObject.h:61
Geometry shader.
Definition: vtkShader.h:47
Type
Available shader types.
Definition: vtkShader.h:44
std::string Error
Definition: vtkShader.h:89
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:632
Fragment shader.
Definition: vtkShader.h:46
bool Dirty
Definition: vtkShader.h:86
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
int GetHandle() const
Get the handle of the shader.
Definition: vtkShader.h:67
std::string Source
Definition: vtkShader.h:88
std::string GetError() const
Get the error message (empty if none) for the shader.
Definition: vtkShader.h:64
int Handle
Definition: vtkShader.h:85
Type ShaderType
Definition: vtkShader.h:84
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Vertex or Fragment shader, combined into a ShaderProgram.
Definition: vtkShader.h:35
std::string GetSource() const
Get the source for the shader.
Definition: vtkShader.h:61
static vtkObject * New()
Vertex shader.
Definition: vtkShader.h:45
GLsizei const GLchar ** string
Definition: vtkgl.h:12011