Go to the documentation of this file.
45 #ifndef vtkFrameBufferObject2_h
46 #define vtkFrameBufferObject2_h
49 #include "vtkRenderingOpenGL2Module.h"
60 # define vtkCheckFrameBufferStatusMacro(mode)
61 # define vtkStaticCheckFrameBufferStatusMacro(mode)
63 # define vtkCheckFrameBufferStatusMacroImpl(macro, mode) \
66 bool ok = vtkFrameBufferObject2::GetFrameBufferStatus(mode, eStr); \
70 << "OpenGL ERROR. The FBO is incomplete : " << eStr); \
73 # define vtkCheckFrameBufferStatusMacro(mode) \
74 vtkCheckFrameBufferStatusMacroImpl(vtkErrorMacro, mode)
75 # define vtkStaticCheckFrameBufferStatusMacro(mode) \
76 vtkCheckFrameBufferStatusMacroImpl(vtkGenericWarningMacro, mode)
157 unsigned int handle);
161 { this->AddTexColorAttachment(
mode, attId, 0U); }
174 unsigned int handle);
178 { this->AddRenColorAttachment(
mode, attId, 0U); }
187 { this->AddTexDepthAttachment(
mode, 0U); }
197 { this->AddRenDepthAttachment(
mode, 0U); }
257 unsigned int mapping);
356 unsigned int FBOIndex;
357 unsigned int PreviousDrawFBO;
358 unsigned int PreviousReadFBO;
359 unsigned int PreviousDrawBuffer;
360 unsigned int PreviousReadBuffer;
361 int LastViewportSize[2];
367 inline void QueryViewportSize();
int GetOpenGLType(int vtkType)
Given a vtk type get a compatible open gl type.
void RemoveTexDepthAttachment(unsigned int mode)
void AddDepthAttachment(unsigned int mode, vtkRenderbuffer *tex)
Directly assign/remove a renderbuffer to depth attachments.
static void InitializeViewport(int width, int height)
Set up ortho viewport with scissor, lighting, blend, and depth disabled.
void AddRenColorAttachment(unsigned int mode, unsigned int attId, unsigned int handle)
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void RemoveRenDepthAttachment(unsigned int mode)
virtual int * GetLastSize()
Dimensions in pixels of the framebuffer.
void RestorePreviousBuffers(unsigned int mode)
void UnBind(unsigned int mode)
Bind saved FBO (see SaveCurrentBindings) for DRAW or READ (see glBindFramebuffer) If no bindings were...
vtkPixelBufferObject * Download(int extent[4], int vtkType, int nComps, int oglType, int oglFormat)
Download data from the read buffer of the current FBO.
void AddTexDepthAttachment(unsigned int mode, unsigned int handle)
abstract interface to OpenGL FBOs
void AddTexColorAttachment(unsigned int mode, unsigned int attId, unsigned int handle)
void DeactivateDrawBuffers()
void RemoveRenColorAttachment(unsigned int mode, unsigned int attId)
void AddColorAttachment(unsigned int mode, unsigned int attId, vtkRenderbuffer *tex)
Directly assign/remove a renderbuffer to color attachments.
vtkPixelBufferObject * DownloadColor3(int extent[4], int vtkType)
void DeactivateReadBuffer()
virtual void GetLastSize(int size[2])
void RemoveRenColorAttachments(unsigned int mode, unsigned int num)
void ActivateDrawBuffers(unsigned int n)
Select n consecutive write attachments.
static vtkFrameBufferObject2 * New()
void SaveCurrentBuffers()
Store the current draw and read buffers.
void ActivateDrawBuffers(unsigned int *ids, int n)
void ActivateDrawBuffer(unsigned int id)
Select a single specific draw or read buffer (zero based)
static bool LoadRequiredExtensions(vtkRenderWindow *renWin)
Load all necessary extensions.
static bool GetFrameBufferStatus(unsigned int mode, const char *&desc)
Validate the current FBO configuration (attachments, formats, etc) return false if the FBO is incompl...
a simple class to control print indentation
abstracts an OpenGL texture object.
void AddRenDepthAttachment(unsigned int mode, unsigned int handle)
int CheckFrameBufferStatus(unsigned int mode)
Validate the current FBO configuration (attachments, formats, etc) prints detected errors to vtkError...
void RemoveTexColorAttachments(unsigned int mode, unsigned int num)
vtkPixelBufferObject * DownloadColor4(int extent[4], int vtkType)
void ActivateReadBuffer(unsigned int id)
void SaveCurrentBindings()
Store the current framebuffer bindings.
vtkRenderWindow * GetContext()
void SetContext(vtkRenderWindow *context)
Get/Set the context.
static void Download(int extent[4], int vtkType, int nComps, int oglType, int oglFormat, vtkPixelBufferObject *pbo)
void AddColorAttachment(unsigned int mode, unsigned int attId, vtkTextureObject *tex)
Directly assign/remove a texture to color attachments.
vtkPixelBufferObject * DownloadColor1(int extent[4], int vtkType, int channel)
Download data from the read color attachment of the currently bound FBO into the retruned PBO.
void Bind(unsigned int mode)
Bind FBO to FRAMEBUFFER, DRAW_FRAMEBUFFER or READ_FRAMEBUFFER The current binding is not saved,...
void AddDepthAttachment(unsigned int mode, vtkTextureObject *tex)
Directly assign/remove a texture/renderbuffer to depth attachments.
static int Blit(int srcExt[4], int destExt[4], unsigned int bits, unsigned int mapping)
Copy from the currently bound READ FBO to the currently bound DRAW FBO.
void RemoveTexColorAttachment(unsigned int mode, unsigned int attId)
int * GetLastSize(bool forceUpdate)
Additional overload which lets the user decide whether the returned size should be the currently cach...
create a window for renderers to draw into
Interface to OpenGL framebuffer object.
static bool IsSupported(vtkRenderWindow *renWin)
Returns if the context supports the required extensions.
abstracts an OpenGL pixel buffer object.
vtkPixelBufferObject * DownloadDepth(int extent[4], int vtkType)
Download data from the depth attachment of the currently bound FBO.
virtual void GetLastSize(int &width, int &height)