Louvre  v2.4.0-1
C++ library for Wayland compositors
Public Types | Public Member Functions | List of all members
LFramebuffer Class Referenceabstract

Base class for LPainter framebuffers. More...

+ Inheritance diagram for LFramebuffer:

Public Types

enum  Type
 Types of framebuffer. More...
 

Public Member Functions

virtual Float32 scale () const =0
 Gets the scale by which the framebuffer dimensions must be interpreted. More...
 
virtual const LSizesizeB () const =0
 Gets the size of the framebuffer in buffer coordinates. More...
 
virtual const LRectrect () const =0
 Gets the position and size of the framebuffer in surface coordinates. More...
 
virtual GLuint id () const =0
 Gets the OpenGL framebuffer ID. More...
 
virtual Int32 buffersCount () const =0
 Gets the number of internal framebuffers. More...
 
virtual Int32 currentBufferIndex () const =0
 Gets the index of the current internal framebuffer. More...
 
virtual LTexturetexture (Int32 index=0) const =0
 Gets the OpenGL texture ID of a specific framebuffer index. More...
 
virtual void setFramebufferDamage (const LRegion *damage)=0
 Set the damaged region. More...
 
virtual LTransform transform () const =0
 Gets the framebuffer transform. More...
 
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

- 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

Base class for LPainter framebuffers.

The LFramebuffer abstract class defines an interface for creating framebuffers or groups of framebuffers compatible with LPainter.

See also
LPainter::bindFramebuffer() for usage instructions.
LRenderBuffer
LFramebufferWrapper
LOutputFramebuffer

Member Enumeration Documentation

◆ Type

enum Type

Types of framebuffer.

Enumerator
Output 

LOutputFramebuffer.

RenderBuffer 

LRenderBuffer.

Wrapper 

LFramebufferWrapper.

Member Function Documentation

◆ scale()

virtual Float32 scale ( ) const
pure virtual

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.

Implemented in LRenderBuffer, LOutputFramebuffer, and LFramebufferWrapper.

◆ sizeB()

virtual const LSize& sizeB ( ) const
pure virtual

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.

Implemented in LRenderBuffer, LOutputFramebuffer, and LFramebufferWrapper.

◆ rect()

virtual const LRect& rect ( ) const
pure virtual

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.

Implemented in LRenderBuffer, LOutputFramebuffer, and LFramebufferWrapper.

◆ id()

virtual GLuint id ( ) const
pure virtual

Gets the OpenGL framebuffer ID.

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

Returns
The OpenGL framebuffer ID.

Implemented in LRenderBuffer, LOutputFramebuffer, and LFramebufferWrapper.

◆ buffersCount()

virtual Int32 buffersCount ( ) const
pure virtual

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.

Implemented in LRenderBuffer, LOutputFramebuffer, and LFramebufferWrapper.

◆ currentBufferIndex()

virtual Int32 currentBufferIndex ( ) const
pure virtual

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.

Implemented in LRenderBuffer, LOutputFramebuffer, and LFramebufferWrapper.

◆ texture()

virtual LTexture* texture ( Int32  index = 0) const
pure virtual

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.

Implemented in LFramebufferWrapper, LRenderBuffer, and LOutputFramebuffer.

◆ setFramebufferDamage()

virtual void setFramebufferDamage ( const LRegion damage)
pure virtual

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.

Implemented in LRenderBuffer, LOutputFramebuffer, and LFramebufferWrapper.

◆ transform()

virtual LTransform transform ( ) const
pure virtual

Gets the framebuffer transform.

Implemented in LRenderBuffer, LOutputFramebuffer, and LFramebufferWrapper.

◆ type()

Type type ( ) const
inlinenoexcept

Gets the type of LFramebuffer.