Open Source Tomb Raider Engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*!
  2. * \file include/FontSDL.h
  3. * \brief SDL Font implementation
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _FONT_SDL_H_
  8. #define _FONT_SDL_H_
  9. #include "SDL_ttf.h"
  10. #include "Font.h"
  11. /*!
  12. * \brief SDL Font implementation
  13. */
  14. class FontSDL : public Font {
  15. public:
  16. /*!
  17. * \brief Constructs an object of FontSDL
  18. */
  19. FontSDL();
  20. /*!
  21. * \brief Deconstructs an object of FontSDL
  22. */
  23. virtual ~FontSDL();
  24. virtual int initialize();
  25. virtual unsigned int widthText(float scale, std::string s);
  26. virtual void drawText(unsigned int x, unsigned int y, float scale,
  27. const unsigned char color[4], std::string s);
  28. virtual unsigned int heightText(float scale, unsigned int maxWidth, std::string s);
  29. virtual void drawTextWrapped(unsigned int x, unsigned int y, float scale,
  30. const unsigned char color[4], unsigned int maxWidth, std::string s);
  31. private:
  32. TTF_Font *mFont;
  33. unsigned int mFontTexture;
  34. };
  35. #endif