Add masks to all channels in SDL_CreateRGBSurface calls
[sdl_tbmf.git] / src / SDL_tbmf_textsurf.h
blob1a6e4c13aaa42b0951e42f25da419bbd4cf38e6d
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 void operator=(const char *t) { setText(t); }
17 operator SDL_Surface *() { return mSurface; }
18 operator const SDL_Surface *() const { return mSurface; }
20 SDL_Surface *surface() { return mSurface; }
21 const SDL_Surface *surface() const { return mSurface; }
23 char *text() { return mText; }
24 const char *text() const { return mText; }
25 Font &font() { return mFont; }
26 const Font &font() const { return mFont; }
27 SDL_Color color() const { return mColor; }
28 SDL_Surface *texture() { return mTexture; }
30 TextSurface &setText(const char *);
31 TextSurface &setFont(const Font &);
32 TextSurface &setColor(SDL_Color);
33 TextSurface &setTexture(SDL_Surface *);
35 private:
36 TString mText;
37 Font mFont;
38 SDL_Color mColor;
39 SDL_Surface *mTexture;
40 SDL_Surface *mSurface;
42 void generate();
45 } // namespace sdl_tbmf
47 #endif /* SDL_TBMF_TEXTSURF_H */