Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 31, 2005, 2:14:02 AM (19 years ago)
Author:
bensch
Message:

orxonox/branches/textEngine: implemented some basic functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/textEngine/src/lib/graphics/font/glfont.h

    r3682 r3691  
    88
    99#include "glincl.h"
     10#include "SDL_ttf.h"
     11
     12
     13//! A struct for handling glyphs
     14struct glyph
     15{
     16  Uint16 character;
     17  int minX;
     18  int maxX;
     19  int minY;
     20  int maxY;
     21  int width;
     22  int height;
     23  int bearingX;
     24  int bearingY;
     25  int advance;
     26};
     27
    1028
    1129class GLFont
    1230{
     31 
     32 private:
     33
     34   
     35
    1336 public:
    1437  GLFont();
    1538  GLFont(const char* fontFile);
    16   ~GLFont();
    17  
     39  virtual ~GLFont();
     40
     41  static void enableFonts(void);
     42  static void disableFonts(void);
    1843
    1944
     
    2146  void setText(const char* text);
    2247
    23   void setStyle(char* style);
     48  void setStyle(char* renderStyle);
    2449  void setSize(void);
    2550  void setPosition(int x, int y);
     
    2954
    3055 private:
     56  // information about the Font
     57  TTF_Font* font;
    3158  char* fontFile;
    3259  char* text;
     60  unsigned int fontSize;
     61
     62  // placement in openGL
    3363  GLuint texture;
    3464  int positionX;
     
    3969
    4070  bool init(const char* fontFile);
    41   bool loadTexture();
    42   static int powerOfTwo(int input);
     71  int getMaxHeight(void);
     72  int getMaxAscent(void);
     73  int getMaxDescent(void);
     74  glyph getGlyphMetrics(Uint16 character);
    4375
    4476  static bool ttfInitialized;
     
    4779  void leave2DMode(void);
    4880
     81  static bool checkVersion(void);
     82
    4983  GLuint loadTexture(SDL_Surface* surface, GLfloat* texcoord);
    5084
    51   static int power_of_two(int input);
     85  static int powerOfTwo(int input);
     86
     87  void debug(void);
    5288
    5389};
Note: See TracChangeset for help on using the changeset viewer.