Open Source Tomb Raider Engine
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

FontSDL.h 853B

123456789101112131415161718192021222324252627282930313233343536373839
  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. /*!
  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