#include <vtkTextureUnitManager.h>
vtkTextureUnitManager is a central place used by shaders to reserve a texture unit ( Allocate() ) or release it ( Free() ).
Don't create a vtkTextureUnitManager, query it from the vtkOpenGLRenderWindow
Definition at line 36 of file vtkTextureUnitManager.h.
Public Types | |
typedef vtkObject | Superclass |
Public Member Functions | |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) |
int | GetNumberOfTextureUnits () |
virtual int | Allocate () |
bool | IsAllocated (int textureUnitId) |
virtual void | Free (int textureUnitId) |
void | SetContext (vtkOpenGLRenderWindow *context) |
virtual vtkOpenGLRenderWindow * | GetContext () |
Static Public Member Functions | |
static int | IsTypeOf (const char *type) |
static vtkTextureUnitManager * | SafeDownCast (vtkObject *o) |
static vtkTextureUnitManager * | New () |
Protected Member Functions | |
vtkTextureUnitManager () | |
~vtkTextureUnitManager () | |
void | DeleteTable () |
Protected Attributes | |
vtkOpenGLRenderWindow * | Context |
int | NumberOfTextureUnits |
bool * | TextureUnits |
vtkTextureUnitManager::vtkTextureUnitManager | ( | ) | [protected] |
Default constructor.
vtkTextureUnitManager::~vtkTextureUnitManager | ( | ) | [protected] |
Destructor.
virtual const char* vtkTextureUnitManager::GetClassName | ( | ) | [virtual] |
Reimplemented from vtkObject.
static int vtkTextureUnitManager::IsTypeOf | ( | const char * | name | ) | [static] |
Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkObject.
virtual int vtkTextureUnitManager::IsA | ( | const char * | name | ) | [virtual] |
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkObject.
static vtkTextureUnitManager* vtkTextureUnitManager::SafeDownCast | ( | vtkObject * | o | ) | [static] |
Reimplemented from vtkObject.
void vtkTextureUnitManager::PrintSelf | ( | ostream & | os, | |
vtkIndent | indent | |||
) | [virtual] |
static vtkTextureUnitManager* vtkTextureUnitManager::New | ( | ) | [static] |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkObject.
void vtkTextureUnitManager::SetContext | ( | vtkOpenGLRenderWindow * | context | ) |
Get/Set the context. This does not increase the reference count of the context to avoid reference loops. SetContext() may raise an error is the OpenGL context does not support the required OpenGL extensions.
virtual vtkOpenGLRenderWindow* vtkTextureUnitManager::GetContext | ( | ) | [virtual] |
Get/Set the context. This does not increase the reference count of the context to avoid reference loops. SetContext() may raise an error is the OpenGL context does not support the required OpenGL extensions.
int vtkTextureUnitManager::GetNumberOfTextureUnits | ( | ) |
Number of texture units supported by the OpenGL context.
virtual int vtkTextureUnitManager::Allocate | ( | ) | [virtual] |
Reserve a texture unit. It returns its number. It returns -1 if the allocation failed (because there is no more texture unit left).
allocated: result==-1 || this->IsAllocated(result)
bool vtkTextureUnitManager::IsAllocated | ( | int | textureUnitId | ) |
Tell if texture unit `textureUnitId' is already allocated.
virtual void vtkTextureUnitManager::Free | ( | int | textureUnitId | ) | [virtual] |
Release a texture unit.
allocated_textureUnitId: this->IsAllocated(textureUnitId)
void vtkTextureUnitManager::DeleteTable | ( | ) | [protected] |
Delete the allocation table and check if it is not called before all the texture units have been released.
vtkOpenGLRenderWindow* vtkTextureUnitManager::Context [protected] |
Definition at line 85 of file vtkTextureUnitManager.h.
int vtkTextureUnitManager::NumberOfTextureUnits [protected] |
Definition at line 87 of file vtkTextureUnitManager.h.
bool* vtkTextureUnitManager::TextureUnits [protected] |
Definition at line 88 of file vtkTextureUnitManager.h.