Gwork: 0.3.0Dev
Gwk::Renderer::Software Class Reference

Renders to a buffer without needing external dependencies. More...

#include <Software.h>

Inheritance diagram for Gwk::Renderer::Software:
Gwk::Renderer::Base

Public Member Functions

 Software (ResourceLoader &loader, PixelBuffer &pbuff)
 
void StartClip () override
 Start clipping the drawing. More...
 
void EndClip () override
 Stop clipping the drawing.
 
void SetDrawColor (Gwk::Color color) override
 Set the current drawing color.
 
Gwk::Point MeasureText (Gwk::Font *font, const Gwk::String &text) override
 
void RenderText (Gwk::Font *font, Gwk::Point pos, const Gwk::String &text) override
 
void DrawFilledRect (Gwk::Rect rect) override
 Draw a filled rectangle using the current color.
 
void DrawTexturedRect (Gwk::Texture *texture, Gwk::Rect targetRect, float u1=0.0f, float v1=0.0f, float u2=1.0f, float v2=1.0f) override
 
void DrawLinedRect (Gwk::Rect rect) override
 
void DrawPixel (int x, int y) override
 
Gwk::Color PixelColor (Gwk::Texture *texture, unsigned int x, unsigned int y, const Gwk::Color &col_default) override
 
bool BeginContext (Gwk::WindowProvider *window) override
 
bool EndContext (Gwk::WindowProvider *window) override
 
bool PresentContext (Gwk::WindowProvider *window) override
 
- Public Member Functions inherited from Gwk::Renderer::Base
virtual void Init ()
 
virtual void Begin ()
 
virtual void End ()
 
ResourceLoaderGetLoader ()
 Get ResourceLoader we are using for the renderer.
 
void SetClipRegion (Gwk::Rect const &rect)
 
void AddClipRegion (Gwk::Rect rect)
 
bool ClipRegionVisible ()
 
const Gwk::RectClipRegion () const
 
virtual void DrawMissingImage (Gwk::Rect targetRect)
 
virtual ICacheToTextureGetCTT ()
 
virtual void DrawShavedCornerRect (Gwk::Rect rect, bool bSlight=false)
 
void Translate (int &x, int &y)
 
void Translate (Gwk::Rect &rect)
 
void SetRenderOffset (const Gwk::Point &offset)
 Set the rendering offset. You shouldn't have to touch these, ever.
 
void AddRenderOffset (const Gwk::Rect &offset)
 
const Gwk::PointGetRenderOffset () const
 
void SetScale (float fScale)
 
float Scale () const
 
virtual bool InitializeContext (Gwk::WindowProvider *window)
 
virtual bool ShutdownContext (Gwk::WindowProvider *window)
 
virtual bool ResizedContext (Gwk::WindowProvider *window, int w, int h)
 

Additional Inherited Members

- Protected Member Functions inherited from Gwk::Renderer::Base
 Base (ResourceLoader &loader)
 Constructor. Not public as we only instance derived implementations.
 
bool EnsureFont (Font &font)
 
- Protected Attributes inherited from Gwk::Renderer::Base
float m_fScale
 

Detailed Description

Renders to a buffer without needing external dependencies.

This can be used for screenshots and testing.

Member Function Documentation

◆ DrawLinedRect()

void Gwk::Renderer::Software::DrawLinedRect ( Gwk::Rect  rect)
overridevirtual

"\name Render Specialisation" No need to implement these functions in your derived class, but if you can do them faster than the default implementation it's a good idea to.

Reimplemented from Gwk::Renderer::Base.

◆ StartClip()

void Gwk::Renderer::Software::StartClip ( )
overridevirtual

Start clipping the drawing.

See also
SetClipRegion().

Reimplemented from Gwk::Renderer::Base.


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