Cinder  0.9.1
Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
cinder::gl::Fbo::Format Struct Reference

#include <Fbo.h>

Inherited by cinder::gl::FboCubeMap::Format [private].

Public Member Functions

 Format ()
 
FormatcolorTexture (const Texture::Format &textureFormat=getDefaultColorTextureFormat(true))
 
FormatdisableColor ()
 
FormatdepthBuffer (GLenum internalFormat=getDefaultDepthInternalFormat())
 
FormatdepthTexture (const Texture::Format &textureFormat=getDefaultDepthTextureFormat())
 
FormatdisableDepth ()
 
Formatsamples (int samples)
 
FormatcoverageSamples (int coverageSamples)
 
FormatstencilBuffer (bool stencilBuffer=true)
 
Formatattachment (GLenum attachmentPoint, const RenderbufferRef &buffer, RenderbufferRef multisampleBuffer=RenderbufferRef())
 
Formatattachment (GLenum attachmentPoint, const TextureBaseRef &texture, RenderbufferRef multisampleBuffer=RenderbufferRef())
 
void setDepthBufferInternalFormat (GLint depthInternalFormat)
 
void setSamples (int samples)
 
void setCoverageSamples (int coverageSamples)
 
void setColorTextureFormat (const Texture::Format &format)
 
void enableDepthBuffer (bool depthBuffer=true)
 
void enableStencilBuffer (bool stencilBuffer=true)
 
void removeAttachment (GLenum attachmentPoint)
 
GLint getDepthBufferInternalFormat () const
 
const Texture::Format & getColorTextureFormat () const
 
const Texture::Format & getDepthTextureFormat () const
 
int getSamples () const
 
int getCoverageSamples () const
 
bool hasColorTexture () const
 
bool hasDepthBuffer () const
 
bool hasStencilBuffer () const
 
const std::string & getLabel () const
 
void setLabel (const std::string &label)
 
Formatlabel (const std::string &label)
 

Static Public Member Functions

static Texture::Format getDefaultColorTextureFormat (bool alpha=true)
 
static Texture::Format getDefaultDepthTextureFormat ()
 
static GLint getDefaultColorInternalFormat (bool alpha=true)
 
static GLint getDefaultDepthInternalFormat ()
 
static void getDepthStencilFormats (GLint depthInternalFormat, GLint *resultInternalFormat, GLenum *resultPixelDataType)
 

Protected Attributes

GLenum mDepthBufferInternalFormat
 
int mSamples
 
int mCoverageSamples
 
bool mColorTexture
 
bool mDepthTexture
 
bool mDepthBuffer
 
bool mStencilBuffer
 
Texture::Format mColorTextureFormat
 
Texture::Format mDepthTextureFormat
 
std::string mLabel
 
std::map< GLenum, RenderbufferRefmAttachmentsBuffer
 
std::map< GLenum, RenderbufferRefmAttachmentsMultisampleBuffer
 
std::map< GLenum, TextureBaseRefmAttachmentsTexture
 

Friends

class Fbo
 

Detailed Description

Defines the Format of the Fbo, which is passed in via create().

The default provides an 8-bit RGBA color texture attachment and a 24-bit depth renderbuffer attachment, multi-sampling and stencil disabled.

Constructor & Destructor Documentation

cinder::gl::Fbo::Format::Format ( )

Default constructor, sets the target to GL_TEXTURE_2D with an 8-bit color+alpha, a 24-bit depth texture, and no multisampling or mipmapping.

Member Function Documentation

Format& cinder::gl::Fbo::Format::colorTexture ( const Texture::Format &  textureFormat = getDefaultColorTextureFormat( true ))

Enables a color texture at GL_COLOR_ATTACHMENT0 with a Texture::Format of textureFormat, which defaults to 8-bit RGBA with no mipmapping. Disables a color renderbuffer.

Format& cinder::gl::Fbo::Format::disableColor ( )

Disables both a color Texture and a color Buffer.

Format& cinder::gl::Fbo::Format::depthBuffer ( GLenum  internalFormat = getDefaultDepthInternalFormat())

Enables a depth renderbuffer with an internal format of internalFormat, which defaults to GL_DEPTH_COMPONENT24. Disables a depth texture.

Format& cinder::gl::Fbo::Format::depthTexture ( const Texture::Format &  textureFormat = getDefaultDepthTextureFormat())

Enables a depth texture with a format of textureFormat, which defaults to GL_DEPTH_COMPONENT24. Disables a depth renderbuffer.

Format& cinder::gl::Fbo::Format::disableDepth ( )

Disables both a depth Texture and a depth Buffer.

Format& cinder::gl::Fbo::Format::samples ( int  samples)

Sets the number of MSAA samples. Defaults to none.

Format& cinder::gl::Fbo::Format::coverageSamples ( int  coverageSamples)

Sets the number of CSAA samples. Defaults to none.

Format& cinder::gl::Fbo::Format::stencilBuffer ( bool  stencilBuffer = true)

Enables a stencil buffer. Defaults to false.

Fbo::Format & cinder::gl::Fbo::Format::attachment ( GLenum  attachmentPoint,
const RenderbufferRef buffer,
RenderbufferRef  multisampleBuffer = RenderbufferRef() 
)

Adds a Renderbuffer attachment buffer at attachmentPoint (such as GL_COLOR_ATTACHMENT0). Replaces any existing attachment at the same attachment point.

Fbo::Format & cinder::gl::Fbo::Format::attachment ( GLenum  attachmentPoint,
const TextureBaseRef texture,
RenderbufferRef  multisampleBuffer = RenderbufferRef() 
)

Adds a Texture attachment texture at attachmentPoint (such as GL_COLOR_ATTACHMENT0). Replaces any existing attachment at the same attachment point.

void cinder::gl::Fbo::Format::setDepthBufferInternalFormat ( GLint  depthInternalFormat)

Sets the internal format for the depth buffer. Defaults to GL_DEPTH_COMPONENT24. Common options also include GL_DEPTH_COMPONENT16 and GL_DEPTH_COMPONENT32.

void cinder::gl::Fbo::Format::setSamples ( int  samples)

Sets the number of samples used in MSAA-style antialiasing. Defaults to none, disabling multisampling. Note that not all implementations support multisampling.

void cinder::gl::Fbo::Format::setCoverageSamples ( int  coverageSamples)

Sets the number of coverage samples used in CSAA-style antialiasing. Defaults to none. Note that not all implementations support CSAA, and is currenlty Windows-only Nvidia. Ignored on OpenGL ES.

void cinder::gl::Fbo::Format::setColorTextureFormat ( const Texture::Format &  format)

Sets the Color Texture::Format for use in the creation of the color texture.

void cinder::gl::Fbo::Format::enableDepthBuffer ( bool  depthBuffer = true)

Enables or disables the creation of a depth buffer for the FBO.

void cinder::gl::Fbo::Format::enableStencilBuffer ( bool  stencilBuffer = true)

Enables or disables the creation of a stencil buffer.

void cinder::gl::Fbo::Format::removeAttachment ( GLenum  attachmentPoint)

Removes a buffer or texture attached at attachmentPoint.

GLint cinder::gl::Fbo::Format::getDepthBufferInternalFormat ( ) const

Returns the GL internal format for the depth buffer. Defaults to GL_DEPTH_COMPONENT24.

const Texture::Format& cinder::gl::Fbo::Format::getColorTextureFormat ( ) const

Returns the Texture::Format for the default color texture at GL_COLOR_ATTACHMENT0.

const Texture::Format& cinder::gl::Fbo::Format::getDepthTextureFormat ( ) const

Returns the Texture::Format for the depth texture.

int cinder::gl::Fbo::Format::getSamples ( ) const

Returns the number of samples used in MSAA-style antialiasing. Defaults to none, disabling multisampling.

int cinder::gl::Fbo::Format::getCoverageSamples ( ) const

Returns the number of coverage samples used in CSAA-style antialiasing. Defaults to none. MSW only.

bool cinder::gl::Fbo::Format::hasColorTexture ( ) const

Returns whether the FBO contains a Texture at GL_COLOR_ATTACHMENT0.

bool cinder::gl::Fbo::Format::hasDepthBuffer ( ) const

Returns whether the FBO has a Renderbuffer as a depth attachment.

bool cinder::gl::Fbo::Format::hasStencilBuffer ( ) const

Returns whether the FBO has a Renderbuffer as a stencil attachment.

Texture::Format cinder::gl::Fbo::Format::getDefaultColorTextureFormat ( bool  alpha = true)
static

Returns the default color Texture::Format for this platform.

Texture::Format cinder::gl::Fbo::Format::getDefaultDepthTextureFormat ( )
static

Returns the default depth Texture::Format for this platform.

GLint cinder::gl::Fbo::Format::getDefaultColorInternalFormat ( bool  alpha = true)
static

Returns the default internalFormat for a color Renderbuffer for this platform.

GLint cinder::gl::Fbo::Format::getDefaultDepthInternalFormat ( )
static

Returns the default internalFormat for a depth Renderbuffer for this platform.

void cinder::gl::Fbo::Format::getDepthStencilFormats ( GLint  depthInternalFormat,
GLint *  resultInternalFormat,
GLenum *  resultPixelDataType 
)
static
const std::string& cinder::gl::Fbo::Format::getLabel ( ) const

Returns the debugging label associated with the Fbo.

void cinder::gl::Fbo::Format::setLabel ( const std::string &  label)

Sets the debugging label associated with the Fbo. Calls glObjectLabel() when available.

Format& cinder::gl::Fbo::Format::label ( const std::string &  label)

Sets the debugging label associated with the Fbo. Calls glObjectLabel() when available.

Friends And Related Function Documentation

friend class Fbo
friend

Member Data Documentation

GLenum cinder::gl::Fbo::Format::mDepthBufferInternalFormat
protected
int cinder::gl::Fbo::Format::mSamples
protected
int cinder::gl::Fbo::Format::mCoverageSamples
protected
bool cinder::gl::Fbo::Format::mColorTexture
protected
bool cinder::gl::Fbo::Format::mDepthTexture
protected
bool cinder::gl::Fbo::Format::mDepthBuffer
protected
bool cinder::gl::Fbo::Format::mStencilBuffer
protected
Texture::Format cinder::gl::Fbo::Format::mColorTextureFormat
protected
Texture::Format cinder::gl::Fbo::Format::mDepthTextureFormat
protected
std::string cinder::gl::Fbo::Format::mLabel
protected
std::map<GLenum,RenderbufferRef> cinder::gl::Fbo::Format::mAttachmentsBuffer
protected
std::map<GLenum,RenderbufferRef> cinder::gl::Fbo::Format::mAttachmentsMultisampleBuffer
protected
std::map<GLenum,TextureBaseRef> cinder::gl::Fbo::Format::mAttachmentsTexture
protected

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