VTK  9.0.20200807
vtkOpenGLQuadHelper.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 =========================================================================*/
43 #ifndef vtkOpenGLQuadHelper_h
44 #define vtkOpenGLQuadHelper_h
45 
46 #include "vtkRenderingOpenGL2Module.h" // for export macro
47 #include "vtkTimeStamp.h"
48 #include <memory> // for std::unique_ptr
49 
52 class vtkShaderProgram;
54 class vtkWindow;
55 
56 // Helper class to render full screen quads
57 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLQuadHelper
58 {
59 public:
63  unsigned int ShaderChangeValue;
64 
65  // create a quadhelper with the provided shaders
66  // if the vertex is nullptr
67  // then the default is used. Note that this
68  // class should be destroyed upon
69  // ReleaseGraphicsResources
70  vtkOpenGLQuadHelper(vtkOpenGLRenderWindow*, const char* vs, const char* fs, const char* gs);
71 
73 
74  // Draw the Quad, will bind the VAO for you
75  void Render();
76 
82  void ReleaseGraphicsResources(vtkWindow*);
83 
84 private:
86  vtkOpenGLQuadHelper& operator=(const vtkOpenGLQuadHelper&) = delete;
87  std::unique_ptr<vtkGenericOpenGLResourceFreeCallback> ResourceCallback;
88 };
89 
90 #endif // vtkOpenGLQuadHelper_h
91 
92 // VTK-HeaderTest-Exclude: vtkOpenGLQuadHelper.h
vtkTimeStamp.h
vtkOpenGLQuadHelper::ShaderSourceTime
vtkTimeStamp ShaderSourceTime
Definition: vtkOpenGLQuadHelper.h:61
vtkOpenGLQuadHelper::VAO
vtkOpenGLVertexArrayObject * VAO
Definition: vtkOpenGLQuadHelper.h:62
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:32
vtkOpenGLQuadHelper
Class to make rendering a full screen quad easier.
Definition: vtkOpenGLQuadHelper.h:57
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
vtkShaderProgram
The ShaderProgram uses one or more Shader objects.
Definition: vtkShaderProgram.h:44
vtkGenericOpenGLResourceFreeCallback
Definition: vtkOpenGLResourceFreeCallback.h:25
vtkOpenGLQuadHelper::ShaderChangeValue
unsigned int ShaderChangeValue
Definition: vtkOpenGLQuadHelper.h:63
vtkOpenGLQuadHelper::Program
vtkShaderProgram * Program
Definition: vtkOpenGLQuadHelper.h:60
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition: vtkOpenGLRenderWindow.h:53
vtkOpenGLVertexArrayObject
The VertexArrayObject class uses, or emulates, vertex array objects.
Definition: vtkOpenGLVertexArrayObject.h:36