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*) VTK_OVERRIDE;
47 
48  // Descsription:
49  // Clean up after the rendering is complete.
50  void PostRender(vtkRenderer*) VTK_OVERRIDE;
51 
58  void ReleaseGraphicsResources(vtkWindow*) VTK_OVERRIDE;
59 
61 
65  vtkGetMacro(Index, long);
67 
68 protected:
69 
71  ~vtkOpenGLTexture() VTK_OVERRIDE;
72 
73  unsigned char *ResampleToPowerOfTwo(int &xsize, int &ysize,
74  unsigned char *dptr, int bpp);
75 
76  vtkTimeStamp LoadTime;
77  unsigned int Index; // actually GLuint
78  vtkWeakPointer<vtkRenderWindow> RenderWindow; // RenderWindow used for previous render
79  bool CheckedHardwareSupport;
80  bool SupportsNonPowerOfTwoTextures;
81  bool SupportsPBO;
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:82
record modification and/or execution time
Definition: vtkTimeStamp.h:32
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this texture.
Definition: vtkTexture.h:89
abstract specification for renderers
Definition: vtkRenderer.h:57
virtual void Load(vtkRenderer *)
Abstract interface to renderer.
Definition: vtkTexture.h:96
OpenGL texture map.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
a simple class to control print indentation
Definition: vtkIndent.h:33
a weak reference to a vtkObject.
static vtkTexture * New()
handles properties associated with a texture map
Definition: vtkTexture.h:64
abstracts an OpenGL pixel buffer object.
create a window for renderers to draw into
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
OpenGL renderer.