KiCad PCB EDA Suite
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
 Function Reset() performs primary initialiation, necessary to use the object. More...
 
virtual void Resize (unsigned int aWidth, unsigned int aHeight)=0
 Function Resize() clears the state of COMPOSITOR, so it has to be reinitialized again with the new dimensions. More...
 
virtual unsigned int CreateBuffer ()=0
 Function CreateBuffer() prepares a new buffer that may be used as a rendering target. More...
 
virtual unsigned int GetBuffer () const =0
 Function GetBuffer() returns currently used buffer handle. More...
 
virtual void SetBuffer (unsigned int aBufferHandle)=0
 Function SetBuffer() sets the selected buffer as the rendering target. More...
 
virtual void ClearBuffer (const COLOR4D &aColor)=0
 Function ClearBuffer() clears the selected buffer (set by the SetBuffer() function). More...
 
virtual void Begin ()=0
 Function Begin() Call this at the beginning of each frame. More...
 
virtual void DrawBuffer (unsigned int aBufferHandle)=0
 Function DrawBuffer() draws the selected buffer to the output buffer. More...
 
virtual void Present ()=0
 Function Present() Call this to present the output buffer to the screen. More...
 

Protected Attributes

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

Detailed Description

Definition at line 39 of file compositor.h.

Constructor & Destructor Documentation

KIGFX::COMPOSITOR::COMPOSITOR ( )
inline

Definition at line 42 of file compositor.h.

43  : m_width( 0 ), m_height( 0 )
44  {
45  }
unsigned int m_width
Width of the buffer (in pixels)
Definition: compositor.h:119
unsigned int m_height
Height of the buffer (in pixels)
Definition: compositor.h:120
virtual KIGFX::COMPOSITOR::~COMPOSITOR ( )
inlinevirtual

Definition at line 47 of file compositor.h.

48  {
49  }

Member Function Documentation

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

Function Begin() Call this at the beginning of each frame.

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

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

Function ClearBuffer() clears the selected buffer (set by the SetBuffer() function).

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

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

Function CreateBuffer() prepares 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::OPENGL_COMPOSITOR, and KIGFX::CAIRO_COMPOSITOR.

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

Function DrawBuffer() draws the selected buffer to the output buffer.

Parameters
aBufferHandleis the handle of the buffer to be drawn.

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

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

Function GetBuffer() returns currently used buffer handle.

Returns
Currently used buffer handle.

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

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

Function Reset() performs primary initialiation, necessary to use the object.

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

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

Function Present() Call this to present the output buffer to the screen.

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

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

Function Resize() clears 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::OPENGL_COMPOSITOR, and KIGFX::CAIRO_COMPOSITOR.

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

Function SetBuffer() sets 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

unsigned int KIGFX::COMPOSITOR::m_height
protected
unsigned int KIGFX::COMPOSITOR::m_width
protected

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