VTK  9.3.20240327
vtkOpenGLRenderUtilities.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
16 #ifndef vtkOpenGLRenderUtilities_h
17 #define vtkOpenGLRenderUtilities_h
18 
19 #include "vtkObject.h"
20 #include "vtkRenderingOpenGL2Module.h" // For export macro
21 
22 #include "vtk_glew.h" // Needed for GLuint.
23 #include <string> // for std::string
24 
25 VTK_ABI_NAMESPACE_BEGIN
29 class vtkShaderProgram;
30 
31 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLRenderUtilities : public vtkObject
32 {
33 public:
35  void PrintSelf(ostream& os, vtkIndent indent) override;
36 
38 
44  static void RenderQuad(
45  float* verts, float* tcoords, vtkShaderProgram* program, vtkOpenGLVertexArrayObject* vao);
46  static void RenderTriangles(float* verts, unsigned int numVerts, GLuint* iboData,
47  unsigned int numIndices, float* tcoords, vtkShaderProgram* program,
50 
52 
100  static bool PrepFullScreenVAO(
102  static void DrawFullScreenQuad();
104 
105  // older signsature, we suggest you use the newer signature above
106  static bool PrepFullScreenVAO(
108 
117  static void MarkDebugEvent(const std::string& event);
118 
119 protected:
122 
123 private:
125  void operator=(const vtkOpenGLRenderUtilities&) = delete;
126 };
127 
128 VTK_ABI_NAMESPACE_END
129 #endif
a simple class to control print indentation
Definition: vtkIndent.h:108
abstract base class for most VTK objects
Definition: vtkObject.h:161
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:490