VTK: Rendering/ContextOpenGL2/vtkOpenGLContextDeviceBufferObjectBuilder.h Source File

| VTK 9.3.1

vtkOpenGLContextDeviceBufferObjectBuilder.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
10 #ifndef vtkOpenGLContextDeviceBufferObjectBuilder_h
11 #define vtkOpenGLContextDeviceBufferObjectBuilder_h
12
13 #include "vtkFloatArray.h"
14 #include "vtkNew.h"
15 #include "vtkOpenGLHelper.h"
16 #include "vtkOpenGLVertexBufferObjectCache.h"
17 #include "vtkOpenGLVertexBufferObjectGroup.h"
18 #include "vtkRenderWindow.h"
19 #include "vtkRenderingContextOpenGL2Module.h" // for export macro
20 #include "vtkUnsignedCharArray.h"
21
22 #include <cstdint> // for std::uintptr_t
23 #include <unordered_map> // for std::unordered_map
24
25 VTK_ABI_NAMESPACE_BEGIN
26 class VTKRENDERINGCONTEXTOPENGL2_NO_EXPORT vtkOpenGLContextDeviceBufferObjectBuilder
27 {
28 public:
34 void BuildVBO(vtkOpenGLHelper* cbo, vtkDataArray* positions, vtkUnsignedCharArray* colors,
35 vtkFloatArray* tcoords, std::uintptr_t cacheIdentifier, vtkRenderWindow* renderWindow);
36
40 void Erase(std::uintptr_t cacheIdentifier, vtkRenderWindow* renderWindow);
41
42 private:
43 std::unordered_map<std::size_t, vtkSmartPointer<vtkOpenGLVertexBufferObjectGroup>> VBOGroups;
44 };
45
46 VTK_ABI_NAMESPACE_END
47 #endif // vtkOpenGLContextDeviceBufferObjectBuilder_h
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:40
vtkOpenGLContextDeviceBufferObjectBuilder
Internal buffer object builder that maintains a cache of VBO groups.
Definition: vtkOpenGLContextDeviceBufferObjectBuilder.h:27
vtkOpenGLContextDeviceBufferObjectBuilder::BuildVBO
void BuildVBO(vtkOpenGLHelper *cbo, vtkDataArray *positions, vtkUnsignedCharArray *colors, vtkFloatArray *tcoords, std::uintptr_t cacheIdentifier, vtkRenderWindow *renderWindow)
Build vertex buffer objects for these data arrays and add vertex attribute specifications to the vert...
vtkOpenGLContextDeviceBufferObjectBuilder::Erase
void Erase(std::uintptr_t cacheIdentifier, vtkRenderWindow *renderWindow)
Erase cache entry for given identifier.
vtkOpenGLHelper
Definition: vtkOpenGLHelper.h:21
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:95
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:40
vtkFloatArray.h
vtkNew.h
vtkOpenGLHelper.h
vtkOpenGLVertexBufferObjectCache.h
vtkOpenGLVertexBufferObjectGroup.h
vtkRenderWindow.h
vtkUnsignedCharArray.h