Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5768 in orxonox.OLD for trunk/src/lib/graphics/text_engine/text.cc


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/text.cc

    r5767 r5768  
    3838  if (fontFile != NULL)
    3939    this->setFont(fontFile, FONT_DEFAULT_RENDER_SIZE);
    40   this->setSizeY2D(this->size = textSize);
     40  this->setSizeY2D(textSize);
    4141}
    4242
     
    6969  this->blending = TEXT_DEFAULT_BLENDING;
    7070  this->color = TEXT_DEFAULT_COLOR;
    71   this->size = TEXT_DEFAULT_SIZE;
    72 
     71  this->setSize(TEXT_DEFAULT_SIZE);
    7372  this->setText(NULL);
    7473}
     
    182181  {
    183182    glyphArray = this->font->getGlyphArray();
    184     glBindTexture(GL_TEXTURE_2D, font->getFastTextureID());
     183    glBindTexture(GL_TEXTURE_2D, font->getTexture());
    185184  }
    186185  else
     
    189188      Font::initDefaultFont();
    190189    glyphArray = Font::getDefaultFont()->getGlyphArray();
    191     glBindTexture(GL_TEXTURE_2D, Font::getDefaultFont()->getFastTextureID());
     190    glBindTexture(GL_TEXTURE_2D, Font::getDefaultFont()->getTexture());
    192191  }
    193192  const char* tmpText = this->externText;
     
    210209
    211210        glTexCoord2f(tmpGlyph->texCoord[0], tmpGlyph->texCoord[3]);
    212         glVertex2d(posX, this->size);
     211        glVertex2d(posX, this->getSizeY2D());
    213212
    214213        glTexCoord2f(tmpGlyph->texCoord[1], tmpGlyph->texCoord[3]);
    215         glVertex2d(posX+tmpGlyph->width*this->size, this->size);
     214        glVertex2d(posX+tmpGlyph->width*this->getSizeY2D(), this->getSizeY2D());
    216215
    217216        glTexCoord2f(tmpGlyph->texCoord[1], tmpGlyph->texCoord[2]);
    218         glVertex2d(posX+tmpGlyph->width*this->size, 0);
     217        glVertex2d(posX+tmpGlyph->width*this->getSizeY2D(), 0);
    219218
    220219        glEnd();
    221220        glEndList();
    222         posX += tmpGlyph->advance * this->size;
     221        posX += tmpGlyph->advance * this->getSizeY2D();
    223222      }
    224223      ++tmpText;
Note: See TracChangeset for help on using the changeset viewer.