Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
ACG::FBO Class Reference

#include <AC>


struct  RenderTexture
 attached textures More...

Public Member Functions

 FBO ()
 Default constructor.
 ~FBO ()
void init ()
 function to generate the framebuffer object
void del ()
 delete fbo and all internally created render textures
GLsizei setMultisampling (GLsizei _samples, GLboolean _fixedsamplelocations=GL_TRUE)
GLsizei getMultisamplingCount () const
 get number of samples
void attachTexture (GLenum _attachment, GLuint _texture, GLuint _level=0)
 attach a texture of arbitrary dimension (requires OpenGL 3.2)
void attachTexture2D (GLenum _attachment, GLsizei _width, GLsizei _height, GLuint _internalFmt, GLenum _format, GLint _wrapMode=GL_CLAMP, GLint _minFilter=GL_NEAREST, GLint _magFilter=GL_NEAREST)
 function to attach a texture to fbo
void attachTexture2D (GLenum _attachment, GLuint _texture, GLenum _target=GL_TEXTURE_2D)
 function to attach a texture to fbo
void attachTexture2DDepth (GLsizei _width, GLsizei _height, GLuint _internalFmt=GL_DEPTH_COMPONENT32, GLenum _format=GL_DEPTH_COMPONENT)
 function to attach a depth-buffer texture to fbo (using GL_DEPTH_ATTACHMENT)
void attachTexture2DStencil (GLsizei _width, GLsizei _height)
 function to attach a stencil-buffer texture to fbo (texformat = GL_STENCIL_INDEX8)
void attachTexture3D (GLenum _attachment, GLsizei _width, GLsizei _height, GLsizei _depth, GLuint _internalFmt, GLenum _format, GLint _wrapMode=GL_CLAMP, GLint _minFilter=GL_NEAREST, GLint _magFilter=GL_NEAREST)
void addDepthBuffer (GLuint _width, GLuint _height)
 function to add a depth renderbuffer to the fbo
void addStencilBuffer (GLuint _width, GLuint _height)
 function to add a stencil renderbuffer to the fbo
void addDepthStencilBuffer (GLuint _width, GLuint _height)
 add a packed depth24_stencil8 renderbuffer
GLuint getAttachment (GLenum _attachment)
 return attached texture id
GLuint getInternalFormat (GLenum _attachment)
 return internal texture format of attachment
GLuint getFboID ()
 return opengl id
void resize (GLsizei _width, GLsizei _height, bool _forceResize=false)
 resize function (if textures created by this class)
GLsizei width () const
 get width of fbo texture
GLsizei height () const
 get height of fbo texture
ACG::Vec2i size () const
 get width and height of fbo texture
bool bind ()
 bind the fbo and sets it as rendertarget
void unbind ()
 unbind fbo, go to normal rendering mode
bool checkFramebufferStatus ()
 function to check the framebuffer status

Private Types

typedef std::map< GLenum,

Private Attributes

GLuint fbo_
 handle of frame buffer object
GLuint depthbuffer_
GLuint stencilbuffer_
AttachmentList attachments_
GLsizei width_
 width and height of render textures
GLsizei height_
GLsizei samples_
 sample count if multisampling
GLboolean fixedsamplelocation_
 enable fixed sample location if multisampling
GLuint prevFbo_
 handle of previously bound fbo
GLuint prevDrawBuffer_

Detailed Description


Brief Description.

A more elaborate description follows.

Definition at line 83 of file FBO.hh.

Member Function Documentation

void ACG::FBO::attachTexture3D ( GLenum  _attachment,
GLsizei  _width,
GLsizei  _height,
GLsizei  _depth,
GLuint  _internalFmt,
GLenum  _format,
GLint  _wrapMode = GL_CLAMP,
GLint  _minFilter = GL_NEAREST,
GLint  _magFilter = GL_NEAREST 

attach a 3D texture for render to volume (requires OpenGL 3.2) binds all slices at once, target slice has to be chosen via gl_Layer in geometry shader

Definition at line 279 of file

GLsizei ACG::FBO::setMultisampling ( GLsizei  _samples,
GLboolean  _fixedsamplelocations = GL_TRUE 

enable/disable multisampling returns the MSAA sample count of the fbo, which might not be equal to the requested _samples count but you'll get something close

Definition at line 602 of file

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