VTK
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 "vtkRenderingOpenGL2Module.h" // For export macro
34 #include "vtkObject.h"
35 
37 
38 class VTKRENDERINGOPENGL2_EXPORT vtkTextureUnitManager : public vtkObject
39 {
40 public:
42 
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
46 
48 
55  vtkGetObjectMacro(Context,vtkOpenGLRenderWindow);
57 
62 
70  virtual int Allocate();
71 
83  virtual int Allocate(int unit);
84 
89  bool IsAllocated(int textureUnitId);
90 
96  virtual void Free(int textureUnitId);
97 
98 protected:
103 
108 
113  void DeleteTable();
114 
116 
119 
120 private:
122  void operator=(const vtkTextureUnitManager&) = delete;
123 };
124 
125 #endif
vtkTextureUnitManager::~vtkTextureUnitManager
~vtkTextureUnitManager() override
Destructor.
vtkTextureUnitManager::TextureUnits
bool * TextureUnits
Definition: vtkTextureUnitManager.h:118
vtkTextureUnitManager::Allocate
virtual int Allocate(int unit)
Reserve a specific texture unit if not already in use.
vtkTextureUnitManager::Free
virtual void Free(int textureUnitId)
Release a texture unit.
vtkTextureUnitManager::Context
vtkOpenGLRenderWindow * Context
Definition: vtkTextureUnitManager.h:115
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkTextureUnitManager::Allocate
virtual int Allocate()
Reserve a texture unit.
vtkTextureUnitManager::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTextureUnitManager
allocate/free texture units.
Definition: vtkTextureUnitManager.h:39
vtkTextureUnitManager::DeleteTable
void DeleteTable()
Delete the allocation table and check if it is not called before all the texture units have been rele...
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkTextureUnitManager::IsAllocated
bool IsAllocated(int textureUnitId)
Tell if texture unit ‘textureUnitId’ is already allocated.
vtkTextureUnitManager::New
static vtkTextureUnitManager * New()
vtkObject.h
vtkTextureUnitManager::GetNumberOfTextureUnits
int GetNumberOfTextureUnits()
Number of texture units supported by the OpenGL context.
vtkTextureUnitManager::vtkTextureUnitManager
vtkTextureUnitManager()
Default constructor.
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition: vtkOpenGLRenderWindow.h:54
vtkTextureUnitManager::SetContext
void SetContext(vtkOpenGLRenderWindow *context)
Get/Set the context.
vtkTextureUnitManager::NumberOfTextureUnits
int NumberOfTextureUnits
Definition: vtkTextureUnitManager.h:117