VTK  9.2.20230129
vtkOpenGLVertexArrayObject.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 =========================================================================*/
14 #ifndef vtkOpenGLVertexArrayObject_h
15 #define vtkOpenGLVertexArrayObject_h
16 
17 #include "vtkObject.h"
18 #include "vtkRenderingOpenGL2Module.h" // for export macro
19 #include <string> // For API.
20 
21 VTK_ABI_NAMESPACE_BEGIN
22 class vtkShaderProgram;
25 
37 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLVertexArrayObject : public vtkObject
38 {
39 public:
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
44  void Bind();
45 
46  void Release();
47 
49 
51 
53  const std::string& name, int offset, size_t stride, int elementType, int elementTupleSize,
54  bool normalize)
55  {
56  return this->AddAttributeArrayWithDivisor(
57  program, buffer, name, offset, stride, elementType, elementTupleSize, normalize, 0, false);
58  }
59 
61  const std::string& name, int offset, bool normalize);
62 
64  const std::string& name, int offset, size_t stride, int elementType, int elementTupleSize,
65  bool normalize, int divisor, bool isMatrix);
66 
68  const std::string& name, int offset, size_t stride, int elementType, int elementTupleSize,
69  bool normalize, int divisor, int tupleOffset);
70 
72 
73  // Force this VAO to emulate a vertex array object even if
74  // the system supports VAOs. This can be useful in cases where
75  // the vertex array object does not handle all extensions.
76  void SetForceEmulation(bool val);
77 
78 protected:
81 
82 private:
84  void operator=(const vtkOpenGLVertexArrayObject&) = delete;
85  class Private;
86  Private* Internal;
87 };
88 
89 VTK_ABI_NAMESPACE_END
90 #endif // vtkOpenGLVertexArrayObject_h
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.
The VertexArrayObject class uses, or emulates, vertex array objects.
bool AddAttributeArrayWithDivisor(vtkShaderProgram *program, vtkOpenGLBufferObject *buffer, const std::string &name, int offset, size_t stride, int elementType, int elementTupleSize, bool normalize, int divisor, bool isMatrix)
bool AddAttributeMatrixWithDivisor(vtkShaderProgram *program, vtkOpenGLBufferObject *buffer, const std::string &name, int offset, size_t stride, int elementType, int elementTupleSize, bool normalize, int divisor, int tupleOffset)
bool AddAttributeArray(vtkShaderProgram *program, vtkOpenGLVertexBufferObject *buffer, const std::string &name, int offset, bool normalize)
~vtkOpenGLVertexArrayObject() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bool AddAttributeArray(vtkShaderProgram *program, vtkOpenGLBufferObject *buffer, const std::string &name, int offset, size_t stride, int elementType, int elementTupleSize, bool normalize)
static vtkOpenGLVertexArrayObject * New()
bool RemoveAttributeArray(const std::string &name)
void SetForceEmulation(bool val)
The ShaderProgram uses one or more Shader objects.
@ name
Definition: vtkX3D.h:231
@ offset
Definition: vtkX3D.h:450
@ string
Definition: vtkX3D.h:502