VTK  9.4.20251203
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#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);
81 void SetTextureObject(vtkTextureObject*);
82
86 int GetTextureUnit() override;
87
94 int IsTranslucent() override;
95
96protected:
98 ~vtkOpenGLTexture() override;
99
100 vtkTimeStamp LoadTime;
101 vtkWeakPointer<vtkRenderWindow> RenderWindow; // RenderWindow used for previous render
102
103 bool ExternalTextureObject;
104 vtkTextureObject* TextureObject;
105
106 int IsDepthTexture;
107 int TextureType;
108 int PrevBlendParams[4];
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
OpenGL texture map.
void Load(vtkRenderer *) override
Implement base class method.
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.
static vtkOpenGLTexture * New()
void PostRender(vtkRenderer *) override
Cleans up after the texture rendering to restore the state of the graphics context.
void Render(vtkRenderer *ren) override
Renders a texture map.
create a window for renderers to draw into
abstract specification for renderers
Definition vtkRenderer.h:63
abstracts an OpenGL texture object.
handles properties associated with a texture map
Definition vtkTexture.h:59
record modification and/or execution time
a weak reference to a vtkObject.
window superclass for vtkRenderWindow
Definition vtkWindow.h:29
#define VTK_MARSHAL_EXCLUDE_REASON_IS_INTERNAL
#define VTK_MARSHALAUTO
#define VTK_MARSHALEXCLUDE(reason)