Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3692 in orxonox.OLD


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

orxonox/branches/textEngine: some minor changes

Location:
orxonox/branches/textEngine/src/lib/graphics/font
Files:
2 edited

Legend:

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

    r3691 r3692  
    5454
    5555
    56 #define DEFAULT_PTSIZE  18
     56#define DEFAULT_SIZE    18
    5757#define DEFAULT_TEXT    "orxonox 1234567890"
     58#define DEFAULT_COLOR_R 256
     59#define DEFAULT_COLOR_G 256
     60#define DEFAULT_COLOR_B 256
    5861#define NUM_COLORS      256
    5962
     
    6568
    6669}
     70
     71
    6772GLFont::GLFont(const char* fontFile)
    6873{
     
    7681}
    7782
     83/**
     84   \function to enable TTF_Fonts
     85*/
    7886void GLFont::enableFonts(void)
    7987{
     
    9199     
    92100}
     101
     102/**
     103   \brief function to disable TTF_fonts
     104*/
    93105void GLFont::disableFonts(void)
    94106{
     
    168180}
    169181
    170 void GLFont::setSize(void)
    171 {
    172 
    173 }
     182void GLFont::setSize(unsigned int fontSize)
     183{
     184  this->fontSize = fontSize;
     185}
     186
     187void GLFont::setColor(Uint8 r, Uint8 g, Uint8 b)
     188{
     189  this->color.r = r;
     190  this->color.g = g;
     191  this->color.b = b;
     192}
     193
     194
     195
     196void GLFont::createTexture(void)
     197{
     198  GLfloat texcoord[4];
     199  SDL_Surface* tmpSurf = TTF_RenderText_Blended(this->font, this->text, this->color);
     200  texture = loadTexture(tmpSurf, texcoord);
     201
     202}
     203
    174204
    175205/**
     
    242272
    243273}
     274
     275
    244276void GLFont::renderText(const char* text, int x, int y)
    245277{
  • orxonox/branches/textEngine/src/lib/graphics/font/glfont.h

    r3691 r3692  
    4747
    4848  void setStyle(char* renderStyle);
    49   void setSize(void);
     49  void setSize(unsigned int fontSize);
     50  void setColor(Uint8 r, Uint8 g, Uint8 b);
    5051  void setPosition(int x, int y);
     52
     53  void createTexture(void);
    5154 
    5255  void renderText(void);
     
    5962  char* text;
    6063  unsigned int fontSize;
     64  SDL_Color color;
    6165
    6266  // placement in openGL
Note: See TracChangeset for help on using the changeset viewer.