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.

FontSDL.h 969B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*!
  2. * \file include/system/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. /*!
  11. * \brief SDL Font implementation
  12. */
  13. class FontSDL {
  14. public:
  15. static void shutdown();
  16. static int initialize(std::string font);
  17. static unsigned int widthText(float scale, std::string s);
  18. static unsigned int heightText(float scale, unsigned int maxWidth, std::string s);
  19. static void drawText(unsigned int x, unsigned int y, float scale,
  20. const unsigned char color[4], std::string s);
  21. static void drawTextWrapped(unsigned int x, unsigned int y, float scale,
  22. const unsigned char color[4], unsigned int maxWidth, std::string s);
  23. private:
  24. static bool mFontInit;
  25. static TTF_Font* mFont;
  26. static unsigned int mFontTexture;
  27. static ShaderBuffer vertexBuffer;
  28. static ShaderBuffer uvBuffer;
  29. };
  30. #endif