VTK  9.1.0
vtkTextureUnitManager.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkTextureUnitManager.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
30#ifndef vtkTextureUnitManager_h
31#define vtkTextureUnitManager_h
32
33#include "vtkObject.h"
34#include "vtkRenderingOpenGL2Module.h" // For export macro
35
37
38class VTKRENDERINGOPENGL2_EXPORT vtkTextureUnitManager : public vtkObject
39{
40public:
42
43 void PrintSelf(ostream& os, vtkIndent indent) override;
44
46
50 void Initialize();
51
56
64 virtual int Allocate();
65
77 virtual int Allocate(int unit);
78
84 bool IsAllocated(int textureUnitId);
85
91 virtual void Free(int textureUnitId);
92
93protected:
98
103
109
112
113private:
115 void operator=(const vtkTextureUnitManager&) = delete;
116};
117
118#endif
a simple class to control print indentation
Definition: vtkIndent.h:113
abstract base class for most VTK objects
Definition: vtkObject.h:73
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.