KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KIGFX::COMPOSITOR Class Referenceabstract

#include <compositor.h>

Inheritance diagram for KIGFX::COMPOSITOR:
KIGFX::CAIRO_COMPOSITOR KIGFX::OPENGL_COMPOSITOR

Public Member Functions

 COMPOSITOR ()
 
virtual ~COMPOSITOR ()
 
virtual void Initialize ()=0
 Perform primary initialization, necessary to use the object.
 
virtual void Resize (unsigned int aWidth, unsigned int aHeight)=0
 Clear the state of COMPOSITOR, so it has to be reinitialized again with the new dimensions.
 
virtual unsigned int CreateBuffer ()=0
 Prepare a new buffer that may be used as a rendering target.
 
virtual unsigned int GetBuffer () const =0
 Return currently used buffer handle.
 
virtual void SetBuffer (unsigned int aBufferHandle)=0
 Set the selected buffer as the rendering target.
 
virtual void ClearBuffer (const COLOR4D &aColor)=0
 Clear the selected buffer (set by the SetBuffer() function).
 
virtual void Begin ()=0
 Call this at the beginning of each frame.
 
virtual void DrawBuffer (unsigned int aBufferHandle)=0
 Draw the selected buffer to the output buffer.
 
virtual void Present ()=0
 Call this to present the output buffer to the screen.
 

Protected Attributes

unsigned int m_width
 Width of the buffer (in pixels)
 
unsigned int m_height
 Height of the buffer (in pixels)
 

Detailed Description

Definition at line 40 of file compositor.h.

Constructor & Destructor Documentation

◆ COMPOSITOR()

KIGFX::COMPOSITOR::COMPOSITOR ( )
inline

Definition at line 43 of file compositor.h.

◆ ~COMPOSITOR()

virtual KIGFX::COMPOSITOR::~COMPOSITOR ( )
inlinevirtual

Definition at line 48 of file compositor.h.

Member Function Documentation

◆ Begin()

virtual void KIGFX::COMPOSITOR::Begin ( )
pure virtual

Call this at the beginning of each frame.

Implemented in KIGFX::CAIRO_COMPOSITOR, and KIGFX::OPENGL_COMPOSITOR.

◆ ClearBuffer()

virtual void KIGFX::COMPOSITOR::ClearBuffer ( const COLOR4D aColor)
pure virtual

Clear the selected buffer (set by the SetBuffer() function).

Implemented in KIGFX::CAIRO_COMPOSITOR, and KIGFX::OPENGL_COMPOSITOR.

◆ CreateBuffer()

virtual unsigned int KIGFX::COMPOSITOR::CreateBuffer ( )
pure virtual

Prepare a new buffer that may be used as a rendering target.

Returns
is the handle of the buffer. In case of failure 0 (zero) is returned as the handle.

Implemented in KIGFX::CAIRO_COMPOSITOR, and KIGFX::OPENGL_COMPOSITOR.

◆ DrawBuffer()

virtual void KIGFX::COMPOSITOR::DrawBuffer ( unsigned int  aBufferHandle)
pure virtual

Draw the selected buffer to the output buffer.

Parameters
aBufferHandleis the handle of the buffer to be drawn.

Implemented in KIGFX::CAIRO_COMPOSITOR, and KIGFX::OPENGL_COMPOSITOR.

◆ GetBuffer()

virtual unsigned int KIGFX::COMPOSITOR::GetBuffer ( ) const
pure virtual

Return currently used buffer handle.

Returns
Currently used buffer handle.

Implemented in KIGFX::CAIRO_COMPOSITOR, and KIGFX::OPENGL_COMPOSITOR.

◆ Initialize()

virtual void KIGFX::COMPOSITOR::Initialize ( )
pure virtual

Perform primary initialization, necessary to use the object.

Implemented in KIGFX::CAIRO_COMPOSITOR, and KIGFX::OPENGL_COMPOSITOR.

◆ Present()

virtual void KIGFX::COMPOSITOR::Present ( )
pure virtual

Call this to present the output buffer to the screen.

Implemented in KIGFX::CAIRO_COMPOSITOR, and KIGFX::OPENGL_COMPOSITOR.

◆ Resize()

virtual void KIGFX::COMPOSITOR::Resize ( unsigned int  aWidth,
unsigned int  aHeight 
)
pure virtual

Clear the state of COMPOSITOR, so it has to be reinitialized again with the new dimensions.

Parameters
aWidthis the framebuffer width (in pixels).
aHeightis the framebuffer height (in pixels).

Implemented in KIGFX::CAIRO_COMPOSITOR, and KIGFX::OPENGL_COMPOSITOR.

◆ SetBuffer()

virtual void KIGFX::COMPOSITOR::SetBuffer ( unsigned int  aBufferHandle)
pure virtual

Set the selected buffer as the rendering target.

All the following drawing functions are going to be rendered in the selected buffer.

Parameters
aBufferHandleis the handle of the buffer or 0 in case of rendering directly to the display.

Implemented in KIGFX::CAIRO_COMPOSITOR, and KIGFX::OPENGL_COMPOSITOR.

Member Data Documentation

◆ m_height

unsigned int KIGFX::COMPOSITOR::m_height
protected

◆ m_width

unsigned int KIGFX::COMPOSITOR::m_width
protected

The documentation for this class was generated from the following file: