Allolib  1.0
C++ Components For Interactive Multimedia
al::FBO Class Reference

Frame buffer object class. More...

#include <C:/Users/Andres/source/repos/casm_viewer/external/tinc/external/allolib/include/al/graphics/al_FBO.hpp>

Inheritance diagram for al::FBO:
al::GPUObject

Public Types

enum  Attachment {
  COLOR_ATTACHMENT0 = GL_COLOR_ATTACHMENT0 , COLOR_ATTACHMENT1 = GL_COLOR_ATTACHMENT1 , COLOR_ATTACHMENT2 = GL_COLOR_ATTACHMENT2 , COLOR_ATTACHMENT3 = GL_COLOR_ATTACHMENT3 ,
  DEPTH_ATTACHMENT = GL_DEPTH_ATTACHMENT , STENCIL_ATTACHMENT = GL_STENCIL_ATTACHMENT , DEPTH_STENCIL_ATTACHMENT = GL_DEPTH_STENCIL_ATTACHMENT
}
 Attachment type.
 

Public Member Functions

FBOattachRBO (const RBO &rbo, unsigned int attachment=GL_DEPTH_ATTACHMENT)
 Attach RBO at specified attachment point.
 
FBOdetachRBO (unsigned int attachment)
 Detach RBO at specified attachment point.
 
FBOattachTexture2D (Texture const &tex, unsigned int attach=GL_COLOR_ATTACHMENT0, int level=0)
 Attach a texture. More...
 
FBOdetachTexture2D (unsigned int attachment, int level=0)
 Detach texture at a specified attachment point and mipmap level.
 
FBOattachCubemapFace (Texture const &tex, unsigned int target_face, unsigned int attachment=GL_COLOR_ATTACHMENT0, int level=0)
 
FBOdetachCubemapFace (unsigned int target_face, unsigned int attachment, int level=0)
 
void bind ()
 Bind object (start rendering to attached objects)
 
void unbind ()
 Unbind object.
 
void begin ()
 
void end ()
 
GLenum status ()
 Get status of frame buffer object.
 
const char * statusString ()
 
const char * statusString (GLenum stat)
 
bool created () const
 Returns whether object has been created.
 
void create ()
 Creates object on GPU.
 
void destroy ()
 Destroys object on GPU.
 
unsigned long id () const
 Returns the assigned object id.
 
void id (unsigned long v)
 
void validate ()
 Ensure that the GPUObject is ready to use. More...
 
void invalidate ()
 Triggers re-creation of object safely.
 

Static Public Member Functions

static void bind (unsigned fboID)
 
static void renderBuffer (unsigned rboID, unsigned int attachment)
 
static void texture2D (unsigned texID, unsigned int attachment=GL_COLOR_ATTACHMENT0, int level=0)
 
static void textureCubemapFace (unsigned int texID, unsigned int target_face, unsigned int attachment=GL_COLOR_ATTACHMENT0, int level=0)
 

Static Public Attributes

static unsigned int const DEFAULT {0}
 

Protected Member Functions

virtual void onCreate ()
 Called when currently assigned context is created.
 
virtual void onDestroy ()
 Called when currently assigned context is destroyed.
 

Protected Attributes

unsigned int mID
 
bool mResubmit
 

Detailed Description

Frame buffer object class.

A frame buffer object is an application-created frame buffer that is non-displayable. A single FBO can have multiple rendering destinations (attachments) for color, depth, and stencil information. If the attachment is a texture, then the FBO does "render-to-texture". If the attachment is a render buffer object, then the FBO does "offscreen rendering". A single FBO can have multiple color attachments, but only one depth and one stencil attachment. Switching the attachments (attach/detach calls) is much faster than using multiple FBOs. All attachments must have the same dimensions and all color attachments must have the same pixel format. These are standard requirements of an FBO, not an implementation-imposed limitation.

Definition at line 150 of file al_FBO.hpp.

Member Function Documentation

◆ attachTexture2D()

FBO& al::FBO::attachTexture2D ( Texture const &  tex,
unsigned int  attach = GL_COLOR_ATTACHMENT0,
int  level = 0 
)

Attach a texture.

Parameters
[in]texIDtexture ID
[in]attachAttachment type
[in]levelmipmap level of texture

◆ validate()

void al::GPUObject::validate ( )
inherited

Ensure that the GPUObject is ready to use.

This is typically placed before any rendering implementation. If the object has been invalidated, the object will be destroyed and then created again. Otherwise, the object will simply be created if not already created.


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