VTK  9.4.20241118
vtkRenderbuffer.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
10#ifndef vtkRenderbuffer_h
11#define vtkRenderbuffer_h
12
13#include "vtkObject.h"
14#include "vtkRenderingOpenGL2Module.h" // for export macro
15#include "vtkWeakPointer.h" // for render context
16
17VTK_ABI_NAMESPACE_BEGIN
18class vtkRenderWindow;
19class vtkWindow;
20
21class VTKRENDERINGOPENGL2_EXPORT vtkRenderbuffer : public vtkObject
22{
23public:
25 vtkTypeMacro(vtkRenderbuffer, vtkObject);
26 void PrintSelf(ostream& os, vtkIndent indent) override;
27
32 static bool IsSupported(vtkRenderWindow* renWin);
33
35
38 vtkGetMacro(Handle, unsigned int);
40
42
52
57 int CreateColorAttachment(unsigned int width, unsigned int height);
58
63 int CreateDepthAttachment(unsigned int width, unsigned int height);
64
69 int Create(unsigned int format, unsigned int width, unsigned int height);
70 int Create(unsigned int format, unsigned int width, unsigned int height, unsigned int samples);
71
73
74 // resizes an existing renderbuffer
75 void Resize(unsigned int width, unsigned int height);
76
78
82 vtkGetMacro(Width, unsigned int);
83 vtkGetMacro(Height, unsigned int);
84 vtkGetMacro(Samples, unsigned int);
86
87protected:
89 ~vtkRenderbuffer() override;
90
92 void Alloc();
93 void Free();
94
96
97 unsigned int Width;
98 unsigned int Height;
99 unsigned int Format;
100 unsigned int Samples;
101
102private:
103 unsigned int Handle;
105
106 vtkRenderbuffer(const vtkRenderbuffer&) = delete;
107 void operator=(const vtkRenderbuffer&) = delete;
108};
109
110VTK_ABI_NAMESPACE_END
111#endif
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
create a window for renderers to draw into
Storage for FBO's.
static bool IsSupported(vtkRenderWindow *renWin)
Returns if the context supports the required extensions.
bool LoadRequiredExtensions(vtkRenderWindow *renWin)
unsigned int Samples
int CreateColorAttachment(unsigned int width, unsigned int height)
Sets up an RGBAF renderbufffer for use as a color attachment.
unsigned int Width
void ReleaseGraphicsResources(vtkWindow *win)
unsigned int Height
int Create(unsigned int format, unsigned int width, unsigned int height, unsigned int samples)
int Create(unsigned int format, unsigned int width, unsigned int height)
Sets up an renderbufffer.
unsigned int Format
void Resize(unsigned int width, unsigned int height)
vtkRenderWindow * GetContext()
Setting the context has the side affect of initializing OpenGL required extensions and allocates an O...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkRenderbuffer * New()
void SetContext(vtkRenderWindow *win)
Setting the context has the side affect of initializing OpenGL required extensions and allocates an O...
~vtkRenderbuffer() override
int CreateDepthAttachment(unsigned int width, unsigned int height)
Sets up an DEPTH renderbufffer for use as a color attachment.
a weak reference to a vtkObject.
window superclass for vtkRenderWindow
Definition vtkWindow.h:48