VTK
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(
69  unsigned int width,
70  unsigned int height);
71 
76  int CreateDepthAttachment(
77  unsigned int width,
78  unsigned int height);
79 
84  int Create(
85  unsigned int format,
86  unsigned int width,
87  unsigned int height);
88  int Create(
89  unsigned int format,
90  unsigned int width,
91  unsigned int height,
92  unsigned int samples);
93 
94  void ReleaseGraphicsResources(vtkWindow *win);
95 
96  // resizes an existing renderbuffer
97  void Resize(unsigned int width, unsigned int height);
98 
100 
104  vtkGetMacro(Width, unsigned int);
105  vtkGetMacro(Height, unsigned int);
106  vtkGetMacro(Samples, unsigned int);
108 
109 protected:
110  vtkRenderbuffer();
111  ~vtkRenderbuffer() override;
112 
113  bool LoadRequiredExtensions(vtkRenderWindow *renWin);
114  void Alloc();
115  void Free();
116 
118 
119  unsigned int Width;
120  unsigned int Height;
121  unsigned int Format;
122  unsigned int Samples;
123 
124 private:
125  unsigned int Handle;
127 
128 private:
129  vtkRenderbuffer(const vtkRenderbuffer&) = delete;
130  void operator=(const vtkRenderbuffer&) = delete;
131 };
132 
133 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:59
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
unsigned int Format
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
a simple class to control print indentation
Definition: vtkIndent.h:39
unsigned int Samples
create a window for renderers to draw into
unsigned int Height
Storage for FBO's.
unsigned int Width
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...