VTK  9.3.20240328
vtkOpenGLVertexArrayObject.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
3 #ifndef vtkOpenGLVertexArrayObject_h
4 #define vtkOpenGLVertexArrayObject_h
5 
6 #include "vtkObject.h"
7 #include "vtkRenderingOpenGL2Module.h" // for export macro
8 #include <string> // For API.
9 
10 VTK_ABI_NAMESPACE_BEGIN
11 class vtkShaderProgram;
14 
26 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLVertexArrayObject : public vtkObject
27 {
28 public:
31  void PrintSelf(ostream& os, vtkIndent indent) override;
32 
33  void Bind();
34 
35  void Release();
36 
38 
40 
42  const std::string& name, int offset, size_t stride, int elementType, int elementTupleSize,
43  bool normalize)
44  {
45  return this->AddAttributeArrayWithDivisor(
46  program, buffer, name, offset, stride, elementType, elementTupleSize, normalize, 0, false);
47  }
48 
50  const std::string& name, int offset, bool normalize);
51 
53  const std::string& name, int offset, size_t stride, int elementType, int elementTupleSize,
54  bool normalize, int divisor, bool isMatrix);
55 
57  const std::string& name, int offset, size_t stride, int elementType, int elementTupleSize,
58  bool normalize, int divisor, int tupleOffset);
59 
61 
62  // Force this VAO to emulate a vertex array object even if
63  // the system supports VAOs. This can be useful in cases where
64  // the vertex array object does not handle all extensions.
65  void SetForceEmulation(bool val);
66 
67 protected:
70 
71 private:
73  void operator=(const vtkOpenGLVertexArrayObject&) = delete;
74  class Private;
75  Private* Internal;
76 };
77 
78 VTK_ABI_NAMESPACE_END
79 #endif // vtkOpenGLVertexArrayObject_h
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.
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:219
@ offset
Definition: vtkX3D.h:438
@ string
Definition: vtkX3D.h:490