VTK: Rendering/OpenGL2/vtkRenderbuffer.h Source File

| VTK 9.3.1

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
17 VTK_ABI_NAMESPACE_BEGIN
18 class vtkRenderWindow;
19 class vtkWindow;
20
21 class VTKRENDERINGOPENGL2_EXPORT vtkRenderbuffer : public vtkObject
22 {
23 public:
24 static vtkRenderbuffer* New();
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
49 void SetContext(vtkRenderWindow* win);
50 vtkRenderWindow* GetContext();
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
72 void ReleaseGraphicsResources(vtkWindow* win);
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
87 protected:
88 vtkRenderbuffer();
89 ~vtkRenderbuffer() override;
90
91 bool LoadRequiredExtensions(vtkRenderWindow* renWin);
92 void Alloc();
93 void Free();
94
95 int DepthBufferFloat;
96
97 unsigned int Width;
98 unsigned int Height;
99 unsigned int Format;
100 unsigned int Samples;
101
102 private:
103 unsigned int Handle;
104 vtkWeakPointer<vtkRenderWindow> Context;
105
106 vtkRenderbuffer(const vtkRenderbuffer&) = delete;
107 void operator=(const vtkRenderbuffer&) = delete;
108 };
109
110 VTK_ABI_NAMESPACE_END
111 #endif
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:95
vtkRenderbuffer
Storage for FBO's.
Definition: vtkRenderbuffer.h:22
vtkRenderbuffer::IsSupported
static bool IsSupported(vtkRenderWindow *renWin)
Returns if the context supports the required extensions.
vtkRenderbuffer::LoadRequiredExtensions
bool LoadRequiredExtensions(vtkRenderWindow *renWin)
vtkRenderbuffer::Samples
unsigned int Samples
Definition: vtkRenderbuffer.h:100
vtkRenderbuffer::CreateColorAttachment
int CreateColorAttachment(unsigned int width, unsigned int height)
Sets up an RGBAF renderbufffer for use as a color attachment.
vtkRenderbuffer::DepthBufferFloat
int DepthBufferFloat
Definition: vtkRenderbuffer.h:95
vtkRenderbuffer::New
static vtkRenderbuffer * New()
vtkRenderbuffer::vtkRenderbuffer
vtkRenderbuffer()
vtkRenderbuffer::Width
unsigned int Width
Definition: vtkRenderbuffer.h:97
vtkRenderbuffer::Alloc
void Alloc()
vtkRenderbuffer::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *win)
vtkRenderbuffer::Height
unsigned int Height
Definition: vtkRenderbuffer.h:98
vtkRenderbuffer::GetContext
vtkRenderWindow * GetContext()
Setting the context has the side affect of initializing OpenGL required extensions and allocates an O...
vtkRenderbuffer::Create
int Create(unsigned int format, unsigned int width, unsigned int height, unsigned int samples)
vtkRenderbuffer::Create
int Create(unsigned int format, unsigned int width, unsigned int height)
Sets up an renderbufffer.
vtkRenderbuffer::Format
unsigned int Format
Definition: vtkRenderbuffer.h:99
vtkRenderbuffer::Resize
void Resize(unsigned int width, unsigned int height)
vtkRenderbuffer::Free
void Free()
vtkRenderbuffer::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkRenderbuffer::SetContext
void SetContext(vtkRenderWindow *win)
Setting the context has the side affect of initializing OpenGL required extensions and allocates an O...
vtkRenderbuffer::~vtkRenderbuffer
~vtkRenderbuffer() override
vtkRenderbuffer::CreateDepthAttachment
int CreateDepthAttachment(unsigned int width, unsigned int height)
Sets up an DEPTH renderbufffer for use as a color attachment.
vtkWeakPointer< vtkRenderWindow >
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkX3D::samples
@ samples
Definition: vtkX3D.h:473
vtkX3D::height
@ height
Definition: vtkX3D.h:254
vtkObject.h
vtkWeakPointer.h