Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/new_class_id/src/lib/graphics/text_engine/resource_font.h @ 9854

Last change on this file since 9854 was 9854, checked in by bensch, 18 years ago

more nice comments, and also updated the KeepLevel loading (if you want to load a Resource to a KeepLevel just append it at loadtime:
eg.:
Texture tex = ResourceTexture(orxonox.png, GL_TEXTURE_2D, GameEnd);
where GameEnd is the KeepLevel as defined in orxonox.cc→initResources()

File size: 1.0 KB
Line 
1/*!
2 * @file resource_font.h
3 * @brief Contains the ResourceFont class, that handles the Resource-specific loading part of the Font.
4 *
5 */
6
7#ifndef _RESOURCE_FONT_H
8#define _RESOURCE_FONT_H
9
10#include "util/loading/resource.h"
11#include "font.h"
12
13
14class ResourceFont : public Font, public Resources::Resource
15{
16public:
17  ResourceFont(const std::string& fontName, unsigned int renderSize, const Resources::KeepLevel& keepLevel = Resources::KeepLevel());
18  static ResourceFont createFromString(const std::string& loadString, const Resources::KeepLevel& keepLevel = Resources::KeepLevel());
19
20private:
21class FontResourcePointer : public Resources::StorePointer
22  {
23  public:
24    FontResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const FontData::Pointer& data);
25    inline const FontData::Pointer& ptr() const { return pointer; }
26    virtual bool last() const { return pointer.count() == 1; }
27  private:
28    FontData::Pointer pointer;
29  };
30
31private:
32  static Resources::tType<ResourceFont> type;
33};
34
35
36#endif /* _RESOURCE_FONT_H */
Note: See TracBrowser for help on using the repository browser.