VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
vtkFrameBufferObject Class Reference

internal class which encapsulates OpenGL frame buffer object. Not to be used directly. More...

#include <vtkFrameBufferObject.h>

Inheritance diagram for vtkFrameBufferObject:
[legend]
Collaboration diagram for vtkFrameBufferObject:
[legend]

Public Types

typedef vtkFrameBufferObjectBase Superclass
 
typedef vtkFrameBufferObjectBase Superclass
 
- Public Types inherited from vtkFrameBufferObjectBase
typedef vtkObject Superclass
 

Public Member Functions

virtual int IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class. More...
 
vtkFrameBufferObjectNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 
void SetContext (vtkRenderWindow *context)
 Get/Set the context. More...
 
vtkRenderWindowGetContext ()
 
bool Start (int width, int height, bool shaderSupportsTextureInt)
 User must take care that width/height match the dimensions of the user defined texture attachments. More...
 
bool StartNonOrtho (int width, int height, bool shaderSupportsTextureInt)
 
void RenderQuad (int minX, int maxX, int minY, int maxY)
 Renders a quad at the given location with pixel coordinates. More...
 
void Bind ()
 Make the draw frame buffer active (uses FRAMEBUFFER). More...
 
void UnBind ()
 Restore the previous draw framebuffer if saved, else bind the default buffer. More...
 
void SetActiveBuffer (unsigned int index)
 Choose the buffers to render into. More...
 
void SetActiveBuffers (int numbuffers, unsigned int indices[])
 User provided color buffers are attached by index to color buffers. More...
 
void SetColorBuffer (unsigned int index, vtkTextureObject *texture, unsigned int zslice=0)
 Insert a color buffer into the list of available color buffers. More...
 
vtkTextureObjectGetColorBuffer (unsigned int index)
 
void RemoveColorBuffer (unsigned int index)
 
void RemoveAllColorBuffers ()
 
void SetDepthBuffer (vtkTextureObject *depthTexture)
 Set the texture to use as depth buffer. More...
 
void RemoveDepthBuffer ()
 
virtual void SetDepthBufferNeeded (bool)
 If true, the frame buffer object will be initialized with a depth buffer. More...
 
virtual bool GetDepthBufferNeeded ()
 
void SetNumberOfRenderTargets (unsigned int)
 Set/Get the number of render targets to render into at once. More...
 
virtual unsigned int GetNumberOfRenderTargets ()
 
unsigned int GetMaximumNumberOfActiveTargets ()
 Returns the maximum number of targets that can be rendered to at one time. More...
 
unsigned int GetMaximumNumberOfRenderTargets ()
 Returns the maximum number of render targets available. More...
 
virtual intGetLastSize ()
 Dimensions in pixels of the framebuffer. More...
 
virtual void GetLastSize (int &, int &)
 
virtual void GetLastSize (int[2])
 
int CheckFrameBufferStatus (unsigned int mode)
 Validate the current FBO configuration (attachments, formats, etc) prints detected errors to vtkErrorMacro. More...
 
virtual int IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class. More...
 
vtkFrameBufferObjectNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 
void SetContext (vtkOpenGLRenderWindow *context)
 Get/Set the context. More...
 
vtkOpenGLRenderWindowGetContext ()
 
bool Start (int width, int height, bool shaderSupportsTextureInt)
 User must take care that width/height match the dimensions of the user defined texture attachments. More...
 
bool StartNonOrtho (int width, int height, bool shaderSupportsTextureInt)
 
void RenderQuad (int minX, int maxX, int minY, int maxY, vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
 Renders a quad at the given location with pixel coordinates. More...
 
void Bind ()
 Make the draw frame buffer active (uses FRAMEBUFFER). More...
 
void UnBind ()
 Restore the previous draw framebuffer if saved, else bind the default buffer. More...
 
void SetActiveBuffer (unsigned int index)
 Choose the buffers to render into. More...
 
void SetActiveBuffers (int numbuffers, unsigned int indices[])
 User provided color buffers are attached by index to color buffers. More...
 
void SetColorBuffer (unsigned int index, vtkTextureObject *texture, unsigned int zslice=0)
 Insert a color buffer into the list of available color buffers. More...
 
vtkTextureObjectGetColorBuffer (unsigned int index)
 
void RemoveColorBuffer (unsigned int index)
 
void RemoveAllColorBuffers ()
 
void SetDepthBuffer (vtkTextureObject *depthTexture)
 Set the texture to use as depth buffer. More...
 
void RemoveDepthBuffer ()
 
virtual void SetDepthBufferNeeded (bool)
 If true, the frame buffer object will be initialized with a depth buffer. More...
 
virtual bool GetDepthBufferNeeded ()
 
void SetNumberOfRenderTargets (unsigned int)
 Set/Get the number of render targets to render into at once. More...
 
virtual unsigned int GetNumberOfRenderTargets ()
 
unsigned int GetMaximumNumberOfActiveTargets ()
 Returns the maximum number of targets that can be rendered to at one time. More...
 
unsigned int GetMaximumNumberOfRenderTargets ()
 Returns the maximum number of render targets available. More...
 
virtual intGetLastSize ()
 Dimensions in pixels of the framebuffer. More...
 
virtual void GetLastSize (int &, int &)
 
virtual void GetLastSize (int[2])
 
int CheckFrameBufferStatus (unsigned int mode)
 Validate the current FBO configuration (attachments, formats, etc) prints detected errors to vtkErrorMacro. More...
 
virtual void ReleaseGraphicsResources (vtkWindow *win)
 Deactivate and UnBind. More...
 
- Public Member Functions inherited from vtkFrameBufferObjectBase
vtkFrameBufferObjectBaseNewInstance () const
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 Turn debugging output on. More...
 
virtual void DebugOff ()
 Turn debugging output off. More...
 
bool GetDebug ()
 Get the value of the debug flag. More...
 
void SetDebug (bool debugFlag)
 Set the value of the debug flag. More...
 
virtual void Modified ()
 Update the modification time for this object. More...
 
virtual vtkMTimeType GetMTime ()
 Return this object's modified time. More...
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Allow user to set the AbortFlagOn() with the return value of the callback method. More...
 
int InvokeEvent (unsigned long event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
int InvokeEvent (const char *event, void *callData)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 Return the class name as a string. More...
 
virtual void Delete ()
 Delete a VTK object. More...
 
virtual void FastDelete ()
 Delete a reference to this object. More...
 
void InitializeObjectBase ()
 
void Print (ostream &os)
 Print an object to an ostream. More...
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
virtual void Register (vtkObjectBase *o)
 Increase the reference count (mark as used by another object). More...
 
virtual void UnRegister (vtkObjectBase *o)
 Decrease the reference count (release by another object). More...
 
int GetReferenceCount ()
 Return the current reference count of this object. More...
 
void SetReferenceCount (int)
 Sets the reference count. More...
 
void PrintRevisions (ostream &)
 Legacy. More...
 

Static Public Member Functions

static vtkFrameBufferObjectNew ()
 
static int IsTypeOf (const char *type)
 
static vtkFrameBufferObjectSafeDownCast (vtkObjectBase *o)
 
static bool IsSupported (vtkRenderWindow *renWin)
 Returns if the context supports the required extensions. More...
 
static vtkFrameBufferObjectNew ()
 
static int IsTypeOf (const char *type)
 
static vtkFrameBufferObjectSafeDownCast (vtkObjectBase *o)
 
static bool IsSupported (vtkOpenGLRenderWindow *renWin)
 Returns if the context supports the required extensions. More...
 
- Static Public Member Functions inherited from vtkFrameBufferObjectBase
static int IsTypeOf (const char *type)
 
static vtkFrameBufferObjectBaseSafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 
static void BreakOnError ()
 This method is called when vtkErrorMacro executes. More...
 
static void SetGlobalWarningDisplay (int val)
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 Return 1 if this class type is the same type of (or a subclass of) the named class. More...
 
static vtkObjectBaseNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
void CreateFBO ()
 
void DestroyFBO ()
 
void CreateDepthBuffer (int width, int height, unsigned int mode)
 
void CreateColorBuffers (int width, int height, unsigned int mode, bool shaderSupportsTextureInt)
 
void DestroyDepthBuffer ()
 
void DestroyColorBuffers ()
 
void ActivateBuffers ()
 
void DisplayFrameBufferAttachments ()
 Display all the attachments of the current framebuffer object. More...
 
void DisplayFrameBufferAttachment (unsigned int uattachment)
 Display a given attachment for the current framebuffer object. More...
 
void DisplayDrawBuffers ()
 Display the draw buffers. More...
 
void DisplayReadBuffer ()
 Display the read buffer. More...
 
void DisplayBuffer (int value)
 Display any buffer (convert value into string). More...
 
 vtkFrameBufferObject ()
 
 ~vtkFrameBufferObject ()
 
virtual vtkObjectBaseNewInstanceInternal () const
 
void CreateFBO ()
 
void DestroyFBO ()
 
void CreateDepthBuffer (int width, int height, unsigned int mode)
 
void CreateColorBuffers (int width, int height, unsigned int mode, bool shaderSupportsTextureInt)
 
void DestroyDepthBuffer ()
 
void DestroyColorBuffers ()
 
void ActivateBuffers ()
 
void DisplayFrameBufferAttachments ()
 Display all the attachments of the current framebuffer object. More...
 
void DisplayFrameBufferAttachment (unsigned int uattachment)
 Display a given attachment for the current framebuffer object. More...
 
void DisplayDrawBuffers ()
 Display the draw buffers. More...
 
void DisplayReadBuffer ()
 Display the read buffer. More...
 
void DisplayBuffer (int value)
 Display any buffer (convert value into string). More...
 
 vtkFrameBufferObject ()
 
 ~vtkFrameBufferObject ()
 
- Protected Member Functions inherited from vtkFrameBufferObjectBase
 vtkFrameBufferObjectBase ()
 
 ~vtkFrameBufferObjectBase ()
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
 ~vtkObject () override
 
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 These methods allow a command to exclusively grab all events. More...
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Static Protected Member Functions

static bool LoadRequiredExtensions (vtkRenderWindow *renWin)
 Load all necessary extensions. More...
 
static bool LoadRequiredExtensions (vtkOpenGLRenderWindow *renWin)
 Load all necessary extensions. More...
 

Protected Attributes

vtkWeakPointer< vtkRenderWindowContext
 
bool DepthBufferNeeded
 
bool ColorBuffersDirty
 
unsigned int FBOIndex
 
int PreviousFBOIndex
 
unsigned int DepthBuffer
 
unsigned int NumberOfRenderTargets
 
int LastSize [2]
 
std::vector< unsigned intUserZSlices
 
std::vector< vtkSmartPointer< vtkTextureObject > > UserColorBuffers
 
std::vector< vtkSmartPointer< vtkTextureObject > > ColorBuffers
 
std::vector< unsigned intActiveBuffers
 
vtkSmartPointer< vtkTextureObjectUserDepthBuffer
 
bool DepthBufferDirty
 
vtkGenericOpenGLResourceFreeCallbackResourceCallback
 
vtkWeakPointer< vtkOpenGLRenderWindowContext
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

internal class which encapsulates OpenGL frame buffer object. Not to be used directly.

Encapsulates an OpenGL Frame Buffer Object. For use by vtkOpenGLFBORenderWindow, not to be used directly. Use vtkFrameBufferObject2 instead.

Warning
DON'T PLAY WITH IT YET.
See also
vtkFrameBufferObject2, vtkRenderbufferObject

Definition at line 46 of file vtkFrameBufferObject.h.

Member Typedef Documentation

◆ Superclass [1/2]

Definition at line 50 of file vtkFrameBufferObject.h.

◆ Superclass [2/2]

Definition at line 52 of file vtkFrameBufferObject.h.

Constructor & Destructor Documentation

◆ vtkFrameBufferObject() [1/2]

vtkFrameBufferObject::vtkFrameBufferObject ( )
protected

◆ ~vtkFrameBufferObject() [1/2]

vtkFrameBufferObject::~vtkFrameBufferObject ( )
protected

◆ vtkFrameBufferObject() [2/2]

vtkFrameBufferObject::vtkFrameBufferObject ( )
protected

◆ ~vtkFrameBufferObject() [2/2]

vtkFrameBufferObject::~vtkFrameBufferObject ( )
protected

Member Function Documentation

◆ New() [1/2]

static vtkFrameBufferObject* vtkFrameBufferObject::New ( )
static

◆ IsTypeOf() [1/2]

static int vtkFrameBufferObject::IsTypeOf ( const char *  type)
static

◆ IsA() [1/2]

virtual int vtkFrameBufferObject::IsA ( const char *  name)
virtual

Return 1 if this class is the same type of (or a subclass of) the named class.

Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkFrameBufferObjectBase.

◆ SafeDownCast() [1/2]

static vtkFrameBufferObject* vtkFrameBufferObject::SafeDownCast ( vtkObjectBase o)
static

◆ NewInstanceInternal() [1/2]

virtual vtkObjectBase* vtkFrameBufferObject::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented from vtkFrameBufferObjectBase.

◆ NewInstance() [1/2]

vtkFrameBufferObject* vtkFrameBufferObject::NewInstance ( ) const

◆ PrintSelf() [1/2]

void vtkFrameBufferObject::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
virtual

Methods invoked by print to print information about the object including superclasses.

Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkFrameBufferObjectBase.

◆ SetContext() [1/2]

void vtkFrameBufferObject::SetContext ( vtkRenderWindow context)

Get/Set the context.

Context must be a vtkOpenGLRenderWindow. This does not increase the reference count of the context to avoid reference loops. SetContext() may raise an error is the OpenGL context does not support the required OpenGL extensions.

◆ GetContext() [1/2]

vtkRenderWindow* vtkFrameBufferObject::GetContext ( )

◆ Start() [1/2]

bool vtkFrameBufferObject::Start ( int  width,
int  height,
bool  shaderSupportsTextureInt 
)

User must take care that width/height match the dimensions of the user defined texture attachments.

This method makes the "active buffers" the buffers that will get drawn into by subsequent drawing calls. Note that this does not clear the render buffers i.e. no glClear() calls are made by either of these methods. It's up to the caller to clear the buffers if needed.

◆ StartNonOrtho() [1/2]

bool vtkFrameBufferObject::StartNonOrtho ( int  width,
int  height,
bool  shaderSupportsTextureInt 
)

◆ RenderQuad() [1/2]

void vtkFrameBufferObject::RenderQuad ( int  minX,
int  maxX,
int  minY,
int  maxY 
)

Renders a quad at the given location with pixel coordinates.

This method is provided as a convenience, since we often render quads in a FBO.

Precondition
positive_minX: minX>=0
increasing_x: minX<=maxX
valid_maxX: maxX<LastSize[0]
positive_minY: minY>=0
increasing_y: minY<=maxY
valid_maxY: maxY<LastSize[1]

◆ Bind() [1/2]

void vtkFrameBufferObject::Bind ( )

Make the draw frame buffer active (uses FRAMEBUFFER).

◆ UnBind() [1/2]

void vtkFrameBufferObject::UnBind ( )

Restore the previous draw framebuffer if saved, else bind the default buffer.

◆ SetActiveBuffer() [1/2]

void vtkFrameBufferObject::SetActiveBuffer ( unsigned int  index)
inline

Choose the buffers to render into.

Definition at line 105 of file vtkFrameBufferObject.h.

◆ SetActiveBuffers() [1/2]

void vtkFrameBufferObject::SetActiveBuffers ( int  numbuffers,
unsigned int  indices[] 
)

User provided color buffers are attached by index to color buffers.

This command lets you select which attachments are written to. See set color buffer. This call overwrites what the previous list of active buffers.

◆ SetColorBuffer() [1/2]

void vtkFrameBufferObject::SetColorBuffer ( unsigned int  index,
vtkTextureObject texture,
unsigned int  zslice = 0 
)

Insert a color buffer into the list of available color buffers.

0 to NumberOfRenderTargets of these are attached to color attachments by index. See SetActiveBuffers to select them for writing. All user specified texture objects must match the FBO dimensions and must have been created by the time Start() gets called. If texture is a 3D texture, zslice identifies the zslice that will be attached to the color buffer. .SECTION Caveat Currently, 1D textures are not supported.

◆ GetColorBuffer() [1/2]

vtkTextureObject* vtkFrameBufferObject::GetColorBuffer ( unsigned int  index)

◆ RemoveColorBuffer() [1/2]

void vtkFrameBufferObject::RemoveColorBuffer ( unsigned int  index)

◆ RemoveAllColorBuffers() [1/2]

void vtkFrameBufferObject::RemoveAllColorBuffers ( )

◆ SetDepthBuffer() [1/2]

void vtkFrameBufferObject::SetDepthBuffer ( vtkTextureObject depthTexture)

Set the texture to use as depth buffer.

◆ RemoveDepthBuffer() [1/2]

void vtkFrameBufferObject::RemoveDepthBuffer ( )

◆ SetDepthBufferNeeded() [1/2]

virtual void vtkFrameBufferObject::SetDepthBufferNeeded ( bool  )
virtual

If true, the frame buffer object will be initialized with a depth buffer.

Initial value is true.

◆ GetDepthBufferNeeded() [1/2]

virtual bool vtkFrameBufferObject::GetDepthBufferNeeded ( )
virtual

◆ SetNumberOfRenderTargets() [1/2]

void vtkFrameBufferObject::SetNumberOfRenderTargets ( unsigned int  )

Set/Get the number of render targets to render into at once.

Textures (user supplied or generated internally) are attached to color attachment 0 to NumberOfRenderTargets. You can use SetActiveBuffer to specify which of these are actually written to. If zero then all of the user provided color buffers are used.

◆ GetNumberOfRenderTargets() [1/2]

virtual unsigned int vtkFrameBufferObject::GetNumberOfRenderTargets ( )
virtual

◆ GetMaximumNumberOfActiveTargets() [1/2]

unsigned int vtkFrameBufferObject::GetMaximumNumberOfActiveTargets ( )

Returns the maximum number of targets that can be rendered to at one time.

This limits the active targets set by SetActiveTargets(). The return value is valid only if GetContext is non-null.

◆ GetMaximumNumberOfRenderTargets() [1/2]

unsigned int vtkFrameBufferObject::GetMaximumNumberOfRenderTargets ( )

Returns the maximum number of render targets available.

This limits the available attachement points for SetColorAttachment(). The return value is valid only if GetContext is non-null.

◆ GetLastSize() [1/6]

virtual int* vtkFrameBufferObject::GetLastSize ( )
virtual

Dimensions in pixels of the framebuffer.

Implements vtkFrameBufferObjectBase.

◆ GetLastSize() [2/6]

virtual void vtkFrameBufferObject::GetLastSize ( int ,
int  
)
virtual

◆ GetLastSize() [3/6]

virtual void vtkFrameBufferObject::GetLastSize ( int  [2])
virtual

◆ IsSupported() [1/2]

static bool vtkFrameBufferObject::IsSupported ( vtkRenderWindow renWin)
static

Returns if the context supports the required extensions.

Extension will be loaded when the conetxt is set.

◆ CheckFrameBufferStatus() [1/2]

int vtkFrameBufferObject::CheckFrameBufferStatus ( unsigned int  mode)

Validate the current FBO configuration (attachments, formats, etc) prints detected errors to vtkErrorMacro.

◆ LoadRequiredExtensions() [1/2]

static bool vtkFrameBufferObject::LoadRequiredExtensions ( vtkRenderWindow renWin)
staticprotected

Load all necessary extensions.

◆ CreateFBO() [1/2]

void vtkFrameBufferObject::CreateFBO ( )
protected

◆ DestroyFBO() [1/2]

void vtkFrameBufferObject::DestroyFBO ( )
protected

◆ CreateDepthBuffer() [1/2]

void vtkFrameBufferObject::CreateDepthBuffer ( int  width,
int  height,
unsigned int  mode 
)
protected

◆ CreateColorBuffers() [1/2]

void vtkFrameBufferObject::CreateColorBuffers ( int  width,
int  height,
unsigned int  mode,
bool  shaderSupportsTextureInt 
)
protected

◆ DestroyDepthBuffer() [1/2]

void vtkFrameBufferObject::DestroyDepthBuffer ( )
protected

◆ DestroyColorBuffers() [1/2]

void vtkFrameBufferObject::DestroyColorBuffers ( )
protected

◆ ActivateBuffers() [1/2]

void vtkFrameBufferObject::ActivateBuffers ( )
protected

◆ DisplayFrameBufferAttachments() [1/2]

void vtkFrameBufferObject::DisplayFrameBufferAttachments ( )
protected

Display all the attachments of the current framebuffer object.

◆ DisplayFrameBufferAttachment() [1/2]

void vtkFrameBufferObject::DisplayFrameBufferAttachment ( unsigned int  uattachment)
protected

Display a given attachment for the current framebuffer object.

◆ DisplayDrawBuffers() [1/2]

void vtkFrameBufferObject::DisplayDrawBuffers ( )
protected

Display the draw buffers.

◆ DisplayReadBuffer() [1/2]

void vtkFrameBufferObject::DisplayReadBuffer ( )
protected

Display the read buffer.

◆ DisplayBuffer() [1/2]

void vtkFrameBufferObject::DisplayBuffer ( int  value)
protected

Display any buffer (convert value into string).

◆ New() [2/2]

static vtkFrameBufferObject* vtkFrameBufferObject::New ( )
static

◆ IsTypeOf() [2/2]

static int vtkFrameBufferObject::IsTypeOf ( const char *  type)
static

◆ IsA() [2/2]

virtual int vtkFrameBufferObject::IsA ( const char *  name)
virtual

Return 1 if this class is the same type of (or a subclass of) the named class.

Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkFrameBufferObjectBase.

◆ SafeDownCast() [2/2]

static vtkFrameBufferObject* vtkFrameBufferObject::SafeDownCast ( vtkObjectBase o)
static

◆ NewInstanceInternal() [2/2]

virtual vtkObjectBase* vtkFrameBufferObject::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented from vtkFrameBufferObjectBase.

◆ NewInstance() [2/2]

vtkFrameBufferObject* vtkFrameBufferObject::NewInstance ( ) const

◆ PrintSelf() [2/2]

void vtkFrameBufferObject::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
virtual

Methods invoked by print to print information about the object including superclasses.

Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkFrameBufferObjectBase.

◆ SetContext() [2/2]

void vtkFrameBufferObject::SetContext ( vtkOpenGLRenderWindow context)

Get/Set the context.

Context must be a vtkOpenGLRenderWindow. This does not increase the reference count of the context to avoid reference loops. SetContext() may raise an error is the OpenGL context does not support the required OpenGL extensions.

◆ GetContext() [2/2]

vtkOpenGLRenderWindow* vtkFrameBufferObject::GetContext ( )

◆ Start() [2/2]

bool vtkFrameBufferObject::Start ( int  width,
int  height,
bool  shaderSupportsTextureInt 
)

User must take care that width/height match the dimensions of the user defined texture attachments.

This method makes the "active buffers" the buffers that will get drawn into by subsequent drawing calls. Note that this does not clear the render buffers i.e. no glClear() calls are made by either of these methods. It's up to the caller to clear the buffers if needed.

◆ StartNonOrtho() [2/2]

bool vtkFrameBufferObject::StartNonOrtho ( int  width,
int  height,
bool  shaderSupportsTextureInt 
)

◆ RenderQuad() [2/2]

void vtkFrameBufferObject::RenderQuad ( int  minX,
int  maxX,
int  minY,
int  maxY,
vtkShaderProgram program,
vtkOpenGLVertexArrayObject vao 
)

Renders a quad at the given location with pixel coordinates.

This method is provided as a convenience, since we often render quads in a FBO.

Precondition
positive_minX: minX>=0
increasing_x: minX<=maxX
valid_maxX: maxX<LastSize[0]
positive_minY: minY>=0
increasing_y: minY<=maxY
valid_maxY: maxY<LastSize[1]

◆ Bind() [2/2]

void vtkFrameBufferObject::Bind ( )

Make the draw frame buffer active (uses FRAMEBUFFER).

◆ UnBind() [2/2]

void vtkFrameBufferObject::UnBind ( )

Restore the previous draw framebuffer if saved, else bind the default buffer.

◆ SetActiveBuffer() [2/2]

void vtkFrameBufferObject::SetActiveBuffer ( unsigned int  index)
inline

Choose the buffers to render into.

Definition at line 108 of file vtkFrameBufferObject.h.

◆ SetActiveBuffers() [2/2]

void vtkFrameBufferObject::SetActiveBuffers ( int  numbuffers,
unsigned int  indices[] 
)

User provided color buffers are attached by index to color buffers.

This command lets you select which attachments are written to. See set color buffer. This call overwrites what the previous list of active buffers.

◆ SetColorBuffer() [2/2]

void vtkFrameBufferObject::SetColorBuffer ( unsigned int  index,
vtkTextureObject texture,
unsigned int  zslice = 0 
)

Insert a color buffer into the list of available color buffers.

0 to NumberOfRenderTargets of these are attached to color attachments by index. See SetActiveBuffers to select them for writing. All user specified texture objects must match the FBO dimensions and must have been created by the time Start() gets called. If texture is a 3D texture, zslice identifies the zslice that will be attached to the color buffer. .SECTION Caveat Currently, 1D textures are not supported.

◆ GetColorBuffer() [2/2]

vtkTextureObject* vtkFrameBufferObject::GetColorBuffer ( unsigned int  index)

◆ RemoveColorBuffer() [2/2]

void vtkFrameBufferObject::RemoveColorBuffer ( unsigned int  index)

◆ RemoveAllColorBuffers() [2/2]

void vtkFrameBufferObject::RemoveAllColorBuffers ( )

◆ SetDepthBuffer() [2/2]

void vtkFrameBufferObject::SetDepthBuffer ( vtkTextureObject depthTexture)

Set the texture to use as depth buffer.

◆ RemoveDepthBuffer() [2/2]

void vtkFrameBufferObject::RemoveDepthBuffer ( )

◆ SetDepthBufferNeeded() [2/2]

virtual void vtkFrameBufferObject::SetDepthBufferNeeded ( bool  )
virtual

If true, the frame buffer object will be initialized with a depth buffer.

Initial value is true.

◆ GetDepthBufferNeeded() [2/2]

virtual bool vtkFrameBufferObject::GetDepthBufferNeeded ( )
virtual

◆ SetNumberOfRenderTargets() [2/2]

void vtkFrameBufferObject::SetNumberOfRenderTargets ( unsigned int  )

Set/Get the number of render targets to render into at once.

Textures (user supplied or generated internally) are attached to color attachment 0 to NumberOfRenderTargets. You can use SetActiveBuffer to specify which of these are actually written to. If zero then all of the user provided color buffers are used.

◆ GetNumberOfRenderTargets() [2/2]

virtual unsigned int vtkFrameBufferObject::GetNumberOfRenderTargets ( )
virtual

◆ GetMaximumNumberOfActiveTargets() [2/2]

unsigned int vtkFrameBufferObject::GetMaximumNumberOfActiveTargets ( )

Returns the maximum number of targets that can be rendered to at one time.

This limits the active targets set by SetActiveTargets(). The return value is valid only if GetContext is non-null.

◆ GetMaximumNumberOfRenderTargets() [2/2]

unsigned int vtkFrameBufferObject::GetMaximumNumberOfRenderTargets ( )

Returns the maximum number of render targets available.

This limits the available attachement points for SetColorAttachment(). The return value is valid only if GetContext is non-null.

◆ GetLastSize() [4/6]

virtual int* vtkFrameBufferObject::GetLastSize ( )
virtual

Dimensions in pixels of the framebuffer.

Implements vtkFrameBufferObjectBase.

◆ GetLastSize() [5/6]

virtual void vtkFrameBufferObject::GetLastSize ( int ,
int  
)
virtual

◆ GetLastSize() [6/6]

virtual void vtkFrameBufferObject::GetLastSize ( int  [2])
virtual

◆ IsSupported() [2/2]

static bool vtkFrameBufferObject::IsSupported ( vtkOpenGLRenderWindow renWin)
static

Returns if the context supports the required extensions.

Extension will be loaded when the conetxt is set.

◆ CheckFrameBufferStatus() [2/2]

int vtkFrameBufferObject::CheckFrameBufferStatus ( unsigned int  mode)

Validate the current FBO configuration (attachments, formats, etc) prints detected errors to vtkErrorMacro.

◆ ReleaseGraphicsResources()

virtual void vtkFrameBufferObject::ReleaseGraphicsResources ( vtkWindow win)
virtual

Deactivate and UnBind.

◆ LoadRequiredExtensions() [2/2]

static bool vtkFrameBufferObject::LoadRequiredExtensions ( vtkOpenGLRenderWindow renWin)
staticprotected

Load all necessary extensions.

◆ CreateFBO() [2/2]

void vtkFrameBufferObject::CreateFBO ( )
protected

◆ DestroyFBO() [2/2]

void vtkFrameBufferObject::DestroyFBO ( )
protected

◆ CreateDepthBuffer() [2/2]

void vtkFrameBufferObject::CreateDepthBuffer ( int  width,
int  height,
unsigned int  mode 
)
protected

◆ CreateColorBuffers() [2/2]

void vtkFrameBufferObject::CreateColorBuffers ( int  width,
int  height,
unsigned int  mode,
bool  shaderSupportsTextureInt 
)
protected

◆ DestroyDepthBuffer() [2/2]

void vtkFrameBufferObject::DestroyDepthBuffer ( )
protected

◆ DestroyColorBuffers() [2/2]

void vtkFrameBufferObject::DestroyColorBuffers ( )
protected

◆ ActivateBuffers() [2/2]

void vtkFrameBufferObject::ActivateBuffers ( )
protected

◆ DisplayFrameBufferAttachments() [2/2]

void vtkFrameBufferObject::DisplayFrameBufferAttachments ( )
protected

Display all the attachments of the current framebuffer object.

◆ DisplayFrameBufferAttachment() [2/2]

void vtkFrameBufferObject::DisplayFrameBufferAttachment ( unsigned int  uattachment)
protected

Display a given attachment for the current framebuffer object.

◆ DisplayDrawBuffers() [2/2]

void vtkFrameBufferObject::DisplayDrawBuffers ( )
protected

Display the draw buffers.

◆ DisplayReadBuffer() [2/2]

void vtkFrameBufferObject::DisplayReadBuffer ( )
protected

Display the read buffer.

◆ DisplayBuffer() [2/2]

void vtkFrameBufferObject::DisplayBuffer ( int  value)
protected

Display any buffer (convert value into string).

Member Data Documentation

◆ Context [1/2]

vtkWeakPointer<vtkRenderWindow> vtkFrameBufferObject::Context
protected

Definition at line 264 of file vtkFrameBufferObject.h.

◆ DepthBufferNeeded

bool vtkFrameBufferObject::DepthBufferNeeded
protected

Definition at line 266 of file vtkFrameBufferObject.h.

◆ ColorBuffersDirty

bool vtkFrameBufferObject::ColorBuffersDirty
protected

Definition at line 267 of file vtkFrameBufferObject.h.

◆ FBOIndex

unsigned int vtkFrameBufferObject::FBOIndex
protected

Definition at line 268 of file vtkFrameBufferObject.h.

◆ PreviousFBOIndex

int vtkFrameBufferObject::PreviousFBOIndex
protected

Definition at line 269 of file vtkFrameBufferObject.h.

◆ DepthBuffer

unsigned int vtkFrameBufferObject::DepthBuffer
protected

Definition at line 270 of file vtkFrameBufferObject.h.

◆ NumberOfRenderTargets

unsigned int vtkFrameBufferObject::NumberOfRenderTargets
protected

Definition at line 271 of file vtkFrameBufferObject.h.

◆ LastSize

int vtkFrameBufferObject::LastSize
protected

Definition at line 272 of file vtkFrameBufferObject.h.

◆ UserZSlices

std::vector< unsigned int > vtkFrameBufferObject::UserZSlices
protected

Definition at line 273 of file vtkFrameBufferObject.h.

◆ UserColorBuffers

std::vector< vtkSmartPointer< vtkTextureObject > > vtkFrameBufferObject::UserColorBuffers
protected

Definition at line 274 of file vtkFrameBufferObject.h.

◆ ColorBuffers

std::vector< vtkSmartPointer< vtkTextureObject > > vtkFrameBufferObject::ColorBuffers
protected

Definition at line 275 of file vtkFrameBufferObject.h.

◆ ActiveBuffers

std::vector< unsigned int > vtkFrameBufferObject::ActiveBuffers
protected

Definition at line 276 of file vtkFrameBufferObject.h.

◆ UserDepthBuffer

vtkSmartPointer< vtkTextureObject > vtkFrameBufferObject::UserDepthBuffer
protected

Definition at line 277 of file vtkFrameBufferObject.h.

◆ DepthBufferDirty

bool vtkFrameBufferObject::DepthBufferDirty
protected

Definition at line 278 of file vtkFrameBufferObject.h.

◆ ResourceCallback

vtkGenericOpenGLResourceFreeCallback* vtkFrameBufferObject::ResourceCallback
protected

Definition at line 216 of file vtkFrameBufferObject.h.

◆ Context [2/2]

vtkWeakPointer<vtkOpenGLRenderWindow> vtkFrameBufferObject::Context
protected

Definition at line 274 of file vtkFrameBufferObject.h.


The documentation for this class was generated from the following file: