Advertisement
GeeckoDev

glib2d_font.h

Apr 25th, 2015
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.89 KB | None | 0 0
  1. #ifndef GLIB2D_FONT_H
  2. #define GLIB2D_FONT_H
  3.  
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7.  
  8. #include "glib2d.h"
  9. #include <SDL_ttf.h>
  10.  
  11. #define GLYPH_CACHE_SIZE    (16)
  12.  
  13. typedef struct
  14. {
  15.   int id;
  16.   char ch[4];
  17.   g2dImage *tex;
  18. } g2dGlyph;
  19.  
  20. typedef struct
  21. {
  22.   TTF_Font *ttf;
  23.   g2dGlyph *glyph_cache[GLYPH_CACHE_SIZE];
  24. } g2dFont;
  25.  
  26. void g2dFontInit();
  27. void g2dFontTerm();
  28.  
  29. g2dFont *g2dFontLoad(char *path, int pt);
  30. void g2dFontFree(g2dFont *font);
  31.  
  32. void g2dFontBegin(g2dFont *font);
  33. void g2dFontEnd();
  34.  
  35. void g2dFontReset();
  36. void g2dFontSetText(char *string);
  37. void g2dFontSetCoordXY(float x, float y);
  38. void g2dFontSetScale(float scale);
  39. void g2dFontSetColor(g2dColor color);
  40. void g2dFontSetShadowColor(g2dColor color);
  41. void g2dFontSetAlpha(int alpha);
  42. void g2dFontSetRotation(float degrees);
  43. void g2dFontSetCoordMode(g2dCoord_Mode mode);
  44.  
  45. #ifdef __cplusplus
  46. }
  47. #endif
  48.  
  49. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement