VTK  9.3.0
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 
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 
87 protected:
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 
102 private:
103  unsigned int Handle;
105 
106  vtkRenderbuffer(const vtkRenderbuffer&) = delete;
107  void operator=(const vtkRenderbuffer&) = delete;
108 };
109 
110 VTK_ABI_NAMESPACE_END
111 #endif
a simple class to control print indentation
Definition: vtkIndent.h:38
abstract base class for most VTK objects
Definition: vtkObject.h:61
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.
static vtkRenderbuffer * New()
unsigned int Width
void ReleaseGraphicsResources(vtkWindow *win)
unsigned int Height
vtkRenderWindow * GetContext()
Setting the context has the side affect of initializing OpenGL required extensions and allocates an O...
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)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
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.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
@ samples
Definition: vtkX3D.h:473
@ height
Definition: vtkX3D.h:254