VTK
dox
Rendering
OpenGL2
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 "vtkRenderingOpenGL2Module.h"
// for export macro
18
#include "
vtkObject.h
"
19
#include <string>
// For API.
20
21
class
vtkShaderProgram
;
22
class
vtkOpenGLBufferObject
;
23
class
vtkOpenGLVertexBufferObject
;
24
36
class
VTKRENDERINGOPENGL2_EXPORT
vtkOpenGLVertexArrayObject
:
public
vtkObject
37
{
38
public
:
39
static
vtkOpenGLVertexArrayObject
*
New
();
40
vtkTypeMacro(
vtkOpenGLVertexArrayObject
,
vtkObject
)
41
void
PrintSelf
(ostream& os,
vtkIndent
indent)
override
;
42
43
void
Bind();
44
45
void
Release
();
46
47
void
ReleaseGraphicsResources();
48
49
void
ShaderProgramChanged();
50
51
bool
AddAttributeArray
(
vtkShaderProgram
*program,
52
vtkOpenGLBufferObject
*buffer,
53
const
std::string
&
name
,
int
offset
,
size_t
stride,
54
int
elementType,
int
elementTupleSize,
bool
normalize)
55
{
56
return
this->AddAttributeArrayWithDivisor(program, buffer,
name
,
57
offset
,stride,elementType, elementTupleSize, normalize, 0,
false
);
58
}
59
60
bool
AddAttributeArray(
vtkShaderProgram
*program,
61
vtkOpenGLVertexBufferObject
*buffer,
62
const
std::string
&
name
,
int
offset
,
bool
normalize);
63
64
bool
AddAttributeArrayWithDivisor(
vtkShaderProgram
*program,
65
vtkOpenGLBufferObject
*buffer,
66
const
std::string
&
name
,
int
offset
,
size_t
stride,
67
int
elementType,
int
elementTupleSize,
bool
normalize,
68
int
divisor,
bool
isMatrix);
69
70
bool
AddAttributeMatrixWithDivisor(
vtkShaderProgram
*program,
71
vtkOpenGLBufferObject
*buffer,
72
const
std::string
&
name
,
int
offset
,
size_t
stride,
73
int
elementType,
int
elementTupleSize,
bool
normalize,
74
int
divisor,
int
tupleOffset);
75
76
bool
RemoveAttributeArray(
const
std::string
&
name
);
77
78
// Force this VAO to emulate a vertex array object even if
79
// the system supports VAOs. This can be useful in cases where
80
// the vertex array object does not handle all extensions.
81
void
SetForceEmulation(
bool
val);
82
83
protected
:
84
vtkOpenGLVertexArrayObject
();
85
~
vtkOpenGLVertexArrayObject
()
override
;
86
87
private
:
88
vtkOpenGLVertexArrayObject
(
89
const
vtkOpenGLVertexArrayObject
&) =
delete
;
90
void
operator=(
const
vtkOpenGLVertexArrayObject
&) =
delete
;
91
class
Private;
92
Private *Internal;
93
};
94
95
#endif // vtkOpenGLVertexArrayObject_h
vtkOpenGLBufferObject
OpenGL buffer object.
Definition:
vtkOpenGLBufferObject.h:33
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkObject
abstract base class for most VTK objects
Definition:
vtkObject.h:59
vtkOpenGLVertexArrayObject::AddAttributeArray
bool AddAttributeArray(vtkShaderProgram *program, vtkOpenGLBufferObject *buffer, const std::string &name, int offset, size_t stride, int elementType, int elementTupleSize, bool normalize)
Definition:
vtkOpenGLVertexArrayObject.h:51
vtkEventDataAction::Release
vtkX3D::offset
Definition:
vtkX3D.h:438
vtkShaderProgram
The ShaderProgram uses one or more Shader objects.
Definition:
vtkShaderProgram.h:47
vtkIndent
a simple class to control print indentation
Definition:
vtkIndent.h:39
vtkOpenGLVertexBufferObject
Definition:
vtkOpenGLVertexBufferObject.h:38
vtkObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkX3D::name
Definition:
vtkX3D.h:219
vtkObject.h
vtkX3D::string
Definition:
vtkX3D.h:490
vtkOpenGLVertexArrayObject
The VertexArrayObject class uses, or emulates, vertex array objects.
Definition:
vtkOpenGLVertexArrayObject.h:36
Generated by
1.8.16