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) \
66bool 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();
Interface to OpenGL framebuffer object.
void RestorePreviousBuffers(unsigned int mode)
static bool GetFrameBufferStatus(unsigned int mode, const char *&desc)
Validate the current FBO configuration (attachments, formats, etc) return false if the FBO is incompl...
void DeactivateReadBuffer()
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void AddRenDepthAttachment(unsigned int mode, unsigned int handle)
vtkPixelBufferObject * DownloadColor4(int extent[4], int vtkType)
void AddDepthAttachment(unsigned int mode, vtkRenderbuffer *tex)
Directly assign/remove a renderbuffer to depth 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 ActivateDrawBuffer(unsigned int id)
Select a single specific draw or read buffer (zero based)
void RemoveTexDepthAttachment(unsigned int mode)
virtual int * GetLastSize()
Dimensions in pixels of the framebuffer.
int CheckFrameBufferStatus(unsigned int mode)
Validate the current FBO configuration (attachments, formats, etc) prints detected errors to vtkError...
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.
virtual void GetLastSize(int size[2])
void AddDepthAttachment(unsigned int mode, vtkTextureObject *tex)
Directly assign/remove a texture/renderbuffer to depth attachments.
vtkRenderWindow * GetContext()
int * GetLastSize(bool forceUpdate)
Additional overload which lets the user decide whether the returned size should be the currently cach...
void AddTexDepthAttachment(unsigned int mode, unsigned int handle)
vtkPixelBufferObject * Download(int extent[4], int vtkType, int nComps, int oglType, int oglFormat)
Download data from the read buffer of the current FBO.
void ActivateDrawBuffers(unsigned int n)
Select n consecutive write attachments.
int GetOpenGLType(int vtkType)
Given a vtk type get a compatible open gl type.
void AddTexColorAttachment(unsigned int mode, unsigned int attId, unsigned int handle)
vtkPixelBufferObject * DownloadDepth(int extent[4], int vtkType)
Download data from the depth attachment of the currently bound FBO.
static void InitializeViewport(int width, int height)
Set up ortho viewport with scissor, lighting, blend, and depth disabled.
void RemoveTexColorAttachment(unsigned int mode, unsigned int attId)
void ActivateReadBuffer(unsigned int id)
virtual void GetLastSize(int &width, int &height)
void AddRenColorAttachment(unsigned int mode, unsigned int attId, unsigned int handle)
void Bind(unsigned int mode)
Bind FBO to FRAMEBUFFER, DRAW_FRAMEBUFFER or READ_FRAMEBUFFER The current binding is not saved,...
static void Download(int extent[4], int vtkType, int nComps, int oglType, int oglFormat, vtkPixelBufferObject *pbo)
void UnBind(unsigned int mode)
Bind saved FBO (see SaveCurrentBindings) for DRAW or READ (see glBindFramebuffer) If no bindings were...
static bool LoadRequiredExtensions(vtkRenderWindow *renWin)
Load all necessary extensions.
void DeactivateDrawBuffers()
static vtkFrameBufferObject2 * New()
void AddColorAttachment(unsigned int mode, unsigned int attId, vtkTextureObject *tex)
Directly assign/remove a texture to color attachments.
static bool IsSupported(vtkRenderWindow *renWin)
Returns if the context supports the required extensions.
vtkPixelBufferObject * DownloadColor3(int extent[4], int vtkType)
void SaveCurrentBuffers()
Store the current draw and read buffers.
void ActivateDrawBuffers(unsigned int *ids, int n)
void SaveCurrentBindings()
Store the current framebuffer bindings.
void RemoveRenColorAttachment(unsigned int mode, unsigned int attId)
void RemoveRenDepthAttachment(unsigned int mode)
void RemoveRenColorAttachments(unsigned int mode, unsigned int num)
void AddColorAttachment(unsigned int mode, unsigned int attId, vtkRenderbuffer *tex)
Directly assign/remove a renderbuffer to color attachments.
void SetContext(vtkRenderWindow *context)
Get/Set the context.
void RemoveTexColorAttachments(unsigned int mode, unsigned int num)
abstract interface to OpenGL FBOs
a simple class to control print indentation
abstracts an OpenGL pixel buffer object.
create a window for renderers to draw into
abstracts an OpenGL texture object.