VTK: Rendering/OpenGL2/vtkTextureUnitManager.h Source File

| VTK 9.3.1

vtkTextureUnitManager.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
18 #ifndef vtkTextureUnitManager_h
19 #define vtkTextureUnitManager_h
20
21 #include "vtkObject.h"
22 #include "vtkRenderingOpenGL2Module.h" // For export macro
23
24 VTK_ABI_NAMESPACE_BEGIN
25 class vtkOpenGLRenderWindow;
26
27 class VTKRENDERINGOPENGL2_EXPORT vtkTextureUnitManager : public vtkObject
28 {
29 public:
30 vtkTypeMacro(vtkTextureUnitManager, vtkObject);
31
32 void PrintSelf(ostream& os, vtkIndent indent) override;
33
34 static vtkTextureUnitManager* New();
35
39 void Initialize();
40
44 int GetNumberOfTextureUnits();
45
53 virtual int Allocate();
54
66 virtual int Allocate(int unit);
67
73 bool IsAllocated(int textureUnitId);
74
80 virtual void Free(int textureUnitId);
81
82 protected:
86 vtkTextureUnitManager();
87
91 ~vtkTextureUnitManager() override;
92
97 void DeleteTable();
98
99 int NumberOfTextureUnits;
100 bool* TextureUnits;
101
102 private:
103 vtkTextureUnitManager(const vtkTextureUnitManager&) = delete;
104 void operator=(const vtkTextureUnitManager&) = delete;
105 };
106
107 VTK_ABI_NAMESPACE_END
108 #endif
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition: vtkOpenGLRenderWindow.h:53
vtkTextureUnitManager
allocate/free texture units.
Definition: vtkTextureUnitManager.h:28
vtkTextureUnitManager::Initialize
void Initialize()
Update the number of hardware texture units for the current context.
vtkTextureUnitManager::Free
virtual void Free(int textureUnitId)
Release a texture unit.
vtkTextureUnitManager::New
static vtkTextureUnitManager * New()
vtkTextureUnitManager::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTextureUnitManager::vtkTextureUnitManager
vtkTextureUnitManager()
Default constructor.
vtkTextureUnitManager::Allocate
virtual int Allocate(int unit)
Reserve a specific texture unit if not already in use.
vtkTextureUnitManager::IsAllocated
bool IsAllocated(int textureUnitId)
Tell if texture unit ‘textureUnitId’ is already allocated.
vtkTextureUnitManager::GetNumberOfTextureUnits
int GetNumberOfTextureUnits()
Number of texture units supported by the OpenGL context.
vtkTextureUnitManager::TextureUnits
bool * TextureUnits
Definition: vtkTextureUnitManager.h:100
vtkTextureUnitManager::DeleteTable
void DeleteTable()
Delete the allocation table and check if it is not called before all the texture units have been rele...
vtkTextureUnitManager::~vtkTextureUnitManager
~vtkTextureUnitManager() override
Destructor.
vtkTextureUnitManager::NumberOfTextureUnits
int NumberOfTextureUnits
Definition: vtkTextureUnitManager.h:99
vtkTextureUnitManager::Allocate
virtual int Allocate()
Reserve a texture unit.
vtkObject.h