VTK  9.7.20260912
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
15
16#ifndef vtkOpenGLRenderUtilities_h
17#define vtkOpenGLRenderUtilities_h
18
19#include "vtkObject.h"
20#include "vtkRenderingOpenGL2Module.h" // For export macro
21
22#include "vtk_glad.h" // Needed for GLuint.
23#include <string> // for std::string
24
25VTK_ABI_NAMESPACE_BEGIN
29class vtkOpenGLState;
31class vtkRenderState;
34
35class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLRenderUtilities : public vtkObject
36{
37public:
39 void PrintSelf(ostream& os, vtkIndent indent) override;
40
42
48 static void RenderQuad(
49 float* verts, float* tcoords, vtkShaderProgram* program, vtkOpenGLVertexArrayObject* vao);
50 static void RenderTriangles(float* verts, unsigned int numVerts, GLuint* iboData,
51 unsigned int numIndices, float* tcoords, vtkShaderProgram* program,
54
63 static bool CompositeColorTexture(vtkOpenGLState* state, const vtkRenderState* renderState,
64 vtkOpenGLRenderWindow* renderWindow, vtkOpenGLFramebufferObject* readFramebuffer,
65 vtkTextureObject* colorTexture, int dstXmin, int dstYmin, int width, int height);
66
68
113 static std::string GetFullScreenQuadVertexShader();
116 static bool PrepFullScreenVAO(
118 static void DrawFullScreenQuad();
120
121 // older signsature, we suggest you use the newer signature above
122 static bool PrepFullScreenVAO(
124
133 static void MarkDebugEvent(const std::string& event);
134
135protected:
138
139private:
141 void operator=(const vtkOpenGLRenderUtilities&) = delete;
142};
143
144VTK_ABI_NAMESPACE_END
145#endif
a simple class to control print indentation
Definition vtkIndent.h:108
OpenGL buffer object.
Internal class which encapsulates OpenGL FramebufferObject.
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 bool CompositeColorTexture(vtkOpenGLState *state, const vtkRenderState *renderState, vtkOpenGLRenderWindow *renderWindow, vtkOpenGLFramebufferObject *readFramebuffer, vtkTextureObject *colorTexture, int dstXmin, int dstYmin, int width, int height)
Composite a render pass result into the current draw framebuffer: blit it out of readFramebuffer when...
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.
OpenGL state storage.
The VertexArrayObject class uses, or emulates, vertex array objects.
Context in which a vtkRenderPass will render.
The ShaderProgram uses one or more Shader objects.
abstracts an OpenGL texture object.