VTK  9.5.2
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
13
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#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
21
22VTK_ABI_NAMESPACE_BEGIN
23class vtkRenderWindow;
25
26class VTKRENDERINGOPENGL2_EXPORT VTK_MARSHALAUTO vtkOpenGLTexture : public vtkTexture
27{
28public:
31 void PrintSelf(ostream& os, vtkIndent indent) override;
32
38 void Render(vtkRenderer* ren) override;
39
43 void Load(vtkRenderer*) override;
44
45 // Descsription:
46 // Clean up after the rendering is complete.
47 void PostRender(vtkRenderer*) override;
48
56
60 void CopyTexImage(int x, int y, int width, int height);
61
63
66 vtkGetMacro(IsDepthTexture, int);
67 vtkSetMacro(IsDepthTexture, int);
69
71
74 vtkGetMacro(TextureType, int);
75 vtkSetMacro(TextureType, int);
77
79 vtkGetObjectMacro(TextureObject, vtkTextureObject);
82
86 int GetTextureUnit() override;
87
94 int IsTranslucent() override;
95
96protected:
98 ~vtkOpenGLTexture() override;
99
101 vtkWeakPointer<vtkRenderWindow> RenderWindow; // RenderWindow used for previous render
102
105
109
110 // used when the texture exceeds the GL limit
111 unsigned char* ResampleToPowerOfTwo(
112 int& xsize, int& ysize, unsigned char* dptr, int bpp, int maxDimGL);
113
114private:
115 vtkOpenGLTexture(const vtkOpenGLTexture&) = delete;
116 void operator=(const vtkOpenGLTexture&) = delete;
117};
118
119VTK_ABI_NAMESPACE_END
120#endif
a simple class to control print indentation
Definition vtkIndent.h:29
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?
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
vtkTextureObject * TextureObject
vtkTimeStamp LoadTime
create a window for renderers to draw into
abstract specification for renderers
Definition vtkRenderer.h:60
In case DepthTextureCompare is true, specify the comparison function in use.
record modification and/or execution time
a weak reference to a vtkObject.
window superclass for vtkRenderWindow
Definition vtkWindow.h:26
#define VTK_MARSHAL_EXCLUDE_REASON_IS_INTERNAL
#define VTK_MARSHALAUTO
#define VTK_MARSHALEXCLUDE(reason)