VTK
vtkOpenGLTexture.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOpenGLTexture.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 =========================================================================*/
26 #ifndef vtkOpenGLTexture_h
27 #define vtkOpenGLTexture_h
28 
29 #include "vtkRenderingOpenGLModule.h" // For export macro
30 #include "vtkTexture.h"
31 
32 #include "vtkWeakPointer.h" // needed for vtkWeakPointer.
33 
34 class vtkWindow;
35 class vtkOpenGLRenderer;
36 class vtkRenderWindow;
38 
39 class VTKRENDERINGOPENGL_EXPORT vtkOpenGLTexture : public vtkTexture
40 {
41 public:
42  static vtkOpenGLTexture *New();
43  vtkTypeMacro(vtkOpenGLTexture, vtkTexture);
44  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
45 
49  void Load(vtkRenderer*);
50 
51  // Descsription:
52  // Clean up after the rendering is complete.
53  virtual void PostRender(vtkRenderer*);
54 
62 
64 
68  vtkGetMacro(Index, long);
70 
71 protected:
72 
75 
76  unsigned char *ResampleToPowerOfTwo(int &xsize, int &ysize,
77  unsigned char *dptr, int bpp);
78 
80  unsigned int Index; // actually GLuint
81  vtkWeakPointer<vtkRenderWindow> RenderWindow; // RenderWindow used for previous render
86 
87 private:
88  vtkOpenGLTexture(const vtkOpenGLTexture&) VTK_DELETE_FUNCTION;
89  void operator=(const vtkOpenGLTexture&) VTK_DELETE_FUNCTION;
90 
94  virtual void Initialize(vtkRenderer * ren);
95 
96 };
97 
98 #endif
virtual void PostRender(vtkRenderer *)
Cleans up after the texture rendering to restore the state of the graphics context.
Definition: vtkTexture.h:88
vtkTimeStamp LoadTime
record modification and/or execution time
Definition: vtkTimeStamp.h:35
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this texture.
Definition: vtkTexture.h:95
abstract specification for renderers
Definition: vtkRenderer.h:63
bool SupportsNonPowerOfTwoTextures
virtual void Load(vtkRenderer *)
Abstract interface to renderer.
Definition: vtkTexture.h:102
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
OpenGL texture map.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
a simple class to control print indentation
Definition: vtkIndent.h:39
static vtkTexture * New()
handles properties associated with a texture map
Definition: vtkTexture.h:70
abstracts an OpenGL pixel buffer object.
vtkWeakPointer< vtkRenderWindow > RenderWindow
create a window for renderers to draw into
vtkPixelBufferObject * PBO
OpenGL renderer.
unsigned int Index