45 #ifndef vtkFrameBufferObject2_h
46 #define vtkFrameBufferObject2_h
49 #include "vtkRenderingOpenGLModule.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)
158 unsigned int handle);
162 { this->AddTexColorAttachment(
mode, attId, 0U); }
175 unsigned int handle);
179 { this->AddRenColorAttachment(
mode, attId, 0U); }
188 { this->AddTexDepthAttachment(
mode, 0U); }
198 { this->AddRenDepthAttachment(
mode, 0U); }
258 unsigned int mapping);
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()
vtkPixelBufferObject * DownloadColor4(int extent[4], int vtkType)
vtkPixelBufferObject * DownloadColor3(int extent[4], int vtkType)
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)
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)
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.
unsigned int PreviousDrawFBO
void AddDepthAttachment(unsigned int mode, vtkTextureObject *tex)
Directly assign/remove a texture/renderbuffer to depth attachments.
void AddTexDepthAttachment(unsigned int mode, unsigned int handle)
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)
static vtkFrameBufferObject2 * New()
static void InitializeViewport(int width, int height)
Set up ortho viewport with scissor, lighting, blend, and depth disabled.
unsigned int PreviousReadFBO
void RemoveTexColorAttachment(unsigned int mode, unsigned int attId)
void ActivateReadBuffer(unsigned int id)
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,...
vtkPixelBufferObject * Download(int extent[4], int vtkType, int nComps, int oglType, int oglFormat)
Download data from the read buffer of the current FBO.
static void Download(int extent[4], int vtkType, int nComps, int oglType, int oglFormat, vtkPixelBufferObject *pbo)
vtkWeakPointer< vtkRenderWindow > Context
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()
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.
void SaveCurrentBuffers()
Store the current draw and read buffers.
void ActivateDrawBuffers(unsigned int *ids, int n)
unsigned int PreviousReadBuffer
vtkRenderWindow * GetContext()
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)
unsigned int PreviousDrawBuffer
void AddColorAttachment(unsigned int mode, unsigned int attId, vtkRenderbuffer *tex)
Directly assign/remove a renderbuffer to color attachments.
vtkPixelBufferObject * DownloadDepth(int extent[4], int vtkType)
Download data from the depth attachment of the currently bound FBO.
void SetContext(vtkRenderWindow *context)
Get/Set the context.
void RemoveTexColorAttachments(unsigned int mode, unsigned int num)
a simple class to control print indentation
abstract base class for most VTK objects
Interface class for querying and using OpenGL extensions.
abstracts an OpenGL pixel buffer object.
create a window for renderers to draw into
abstracts an OpenGL texture object.