Class for handling render to texture using framebuffer objects.
More...
#include <FBO.h>
|
| FBO (bool useTextureColor, bool useTextureDepth, bool multiSample, unsigned int width, unsigned int height, bool addSecondColorBuffer=false) |
|
| FBO (unsigned int nrColorTexture, bool useDepthTexture, bool useMultisampling, unsigned int width, unsigned int height) |
|
const unsigned int | getColorTexture (unsigned int i) const |
|
const unsigned int | getColorTexture () const |
|
const unsigned int | getSecondaryColorTexture () const |
|
const unsigned int | getDepthTexture () const |
|
const bool | isMultiSample () const |
|
void | setActive () |
|
|
static void | copyFBO (const FBO &from, const FBO &to, unsigned int bufferMask=GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) |
|
static void | copyFBO (const FBO &from, unsigned int to, unsigned int bufferMask=GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) |
|
static void | copyFBO (unsigned int from, const FBO &to, unsigned int bufferMask=GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) |
|
Class for handling render to texture using framebuffer objects.
◆ FBO() [1/2]
FBO::FBO |
( |
bool |
useTextureColor, |
|
|
bool |
useTextureDepth, |
|
|
bool |
multiSample, |
|
|
unsigned int |
width, |
|
|
unsigned int |
height, |
|
|
bool |
addSecondColorBuffer = false |
|
) |
| |
Creates a FBO with at most two color textures and one depth texture
- Parameters
-
useTextureColor | if a color texture is used |
useTextureDepth | if a depth texture is used |
multiSample | if multisampling should be enabled |
width | width of the framebuffer and textures |
height | height of the framebuffer and textures |
addSecondColorBuffer | if an additional color texture should be attached. |
◆ FBO() [2/2]
FBO::FBO |
( |
unsigned int |
nrColorTexture, |
|
|
bool |
useDepthTexture, |
|
|
bool |
useMultisampling, |
|
|
unsigned int |
width, |
|
|
unsigned int |
height |
|
) |
| |
Creates a FBO with a arbitrary number of color textures.
- Parameters
-
nrColorTexture | nr of color textures attached. |
useDepthTexture | if a depth texture is used |
useMultisampling | if multisampling should be enabled |
width | width of the framebuffer and textures |
height | height of the framebuffer and textures |
◆ copyFBO() [1/3]
void FBO::copyFBO |
( |
const FBO & |
from, |
|
|
const FBO & |
to, |
|
|
unsigned int |
bufferMask = GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT |
|
) |
| |
|
static |
Copys fbo data from one fbo to an other.
- Parameters
-
from | where to copy from |
to | where to copy to |
bufferMask | what to copy. See openGL documentaiton of glBlitFramebuffer |
◆ copyFBO() [2/3]
void FBO::copyFBO |
( |
const FBO & |
from, |
|
|
unsigned int |
to, |
|
|
unsigned int |
bufferMask = GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT |
|
) |
| |
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
◆ copyFBO() [3/3]
void FBO::copyFBO |
( |
unsigned int |
from, |
|
|
const FBO & |
to, |
|
|
unsigned int |
bufferMask = GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT |
|
) |
| |
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
◆ getColorTexture() [1/2]
const unsigned int FBO::getColorTexture |
( |
unsigned int |
i | ) |
const |
|
inline |
Gets the handle of the i-th color texture, counted from 0. Handle can then be used in glBindTexture etc. The texture is either a GL_TEXTURE_2D or GL_TEXTURE_2D_MULTISAMPLE, depending on if multisampling is enabled or not.
- Parameters
-
- Returns
- handle of texture at index 0
◆ getColorTexture() [2/2]
const unsigned int FBO::getColorTexture |
( |
| ) |
const |
|
inline |
Convinience method for getColorTexture(0)
- Returns
- handle of first color texture
◆ getDepthTexture()
const unsigned int FBO::getDepthTexture |
( |
| ) |
const |
|
inline |
Gets the handle of the depth texture. Handle can then be used in glBindTexture etc. The texture is either a GL_TEXTURE_2D or GL_TEXTURE_2D_MULTISAMPLE, depending on if multisampling is enabled or not.
- Returns
- handle of depth texture
◆ getSecondaryColorTexture()
const unsigned int FBO::getSecondaryColorTexture |
( |
| ) |
const |
|
inline |
convinience method for getColorTexture(1)
- Returns
- handle of first color texture
◆ isMultiSample()
const bool FBO::isMultiSample |
( |
| ) |
const |
|
inline |
Checks if FBO has multisampling enabled
◆ setActive()
Prepares FBO for rendering. All draw commands after calling this output to attached textures.
◆ MULTI_SAMPLE_COUNT
unsigned int FBO::MULTI_SAMPLE_COUNT = 16 |
|
static |
Multisample count if multisampling is enebled.
The documentation for this class was generated from the following files:
- Renderer/FBO.h
- Renderer/FBO.cpp