Allolib
1.0
C++ Components For Interactive Multimedia
|
Frame buffer object class. More...
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 | |
FBO & | attachRBO (const RBO &rbo, unsigned int attachment=GL_DEPTH_ATTACHMENT) |
Attach RBO at specified attachment point. | |
FBO & | detachRBO (unsigned int attachment) |
Detach RBO at specified attachment point. | |
FBO & | attachTexture2D (Texture const &tex, unsigned int attach=GL_COLOR_ATTACHMENT0, int level=0) |
Attach a texture. More... | |
FBO & | detachTexture2D (unsigned int attachment, int level=0) |
Detach texture at a specified attachment point and mipmap level. | |
FBO & | attachCubemapFace (Texture const &tex, unsigned int target_face, unsigned int attachment=GL_COLOR_ATTACHMENT0, int level=0) |
FBO & | detachCubemapFace (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 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 |
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.
FBO& al::FBO::attachTexture2D | ( | Texture const & | tex, |
unsigned int | attach = GL_COLOR_ATTACHMENT0 , |
||
int | level = 0 |
||
) |
Attach a texture.
[in] | texID | texture ID |
[in] | attach | Attachment type |
[in] | level | mipmap level of texture |
|
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.