VTK
dox/Rendering/OpenGL/vtkOpenGLTexture.h
Go to the documentation of this file.
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 "vtkRenderingOpenGLModule.h" // For export macro
00026 #include "vtkTexture.h"
00027 //BTX
00028 #include "vtkWeakPointer.h" // needed for vtkWeakPointer.
00029 //ETX
00030 
00031 class vtkWindow;
00032 class vtkOpenGLRenderer;
00033 class vtkRenderWindow;
00034 class vtkPixelBufferObject;
00035 
00036 class VTKRENDERINGOPENGL_EXPORT vtkOpenGLTexture : public vtkTexture
00037 {
00038 public:
00039   static vtkOpenGLTexture *New();
00040   vtkTypeMacro(vtkOpenGLTexture, vtkTexture);
00041   virtual void PrintSelf(ostream& os, vtkIndent indent);
00042 
00044   void Load(vtkRenderer*);
00045 
00046   // Descsription:
00047   // Clean up after the rendering is complete.
00048   virtual void PostRender(vtkRenderer*);
00049 
00054   void ReleaseGraphicsResources(vtkWindow*);
00055 
00057 
00059   vtkGetMacro(Index, long);
00061 
00062 protected:
00063 //BTX
00064   vtkOpenGLTexture();
00065   ~vtkOpenGLTexture();
00066 
00067   unsigned char *ResampleToPowerOfTwo(int &xsize, int &ysize,
00068                                       unsigned char *dptr, int bpp);
00069 
00070   vtkTimeStamp   LoadTime;
00071   unsigned int Index; // actually GLuint
00072   vtkWeakPointer<vtkRenderWindow> RenderWindow;   // RenderWindow used for previous render
00073   bool CheckedHardwareSupport;
00074   bool SupportsNonPowerOfTwoTextures;
00075   bool SupportsPBO;
00076   vtkPixelBufferObject *PBO;
00077 
00078 private:
00079   vtkOpenGLTexture(const vtkOpenGLTexture&);  // Not implemented.
00080   void operator=(const vtkOpenGLTexture&);  // Not implemented.
00081 
00083   virtual void Initialize(vtkRenderer * ren);
00084 
00085 //ETX
00086 };
00087 
00088 #endif