00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkOpenGLTexture.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 =========================================================================*/ 00022 #ifndef __vtkOpenGLTexture_h 00023 #define __vtkOpenGLTexture_h 00024 00025 #include "vtkTexture.h" 00026 //BTX 00027 #include "vtkWeakPointer.h" // needed for vtkWeakPointer. 00028 //ETX 00029 00030 class vtkWindow; 00031 class vtkOpenGLRenderer; 00032 class vtkRenderWindow; 00033 class vtkPixelBufferObject; 00034 00035 class VTK_RENDERING_EXPORT vtkOpenGLTexture : public vtkTexture 00036 { 00037 public: 00038 static vtkOpenGLTexture *New(); 00039 vtkTypeMacro(vtkOpenGLTexture,vtkTexture); 00040 virtual void PrintSelf(ostream& os, vtkIndent indent); 00041 00043 void Load(vtkRenderer *ren); 00044 00045 // Descsription: 00046 // Clean up after the rendering is complete. 00047 virtual void PostRender(vtkRenderer *ren); 00048 00053 void ReleaseGraphicsResources(vtkWindow *); 00054 00055 00057 00059 vtkGetMacro(Index, long); 00060 //BTX 00061 protected: 00062 vtkOpenGLTexture(); 00063 ~vtkOpenGLTexture(); 00065 00066 unsigned char *ResampleToPowerOfTwo(int &xsize, int &ysize, 00067 unsigned char *dptr, int bpp); 00068 00069 vtkTimeStamp LoadTime; 00070 unsigned int Index; // actually GLuint 00071 vtkWeakPointer<vtkRenderWindow> RenderWindow; // RenderWindow used for previous render 00072 bool CheckedHardwareSupport; 00073 bool SupportsNonPowerOfTwoTextures; 00074 bool SupportsPBO; 00075 vtkPixelBufferObject *PBO; 00076 00077 private: 00078 vtkOpenGLTexture(const vtkOpenGLTexture&); // Not implemented. 00079 void operator=(const vtkOpenGLTexture&); // Not implemented. 00080 00082 virtual void Initialize(vtkRenderer * ren); 00083 00084 //ETX 00085 }; 00086 00087 #endif