OpenGL framebuffer object.
More...
#include <glframebuffer.h>
OpenGL framebuffer object.
Framebuffer object enables you to render onto a texture. This texture can later be used to e.g. do post-processing of the scene.
- Author
- Rivo Laks rivol.nosp@m.aks@.nosp@m.hot.e.nosp@m.e
Definition at line 36 of file glframebuffer.h.
◆ Attachment
Enumerator |
---|
NoAttachment | |
CombinedDepthStencil | |
Definition at line 39 of file glframebuffer.h.
◆ GLFramebuffer() [1/3]
KWin::GLFramebuffer::GLFramebuffer |
( |
| ) |
|
|
explicit |
◆ GLFramebuffer() [2/3]
Constructs a GLFramebuffer. Note that ensuring the color attachment outlives the framebuffer is the responsibility of the caller.
- Parameters
-
colorAttachment | texture where the scene will be rendered onto |
Definition at line 108 of file glframebuffer.cpp.
◆ GLFramebuffer() [3/3]
KWin::GLFramebuffer::GLFramebuffer |
( |
GLuint | handle, |
|
|
const QSize & | size ) |
Constructs a wrapper for an already created framebuffer object. The GLFramebuffer does not take the ownership of the framebuffer object handle.
Definition at line 143 of file glframebuffer.cpp.
◆ ~GLFramebuffer()
KWin::GLFramebuffer::~GLFramebuffer |
( |
| ) |
|
◆ blitFromFramebuffer()
void KWin::GLFramebuffer::blitFromFramebuffer |
( |
const QRect & | source = QRect(), |
|
|
const QRect & | destination = QRect(), |
|
|
GLenum | filter = GL_LINEAR, |
|
|
bool | flipX = false, |
|
|
bool | flipY = false ) |
Blits from source rectangle in the current framebuffer to the destination rectangle in this framebuffer.
Be aware that framebuffer blitting may not be supported on all hardware. Use blitSupported() to check whether it is supported.
The source and the destination rectangles can have different sizes. The filter indicates what filter will be used in case scaling needs to be performed.
- See also
- blitSupported
- Since
- 4.8
Definition at line 246 of file glframebuffer.cpp.
◆ blitFromRenderTarget()
bool KWin::GLFramebuffer::blitFromRenderTarget |
( |
const RenderTarget & | sourceRenderTarget, |
|
|
const RenderViewport & | sourceViewport, |
|
|
const QRect & | source, |
|
|
const QRect & | destination ) |
Blits from source rectangle in logical coordinates in the current framebuffer to the destination rectangle in texture-local coordinates in this framebuffer, taking into account any transformations the source render target may have
Definition at line 282 of file glframebuffer.cpp.
◆ blitSupported()
bool KWin::GLFramebuffer::blitSupported |
( |
| ) |
|
|
static |
Whether the GL_EXT_framebuffer_blit extension is supported. This functionality is not available in OpenGL ES 2.0.
- Returns
- whether framebuffer blitting is supported.
- Since
- 4.8
Definition at line 43 of file glframebuffer.cpp.
◆ colorAttachment()
GLTexture * KWin::GLFramebuffer::colorAttachment |
( |
| ) |
const |
- Returns
- the color attachment of this fbo. May be nullptr
Definition at line 318 of file glframebuffer.cpp.
◆ currentFramebuffer()
Returns the last bound framebuffer, or null
if no framebuffer is current.
Definition at line 48 of file glframebuffer.cpp.
◆ handle()
GLuint KWin::GLFramebuffer::handle |
( |
| ) |
const |
|
inline |
Returns the framebuffer object handle to this framebuffer object.
Definition at line 68 of file glframebuffer.h.
◆ initColorAttachment()
void KWin::GLFramebuffer::initColorAttachment |
( |
GLTexture * | colorAttachment | ) |
|
|
protected |
◆ initDepthStencilAttachment()
void KWin::GLFramebuffer::initDepthStencilAttachment |
( |
| ) |
|
|
protected |
◆ initStatic()
void KWin::GLFramebuffer::initStatic |
( |
| ) |
|
|
static |
◆ popFramebuffer()
◆ pushFramebuffer()
◆ size()
QSize KWin::GLFramebuffer::size |
( |
| ) |
const |
|
inline |
Returns the size of the color attachment to this framebuffer object.
Definition at line 75 of file glframebuffer.h.
◆ supported()
static bool KWin::GLFramebuffer::supported |
( |
| ) |
|
|
inlinestatic |
◆ valid()
bool KWin::GLFramebuffer::valid |
( |
| ) |
const |
|
inline |
◆ KWin::cleanupGL
The documentation for this class was generated from the following files: