Index: orxonox/trunk/src/lib/graphics/graphics_engine.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/graphics_engine.cc	(revision 4457)
+++ orxonox/trunk/src/lib/graphics/graphics_engine.cc	(revision 4458)
@@ -165,4 +165,8 @@
 }
 
+/**
+   \brief sets Fullscreen mode
+   \param fullscreen true if fullscreen, false if windowed
+*/
 void GraphicsEngine::setFullscreen(bool fullscreen)
 {
@@ -171,4 +175,11 @@
 }
 
+/**
+   \brief sets the background color
+   \param red the red part of the background
+   \param blue the blue part of the background
+   \param green the green part of the background
+   \param alpha the alpha part of the background
+*/
 void GraphicsEngine::setBackgroundColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
 {
@@ -290,41 +301,50 @@
 }
 
-
+/**
+   \brief ticks the Text
+   \param dt the time passed
+*/
 void GraphicsEngine::tick(float dt)
 {
-	if( unlikely(this->bDisplayFPS))
-	{
-	  this->currentFPS = 1.0/dt;
+  if( unlikely(this->bDisplayFPS))
+    {
+      this->currentFPS = 1.0/dt;
       if( unlikely(this->currentFPS > this->maxFPS)) this->maxFPS = this->currentFPS;
-	  if( unlikely(this->currentFPS < this->minFPS)) this->minFPS = this->currentFPS;
-	  
-	  char tmpChar1[20];
-	  sprintf(tmpChar1, "Current:  %4.0f", this->currentFPS);
-	  this->geTextCFPS->setText(tmpChar1);
-	  char tmpChar2[20];
-	  sprintf(tmpChar2, "Max:    %4.0f", this->maxFPS);
-	  this->geTextMaxFPS->setText(tmpChar2);
-	  char tmpChar3[20];
-	  sprintf(tmpChar3, "Min:    %4.0f", this->minFPS);
-	  this->geTextMinFPS->setText(tmpChar3);
-	}
-}
-  
+      if( unlikely(this->currentFPS < this->minFPS)) this->minFPS = this->currentFPS;
+      
+      char tmpChar1[20];
+      sprintf(tmpChar1, "Current:  %4.0f", this->currentFPS);
+      this->geTextCFPS->setText(tmpChar1);
+      char tmpChar2[20];
+      sprintf(tmpChar2, "Max:    %4.0f", this->maxFPS);
+      this->geTextMaxFPS->setText(tmpChar2);
+      char tmpChar3[20];
+      sprintf(tmpChar3, "Min:    %4.0f", this->minFPS);
+      this->geTextMinFPS->setText(tmpChar3);
+    }
+}
+  
+/**
+   \brief displays the Frames per second
+   \param display if the text should be displayed
+
+   \todo this is dangerous
+*/
 void GraphicsEngine::displayFPS(bool display)
 {
-	if( display)
-	{
-		this->geTextCFPS = TextEngine::getInstance()->createText("fonts/druid.ttf", 35, TEXT_DYNAMIC, 0, 255, 0);
-		this->geTextCFPS->setAlignment(TEXT_ALIGN_LEFT);
-		this->geTextCFPS->setPosition(5, 500);
-		this->geTextMaxFPS = TextEngine::getInstance()->createText("fonts/druid.ttf", 35, TEXT_DYNAMIC, 0, 255, 0);
-		this->geTextMaxFPS->setAlignment(TEXT_ALIGN_LEFT);
-		this->geTextMaxFPS->setPosition(5, 530);
-		this->geTextMinFPS = TextEngine::getInstance()->createText("fonts/druid.ttf", 35, TEXT_DYNAMIC, 0, 255, 0);
-		this->geTextMinFPS->setAlignment(TEXT_ALIGN_LEFT);
-		this->geTextMinFPS->setPosition(5, 560);	
-	}
-	this->bDisplayFPS = display;
-}
-
-  
+  if( display)
+    {
+      this->geTextCFPS = TextEngine::getInstance()->createText("fonts/druid.ttf", 35, TEXT_DYNAMIC, 0, 255, 0);
+      this->geTextCFPS->setAlignment(TEXT_ALIGN_LEFT);
+      this->geTextCFPS->setPosition(5, 500);
+      this->geTextMaxFPS = TextEngine::getInstance()->createText("fonts/druid.ttf", 35, TEXT_DYNAMIC, 0, 255, 0);
+      this->geTextMaxFPS->setAlignment(TEXT_ALIGN_LEFT);
+      this->geTextMaxFPS->setPosition(5, 530);
+      this->geTextMinFPS = TextEngine::getInstance()->createText("fonts/druid.ttf", 35, TEXT_DYNAMIC, 0, 255, 0);
+      this->geTextMinFPS->setAlignment(TEXT_ALIGN_LEFT);
+      this->geTextMinFPS->setPosition(5, 560);	
+    }
+  this->bDisplayFPS = display;
+}
+
+  
Index: orxonox/trunk/src/lib/graphics/graphics_engine.h
===================================================================
--- orxonox/trunk/src/lib/graphics/graphics_engine.h	(revision 4457)
+++ orxonox/trunk/src/lib/graphics/graphics_engine.h	(revision 4458)
@@ -18,5 +18,8 @@
 class Text;
 
-
+//! class to handle graphics
+/**
+   handles graphical SDL-initialisation, textures, resolutions, and so on
+*/   
 class GraphicsEngine : public BaseObject 
 {
@@ -32,9 +35,9 @@
 
   /** \returns the x resolution */
-  inline int getResolutionX(void) {return this->resolutionX;}
+  inline int getResolutionX(void) const {return this->resolutionX;}
   /** \returns the y resolution */
-  inline int getResolutionY(void) {return this->resolutionY;}
+  inline int getResolutionY(void) const {return this->resolutionY;}
   /** \returns the Bits Per Pixel */
-  inline int getbbp(void) {return this->bitsPerPixel;}
+  inline int getbbp(void) const {return this->bitsPerPixel;}
   int resolutionChanged(SDL_ResizeEvent* resizeInfo);
   void listModes(void);
@@ -58,22 +61,22 @@
   static GraphicsEngine* singletonRef;
 
+ private:
+  SDL_Surface*   screen;          //!< the screen we draw to
+  int            resolutionX;     //!< the X-resoultion of the screen
+  int            resolutionY;     //!< the Y-resolution of the screen
+  int            bitsPerPixel;    //!< the bits per pixels of the screen
+  bool           fullscreen;      //!< if we are in fullscreen mode
+  Uint32         videoFlags;      //!< flags for video
+  SDL_Rect**     videoModes;      //!< list of resolutions
+  
+  bool           bDisplayFPS;     //!< is true if the fps should be displayed
+  float          currentFPS;      //!< the current frame rate: frames per seconds
+  float          maxFPS;          //!< maximal frame rate we ever got since start of the game
+  float          minFPS;          //!< minimal frame rate we ever got since start
 
-  SDL_Surface* screen;
-  int resolutionX;
-  int resolutionY;
-  int bitsPerPixel;
-  bool fullscreen;
-  Uint32 videoFlags;
-  
-  bool bDisplayFPS;  //!< is true if the fps should be displayed
-  float currentFPS;  //!< the current frame rate: frames per seconds
-  float maxFPS;      //!< maximal frame rate we ever got since start of the game
-  float minFPS;      //!< minimal frame rate we ever got since start
+  Text*          geTextCFPS;      //!< Text for the current FPS
+  Text*          geTextMaxFPS;    //!< Text for the max FPS
+  Text*          geTextMinFPS;    //!< Text for the min FPS
 
-  Text* geTextCFPS;
-  Text* geTextMaxFPS;
-  Text* geTextMinFPS;
-
-  SDL_Rect **videoModes;
 };
 
Index: orxonox/trunk/src/lib/graphics/text_engine.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/text_engine.cc	(revision 4457)
+++ orxonox/trunk/src/lib/graphics/text_engine.cc	(revision 4458)
@@ -76,5 +76,8 @@
 }
 
-
+/**
+   \brief tells the Text, that it should folow a PNode
+   \param bindNode: the node to bind this text to
+*/
 void Text::setBindNode(PNode* bindNode)
 {
@@ -277,4 +280,104 @@
 
 ////////////
+/// UTIL ///
+////////////
+/**
+   \brief Loads a Font from an SDL_surface into a texture.
+   \param surface The surface to make the texture of
+   \param texCoord The texture coordinates of the 4 corners of the texture
+   \returns the ID of the texture
+*/
+GLuint Text::loadTexture(SDL_Surface *surface, TexCoord* texCoord)
+{
+  GLuint texture;
+  int w, h;
+  SDL_Surface *image;
+  SDL_Rect area;
+  Uint32 saved_flags;
+  Uint8  saved_alpha;
+  
+  /* Use the surface width and height expanded to powers of 2 */
+  w = powerOfTwo(surface->w);
+  h = powerOfTwo(surface->h);
+  if (texCoord)
+    {
+      texCoord->minU = 0.0f;
+      texCoord->minV = 0.0f;
+      texCoord->maxU = (GLfloat)surface->w / w;
+      texCoord->maxV = (GLfloat)surface->h / h;
+    }
+  image = SDL_CreateRGBSurface(SDL_SWSURFACE,
+			       w, h,
+			       32,
+#if SDL_BYTEORDER == SDL_LIL_ENDIAN /* OpenGL RGBA masks */
+			       0x000000FF, 
+			       0x0000FF00, 
+			       0x00FF0000, 
+			       0xFF000000
+#else
+			       0xFF000000,
+			       0x00FF0000, 
+			       0x0000FF00, 
+			       0x000000FF
+#endif
+			       );
+  if ( image == NULL ) {
+    return 0;
+  }
+  
+  /* Save the alpha blending attributes */
+  saved_flags = surface->flags&(SDL_SRCALPHA|SDL_RLEACCELOK);
+  saved_alpha = surface->format->alpha;
+  if ( (saved_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
+    SDL_SetAlpha(surface, 0, 0);
+  }
+  
+  /* Copy the surface into the GL texture image */
+  area.x = 0;
+  area.y = 0;
+  area.w = surface->w;
+  area.h = surface->h;
+  SDL_BlitSurface(surface, &area, image, &area);
+  
+  /* Restore the alpha blending attributes */
+  if ( (saved_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
+    SDL_SetAlpha(surface, saved_flags, saved_alpha);
+  }
+  
+  /* Create an OpenGL texture for the image */
+  glGenTextures(1, &texture);
+  glBindTexture(GL_TEXTURE_2D, texture);
+  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+  glTexImage2D(GL_TEXTURE_2D,
+	       0,
+	       GL_RGBA,
+	       w, h,
+	       0,
+	       GL_RGBA,
+	       GL_UNSIGNED_BYTE,
+	       image->pixels);
+  SDL_FreeSurface(image); /* No longer needed */
+  
+  return texture;
+}
+
+/**
+   \brief Quick utility function for texture creation 
+   \param input an integer
+   \returns the next bigger 2^n-integer than input
+*/
+int Text::powerOfTwo(int input)
+{
+  int value = 1;
+  
+  while ( value < input ) {
+    value <<= 1;
+  }
+  return value;
+}
+
+
+////////////
 /// FONT ///
 ////////////
@@ -358,5 +461,5 @@
    i: italic, b: bold, u, underline
 */
-void Font::setStyle(char* renderStyle)
+void Font::setStyle(const char* renderStyle)
 {
   this->renderStyle = TTF_STYLE_NORMAL;
@@ -690,107 +793,4 @@
 }
 
-////////////
-/// UTIL ///
-////////////
-/**
-   \brief Loads a Font from an SDL_surface into a texture.
-   \param surface The surface to make the texture of
-   \param texCoord The texture coordinates of the 4 corners of the texture
-   \returns the ID of the texture
-*/
-GLuint loadTexture(SDL_Surface *surface, TexCoord* texCoord)
-{
-  GLuint texture;
-  int w, h;
-  SDL_Surface *image;
-  SDL_Rect area;
-  Uint32 saved_flags;
-  Uint8  saved_alpha;
-  
-  /* Use the surface width and height expanded to powers of 2 */
-  w = powerOfTwo(surface->w);
-  h = powerOfTwo(surface->h);
-  if (texCoord)
-    {
-      texCoord->minU = 0.0f;
-      texCoord->minV = 0.0f;
-      texCoord->maxU = (GLfloat)surface->w / w;
-      texCoord->maxV = (GLfloat)surface->h / h;
-    }
-  image = SDL_CreateRGBSurface(SDL_SWSURFACE,
-			       w, h,
-			       32,
-#if SDL_BYTEORDER == SDL_LIL_ENDIAN /* OpenGL RGBA masks */
-			       0x000000FF, 
-			       0x0000FF00, 
-			       0x00FF0000, 
-			       0xFF000000
-#else
-			       0xFF000000,
-			       0x00FF0000, 
-			       0x0000FF00, 
-			       0x000000FF
-#endif
-			       );
-  if ( image == NULL ) {
-    return 0;
-  }
-  
-  /* Save the alpha blending attributes */
-  saved_flags = surface->flags&(SDL_SRCALPHA|SDL_RLEACCELOK);
-  saved_alpha = surface->format->alpha;
-  if ( (saved_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
-    SDL_SetAlpha(surface, 0, 0);
-  }
-  
-  /* Copy the surface into the GL texture image */
-  area.x = 0;
-  area.y = 0;
-  area.w = surface->w;
-  area.h = surface->h;
-  SDL_BlitSurface(surface, &area, image, &area);
-  
-  /* Restore the alpha blending attributes */
-  if ( (saved_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
-    SDL_SetAlpha(surface, saved_flags, saved_alpha);
-  }
-  
-  /* Create an OpenGL texture for the image */
-  glGenTextures(1, &texture);
-  glBindTexture(GL_TEXTURE_2D, texture);
-  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-  glTexImage2D(GL_TEXTURE_2D,
-	       0,
-	       GL_RGBA,
-	       w, h,
-	       0,
-	       GL_RGBA,
-	       GL_UNSIGNED_BYTE,
-	       image->pixels);
-  SDL_FreeSurface(image); /* No longer needed */
-  
-  return texture;
-}
-
-/**
-   \brief Quick utility function for texture creation 
-   \param input an integer
-   \returns the next bigger 2^n-integer than input
-*/
-int powerOfTwo(int input)
-{
-  int value = 1;
-  
-  while ( value < input ) {
-    value <<= 1;
-  }
-  return value;
-}
-
-
-
-
-
 
 ///////////////////
@@ -893,5 +893,5 @@
 /**
    \brief removes a Text from the List
-   \param the text to delete
+   \param text: the text to delete
 
    this only ereases allocated memory, and removes the text
Index: orxonox/trunk/src/lib/graphics/text_engine.h
===================================================================
--- orxonox/trunk/src/lib/graphics/text_engine.h	(revision 4457)
+++ orxonox/trunk/src/lib/graphics/text_engine.h	(revision 4458)
@@ -60,8 +60,8 @@
 struct TexCoord
 {
-  float minU;                      //!< The minimum U-Coordinate
-  float maxU;                      //!< The maximum U-Coordinate
-  float minV;                      //!< The minimum V-Coordinate
-  float maxV;                      //!< The maximum V-Coordinate
+  float    minU;              //!< The minimum U-Coordinate
+  float    maxU;              //!< The maximum U-Coordinate
+  float    minV;              //!< The minimum V-Coordinate
+  float    maxV;              //!< The maximum V-Coordinate
 };
 
@@ -73,18 +73,18 @@
 {
   // Glyph-specific (size and so on)
-  Uint16 character;              //!< The character
-  int minX;                      //!< The minimum distance from the origin in X
-  int maxX;                      //!< The maximum distance from the origin in X
-  int minY;                      //!< The minimum distance from the origin in Y
-  int maxY;                      //!< The maximum distance from the origin in Y
-  int width;                     //!< The width of the Glyph
-  int height;                    //!< The height of the Glyph
-  int bearingX;                  //!< How much is right of the Origin
-  int bearingY;                  //!< How much is above the Origin
-  int advance;                   //!< How big a Glyph would be in monospace-mode
+  Uint16   character;         //!< The character
+  int      minX;              //!< The minimum distance from the origin in X
+  int      maxX;              //!< The maximum distance from the origin in X
+  int      minY;              //!< The minimum distance from the origin in Y
+  int      maxY;              //!< The maximum distance from the origin in Y
+  int      width;             //!< The width of the Glyph
+  int      height;            //!< The height of the Glyph
+  int      bearingX;          //!< How much is right of the Origin
+  int      bearingY;          //!< How much is above the Origin
+  int      advance;           //!< How big a Glyph would be in monospace-mode
   
   // OpenGL-specific
   //  TexCoord texCoord;         //!< A Texture Coordinate for this glyph.
-  GLuint displayList;            //!< DiplayList to render this Glyph.
+  GLuint displayList;         //!< DiplayList to render this Glyph.
 };
 
@@ -110,5 +110,4 @@
   // Static Text
   void setColor(Uint8 r, Uint8 g, Uint8 b);
-  void setStyle(char* renderStyle);
 
   void createTexture();
@@ -120,18 +119,23 @@
  private:
   Text(Font* font, int type = TEXT_DYNAMIC);
-
-  Font* font;
-
-  int type;                      //!< The type of this Font.
-  char* text;                    //!< The text to display
-  SDL_Color color;               //!< The color of the font.
-  TEXT_ALIGNMENT alignment;      //!< The aignment of the text.
-  float blending;                //!< The blending intensity.
+  
+  static GLuint loadTexture(SDL_Surface* surface, TexCoord* texCoord);
+  static int powerOfTwo(int input);
+
+ private:
+  Font*             font;           //!< Font of this text
+
+  int               type;           //!< The type of this Font.
+  char*             text;           //!< The text to display
+  SDL_Color         color;          //!< The color of the font.
+  TEXT_ALIGNMENT    alignment;      //!< The aignment of the text.
+  float             blending;       //!< The blending intensity.
+
   // 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 posSize;              //!< An SDL-Rectangle representing the position and size of the Text on the screen.
-  
-  PNode* bindNode;               //!< A node the Text is bind to. (if NULL thr node will not be bound to anything.)
+  GLuint            texture;        //!< A GL-texture to hold the text
+  TexCoord          texCoord;       //!< Texture-coordinates \todo fix this to have a struct
+  SDL_Rect          posSize;        //!< An SDL-Rectangle representing the position and size of the Text on the screen.
+  
+  PNode*            bindNode;       //!< A node the Text is bind to. (if NULL thr node will not be bound to anything.)
 };
 
@@ -143,7 +147,12 @@
 {
   friend class Text;
+
  public:
-  Font(const char* fontFile, unsigned int fontSize = FONT_DEFAULT_SIZE,
-       Uint8 r = FONT_DEFAULT_COLOR_R, Uint8 g = FONT_DEFAULT_COLOR_G, Uint8 b = FONT_DEFAULT_COLOR_B);
+  Font(const char* fontFile,
+       unsigned int fontSize = FONT_DEFAULT_SIZE,
+       Uint8 r = FONT_DEFAULT_COLOR_R,
+       Uint8 g = FONT_DEFAULT_COLOR_G,
+       Uint8 b = FONT_DEFAULT_COLOR_B);
+
   virtual ~Font();
 
@@ -152,26 +161,12 @@
   void setSize(unsigned int fontSize);
   void setFastColor(Uint8 r, Uint8 g, Uint8 b);
-  void setStyle(char* renderStyle);
-
-  inline Glyph** getGlyphArray(void) {return glyphArray;}
-  inline GLuint getFastTextureID(void) {return fastTextureID;}
-  
-  
- private:
-  // general purpose
-  GLdouble projMat[16];             //!< The Projection Matrix
-
-  // information about the Font
-  TTF_Font* font;                   //!< The font we use for this.
-  char* fontFile;                   //!< The fontfile from whitch the font was loaded.
-  unsigned int fontSize;            //!< The size of the font in pixels. each Font has one size.
-  int renderStyle;                  //!< The Renderstyle
-  
-  Glyph** glyphArray;               //!< An Array of all the Glyphs stored in the Array of Glyphs.
-  GLuint fastTextureID;             //!< The fast textureID.
-  SDL_Color fastColor;              //!< A Color for the fast Texture.
-
-  tList<Text>* textList;
-
+  void setStyle(const char* renderStyle);
+
+  /** \returns a Pointer to the Array of Glyphs */
+  inline Glyph** getGlyphArray(void) const {return glyphArray;}
+  /** \returns the texture to the fast-texture */
+  inline GLuint getFastTextureID(void) const {return fastTextureID;}
+  
+ private:
   int getMaxHeight(void);
   int getMaxAscent(void);
@@ -186,8 +181,20 @@
   void debug(void);
 
-};
-GLuint loadTexture(SDL_Surface* surface, TexCoord* texCoord);
-int powerOfTwo(int input);
-
+ private:
+  // general purpose
+  GLdouble      projMat[16];         //!< The Projection Matrix
+
+  // information about the Font
+  TTF_Font*     font;                //!< The font we use for this.
+  char*         fontFile;            //!< The fontfile from whitch the font was loaded.
+  unsigned int  fontSize;            //!< The size of the font in pixels. each Font has one size.
+  int           renderStyle;         //!< The Renderstyle
+  
+  Glyph**       glyphArray;          //!< An Array of all the Glyphs stored in the Array of Glyphs.
+  GLuint        fastTextureID;       //!< The fast textureID.
+  SDL_Color     fastColor;           //!< A Color for the fast Texture.
+
+  tList<Text>*  textList;            //!< A list of texts this Font is mapped to.
+};
 
 ///////////////////
@@ -224,7 +231,7 @@
   static bool checkVersion(void);
 
-
+ private:
   //  tList<Font>* fontList;
-  tList<Text>* textList;
+  tList<Text>*       textList;      //!< a list of all texts of the textEngine
 
 };
