Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 1, 2006, 11:56:54 PM (18 years ago)
Author:
bensch
Message:

more thoughts on Resources, and soon going to adapt… i think i've got a clue :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/graphics/text_engine/font_data.h

    r8768 r9718  
    2626#define FONT_DEFAULT_RENDER_SIZE     50            //!< At what Resolution to render fonts.
    2727
     28class FontData
     29{
     30
     31
     32public:
     33
    2834//! A struct for handling glyphs
    2935/**
    3036 * a Glyph is one letter of a certain font
    3137 */
    32 struct Glyph
    33 {
     38  struct Glyph
     39  {
    3440  // Glyph-specific (size and so on)
    35   Uint16   character;         //!< The character
    36   float    minX;              //!< The minimum distance from the origin in X
    37   float    maxX;              //!< The maximum distance from the origin in X
    38   float    minY;              //!< The minimum distance from the origin in Y
    39   float    maxY;              //!< The maximum distance from the origin in Y
    40   float    width;             //!< The width of the Glyph
    41   float    height;            //!< The height of the Glyph
    42   float    bearingX;          //!< How much is right of the Origin
    43   float    bearingY;          //!< How much is above the Origin
    44   float    advance;           //!< How big a Glyph would be in monospace-mode
     41    Uint16   character;         //!< The character
     42    float    minX;              //!< The minimum distance from the origin in X
     43    float    maxX;              //!< The maximum distance from the origin in X
     44    float    minY;              //!< The minimum distance from the origin in Y
     45    float    maxY;              //!< The maximum distance from the origin in Y
     46    float    width;             //!< The width of the Glyph
     47    float    height;            //!< The height of the Glyph
     48    float    bearingX;          //!< How much is right of the Origin
     49    float    bearingY;          //!< How much is above the Origin
     50    float    advance;           //!< How big a Glyph would be in monospace-mode
    4551
    46   GLfloat texCoord[4];        //!< Texture coordinates: 0:left, 1:right, 2: top, 3: bottom.
    47 };
     52    GLfloat texCoord[4];        //!< Texture coordinates: 0:left, 1:right, 2: top, 3: bottom.
     53  };
    4854
    49 
    50 class FontData
    51 {
     55  typedef CountPointer<FontData> Pointer;
    5256public:
    5357  FontData();
     
    6165
    6266  /** @returns a Pointer to the Array of Glyphs */
    63   inline Glyph** getGlyphArray() const { return this->glyphArray; };
     67  inline const Glyph* const * const getGlyphArray() const { return this->glyphArray; };
    6468
    6569  int getMaxHeight() const { return maxHeight; };
     
    6872
    6973  /** @returns the Texture-Data of this FontData */
    70   const TextureDataPointer& textureData() const { return texData; };
     74  const TextureData::Pointer& textureData() const { return texData; };
    7175
    7276  bool rebuild() { return texData->rebuild(); };
     
    9195  int           maxDescent;          //!< Max Desent of the Font.
    9296
    93   TextureDataPointer   texData;
     97  TextureData::Pointer   texData;
    9498};
    9599
    96 typedef CountPointer<FontData> FontDataPointer;
    97 
    98100#endif /* _FONT_DATA_H */
Note: See TracChangeset for help on using the changeset viewer.