SFML.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. GWEN
  3. Copyright (c) 2011 Facepunch Studios
  4. See license in Gwen.h
  5. */
  6. #pragma once
  7. #ifndef GWEN_RENDERERS_SFML_H
  8. #define GWEN_RENDERERS_SFML_H
  9. #include "Gwen/Gwen.h"
  10. #include "Gwen/BaseRender.h"
  11. #include <SFML/Graphics.hpp>
  12. namespace Gwen
  13. {
  14. namespace Renderer
  15. {
  16. class SFML : public Gwen::Renderer::Base
  17. {
  18. public:
  19. SFML( sf::RenderTarget& target );
  20. ~SFML();
  21. virtual void SetDrawColor(Gwen::Color color);
  22. virtual void DrawLine( int x, int y, int a, int b );
  23. virtual void DrawFilledRect( Gwen::Rect rect );
  24. virtual void LoadFont( Gwen::Font* pFont );
  25. virtual void FreeFont( Gwen::Font* pFont );
  26. virtual void RenderText( Gwen::Font* pFont, Gwen::Point pos, const Gwen::UnicodeString& text );
  27. virtual Gwen::Point MeasureText( Gwen::Font* pFont, const Gwen::UnicodeString& text );
  28. void StartClip();
  29. void EndClip();
  30. void DrawTexturedRect( Gwen::Texture* pTexture, Gwen::Rect pTargetRect, float u1=0.0f, float v1=0.0f, float u2=1.0f, float v2=1.0f );
  31. void LoadTexture( Gwen::Texture* pTexture );
  32. void FreeTexture( Gwen::Texture* pTexture );
  33. protected:
  34. sf::RenderTarget& m_Target;
  35. sf::Color m_Color;
  36. };
  37. }
  38. }
  39. #endif