VTK  9.4.20241104
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
10VTK_ABI_NAMESPACE_BEGIN
14
26class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLVertexArrayObject : public vtkObject
27{
28public:
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
60 bool RemoveAttributeArray(const std::string& name);
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
67protected:
70
71private:
73 void operator=(const vtkOpenGLVertexArrayObject&) = delete;
74 class Private;
75 Private* Internal;
76};
77
78VTK_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:162
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.
static vtkOpenGLVertexArrayObject * New()
bool AddAttributeArray(vtkShaderProgram *program, vtkOpenGLBufferObject *buffer, const std::string &name, int offset, size_t stride, int elementType, int elementTupleSize, bool normalize)
bool RemoveAttributeArray(const std::string &name)
void SetForceEmulation(bool val)
The ShaderProgram uses one or more Shader objects.