VTK  9.3.0
vtkOpenGLTexture.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
14#ifndef vtkOpenGLTexture_h
15#define vtkOpenGLTexture_h
16
17#include "vtkRenderingOpenGL2Module.h" // For export macro
18#include "vtkTexture.h"
19#include "vtkWeakPointer.h" // needed for vtkWeakPointer.
20
21VTK_ABI_NAMESPACE_BEGIN
22class vtkRenderWindow;
24
25class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLTexture : public vtkTexture
26{
27public:
30 void PrintSelf(ostream& os, vtkIndent indent) override;
31
37 void Render(vtkRenderer* ren) override;
38
42 void Load(vtkRenderer*) override;
43
44 // Descsription:
45 // Clean up after the rendering is complete.
46 void PostRender(vtkRenderer*) override;
47
55
59 void CopyTexImage(int x, int y, int width, int height);
60
62
65 vtkGetMacro(IsDepthTexture, int);
66 vtkSetMacro(IsDepthTexture, int);
68
70
73 vtkGetMacro(TextureType, int);
74 vtkSetMacro(TextureType, int);
76
77 vtkGetObjectMacro(TextureObject, vtkTextureObject);
79
83 int GetTextureUnit() override;
84
91 int IsTranslucent() override;
92
93protected:
96
98 vtkWeakPointer<vtkRenderWindow> RenderWindow; // RenderWindow used for previous render
99
102
105 int PrevBlendParams[4];
106
107 // used when the texture exceeds the GL limit
108 unsigned char* ResampleToPowerOfTwo(
109 int& xsize, int& ysize, unsigned char* dptr, int bpp, int maxDimGL);
110
111private:
112 vtkOpenGLTexture(const vtkOpenGLTexture&) = delete;
113 void operator=(const vtkOpenGLTexture&) = delete;
114};
115
116VTK_ABI_NAMESPACE_END
117#endif
a simple class to control print indentation
Definition vtkIndent.h:29
OpenGL texture map.
void Load(vtkRenderer *) override
Implement base class method.
int GetTextureUnit() override
Return the texture unit used for this texture.
void CopyTexImage(int x, int y, int width, int height)
copy the renderers read buffer into this texture
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this texture.
int IsTranslucent() override
Is this Texture Translucent? returns false (0) if the texture is either fully opaque or has only full...
unsigned char * ResampleToPowerOfTwo(int &xsize, int &ysize, unsigned char *dptr, int bpp, int maxDimGL)
static vtkOpenGLTexture * New()
void PostRender(vtkRenderer *) override
Cleans up after the texture rendering to restore the state of the graphics context.
void SetTextureObject(vtkTextureObject *)
void Render(vtkRenderer *ren) override
Renders a texture map.
vtkWeakPointer< vtkRenderWindow > RenderWindow
~vtkOpenGLTexture() override
vtkTextureObject * TextureObject
vtkTimeStamp LoadTime
create a window for renderers to draw into
abstract specification for renderers
Definition vtkRenderer.h:59
abstracts an OpenGL texture object.
handles properties associated with a texture map
Definition vtkTexture.h:58
record modification and/or execution time
a weak reference to a vtkObject.
window superclass for vtkRenderWindow
Definition vtkWindow.h:25