Inheritance Graph
graph BT
FBO
FBO --> ReferenceCounter
click FBO "classRendering_1_1FBO"
click ReferenceCounter "classUtil_1_1ReferenceCounter"
Description
Representation of a frame buffer object ( FBO ).
See also: A good introductionhttp://www.songho.ca/opengl/gl_fbo.html
// create a FBO
Util::Reference<FBO> fbo = new FBO;
// create a color and depthTexures
Util::Reference<Texture> depthTexture = TextureUtils::createDepthTexture(width, height);
Util::Reference<Texture> colorTexture = TextureUtils::createStdTexture(width, height, true);
myRenderingContext.pushFBO(fbo.get()); // enable FBO
// attach textures
fbo->attachColorTexture(colorTexture.get());
fbo->attachDepthTexture(depthTexture.get());
// check framebuffer
if(!fbo->isComplete()){
WARN( fbo->getStatusMessage() );
myRenderingContext.popFBO();
return;
}
myRenderingContext.popFBO(); // disable FBO
//...
myRenderingContext.pushFBO(fbo.get());
// ... do some rendering
myRenderingContext.popFBO();
// download a texture to access the pixel data
colorTexture->downloadGLTexture();
Public Functions
|
|
|
|
|
FBO() |
|
|
|
~FBO() |
|
|
void |
_enable() |
|
|
bool |
isComplete( RenderingContext & context) |
|
|
const char * |
getStatusMessage( RenderingContext & context) |
|
|
void |
attachTexture( RenderingContext & context, uint32_t attachmentPoint, Texture * t, uint32_t level, int32_t layer) |
|
|
void |
detachTexture( RenderingContext & context, uint32_t attachmentPoint) |
|
|
void |
attachColorTexture( RenderingContext & context, Texture * t, uint32_t colorBufferId, uint32_t level, int32_t layer) |
|
|
void |
detachColorTexture( RenderingContext & context, uint32_t colorBufferId) |
|
|
void |
attachDepthStencilTexture( RenderingContext & context, Texture * t, uint32_t level, int32_t layer) |
|
|
void |
detachDepthStencilTexture( RenderingContext & context) |
|
|
void |
attachDepthTexture( RenderingContext & context, Texture * t, uint32_t level, int32_t layer) |
|
|
void |
detachDepthTexture( RenderingContext & context) |
|
|
void |
setDrawBuffers( RenderingContext & context, uint32_t number) |
|
|
void |
blitToScreen( RenderingContext & context, const Geometry::Rect_i & srcRect, const Geometry::Rect_i & tgtRect) copy a block of pixels from this framebuffer to the screen |
Public Static Functions
Documentation
function
Rendering::FBO::FBO
Defined in Rendering/FBO.h:62
function
Rendering::FBO::~FBO
Defined in Rendering/FBO.h:63
function
Rendering::FBO::_enable
Note: is called by RenderingContext and should not be called directy
Defined in Rendering/FBO.h:69
function
Rendering::FBO::isComplete
Defined in Rendering/FBO.h:71
function
Rendering::FBO::getStatusMessage
Defined in Rendering/FBO.h:73
function
Rendering::FBO::attachTexture
Defined in Rendering/FBO.h:75
function
Rendering::FBO::detachTexture
Defined in Rendering/FBO.h:76
function
Rendering::FBO::attachColorTexture
Defined in Rendering/FBO.h:78
function
Rendering::FBO::detachColorTexture
Defined in Rendering/FBO.h:79
function
Rendering::FBO::attachDepthStencilTexture
Defined in Rendering/FBO.h:80
function
Rendering::FBO::detachDepthStencilTexture
Defined in Rendering/FBO.h:81
function
Rendering::FBO::attachDepthTexture
Defined in Rendering/FBO.h:82
function
Rendering::FBO::detachDepthTexture
Defined in Rendering/FBO.h:83
function
Rendering::FBO::setDrawBuffers
Activate the given number of draw buffers.
Parameters
- number
- Number of draw buffers to activate. Must be from [0, 8].
Exceptions
- std::invalid_argument
- ifnumberis greater than eight.
- std::logic_error
- if the GL implementation does not support this functionality.
See also: functionglDrawBuffers
Defined in Rendering/FBO.h:93
function
Rendering::FBO::blitToScreen
copy a block of pixels from this framebuffer to the screen
Defined in Rendering/FBO.h:96
function
Rendering::FBO::_disable
Note: is called by RenderingContext and should not be called directy
Defined in Rendering/FBO.h:66