Import SDL_tbmf 0.4.0
[sdl_tbmf.git] / src / SDL_tbmf_textsurf.h
blob2c166569abd61ed7f1ab03ae2225136a0167578c
1 #ifndef _SDL_TBMF_TEXTSURF_H
2 #define _SDL_TBMF_TEXTSURF_H
4 #include "SDL.h"
5 #include "SDL_tbmf.h"
6 #include "SDL_tbmf_string.h"
8 namespace sdl_tbmf {
10 class TextSurface {
11 public:
12 TextSurface(const char *, const Font &, SDL_Surface * = NULL);
13 TextSurface(const char *, const Font &, SDL_Color);
14 ~TextSurface();
16 inline void operator=(const char *t) { SetText(t); }
17 operator SDL_Surface *() { return surface; }
18 operator const SDL_Surface *() const { return surface; }
20 SDL_Surface *GetSurface() { return surface; }
21 const SDL_Surface *GetSurface() const { return surface; }
22 char *GetText() { return text; }
23 const char *GetText() const { return text; }
24 TextSurface &SetText(const char *);
25 TextSurface &SetFont(const Font &);
26 TextSurface &SetTexture(SDL_Surface *);
27 TextSurface &SetColor(SDL_Color);
29 private:
30 TString text;
31 Font font;
32 SDL_Surface *texture;
33 SDL_Color color;
34 SDL_Surface *surface;
36 void Generate();
39 } // namespace sdl_tbmf
41 #endif // _SDL_TBMF_TEXTSURF_H