Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | List of all members
BIAS::FramebufferSetupPool Class Reference

Class containing a framebuffer and a map of setups. More...

#include <OpenGLFramework/Utils/FramebufferSetupPool.hh>

Public Member Functions

void Activate (const std::string &setupName)
 
void ClearAll ()
 
void ClearSetup (const std::string &setupName)
 Does not remove the attachment. More...
 
void Create (Texture2DPool &texturePoolP)
 Call this once the GLContext is valid. More...
 
FramebufferSetupCreateSetup (const std::string &setupName)
 
FramebufferSetupCreateSetup (const std::string &setupName, unsigned int width, unsigned int height, const std::string &colorAttachmentName, GLenum internalFormat, const bool clearColors=true, const std::string &depthAttachmentName="", const bool clearDepth=true, const float rClear=0.f, const float gClear=0.f, const float bClear=0.f, const float aClear=0.f, const float zClear=1.f)
 Create a setup and the required 2D textures. More...
 
FramebufferSetupCreateSetup (const std::string &setupName, unsigned int width, unsigned int height, const std::vector< std::string > &colorAttachmentNames, GLenum internalFormat, const bool clearColors=true, const std::string &depthAttachmentName="", const bool clearDepth=true, const float rClear=0.f, const float gClear=0.f, const float bClear=0.f, const float aClear=0.f, const float zClear=1.f)
 
 FramebufferSetupPool ()
 
glfTexture2DGetAttachment (const std::string &setupName, const std::string &attachmentName)
 Returns the pointer to a texture attached during a setup. More...
 
glfFramebufferObjectGetFBO ()
 
FramebufferSetupGetSetup (const std::string &setupName)
 Returns the pointer to a texture attached during a setup. More...
 
void GetSetupAttachmentNames (const std::string &setupName, std::vector< std::string > &attachmentNames)
 
Texture2DPoolGetTexturePool ()
 
void SetColorAttachments (const std::string &setupName, const std::vector< std::string > &colorAttachmentNames)
 
 ~FramebufferSetupPool ()
 

Detailed Description

Class containing a framebuffer and a map of setups.

Class can be used instead of an stand alone glfFramebufferObject, to manage different frambuffer setups. This class so far only supports 2D textures.

Author
bartczak 03/2009

Definition at line 45 of file FramebufferSetupPool.hh.

Constructor & Destructor Documentation

FramebufferSetupPool::~FramebufferSetupPool ( )

Definition at line 31 of file FramebufferSetupPool.cpp.

BIAS::FramebufferSetupPool::FramebufferSetupPool ( )
inline

Definition at line 49 of file FramebufferSetupPool.hh.

Member Function Documentation

void FramebufferSetupPool::Activate ( const std::string &  setupName)
void FramebufferSetupPool::ClearAll ( )

Definition at line 260 of file FramebufferSetupPool.cpp.

void FramebufferSetupPool::ClearSetup ( const std::string &  setupName)

Does not remove the attachment.

Definition at line 273 of file FramebufferSetupPool.cpp.

void FramebufferSetupPool::Create ( Texture2DPool texturePoolP)

Call this once the GLContext is valid.

Attention
must be called before using any other member method.

Definition at line 37 of file FramebufferSetupPool.cpp.

References BIAS::Texture2DPool::Create().

FramebufferSetup * FramebufferSetupPool::CreateSetup ( const std::string &  setupName)

Definition at line 237 of file FramebufferSetupPool.cpp.

References BIAS::FramebufferSetup::LinkFBO().

FramebufferSetup * FramebufferSetupPool::CreateSetup ( const std::string &  setupName,
unsigned int  width,
unsigned int  height,
const std::string &  colorAttachmentName,
GLenum  internalFormat,
const bool  clearColors = true,
const std::string &  depthAttachmentName = "",
const bool  clearDepth = true,
const float  rClear = 0.f,
const float  gClear = 0.f,
const float  bClear = 0.f,
const float  aClear = 0.f,
const float  zClear = 1.f 
)

Create a setup and the required 2D textures.

Parameters
setupNameis the name used to identify the setup.
widthhorizontal resolution.
widthvertical resolution.
colorAttachmentNamename of the glfTexture2D attached to COLOR_ATTACHMENT_0, identifying it in the internal Texture2DPool, this name must be unique across all setups.
internalFormatis the internal format of the target glfTexture2D.
clearColorif true the target texture is cleared when the setup is activated.
depthAttachmentNameif you want to render the depth output to a texture, give it a name for the internal Texture2DPool, if left empty to texture for the depth is attached, this name must be unique across all setups.
clearDepthif true the target 'depth textur'e is cleared when the setup is activated.
*Clearvalues the different channels are cleared, if clearing is enabled.

Definition at line 57 of file FramebufferSetupPool.cpp.

References BIAS::glfTexture::Create(), BIAS::FramebufferSetup::DisableColorClearance(), BIAS::FramebufferSetup::DisableDepthClearance(), BIAS::FramebufferSetup::EnableColorClearance(), BIAS::FramebufferSetup::EnableDepthClearance(), BIAS::FramebufferSetup::LinkFBO(), BIAS::FramebufferSetup::SetColorAttachment(), and BIAS::FramebufferSetup::SetDepthAttachment().

FramebufferSetup * FramebufferSetupPool::CreateSetup ( const std::string &  setupName,
unsigned int  width,
unsigned int  height,
const std::vector< std::string > &  colorAttachmentNames,
GLenum  internalFormat,
const bool  clearColors = true,
const std::string &  depthAttachmentName = "",
const bool  clearDepth = true,
const float  rClear = 0.f,
const float  gClear = 0.f,
const float  bClear = 0.f,
const float  aClear = 0.f,
const float  zClear = 1.f 
)
glfTexture2D * FramebufferSetupPool::GetAttachment ( const std::string &  setupName,
const std::string &  attachmentName 
)

Returns the pointer to a texture attached during a setup.

Attention
it is not possible to read from and write into the same texture.

Definition at line 333 of file FramebufferSetupPool.cpp.

glfFramebufferObject * FramebufferSetupPool::GetFBO ( )
FramebufferSetup * FramebufferSetupPool::GetSetup ( const std::string &  setupName)
void FramebufferSetupPool::GetSetupAttachmentNames ( const std::string &  setupName,
std::vector< std::string > &  attachmentNames 
)

Definition at line 359 of file FramebufferSetupPool.cpp.

Texture2DPool * FramebufferSetupPool::GetTexturePool ( )

Definition at line 327 of file FramebufferSetupPool.cpp.

void FramebufferSetupPool::SetColorAttachments ( const std::string &  setupName,
const std::vector< std::string > &  colorAttachmentNames 
)

Definition at line 184 of file FramebufferSetupPool.cpp.


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