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.

Font.h 778B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*!
  2. * \file include/Font.h
  3. * \brief Font interface
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _FONT_H_
  8. #define _FONT_H_
  9. typedef struct {
  10. char *text;
  11. unsigned int x;
  12. unsigned int y;
  13. int w;
  14. int h;
  15. float scale;
  16. float color[4];
  17. } FontString;
  18. /*!
  19. * \brief Font interface
  20. */
  21. class Font {
  22. public:
  23. /*!
  24. * \brief Deconstructs an object of Font
  25. */
  26. virtual ~Font();
  27. virtual void setFont(const char *font);
  28. virtual int initialize() = 0;
  29. virtual void writeString(FontString &s) = 0;
  30. virtual void drawText(unsigned int x, unsigned int y, float scale, const float color[4], const char *s, ...)
  31. __attribute__((format(printf, 6, 0))) = 0;
  32. protected:
  33. bool mFontInit;
  34. char *mFontName;
  35. };
  36. Font &getFont();
  37. #endif