VTK  9.5.20251211
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
92
93#ifndef vtkOpenGLTexture_h
94#define vtkOpenGLTexture_h
95
96#include "vtkRenderingOpenGL2Module.h" // For export macro
97#include "vtkTexture.h"
98#include "vtkWeakPointer.h" // needed for vtkWeakPointer.
99#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
100
101VTK_ABI_NAMESPACE_BEGIN
102class vtkRenderWindow;
103class vtkTextureObject;
104
105class VTKRENDERINGOPENGL2_EXPORT VTK_MARSHALAUTO vtkOpenGLTexture : public vtkTexture
106{
107public:
110 void PrintSelf(ostream& os, vtkIndent indent) override;
111
117 void Render(vtkRenderer* ren) override;
118
122 void Load(vtkRenderer*) override;
123
124 // Descsription:
125 // Clean up after the rendering is complete.
126 void PostRender(vtkRenderer*) override;
127
135
139 void CopyTexImage(int x, int y, int width, int height);
140
142
145 vtkGetMacro(IsDepthTexture, int);
146 vtkSetMacro(IsDepthTexture, int);
148
150
153 vtkGetMacro(TextureType, int);
154 vtkSetMacro(TextureType, int);
156
158 vtkGetObjectMacro(TextureObject, vtkTextureObject);
161
165 int GetTextureUnit() override;
166
173 int IsTranslucent() override;
174
175protected:
177 ~vtkOpenGLTexture() override;
178
180 vtkWeakPointer<vtkRenderWindow> RenderWindow; // RenderWindow used for previous render
181
184
188
189 // used when the texture exceeds the GL limit
190 unsigned char* ResampleToPowerOfTwo(
191 int& xsize, int& ysize, unsigned char* dptr, int bpp, int maxDimGL);
192
193private:
194 vtkOpenGLTexture(const vtkOpenGLTexture&) = delete;
195 void operator=(const vtkOpenGLTexture&) = delete;
196};
197
198VTK_ABI_NAMESPACE_END
199#endif
a simple class to control print indentation
Definition vtkIndent.h:108
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
abstracts an OpenGL texture object.
record modification and/or execution time
a weak reference to a vtkObject.
window superclass for vtkRenderWindow
Definition vtkWindow.h:48
#define VTK_MARSHAL_EXCLUDE_REASON_IS_INTERNAL
#define VTK_MARSHALAUTO
#define VTK_MARSHALEXCLUDE(reason)