Inviwo  0.9.10.1
Inviwo documentation
inviwo::FrameBufferObject Class Reference

Public Member Functions

void activate ()
 
void defineDrawBuffers ()
 
void deactivate ()
 
void attachTexture (Texture2D *texture, GLenum attachmentID)
 
GLenum attachColorTexture (Texture2D *texture)
 
GLenum attachColorTexture (Texture2D *texture, int attachmentNumber, bool attachFromRear=false, int forcedLocation=-1)
 
void attachTexture (Texture2DArray *texture, GLenum attachmentID)
 
GLenum attachColorTexture (Texture2DArray *texture)
 
GLenum attachColorTexture (Texture2DArray *texture, int attachmentNumber, bool attachFromRear=false, int forcedLocation=-1)
 
void attachTextureLayer (Texture2DArray *texture, GLenum attachmentID, int layer, int level=0)
 
GLenum attachColorTextureLayer (Texture2DArray *texture, int layer)
 
GLenum attachColorTextureLayer (Texture2DArray *texture, int attachmentNumber, int layer, bool attachFromRear=false, int forcedLocation=-1)
 
void attachTexture (Texture3D *texture, GLenum attachmentID)
 
GLenum attachColorTexture (Texture3D *texture)
 
GLenum attachColorTexture (Texture3D *texture, int attachmentNumber, bool attachFromRear=false, int forcedLocation=-1)
 
void attachTextureLayer (Texture3D *texture, GLenum attachmentID, int layer)
 
GLenum attachColorTextureLayer (Texture3D *texture, int layer)
 
GLenum attachColorTextureLayer (Texture3D *texture, int attachmentNumber, int layer, bool attachFromRear=false, int forcedLocation=-1)
 
void detachTexture (GLenum attachmentID)
 
void detachAllTextures ()
 
unsigned int getID () const
 
const std::vector< GLenum > & getDrawBuffers () const
 
const std::vector< bool > & getDrawBuffersInUse () const
 
const GLenum * getDrawBuffersDeprecated () const
 
int getMaxColorAttachments () const
 
int getAttachmentLocation (GLenum attachmentID) const
 
bool hasColorAttachment () const
 
bool hasDepthAttachment () const
 
bool hasStencilAttachment () const
 
void checkStatus ()
 
void setRead_Blit (bool set=true) const
 
void setDraw_Blit (bool set=true)
 
bool isActive () const
 

Static Public Member Functions

static void deactivateFBO ()
 

Protected Member Functions

void performAttachTexture (GLenum attachmentID)
 
bool performAttachColorTexture (GLenum &outAttachNumber)
 
bool performAttachColorTexture (GLenum &outAttachNumber, int attachmentNumber, bool attachFromRear=false, int forcedLocation=-1)
 
std::string printBuffers () const
 

Static Protected Member Functions

static std::string getAttachmentStr (GLenum attachmentID)
 

Member Function Documentation

◆ activate()

void inviwo::FrameBufferObject::activate ( )

Activate this FBO and store the currently set FBO

◆ attachColorTexture() [1/3]

GLenum inviwo::FrameBufferObject::attachColorTexture ( Texture2D texture,
int  attachmentNumber,
bool  attachFromRear = false,
int  forcedLocation = -1 
)

If forcedLocation is > -1, this will enforce to position the color attachment at the given location in the draw buffer list (as used for attrib location in shaders). Side effects: affects subsequent buffer locations of already attached color buffers

◆ attachColorTexture() [2/3]

GLenum inviwo::FrameBufferObject::attachColorTexture ( Texture2DArray texture,
int  attachmentNumber,
bool  attachFromRear = false,
int  forcedLocation = -1 
)

If forcedLocation is > -1, this will enforce to position the color attachment at the given location in the draw buffer list (as used for attrib location in shaders). Side effects: affects subsequent buffer locations of already attached color buffers

◆ attachColorTexture() [3/3]

GLenum inviwo::FrameBufferObject::attachColorTexture ( Texture3D texture,
int  attachmentNumber,
bool  attachFromRear = false,
int  forcedLocation = -1 
)

If forcedLocation is > -1, this will enforce to position the color attachment at the given location in the draw buffer list (as used for attrib location in shaders). Side effects: affects subsequent buffer locations of already attached color buffers

◆ attachColorTextureLayer() [1/2]

GLenum inviwo::FrameBufferObject::attachColorTextureLayer ( Texture2DArray texture,
int  attachmentNumber,
int  layer,
bool  attachFromRear = false,
int  forcedLocation = -1 
)

If forcedLocation is > -1, this will enforce to position the color attachment at the given location in the draw buffer list (as used for attrib location in shaders). Side effects: affects subsequent buffer locations of already attached color buffers

◆ attachColorTextureLayer() [2/2]

GLenum inviwo::FrameBufferObject::attachColorTextureLayer ( Texture3D texture,
int  attachmentNumber,
int  layer,
bool  attachFromRear = false,
int  forcedLocation = -1 
)

If forcedLocation is > -1, this will enforce to position the color attachment at the given location in the draw buffer list (as used for attrib location in shaders). Side effects: affects subsequent buffer locations of already attached color buffers

◆ attachTexture() [1/3]

void inviwo::FrameBufferObject::attachTexture ( Texture2D texture,
GLenum  attachmentID 
)

For attaching a 2D Texture

◆ attachTexture() [2/3]

void inviwo::FrameBufferObject::attachTexture ( Texture2DArray texture,
GLenum  attachmentID 
)

For attaching a 2D Array Texture

◆ attachTexture() [3/3]

void inviwo::FrameBufferObject::attachTexture ( Texture3D texture,
GLenum  attachmentID 
)

For attaching a 3D Texture

◆ attachTextureLayer() [1/2]

void inviwo::FrameBufferObject::attachTextureLayer ( Texture2DArray texture,
GLenum  attachmentID,
int  layer,
int  level = 0 
)

For attaching a layer of a 2D Array Texture

◆ attachTextureLayer() [2/2]

void inviwo::FrameBufferObject::attachTextureLayer ( Texture3D texture,
GLenum  attachmentID,
int  layer 
)

For attaching a layer of a 3D Texture

◆ deactivate()

void inviwo::FrameBufferObject::deactivate ( )

Unbind FBO and restore previous one

◆ deactivateFBO()

void inviwo::FrameBufferObject::deactivateFBO ( )
static

Use this function to unbind the FBO, without restoring the previous after this call, no FBO is bound

◆ getAttachmentLocation()

int inviwo::FrameBufferObject::getAttachmentLocation ( GLenum  attachmentID) const

Returns the location of the given attachment withing the registered draw buffers (e.g. used for glBindAttribLocation() and glFragDataLocation())

◆ getDrawBuffers()

const std::vector<GLenum>& inviwo::FrameBufferObject::getDrawBuffers ( ) const
inline

Returns a compactified list of all color attachments (as used in glDrawBuffers())

◆ getDrawBuffersInUse()

const std::vector<bool>& inviwo::FrameBufferObject::getDrawBuffersInUse ( ) const
inline

Returns a boolean field indicating whether attachment i has an attached texture

◆ performAttachColorTexture()

bool inviwo::FrameBufferObject::performAttachColorTexture ( GLenum &  outAttachNumber,
int  attachmentNumber,
bool  attachFromRear = false,
int  forcedLocation = -1 
)
protected

If forcedLocation is > -1, this will enforce to position the color attachment at the given location in the draw buffer list (as used for attrib location in shaders). Side effects: affects subsequent buffer locations of already attached color buffers. NOTE: if forcedLocation is larger than the number of attachments, it will not be considered


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