Index: orxonox/trunk/src/lib/graphics/graphics_engine.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/graphics_engine.cc	(revision 3610)
+++ orxonox/trunk/src/lib/graphics/graphics_engine.cc	(revision 3611)
@@ -18,4 +18,6 @@
 #include "graphics_engine.h"
 
+#include "debug.h"
+
 using namespace std;
 
@@ -27,7 +29,35 @@
 GraphicsEngine::GraphicsEngine () 
 {
-   this->setClassName ("GraphicsEngine");
+  this->setClassName ("GraphicsEngine");
+  
+  this->initVideo();
+
+}
+
+GraphicsEngine* GraphicsEngine::singletonRef = NULL;
+
+GraphicsEngine* GraphicsEngine::getInstance()
+{
+  if (!GraphicsEngine::singletonRef)
+    GraphicsEngine::singletonRef = new GraphicsEngine();
+  return GraphicsEngine::singletonRef;
+}
 
 
+/**
+   \brief destructs the graphicsEngine.
+*/
+GraphicsEngine::~GraphicsEngine () 
+{
+  // delete what has to be deleted here
+}
+
+/**
+   \brief initializes the Video for openGL.
+
+   This has to be done only once when starting orxonox.
+*/
+int GraphicsEngine::initVideo()
+{
 
   if (SDL_Init(SDL_INIT_VIDEO) == -1)
@@ -53,12 +83,8 @@
 
 
-
-  int bpp = 16;
-  int width = 640;
-  int height = 480;
   //Uint32 flags = SDL_HWSURFACE | SDL_OPENGL | SDL_GL_DOUBLEBUFFER; /* \todo: SDL_OPENGL doen't permit to load images*/
   //Uint32 flags = SDL_HWSURFACE | SDL_GL_DOUBLEBUFFER;
 
-  Uint32 videoFlags = SDL_OPENGL | SDL_HWPALETTE | SDL_RESIZABLE;
+  this->videoFlags = SDL_OPENGL | SDL_HWPALETTE | SDL_RESIZABLE;
 
   /* query SDL for information about our video hardware */
@@ -67,22 +93,17 @@
   if( videoInfo == NULL)
     {
-      printf ("Orxonox::initVideo() - Failed getting Video Info :%s\n", SDL_GetError()); 
+      PRINTF(1)("Orxonox::initVideo() - Failed getting Video Info :%s\n", SDL_GetError()); 
       SDL_Quit ();
     }
   if( videoInfo->hw_available)
-    videoFlags |= SDL_HWSURFACE;
+    this->videoFlags |= SDL_HWSURFACE;
   else 
-    videoFlags |= SDL_SWSURFACE;
+    this->videoFlags |= SDL_SWSURFACE;
   /*
   if(VideoInfo -> blit_hw)                            
     VideoFlags |= SDL_HWACCEL;
   */
-  
-  if((this->screen = SDL_SetVideoMode (width, height, bpp, videoFlags)) == NULL)
-  {
-    printf("Could not SDL_SetVideoMode(%d, %d, %d, %d): %s\n", width, height, bpp, videoFlags, SDL_GetError());
-    SDL_Quit();
-    //    return -1;
-  }
+
+  this->setResoulution(800, 600, 16);
   
   // Set window labeling
@@ -92,25 +113,18 @@
   // SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask);  
 
+}
 
+int GraphicsEngine::setResoulution(int width, int height, int bpp)
+{
+  this->resolutionX = width;
+  this->resolutionY = height;
+  this->bitsPerPixel = bpp;
+  
+  if((this->screen = SDL_SetVideoMode (this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags)) == NULL)
+    {
+      PRINTF(1)("Could not SDL_SetVideoMode(%d, %d, %d, %d): %s\n", this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags, SDL_GetError());
+      SDL_Quit();
+      //    return -1;
+    }
 
 }
-
-GraphicsEngine* GraphicsEngine::singletonRef = NULL;
-
-GraphicsEngine* GraphicsEngine::getInstance()
-{
-  if (!GraphicsEngine::singletonRef)
-    GraphicsEngine::singletonRef = new GraphicsEngine();
-  return GraphicsEngine::singletonRef;
-}
-
-
-/**
-   \brief standard deconstructor
-
-*/
-GraphicsEngine::~GraphicsEngine () 
-{
-  // delete what has to be deleted here
-}
-
Index: orxonox/trunk/src/lib/graphics/graphics_engine.h
===================================================================
--- orxonox/trunk/src/lib/graphics/graphics_engine.h	(revision 3610)
+++ orxonox/trunk/src/lib/graphics/graphics_engine.h	(revision 3611)
@@ -10,5 +10,5 @@
 #define _GRAPHICS_ENGINE_H
 
-#include <SDL/SDL.h>
+#include "glincl.h"
 
 #include "base_object.h"
@@ -23,4 +23,9 @@
   virtual ~GraphicsEngine();
 
+  int initVideo();
+  int setResoulution(int width, int height, int bpp);
+
+  static bool texturesEnabled;
+
  private:
   GraphicsEngine();
@@ -29,4 +34,9 @@
 
   SDL_Surface* screen;
+  int resolutionX;
+  int resolutionY;
+  int bitsPerPixel;
+  bool fullscreen;
+  Uint32 videoFlags;
 };
 
