Open Source Tomb Raider Engine
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

FontSDL.h 897B

123456789101112131415161718192021222324252627282930313233343536373839
  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. };
  28. #endif