VTK  9.1.0
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
24
36class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLVertexArrayObject : public vtkObject
37{
38public:
41 void PrintSelf(ostream& os, vtkIndent indent) override;
42
43 void Bind();
44
45 void Release();
46
48
50
52 const std::string& name, int offset, size_t stride, int elementType, int elementTupleSize,
53 bool normalize)
54 {
55 return this->AddAttributeArrayWithDivisor(
56 program, buffer, name, offset, stride, elementType, elementTupleSize, normalize, 0, false);
57 }
58
60 const std::string& name, int offset, bool normalize);
61
63 const std::string& name, int offset, size_t stride, int elementType, int elementTupleSize,
64 bool normalize, int divisor, bool isMatrix);
65
67 const std::string& name, int offset, size_t stride, int elementType, int elementTupleSize,
68 bool normalize, int divisor, int tupleOffset);
69
70 bool RemoveAttributeArray(const std::string& name);
71
72 // Force this VAO to emulate a vertex array object even if
73 // the system supports VAOs. This can be useful in cases where
74 // the vertex array object does not handle all extensions.
75 void SetForceEmulation(bool val);
76
77protected:
80
81private:
83 void operator=(const vtkOpenGLVertexArrayObject&) = delete;
84 class Private;
85 Private* Internal;
86};
87
88#endif // vtkOpenGLVertexArrayObject_h
a simple class to control print indentation
Definition: vtkIndent.h:113
abstract base class for most VTK objects
Definition: vtkObject.h:82
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.