Louvre
v1.2.1-2
C++ library for Wayland compositors
|
#include <LRenderBuffer.h>
Custom render destination framebuffer. More...
Custom render destination framebuffer.
The LRenderBuffer can be utilized to render to a framebuffer instead of an LOutput and then use that rendered content as a texture.
Essentially, it acts as a wrapper for an OpenGL framebuffer with additional functionality. You can obtain the OpenGL framebuffer ID using the id() method. It can also be utilized with an LPainter by using LPainter::bindFramebuffer().
Public Member Functions | |
LRenderBuffer (const LSize &sizeB, bool alpha=true) | |
Constructor for LRenderBuffer with specified size. More... | |
~LRenderBuffer () | |
Destructor for LRenderBuffer. More... | |
GLuint | id () const override |
Retrieve the OpenGL ID of the framebuffer. More... | |
const LTexture * | texture (Int32 index=0) const override |
Retrieve the texture associated with the framebuffer. More... | |
void | setSizeB (const LSize &sizeB) |
Set the size of the framebuffer in buffer coordinates. More... | |
const LSize & | sizeB () const override |
Retrieve the size of the framebuffer in buffer coordinates. More... | |
const LSize & | size () const |
Retrieve the size of the framebuffer. More... | |
void | setPos (const LPoint &pos) |
Set the position of the framebuffer. More... | |
const LPoint & | pos () const |
Retrieve the position of the framebuffer. More... | |
const LRect & | rect () const override |
Retrieve the position and size of the framebuffer in surface coordinates. More... | |
void | setScale (Float32 scale) const |
Set the buffer scale to properly scale the rendered content. More... | |
Float32 | scale () const override |
Retrieve the buffer scale of the framebuffer. More... | |
Int32 | buffersCount () const override |
Get the number of framebuffers represented by this instance. More... | |
Int32 | currentBufferIndex () const override |
Get the index of the framebuffer where the rendering is stored. More... | |
void | setFramebufferDamage (const LRegion *damage) override |
Set the damaged region. More... | |
Transform | transform () const override |
Get the framebuffer transformation. More... | |
Public Member Functions inherited from LFramebuffer | |
Type | type () const |
virtual | ~LFramebuffer () |
Destructor for the LFramebuffer class. More... | |
Public Member Functions inherited from LObject | |
LObject ()=default | |
Constructor of the LObject class. More... | |
~LObject () | |
Destructor of the LObject class. More... | |
std::shared_ptr< const bool > | isAlive () const |
Object's liveness status. More... | |
Additional Inherited Members | |
Public Types inherited from LFramebuffer | |
enum | Type |
enum | Transform : Int32 |
Enumeration for Framebuffer Transformations. More... | |
Static Public Member Functions inherited from LFramebuffer | |
static bool | is90Transform (Transform transform) |
static Transform | requiredTransform (Transform from, Transform to) |
Static Public Member Functions inherited from LObject | |
static LCompositor * | compositor () |
Quick access to the global compositor instance. More... | |
static LSeat * | seat () |
Quick access to the global seat instance. More... | |
static LCursor * | cursor () |
Quick access to the global cursor instance. More... | |
Protected Attributes inherited from LFramebuffer | |
Type | m_type |
LRenderBuffer | ( | const LSize & | sizeB, |
bool | alpha = true |
||
) |
Constructor for LRenderBuffer with specified size.
This constructor creates an LRenderBuffer with the specified size in buffer coordinates.
sizeB | The size of the framebuffer in buffer coordinates. |
alpha | Employ a format with an alpha component. |
~LRenderBuffer | ( | ) |
Destructor for LRenderBuffer.
|
overridevirtual |
Retrieve the OpenGL ID of the framebuffer.
This method returns the OpenGL ID of the framebuffer associated with the LRenderBuffer.
Implements LFramebuffer.
Retrieve the texture associated with the framebuffer.
LRenderBuffers always have a single framebuffer, so 0 must always be passed as an argument. The index is part of the LFramebuffer parent class, which may be used by special framebuffers like those of LOutput.
index | The index of the texture (default is 0). |
Implements LFramebuffer.
void setSizeB | ( | const LSize & | sizeB | ) |
Set the size of the framebuffer in buffer coordinates.
sizeB | The new size of the framebuffer in buffer coordinates. |
|
overridevirtual |
Retrieve the size of the framebuffer in buffer coordinates.
This method returns the size of the framebuffer in buffer coordinates.
Implements LFramebuffer.
const LSize & size | ( | ) | const |
void setPos | ( | const LPoint & | pos | ) |
Set the position of the framebuffer.
This method sets the position of the framebuffer in surface coordinates.
pos | The new position of the framebuffer. |
const LPoint & pos | ( | ) | const |
Retrieve the position of the framebuffer.
This method returns the position of the framebuffer in surface coordinates.
|
overridevirtual |
Retrieve the position and size of the framebuffer in surface coordinates.
The size provided by this rect is equal to size().
Implements LFramebuffer.
void setScale | ( | Float32 | scale | ) | const |
Set the buffer scale to properly scale the rendered content.
For example, framebuffers used in HiDPI displays should have a scale of 2 or greater.
scale | The buffer scale factor. |
|
overridevirtual |
Retrieve the buffer scale of the framebuffer.
This method returns the buffer scale factor of the framebuffer.
Implements LFramebuffer.
|
overridevirtual |
Get the number of framebuffers represented by this instance.
This method must return the number of framebuffers represented by this instance.
Implements LFramebuffer.
|
overridevirtual |
Get the index of the framebuffer where the rendering is stored.
This method must return the index of the framebuffer where rendering must be performed/stored.
Implements LFramebuffer.
|
overridevirtual |
Set the damaged region.
This method sets the region in surface coordinates that indicates the parts of the framebuffer that have changed since the last painting was performed.
damage | A pointer to the LRegion object representing the changed region. |
Implements LFramebuffer.
|
overridevirtual |
Get the framebuffer transformation.
This method must return the current framebuffer transformation applied.
Implements LFramebuffer.