Louvre  v2.9.0-1
C++ library for Wayland compositors
Public Member Functions | List of all members
LOutputFramebuffer Class Referencefinal

An output framebuffer. More...

+ Inheritance diagram for LOutputFramebuffer:

Public Member Functions

Float32 scale () const noexcept override
 Gets the scale by which the framebuffer dimensions must be interpreted. More...
 
const LSizesizeB () const noexcept override
 Gets the size of the framebuffer in buffer coordinates. More...
 
const LRectrect () const noexcept override
 Gets the position and size of the framebuffer in surface coordinates. More...
 
GLuint id () const noexcept override
 Gets the OpenGL framebuffer ID. More...
 
Int32 buffersCount () const noexcept override
 Gets the number of internal framebuffers. More...
 
Int32 currentBufferIndex () const noexcept override
 Gets the index of the current internal framebuffer. More...
 
LTexturetexture (Int32 index=0) const noexcept override
 Gets the OpenGL texture ID of a specific framebuffer index. More...
 
void setFramebufferDamage (const LRegion *damage) noexcept override
 Set the damaged region. More...
 
LTransform transform () const noexcept override
 Gets the framebuffer transform. More...
 
- Public Member Functions inherited from LFramebuffer
Type type () const noexcept
 Gets the type of LFramebuffer. More...
 
- Public Member Functions inherited from LObject
 LObject (const LObject &) noexcept
 Copy constructor. More...
 
LObjectoperator= (const LObject &) noexcept
 Assignment operator (each object has its own individual LWeak reference count). More...
 
void setUserData (UIntPtr data) const noexcept
 Store an unsigned integer value/pointer. More...
 
UIntPtr userData () const noexcept
 Retrieves the stored unsigned integer value/pointer. More...
 

Additional Inherited Members

- Public Types inherited from LFramebuffer
enum  Type
 Types of framebuffer. More...
 
- Protected Member Functions inherited from LObject
 LObject () noexcept=default
 Constructor of the LObject class. More...
 
virtual ~LObject () noexcept
 Destructor of the LObject class. More...
 
void notifyDestruction () noexcept
 Notifies the object destruction. More...
 

Detailed Description

An output framebuffer.

An LOutputFramebuffer is a specific type of framebuffer used by an LOutput and managed by the graphic backend.

Note
This class is primarily used internally by Louvre and may have limited utility for library users.

It's advisable to use the interface provided by LOutput instead of directly accessing the methods associated with this class.

See also
LOutput::framebuffer()
LOutput::currentBuffer()
LOutput::buffersCount()
LOutput::bufferTexture()
LOutput::hasBufferDamageSupport()
LOutput::setBufferDamage()

Member Function Documentation

◆ scale()

Float32 scale ( ) const
overridevirtualnoexcept

Gets the scale by which the framebuffer dimensions must be interpreted.

This method must return the scale factor used to interpret the dimensions of the framebuffer.
For example, HiDPI pixmaps/displays may have a scale of 2, whereas low DPI pixmaps/displays may have a scale of 1.

Returns
The scale factor for the framebuffer.

Implements LFramebuffer.

◆ sizeB()

const LSize & sizeB ( ) const
overridevirtualnoexcept

Gets the size of the framebuffer in buffer coordinates.

This method must return the size of the framebuffer in buffer coordinates.

Returns
The size of the framebuffer in buffer coordinates.

Implements LFramebuffer.

◆ rect()

const LRect & rect ( ) const
overridevirtualnoexcept

Gets the position and size of the framebuffer in surface coordinates.

This method must return the position and size of the framebuffer in surface coordinates.

Returns
The rect representing the position and size of the framebuffer in surface coordinates.

Implements LFramebuffer.

◆ id()

GLuint id ( ) const
overridevirtualnoexcept

Gets the OpenGL framebuffer ID.

This method must return the current OpenGL framebuffer ID associated with the instance.

Returns
The OpenGL framebuffer ID.

Implements LFramebuffer.

◆ buffersCount()

Int32 buffersCount ( ) const
overridevirtualnoexcept

Gets the number of internal framebuffers.

This method is used in implementations like LOutputFramebuffer, which may contain more than one internal framebuffer associated with an LFramebuffer, for example, when double or triple buffering is used.

Returns
The number of internal framebuffers.

Implements LFramebuffer.

◆ currentBufferIndex()

Int32 currentBufferIndex ( ) const
overridevirtualnoexcept

Gets the index of the current internal framebuffer.

This method must return the index of the current internal framebuffer (where the rendered content will be stored).

Returns
The index of the framebuffer used for rendering.

Implements LFramebuffer.

◆ texture()

LTexture * texture ( Int32  index = 0) const
overridevirtualnoexcept

Gets the OpenGL texture ID of a specific framebuffer index.

This method must return the OpenGL texture ID associated with the specified framebuffer index or 0 if not available.

Parameters
indexThe index of the framebuffer.
Returns
The OpenGL texture ID of the specified framebuffer index or 0 if not available.

Implements LFramebuffer.

◆ setFramebufferDamage()

void setFramebufferDamage ( const LRegion damage)
overridevirtualnoexcept

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.

Parameters
damageA pointer to the LRegion object representing the changed region.

Implements LFramebuffer.

◆ transform()

LTransform transform ( ) const
overridevirtualnoexcept

Gets the framebuffer transform.

Implements LFramebuffer.