VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkTextureUnitManager.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00029 #ifndef __vtkTextureUnitManager_h 00030 #define __vtkTextureUnitManager_h 00031 00032 #include "vtkRenderingOpenGLModule.h" // For export macro 00033 #include "vtkObject.h" 00034 00035 class vtkOpenGLRenderWindow; 00036 00037 class VTKRENDERINGOPENGL_EXPORT vtkTextureUnitManager : public vtkObject 00038 { 00039 public: 00040 vtkTypeMacro(vtkTextureUnitManager,vtkObject); 00041 00042 void PrintSelf(ostream& os, vtkIndent indent); 00043 00044 static vtkTextureUnitManager *New(); 00045 00047 00051 void SetContext(vtkOpenGLRenderWindow *context); 00052 vtkGetObjectMacro(Context,vtkOpenGLRenderWindow); 00054 00056 int GetNumberOfTextureUnits(); 00057 00063 virtual int Allocate(); 00064 00068 bool IsAllocated(int textureUnitId); 00069 00073 virtual void Free(int textureUnitId); 00074 00075 protected: 00077 vtkTextureUnitManager(); 00078 00080 ~vtkTextureUnitManager(); 00081 00084 void DeleteTable(); 00085 00086 vtkOpenGLRenderWindow *Context; 00087 00088 int NumberOfTextureUnits; 00089 bool *TextureUnits; 00090 00091 private: 00092 vtkTextureUnitManager(const vtkTextureUnitManager&); // Not implemented. 00093 void operator=(const vtkTextureUnitManager&); // Not implemented. 00094 }; 00095 00096 #endif