VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Rendering/OpenGL2/vtkRenderbuffer.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkRenderbuffer.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00021 #ifndef vtkRenderbuffer_h
00022 #define vtkRenderbuffer_h
00023 
00024 #include "vtkObject.h"
00025 #include "vtkRenderingOpenGL2Module.h" // for export macro
00026 #include "vtkWeakPointer.h" // for render context
00027 
00028 class vtkRenderWindow;
00029 
00030 class VTKRENDERINGOPENGL2_EXPORT vtkRenderbuffer : public vtkObject
00031 {
00032 public:
00033   static vtkRenderbuffer* New();
00034   vtkTypeMacro(vtkRenderbuffer, vtkObject);
00035   void PrintSelf(ostream& os, vtkIndent indent);
00036 
00039   static bool IsSupported(vtkRenderWindow *renWin);
00040 
00042 
00043   vtkGetMacro(Handle, unsigned int);
00045 
00047 
00052   void SetContext(vtkRenderWindow *win);
00053   vtkRenderWindow* GetContext();
00055 
00057 
00059   int CreateColorAttachment(
00060         unsigned int width,
00061         unsigned int height);
00063 
00065 
00067   int CreateDepthAttachment(
00068         unsigned int width,
00069         unsigned int height);
00071 
00073 
00076   int Create(
00077         unsigned int format,
00078         unsigned int width,
00079         unsigned int height);
00081 
00082 protected:
00083   vtkRenderbuffer();
00084   ~vtkRenderbuffer();
00085 
00086   bool LoadRequiredExtensions(vtkRenderWindow *renWin);
00087   void Alloc();
00088   void Free();
00089 
00090   int DepthBufferFloat;
00091 
00092 private:
00093   unsigned int Handle;
00094   vtkWeakPointer<vtkRenderWindow> Context;
00095 
00096 private:
00097   vtkRenderbuffer(const vtkRenderbuffer&); // Not implemented.
00098   void operator=(const vtkRenderbuffer&); // Not implemented.
00099 };
00100 
00101 #endif