VTK  9.2.20230320
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 =========================================================================*/
28 #ifndef vtkOpenGLRenderUtilities_h
29 #define vtkOpenGLRenderUtilities_h
30 
31 #include "vtkObject.h"
32 #include "vtkRenderingOpenGL2Module.h" // For export macro
33 
34 #include "vtk_glew.h" // Needed for GLuint.
35 #include <string> // for std::string
36 
37 VTK_ABI_NAMESPACE_BEGIN
41 class vtkShaderProgram;
42 
43 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLRenderUtilities : public vtkObject
44 {
45 public:
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
50 
56  static void RenderQuad(
57  float* verts, float* tcoords, vtkShaderProgram* program, vtkOpenGLVertexArrayObject* vao);
58  static void RenderTriangles(float* verts, unsigned int numVerts, GLuint* iboData,
59  unsigned int numIndices, float* tcoords, vtkShaderProgram* program,
62 
64 
112  static bool PrepFullScreenVAO(
114  static void DrawFullScreenQuad();
116 
117  // older signsature, we suggest you use the newer signature above
118  static bool PrepFullScreenVAO(
120 
129  static void MarkDebugEvent(const std::string& event);
130 
131 protected:
134 
135 private:
137  void operator=(const vtkOpenGLRenderUtilities&) = delete;
138 };
139 
140 VTK_ABI_NAMESPACE_END
141 #endif
a simple class to control print indentation
Definition: vtkIndent.h:120
abstract base class for most VTK objects
Definition: vtkObject.h:83
OpenGL buffer object.
OpenGL rendering utility functions.
static bool PrepFullScreenVAO(vtkOpenGLRenderWindow *renWin, vtkOpenGLVertexArrayObject *vao, vtkShaderProgram *prog)
Draw a full-screen quad:
static std::string GetFullScreenQuadVertexShader()
Draw a full-screen quad:
static std::string GetFullScreenQuadFragmentShaderTemplate()
Draw a full-screen quad:
static std::string GetFullScreenQuadGeometryShader()
Draw a full-screen quad:
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkOpenGLRenderUtilities() override
static void RenderTriangles(float *verts, unsigned int numVerts, GLuint *iboData, unsigned int numIndices, float *tcoords, vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
Helper function that draws a quad on the screen at the specified vertex coordinates and if tcoords ar...
static void RenderQuad(float *verts, float *tcoords, vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
Helper function that draws a quad on the screen at the specified vertex coordinates and if tcoords ar...
static bool PrepFullScreenVAO(vtkOpenGLBufferObject *vertBuf, vtkOpenGLVertexArrayObject *vao, vtkShaderProgram *prog)
static void MarkDebugEvent(const std::string &event)
Pass a debugging mark to the render engine to assist development via tools like apitrace.
static void DrawFullScreenQuad()
Draw a full-screen quad:
OpenGL rendering window.
The VertexArrayObject class uses, or emulates, vertex array objects.
The ShaderProgram uses one or more Shader objects.
@ string
Definition: vtkX3D.h:502