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"
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
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:30
Internal buffer object builder that maintains a cache of VBO groups.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
dynamic, self-adjusting array of unsigned char
create a window for renderers to draw into