Index: /orxonox/branches/textEngine/src/lib/graphics/font/glfont.cc
===================================================================
--- /orxonox/branches/textEngine/src/lib/graphics/font/glfont.cc	(revision 3713)
+++ /orxonox/branches/textEngine/src/lib/graphics/font/glfont.cc	(revision 3714)
@@ -71,4 +71,6 @@
 GLFont::~GLFont(void)
 {
+  delete this->currentText;
+
   if (this->font)
     TTF_CloseFont(this->font);
@@ -82,8 +84,7 @@
   if (!GLFont::ttfInitialized)
     {
-      if(TTF_Init()==-1) {
+      if(TTF_Init()==-1)
 	PRINTF(1)("TTF_Init: %s\n", TTF_GetError());
-	exit(2);
-      }
+
       GLFont::checkVersion();
       GLFont::ttfInitialized = true;
@@ -124,10 +125,13 @@
   this->font = NULL;
   this->fontFile = NULL;
-  this->text = NULL;
-  this->texture = 0;
+
+  this->currentText = new Text;
+
+  this->currentText->text = NULL;
+  this->currentText->texture = 0;
   
   this->setSize(fontSize);
   
-  this->renderStyle = TTF_STYLE_NORMAL;
+  this->currentText->renderStyle = TTF_STYLE_NORMAL;
 
   this->setFont(fontFile);
@@ -173,8 +177,8 @@
 void GLFont::setText(const char* text)
 {
-  if (this->text)
-    delete []this->text;
-  this->text = new char[strlen(text)+1];
-  strcpy(this->text, text);
+  if (this->currentText->text)
+    delete []this->currentText->text;
+  this->currentText->text = new char[strlen(text)+1];
+  strcpy(this->currentText->text, text);
 }
 
@@ -186,16 +190,16 @@
 void GLFont::setStyle(char* renderStyle)
 {
-  this->renderStyle = TTF_STYLE_NORMAL;
+  this->currentText->renderStyle = TTF_STYLE_NORMAL;
   
   for (int i = 0; i < strlen(renderStyle); i++)
     if (strncmp(renderStyle+i, "b", 1) == 0) 
-      this->renderStyle |= TTF_STYLE_BOLD;
+      this->currentText->renderStyle |= TTF_STYLE_BOLD;
     else if (strncmp(renderStyle+i, "i", 1) == 0)
-      this->renderStyle |= TTF_STYLE_ITALIC;
+      this->currentText->renderStyle |= TTF_STYLE_ITALIC;
     else if (strncmp(renderStyle+i, "u", 1) == 0) 
-      this->renderStyle |= TTF_STYLE_UNDERLINE;
+      this->currentText->renderStyle |= TTF_STYLE_UNDERLINE;
 
   if (this->font)
-    TTF_SetFontStyle(this->font, this->renderStyle);
+    TTF_SetFontStyle(this->font, this->currentText->renderStyle);
   else
     PRINTF(2)("Font was not initialized, please do so before setting the Font-Style.\n");
@@ -219,7 +223,7 @@
 void GLFont::setColor(Uint8 r, Uint8 g, Uint8 b)
 {
-  this->color.r = r;
-  this->color.g = g;
-  this->color.b = b;
+  this->currentText->color.r = r;
+  this->currentText->color.g = g;
+  this->currentText->color.b = b;
 }
 
@@ -231,6 +235,6 @@
 void GLFont::setPosition(int x, int y)
 {
-  this->textPosSize.x = x;
-  this->textPosSize.y = y;
+  this->currentText->textPosSize.x = x;
+  this->currentText->textPosSize.y = y;
 }
 
@@ -242,16 +246,25 @@
 {
   this->enter2DMode();
-  glBindTexture(GL_TEXTURE_2D, texture);
+
+  glBindTexture(GL_TEXTURE_2D, this->currentText->texture);
   glEnable(GL_TEXTURE_2D);
   glBegin(GL_QUADS);
-  glTexCoord2f(this->texCoord.minU, this->texCoord.minV); glVertex2i(20,   20  );
-  glTexCoord2f(this->texCoord.maxU, this->texCoord.minV); glVertex2i(20+this->textPosSize.w, 20  );
-  glTexCoord2f(this->texCoord.maxU, this->texCoord.maxV); glVertex2i(20+this->textPosSize.w, 20+this->textPosSize.h);
-  glTexCoord2f(this->texCoord.minU, this->texCoord.maxV); glVertex2i(20, 20+this->textPosSize.h);
+
+  glTexCoord2f(this->currentText->texCoord.minU, this->currentText->texCoord.minV);
+  glVertex2i(20,   20  );
+
+  glTexCoord2f(this->currentText->texCoord.maxU, this->currentText->texCoord.minV);
+  glVertex2i(20+this->currentText->textPosSize.w, 20  );
+
+  glTexCoord2f(this->currentText->texCoord.maxU, this->currentText->texCoord.maxV);
+  glVertex2i(20+this->currentText->textPosSize.w, 20+this->currentText->textPosSize.h);
+
+  glTexCoord2f(this->currentText->texCoord.minU, this->currentText->texCoord.maxV);
+  glVertex2i(20, 20+this->currentText->textPosSize.h);
+
   glEnd();
+
   this->leave2DMode();
-
-}
-
+}
 
 /**
@@ -263,12 +276,14 @@
 {
   SDL_Surface* tmpSurf;
-  if (this->texture)
-    glDeleteTextures(1, &this->texture);
-  tmpSurf = TTF_RenderText_Blended(this->font, this->text, this->color);
+  if (this->currentText->texture)
+    glDeleteTextures(1, &this->currentText->texture);
+  tmpSurf = TTF_RenderText_Blended(this->font,
+				   this->currentText->text,
+				   this->currentText->color);
   if (tmpSurf)
-    this->texture = loadTexture(tmpSurf, &texCoord);
-
-  this->textPosSize.w = tmpSurf->w;
-  this->textPosSize.h = tmpSurf->h;
+    this->currentText->texture = loadTexture(tmpSurf, &this->currentText->texCoord);
+
+  this->currentText->textPosSize.w = tmpSurf->w;
+  this->currentText->textPosSize.h = tmpSurf->h;
   SDL_FreeSurface(tmpSurf);
 }
Index: /orxonox/branches/textEngine/src/lib/graphics/font/glfont.h
===================================================================
--- /orxonox/branches/textEngine/src/lib/graphics/font/glfont.h	(revision 3713)
+++ /orxonox/branches/textEngine/src/lib/graphics/font/glfont.h	(revision 3714)
@@ -10,4 +10,6 @@
 #include "SDL_ttf.h"
 
+// FORWARD DECLARATION 
+template<class T> class tList;
 
 /* some default values */
@@ -74,13 +76,19 @@
   TTF_Font* font;                  //!< The font we use for this.
   char* fontFile;                  //!< The fontfile from whitch the font was loaded.
-  char* text;                      //!< The text to display
-  unsigned int fontSize;           //!< The size of the font in pixels
-  SDL_Color color;                 //!< The color of the font.
+  unsigned int fontSize;           //!< The size of the font in pixels. each Font has one size.
 
-  // placement in openGL
-  GLuint texture;                  //!< A GL-texture to hold the text
-  SDL_Rect textPosSize;            //!< An SDL-Rectangle representing the position and size of the Text on the screen.
-  int renderStyle;                 //!< The Renderstyle
-  TexCoord texCoord;               //!< Texture-coordinates \todo fix this to have a struct
+  //! Represents one textElement.
+  struct Text
+  {
+    char* text;                      //!< The text to display
+    SDL_Color color;                 //!< The color of the font.
+    // placement in openGL
+    GLuint texture;                  //!< A GL-texture to hold the text
+    TexCoord texCoord;               //!< Texture-coordinates \todo fix this to have a struct
+    SDL_Rect textPosSize;            //!< An SDL-Rectangle representing the position and size of the Text on the screen.
+    int renderStyle;                 //!< The Renderstyle
+  };
+  tList<Text>* textList;
+  Text* currentText;
 
   bool init(const char* fontFile, unsigned int fontSize = FONT_DEFAULT_SIZE);
