VTK  9.0.20200928
vtkRenderbuffer.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkRenderbuffer.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
22 #ifndef vtkRenderbuffer_h
23 #define vtkRenderbuffer_h
24 
25 #include "vtkObject.h"
26 #include "vtkRenderingOpenGL2Module.h" // for export macro
27 #include "vtkWeakPointer.h" // for render context
28 
29 class vtkRenderWindow;
30 class vtkWindow;
31 
32 class VTKRENDERINGOPENGL2_EXPORT vtkRenderbuffer : public vtkObject
33 {
34 public:
35  static vtkRenderbuffer* New();
36  vtkTypeMacro(vtkRenderbuffer, vtkObject);
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
43  static bool IsSupported(vtkRenderWindow* renWin);
44 
46 
49  vtkGetMacro(Handle, unsigned int);
51 
53 
60  void SetContext(vtkRenderWindow* win);
61  vtkRenderWindow* GetContext();
63 
68  int CreateColorAttachment(unsigned int width, unsigned int height);
69 
74  int CreateDepthAttachment(unsigned int width, unsigned int height);
75 
80  int Create(unsigned int format, unsigned int width, unsigned int height);
81  int Create(unsigned int format, unsigned int width, unsigned int height, unsigned int samples);
82 
83  void ReleaseGraphicsResources(vtkWindow* win);
84 
85  // resizes an existing renderbuffer
86  void Resize(unsigned int width, unsigned int height);
87 
89 
93  vtkGetMacro(Width, unsigned int);
94  vtkGetMacro(Height, unsigned int);
95  vtkGetMacro(Samples, unsigned int);
97 
98 protected:
100  ~vtkRenderbuffer() override;
101 
102  bool LoadRequiredExtensions(vtkRenderWindow* renWin);
103  void Alloc();
104  void Free();
105 
107 
108  unsigned int Width;
109  unsigned int Height;
110  unsigned int Format;
111  unsigned int Samples;
112 
113 private:
114  unsigned int Handle;
116 
117 private:
118  vtkRenderbuffer(const vtkRenderbuffer&) = delete;
119  void operator=(const vtkRenderbuffer&) = delete;
120 };
121 
122 #endif
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkRenderbuffer::DepthBufferFloat
int DepthBufferFloat
Definition: vtkRenderbuffer.h:106
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
vtkRenderbuffer::Format
unsigned int Format
Definition: vtkRenderbuffer.h:110
vtkX3D::samples
Definition: vtkX3D.h:479
vtkX3D::height
Definition: vtkX3D.h:260
vtkRenderbuffer::Height
unsigned int Height
Definition: vtkRenderbuffer.h:109
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkWeakPointer.h
vtkObject.h
vtkRenderbuffer::Samples
unsigned int Samples
Definition: vtkRenderbuffer.h:111
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:94
vtkWeakPointer< vtkRenderWindow >
vtkRenderbuffer::Width
unsigned int Width
Definition: vtkRenderbuffer.h:108
vtkRenderbuffer
Storage for FBO's.
Definition: vtkRenderbuffer.h:32