![]() |
Carna Version 3.3.3
|
Maintains a framebuffer object that supports up to 8 color components simultaneously. More...
#include <Framebuffer.h>
Classes | |
class | Binding |
Acts like MinimalBinding, but checks the bound framebuffer for validity and allows rendering. More... | |
class | MinimalBinding |
Maintains the binding of a Framebuffer in a RAII-manner. More... | |
Public Member Functions | |
Framebuffer (unsigned int width, unsigned int height, Texture< 2 > &renderTexture) | |
Acquires framebuffer object with depth buffer and attaches renderTexture as the first color attachment. The renderTexture is resized automatically s.t. it matches the size of the framebuffer. | |
~Framebuffer () | |
Deletes the maintained framebuffer object and its depth buffer. | |
bool | hasRenderTexture (unsigned int location) const |
Tells whether a color component exists at location. | |
const Texture< 2 > & | renderTexture (unsigned int location) const |
References the render texture at location. | |
void | resize (const math::Vector2ui &size) |
Resizes depth buffer and color components to size. | |
void | resize (unsigned int width, unsigned int height) |
unsigned int | width () const |
Returns the framebuffer's width. | |
unsigned int | height () const |
Returns the framebuffer's height. | |
Static Public Member Functions | |
static Texture< 2 > * | createRenderTexture (bool floatingPoint=false) |
Creates render texture. | |
static void | copyDepthAttachment (unsigned int srcId, unsigned int dstId, const Viewport &src, const Viewport &dst) |
Copies data from the depth attachment of the framebuffer identified by srcId to the depth attachment of the framebuffer identified by dstId. Use 0 for one of these arguments to reference the main framebuffer. | |
static void | copyColorAttachment (unsigned int srcId, unsigned int dstId, const Viewport &src, const Viewport &dst, unsigned int srcColorAttachment, unsigned int dstColorAttachment) |
Copies data from the color attachment srcColorAttachment of the framebuffer identified by srcId to the color attachment dstColorAttachment of the framebuffer identified by dstId. Use 0 for one of these arguments to reference the main framebuffer. | |
static unsigned int | currentId () |
Tells the ID of the currently bound framebuffer. This is 0 for the main framebuffer. | |
Public Attributes | |
const unsigned int | id |
Identifies the maintained framebuffer object. | |
Static Public Attributes | |
static const unsigned int | MAXIMUM_ALLOWED_COLOR_COMPONENTS = 8 |
Holds maximum number of simultaneously supported color attachments. | |
Maintains a framebuffer object that supports up to 8 color components simultaneously.
An OpenGL framebuffer object typically consists of a depth attachment and an ordered set of color attachments. The depth attachment can be realized either by a depth buffer (faster, read-only) or by a depth texture. Color attachments are always textures. We call them render textures here.
Definition at line 49 of file Framebuffer.h.
|
static |
Creates render texture.
floatingPoint | sets whether float -based pixels shall be used instead of unsigned byte. |
Returns the framebuffer's height.
Definition at line 143 of file Framebuffer.h.
References the render texture at location.
hasRenderTexture(location) == true
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Returns the framebuffer's width.
Definition at line 135 of file Framebuffer.h.
Identifies the maintained framebuffer object.
Definition at line 97 of file Framebuffer.h.
Holds maximum number of simultaneously supported color attachments.
Definition at line 61 of file Framebuffer.h.
Documentation generated by Doxygen