Initial clone in from local subversion server

This commit is contained in:
2011-05-26 02:24:33 +00:00
commit ccca81e04e
87 changed files with 20290 additions and 0 deletions

36
FontRenderer.h Executable file
View File

@@ -0,0 +1,36 @@
#ifndef __FONTRENDERER_H__
#define __FONTRENDERER_H__
#include <SDL.h>
#include <SDL_ttf.h>
#include <iostream>
#include <vector>
#include <map>
#include "Common.h"
class FontRenderer
{
protected:
// organized by loadedFonts[FontName][PointSize] = TTF_Font *
FontRenderer();
~FontRenderer();
std::map<std::string, std::map<int, TTF_Font *> > loadedFonts;
SDL_Color textColor;
SDL_Color bgColor;
int alpha;
public:
static FontRenderer &NewSingleton()
{
static FontRenderer rend;
return rend;
}
void setColor(SDL_Color textColor, SDL_Color bgColor, int alpha);
int loadFont(std::string filename, std::string fontname, int pointsize);
SDL_Rect renderString(std::string text,
SDL_Surface *dest,
std::string fontname,
Vector position,
int pointsize);
};
#endif // __FONTRENDERER_H__