VTK
|
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 "vtkRenderingOpenGLModule.h" // for export macro 00026 #include "vtkWeakPointer.h" // for render context 00027 00028 class vtkRenderWindow; 00029 class vtkTextureObject; 00030 00031 class VTKRENDERINGOPENGL_EXPORT vtkRenderbuffer : public vtkObject 00032 { 00033 public: 00034 static vtkRenderbuffer* New(); 00035 vtkTypeMacro(vtkRenderbuffer, vtkObject); 00036 void PrintSelf(ostream& os, vtkIndent indent); 00037 00040 static bool IsSupported(vtkRenderWindow *renWin); 00041 00043 00044 vtkGetMacro(Handle, unsigned int); 00046 00048 00053 void SetContext(vtkRenderWindow *win); 00054 vtkRenderWindow* GetContext(); 00056 00058 00060 int CreateColorAttachment( 00061 unsigned int width, 00062 unsigned int height); 00064 00066 00068 int CreateDepthAttachment( 00069 unsigned int width, 00070 unsigned int height); 00072 00074 00077 int Create( 00078 unsigned int format, 00079 unsigned int width, 00080 unsigned int height); 00082 00083 protected: 00084 vtkRenderbuffer(); 00085 ~vtkRenderbuffer(); 00086 00087 bool LoadRequiredExtensions(vtkRenderWindow *renWin); 00088 void Alloc(); 00089 void Free(); 00090 00091 int DepthBufferFloat; 00092 00093 private: 00094 unsigned int Handle; 00095 vtkWeakPointer<vtkRenderWindow> Context; 00096 00097 private: 00098 vtkRenderbuffer(const vtkRenderbuffer&); // Not implemented. 00099 void operator=(const vtkRenderbuffer&); // Not implemented. 00100 }; 00101 00102 #endif