VTK  9.4.20241118
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
24VTK_ABI_NAMESPACE_BEGIN
26
27class VTKRENDERINGOPENGL2_EXPORT vtkTextureUnitManager : public vtkObject
28{
29public:
31
32 void PrintSelf(ostream& os, vtkIndent indent) override;
33
35
39 void Initialize();
40
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
82protected:
87
92
98
101
102private:
104 void operator=(const vtkTextureUnitManager&) = delete;
105};
106
107VTK_ABI_NAMESPACE_END
108#endif
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
OpenGL rendering window.
allocate/free texture units.
void Initialize()
Update the number of hardware texture units for the current context.
virtual void Free(int textureUnitId)
Release a texture unit.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTextureUnitManager()
Default constructor.
virtual int Allocate(int unit)
Reserve a specific texture unit if not already in use.
bool IsAllocated(int textureUnitId)
Tell if texture unit ‘textureUnitId’ is already allocated.
int GetNumberOfTextureUnits()
Number of texture units supported by the OpenGL context.
void DeleteTable()
Delete the allocation table and check if it is not called before all the texture units have been rele...
~vtkTextureUnitManager() override
Destructor.
static vtkTextureUnitManager * New()
virtual int Allocate()
Reserve a texture unit.