cpp_photon/include/video/FontResourceManager.hpp

64 lines
1.4 KiB
C++
Raw Normal View History

2005-06-29 04:30:40 +00:00
//This file is part of Photon (http://photon.sourceforge.net)
//Copyright (C) 2004-2005 James Turk
//
// Author:
// James Turk (jpt2433@rit.edu)
//
// Version:
// $Id: FontResourceManager.hpp,v 1.2 2005/07/03 05:20:49 cozman Exp $
2005-06-29 04:30:40 +00:00
#ifndef PHOTON_VIDEO_FONTRESOURCEMANAGER_HPP
#define PHOTON_VIDEO_FONTRESOURCEMANAGER_HPP
#include "ResourceManager.hpp"
#include <ft2build.h>
#include FT_FREETYPE_H
2005-06-29 04:30:40 +00:00
namespace photon
{
namespace video
{
class FontResource : public Resource
{
public:
uint texID;
uint listBase;
std::vector<ubyte> widths;
ubyte height;
2005-06-29 04:30:40 +00:00
};
class FontResourceManager : public ResourceManager<FontResource>
{
public:
FontResourceManager();
~FontResourceManager();
void getFontData(const std::string& name, uint& texID, uint& listBase,
std::vector<ubyte>& widths, ubyte& height);
2005-06-29 04:30:40 +00:00
private:
// defined but not implemented
2005-06-29 04:30:40 +00:00
virtual void loadResource(FontResource &res, const std::string& name);
FontResource newResource(const std::string& name, const std::string& path,
uint size);
virtual void loadResource(FontResource &res, const std::string& name,
uint size);
2005-06-29 04:30:40 +00:00
virtual void freeResource(FontResource &res);
private:
FT_Library library_;
public:
static const unsigned int SPACE = 32;
static const unsigned int NUM_CHARS = 96;
2005-06-29 04:30:40 +00:00
};
}
}
#endif //PHOTON_VIDEO_FONTRESOURCEMANAGER_HPP