Inviwo 0.9.12-pre
Inviwo documentation
|
Inviwo framebuffer wrapper. More...
#include <framebufferobject.h>
Public Member Functions | |
FrameBufferObject () | |
Create a new framebuffer object. | |
FrameBufferObject (const FrameBufferObject &)=delete | |
FrameBufferObject (FrameBufferObject &&rhs) noexcept | |
FrameBufferObject & | operator= (const FrameBufferObject &)=delete |
FrameBufferObject & | operator= (FrameBufferObject &&rhs) noexcept |
unsigned int | getID () const |
Get the framebuffer name. | |
void | activate () |
Binds the framebuffer. | |
void | deactivate () |
Unbind the framebuffer (binds id 0) | |
bool | isActive () const |
Check if this framebuffer is currently bound. | |
GLenum | status () const |
Get the framebuffer status. GL_FRAMEBUFFER_COMPLETE represents a complete framebuffer. see glCheckFramebufferStatus for more details of the return value. | |
void | attachTexture (Texture2D *texture, GLenum attachmentID) |
Attach a 2D Texture to the framebuffer. | |
GLenum | attachColorTexture (Texture2D *texture) |
Attach a 2D Color Texture to the framebuffer. | |
GLenum | attachColorTexture (Texture2D *texture, int attachmentNumber) |
Attach a 2D Color Texture to the framebuffer. | |
void | attachTexture (Texture2DArray *texture, GLenum attachmentID) |
Attach a 2D Texture Array to the framebuffer. | |
GLenum | attachColorTexture (Texture2DArray *texture) |
Attach a 2D Color Texture Array to the framebuffer. | |
GLenum | attachColorTexture (Texture2DArray *texture, int attachmentNumber) |
Attach a 2D Color Texture Array to the framebuffer. | |
void | attachTextureLayer (Texture2DArray *texture, GLenum attachmentID, int layer, int level=0) |
Attach a layer of 2D a Texture Array to the framebuffer. | |
GLenum | attachColorTextureLayer (Texture2DArray *texture, int layer) |
Attach a layer of a 2D Color Texture Array to the framebuffer. | |
GLenum | attachColorTextureLayer (Texture2DArray *texture, int attachmentNumber, int layer) |
Attach a layer of a 2D Color Texture Array to the framebuffer. | |
void | attachTexture (Texture3D *texture, GLenum attachmentID) |
Attach a 3D Texture to the framebuffer. | |
GLenum | attachColorTexture (Texture3D *texture) |
Attach a 3D Color Texture to the framebuffer. | |
GLenum | attachColorTexture (Texture3D *texture, int attachmentNumber) |
Attach a 3D Color Texture to the framebuffer. | |
void | attachTextureLayer (Texture3D *texture, GLenum attachmentID, int layer) |
Attach a layer of a 3D Texture to the framebuffer. | |
GLenum | attachColorTextureLayer (Texture3D *texture, int layer) |
Attach a layer of a 3D Color Texture to the framebuffer. Will use the first available attachment point. | |
GLenum | attachColorTextureLayer (Texture3D *texture, int attachmentNumber, int layer) |
Attach a layer of a 3D Color Texture to the framebuffer. | |
void | detachTexture (GLenum attachmentID) |
Detach the texture at the given attachment point. | |
void | detachAllTextures () |
Detach all the attached textures. | |
bool | hasColorAttachment () const |
Check if there are any color attachments. | |
bool | hasDepthAttachment () const |
Check if there is any depth attachment. | |
bool | hasStencilAttachment () const |
Check if there is any stencil attachment. | |
const std::vector< GLuint > & | attachedColorTextureIds () const |
Get the current list of attached colors texture id. | |
GLuint | attachedDepthTextureId () const |
Returns the texture id of the attached depth texture id or 0 if no depth is attached. | |
GLuint | attachedStencilTextureId () const |
Returns the texture id of the attached stencil texture id of 0 if no stencil is attached. | |
void | setReadBlit (bool set=true) const |
Bind the framebuffer name to GL_READ_FRAMEBUFFER for "Blit" reading. | |
void | setDrawBlit (bool set=true) |
Bind the framebuffer name to GL_DRAW_FRAMEBUFFER for "Blit" drawing. | |
Inviwo framebuffer wrapper.
Handles creation and deletion of OpenGL framebuffer objects. Has functions for attaching and detaching of textures to the framebuffer. It also keeps track of all attached texture ids. The wrapper is a move only type.
GLenum inviwo::FrameBufferObject::attachColorTexture | ( | Texture2D * | texture | ) |
Attach a 2D Color Texture to the framebuffer.
Will use the first available attachment point.
texture | to attach |
GL_COLOR_ATTACHMENT0
, ... ) GLenum inviwo::FrameBufferObject::attachColorTexture | ( | Texture2D * | texture, |
int | attachmentNumber ) |
Attach a 2D Color Texture to the framebuffer.
texture | to attach |
attachmentNumber | number of attachment point to use (0, 1, ...) |
GLenum inviwo::FrameBufferObject::attachColorTexture | ( | Texture2DArray * | texture | ) |
Attach a 2D Color Texture Array to the framebuffer.
Will use the first available attachment point.
texture | to attach |
GL_COLOR_ATTACHMENT0
, ... ) GLenum inviwo::FrameBufferObject::attachColorTexture | ( | Texture2DArray * | texture, |
int | attachmentNumber ) |
Attach a 2D Color Texture Array to the framebuffer.
texture | to attach |
attachmentNumber | number of attachment point to use (0, 1, ...) |
GL_COLOR_ATTACHMENT0
, ... ) GLenum inviwo::FrameBufferObject::attachColorTexture | ( | Texture3D * | texture | ) |
Attach a 3D Color Texture to the framebuffer.
Will use the first available attachment point. Use gl_Layer
in the geometry shader to set target z slice.
texture | to attach |
GL_COLOR_ATTACHMENT0
, ... ) GLenum inviwo::FrameBufferObject::attachColorTexture | ( | Texture3D * | texture, |
int | attachmentNumber ) |
Attach a 3D Color Texture to the framebuffer.
Use gl_Layer
in the geometry shader to set target z slice.
texture | to attach |
attachmentNumber | number of attachment point to use (0, 1, ...) |
GL_COLOR_ATTACHMENT0
, ... ) GLenum inviwo::FrameBufferObject::attachColorTextureLayer | ( | Texture2DArray * | texture, |
int | attachmentNumber, | ||
int | layer ) |
Attach a layer of a 2D Color Texture Array to the framebuffer.
texture | to attach |
attachmentNumber | number of attachment point to use (0, 1, ...) |
layer | index of the layer to attach |
GL_COLOR_ATTACHMENT0
, ... ) GLenum inviwo::FrameBufferObject::attachColorTextureLayer | ( | Texture2DArray * | texture, |
int | layer ) |
Attach a layer of a 2D Color Texture Array to the framebuffer.
Will use the first available attachment point.
texture | to attach |
layer | index of the layer to attach |
GL_COLOR_ATTACHMENT0
, ... ) GLenum inviwo::FrameBufferObject::attachColorTextureLayer | ( | Texture3D * | texture, |
int | attachmentNumber, | ||
int | layer ) |
Attach a layer of a 3D Color Texture to the framebuffer.
texture | to attach |
attachmentNumber | number of attachment point to use (0, 1, ...) |
layer | index of the z layer to attach |
GL_COLOR_ATTACHMENT0
, ... ) GLenum inviwo::FrameBufferObject::attachColorTextureLayer | ( | Texture3D * | texture, |
int | layer ) |
Attach a layer of a 3D Color Texture to the framebuffer. Will use the first available attachment point.
texture | to attach |
layer | index of the z layer to attach |
GL_COLOR_ATTACHMENT0
, ... )
|
inline |
Get the current list of attached colors texture id.
Returns a list of all color attachments points, for unused points the value will be 0, for used points the value will be the attached texture id.
void inviwo::FrameBufferObject::attachTexture | ( | Texture2D * | texture, |
GLenum | attachmentID ) |
Attach a 2D Texture to the framebuffer.
texture | to attach |
attachmentID | attachment point to use (GL_COLOR_ATTACHMENT0 , ... ) |
void inviwo::FrameBufferObject::attachTexture | ( | Texture2DArray * | texture, |
GLenum | attachmentID ) |
Attach a 2D Texture Array to the framebuffer.
texture | to attach |
attachmentID | attachment point to use (GL_COLOR_ATTACHMENT0 , ... ) |
void inviwo::FrameBufferObject::attachTexture | ( | Texture3D * | texture, |
GLenum | attachmentID ) |
Attach a 3D Texture to the framebuffer.
Use gl_Layer
in the geometry shader to set target z slice.
texture | to attach |
attachmentID | attachment point to use (GL_COLOR_ATTACHMENT0 , ... ) |
void inviwo::FrameBufferObject::attachTextureLayer | ( | Texture2DArray * | texture, |
GLenum | attachmentID, | ||
int | layer, | ||
int | level = 0 ) |
Attach a layer of 2D a Texture Array to the framebuffer.
texture | to attach |
attachmentID | attachment point to use (GL_COLOR_ATTACHMENT0 , ... ) |
layer | index of the layer to attach |
level | the mimpmap level to use defaults to 0 |
void inviwo::FrameBufferObject::attachTextureLayer | ( | Texture3D * | texture, |
GLenum | attachmentID, | ||
int | layer ) |
Attach a layer of a 3D Texture to the framebuffer.
texture | to attach |
attachmentID | attachment point to use (GL_COLOR_ATTACHMENT0 , ... ) |
layer | index of the z layer to attach |
void inviwo::FrameBufferObject::detachAllTextures | ( | ) |
Detach all the attached textures.
void inviwo::FrameBufferObject::detachTexture | ( | GLenum | attachmentID | ) |
Detach the texture at the given attachment point.
attachmentID | to detach (GL_COLOR_ATTACHMENT0 , ... ) |
void inviwo::FrameBufferObject::setDrawBlit | ( | bool | set = true | ) |
Bind the framebuffer name to GL_DRAW_FRAMEBUFFER for "Blit" drawing.
set | True will bind this buffer, False will bind id 0 |
void inviwo::FrameBufferObject::setReadBlit | ( | bool | set = true | ) | const |
Bind the framebuffer name to GL_READ_FRAMEBUFFER for "Blit" reading.
set | True will bind this buffer, False will bind id 0 |
GLenum inviwo::FrameBufferObject::status | ( | ) | const |
Get the framebuffer status. GL_FRAMEBUFFER_COMPLETE represents a complete framebuffer. see glCheckFramebufferStatus for more details of the return value.