Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5768 in orxonox.OLD for trunk/src/lib/graphics/text_engine/font.h


Ignore:
Timestamp:
Nov 24, 2005, 8:24:52 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: font is a Texture now (this is a procedural texture)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/text_engine/font.h

    r5767 r5768  
    1111#define _FONT_H
    1212
    13 #include "base_object.h"
     13#include "texture.h"
    1414
    1515#include "glincl.h"
     
    5252
    5353//! A class to handle a Font of a certain ttf-File/image-file, Size.
    54 class Font : public BaseObject
     54class Font : public Texture
    5555{
    5656  public:
     
    6363    void init();
    6464
    65   // font
     65  //  font
    6666    bool loadFontFromTTF(const char* fontFile);
    6767    bool loadFontFromSDL_Surface(SDL_Surface* surface);
     
    7171    /** @returns a Pointer to the Array of Glyphs */
    7272    inline Glyph** getGlyphArray() const { return this->glyphArray; };
    73     /** @returns the texture to the fast-texture */
    74     inline GLuint getFastTextureID() const { return this->fastTextureID; };
     73    /** @returns the a pointer to the TTF */
     74    inline TTF_Font* getTTF() const { return this->fontTTF; };
     75
     76
    7577    /** @returns the default Font */
    7678    inline static Font* getDefaultFont() { if (Font::defaultFont == NULL) initDefaultFont(); return Font::defaultFont; };
    77     /** @returns the a pointer to the TTF */
    78     inline TTF_Font* getTTF() const { return this->fontTTF; };
    7979
    8080    void createAsciiImage(const char* fileName);
    8181    static void initDefaultFont();
    8282    static void removeDefaultFont();
    83 
    8483
    8584  private:
     
    8988    Glyph* getGlyphMetrics(Uint16 character);
    9089
    91     GLuint createFastTexture();
     90    bool createFastTexture();
    9291
    9392    void initGlyphs(Uint16 from, Uint16 count);
     
    104103
    105104    Glyph**       glyphArray;          //!< An Array of all the Glyphs stored in the Array of Glyphs.
    106     GLuint        fastTextureID;       //!< The fast textureID.
    107105};
    108106
Note: See TracChangeset for help on using the changeset viewer.