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

Renderer for SFML2. More...

#include <SFML2.h>

Inheritance diagram for Gwk::Renderer::SFML2:
Gwk::Renderer::Base

Public Member Functions

 SFML2 (ResourceLoader &loader, sf::RenderTarget &target)
 
void EnsurePrimitiveType (sf::PrimitiveType type)
 
void EnsureTexture (const sf::Texture *texture)
 
void AddVert (int x, int y, float u=0.0f, float v=0.0f)
 
void Flush ()
 
void Begin () override
 
void End () override
 
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.
 
void DrawPixel (int x, int y) override
 
void DrawLinedRect (Gwk::Rect rect) override
 
void DrawFilledRect (Gwk::Rect rect) override
 Draw a filled rectangle using the current color.
 
void DrawShavedCornerRect (Gwk::Rect rect, bool bSlight=false) override
 
void DrawTexturedRect (Gwk::Texture *texture, Gwk::Rect rect, float u1, float v1, float u2, float v2) override
 
void RenderText (Gwk::Font *font, Gwk::Point pos, const Gwk::String &text) override
 
Gwk::Point MeasureText (Gwk::Font *font, const Gwk::String &text) override
 
Gwk::Color PixelColor (Gwk::Texture *texture, unsigned int x, unsigned int y, const Gwk::Color &col_default) override
 
- Public Member Functions inherited from Gwk::Renderer::Base
virtual void Init ()
 
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 ()
 
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)
 
virtual bool BeginContext (Gwk::WindowProvider *window)
 
virtual bool EndContext (Gwk::WindowProvider *window)
 
virtual bool PresentContext (Gwk::WindowProvider *window)
 

Protected Attributes

sf::RenderTarget & m_target
 
sf::Color m_color
 
sf::VertexArray m_buffer
 
sf::RenderStates m_renderStates
 
sf::View m_originalView
 
int m_height
 
- Protected Attributes inherited from Gwk::Renderer::Base
float m_fScale
 

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)
 

Detailed Description

Renderer for SFML2.

Constructor & Destructor Documentation

◆ SFML2()

Gwk::Renderer::SFML2::SFML2 ( ResourceLoader loader,
sf::RenderTarget &  target 
)

Constructor for SFML2 renderer.

Parameters
loader: ResourceLoader for renderer.
target: application render target.

Member Function Documentation

◆ DrawLinedRect()

void Gwk::Renderer::SFML2::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::SFML2::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: