VTK
vtkOpenGLRenderUtilities.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOpenGLRenderUtilities.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
25 #ifndef vtkOpenGLRenderUtilities_h
26 #define vtkOpenGLRenderUtilities_h
27 
28 #include "vtkRenderingOpenGL2Module.h" // For export macro
29 #include "vtkObject.h"
30 
31 #include "vtk_glew.h" // Needed for GLuint.
32 #include <string> // for std::string
33 
37 class vtkShaderProgram;
38 
39 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLRenderUtilities : public vtkObject
40 {
41 public:
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
46 
52  static void RenderQuad(
53  float *verts, float *tcoords,
55  static void RenderTriangles(
56  float *verts, unsigned int numVerts,
57  GLuint *indices, unsigned int numIndices,
58  float *tcoords,
61 
63 
108  static std::string GetFullScreenQuadVertexShader();
109  static std::string GetFullScreenQuadFragmentShaderTemplate();
110  static std::string GetFullScreenQuadGeometryShader();
111  static bool PrepFullScreenVAO(vtkOpenGLRenderWindow *renWin,
113  vtkShaderProgram *prog);
114  static void DrawFullScreenQuad();
116 
117  // older signsature, we suggest you use the newer signature above
118  static bool PrepFullScreenVAO(vtkOpenGLBufferObject *verts,
120  vtkShaderProgram *prog);
121 
130  static void MarkDebugEvent(const std::string &event);
131 
132 protected:
134  ~vtkOpenGLRenderUtilities() override;
135 
136 private:
138  void operator=(const vtkOpenGLRenderUtilities&) = delete;
139 };
140 
141 #endif
OpenGL rendering window.
abstract base class for most VTK objects
Definition: vtkObject.h:59
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
OpenGL rendering utility functions.
a simple class to control print indentation
Definition: vtkIndent.h:39
The VertexArrayObject class uses, or emulates, vertex array objects.
OpenGL buffer object.
The ShaderProgram uses one or more Shader objects.