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 =========================================================================*/
23 #ifndef vtkOpenGLTexture_h
24 #define vtkOpenGLTexture_h
25 
26 #include "vtkRenderingOpenGLModule.h" // For export macro
27 #include "vtkTexture.h"
28 
29 #include "vtkWeakPointer.h" // needed for vtkWeakPointer.
30 
31 class vtkWindow;
32 class vtkOpenGLRenderer;
33 class vtkRenderWindow;
35 
36 class VTKRENDERINGOPENGL_EXPORT vtkOpenGLTexture : public vtkTexture
37 {
38 public:
39  static vtkOpenGLTexture *New();
40  vtkTypeMacro(vtkOpenGLTexture, vtkTexture);
41  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
42 
46  void Load(vtkRenderer*);
47 
48  // Descsription:
49  // Clean up after the rendering is complete.
50  virtual void PostRender(vtkRenderer*);
51 
59 
61 
65  vtkGetMacro(Index, long);
67 
68 protected:
69 
72 
73  unsigned char *ResampleToPowerOfTwo(int &xsize, int &ysize,
74  unsigned char *dptr, int bpp);
75 
77  unsigned int Index; // actually GLuint
78  vtkWeakPointer<vtkRenderWindow> RenderWindow; // RenderWindow used for previous render
83 
84 private:
85  vtkOpenGLTexture(const vtkOpenGLTexture&) VTK_DELETE_FUNCTION;
86  void operator=(const vtkOpenGLTexture&) VTK_DELETE_FUNCTION;
87 
91  virtual void Initialize(vtkRenderer * ren);
92 
93 };
94 
95 #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:37
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