Index: code/branches/gui/src/orxonox/GraphicsEngine.cc
===================================================================
--- code/branches/gui/src/orxonox/GraphicsEngine.cc	(revision 1640)
+++ code/branches/gui/src/orxonox/GraphicsEngine.cc	(revision 1641)
@@ -22,6 +22,7 @@
  *   Author:
  *      Reto Grieder
+ *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007
  *   Co-authors:
- *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007, Felix Schulthess
+ *      Felix Schulthess
  *
  */
@@ -89,4 +90,5 @@
         RegisterObject(GraphicsEngine);
 
+        assert(singletonRef_s == 0);
         singletonRef_s = this;
 
@@ -305,8 +307,6 @@
         //Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
 
-        // create a full screen viewport in which to render the scene and the loading screen
-        // The GUI uses its own one to be able to render on top of everything.
-        // That explains why the Z order here is only 1 and not 0 (top most)
-        this->viewport_ = this->renderWindow_->addViewport(0, 1);
+        // create a full screen viewport
+        this->viewport_ = this->renderWindow_->addViewport(0, 0);
 
         return true;
Index: code/branches/gui/src/orxonox/GraphicsEngine.h
===================================================================
--- code/branches/gui/src/orxonox/GraphicsEngine.h	(revision 1640)
+++ code/branches/gui/src/orxonox/GraphicsEngine.h	(revision 1641)
@@ -22,6 +22,7 @@
  *   Author:
  *      Reto Grieder
+ *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007
  *   Co-authors:
- *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007, Felix Schulthess
+ *      Felix Schulthess
  *
  */
@@ -88,5 +89,5 @@
 
         static GraphicsEngine& getSingleton();
-        static GraphicsEngine* getSingletonPtr() { return &getSingleton(); }
+        static GraphicsEngine* getSingletonPtr() { return singletonRef_s; }
 
     private:
Index: code/branches/gui/src/orxonox/Orxonox.cc
===================================================================
--- code/branches/gui/src/orxonox/Orxonox.cc	(revision 1640)
+++ code/branches/gui/src/orxonox/Orxonox.cc	(revision 1641)
@@ -300,5 +300,5 @@
   }
 
-  void Orxonox::loadGame(const std::string& name)
+  /*static*/ void Orxonox::loadGame(const std::string& name)
   {
       const GameMode& mode = Settings::getGameMode(name);
Index: code/branches/gui/src/orxonox/gui/GUIManager.h
===================================================================
--- code/branches/gui/src/orxonox/gui/GUIManager.h	(revision 1640)
+++ code/branches/gui/src/orxonox/gui/GUIManager.h	(revision 1641)
@@ -103,4 +103,6 @@
 
         void tickInput(float dt) { }
+        void tickKey(float dt) { }
+        void tickMouse(float dt) { }
 
         void loadScenes();
Index: code/branches/gui/src/orxonox/gui/OgreCEGUIRenderer.cpp
===================================================================
--- code/branches/gui/src/orxonox/gui/OgreCEGUIRenderer.cpp	(revision 1640)
+++ code/branches/gui/src/orxonox/gui/OgreCEGUIRenderer.cpp	(revision 1641)
@@ -191,6 +191,7 @@
     // GUI (uses its own viewport to be able render on top of all viewports).
     // But since we don't use overlays in the GUI, it doesn't matter.
-    //if (d_render_sys->_getViewport()->getOverlaysEnabled() && !d_quadlist.empty())
-    if (!d_quadlist.empty())
+    // ORXONOX REVERT: Changes are not in place anymore, but might be in the future!
+    if (d_render_sys->_getViewport()->getOverlaysEnabled() && !d_quadlist.empty())
+    //if (!d_quadlist.empty())
     {
         /// Quad list needs to be sorted and thus the vertex buffer rebuilt. If not, we can
@@ -493,6 +494,7 @@
     // GUI (uses its own viewport to be able render on top of all viewports).
     // But since we don't use overlays in the GUI, it doesn't matter.
-    //if (d_render_sys->_getViewport()->getOverlaysEnabled())
-    if (true)
+    // ORXONOX REVERT: Changes are not in place anymore, but might be in the future!
+    if (d_render_sys->_getViewport()->getOverlaysEnabled())
+    //if (true)
     {
         z = -1 + z;
Index: code/branches/gui/src/orxonox/overlays/console/InGameConsole.cc
===================================================================
--- code/branches/gui/src/orxonox/overlays/console/InGameConsole.cc	(revision 1640)
+++ code/branches/gui/src/orxonox/overlays/console/InGameConsole.cc	(revision 1641)
@@ -46,4 +46,6 @@
 #include "core/ConsoleCommand.h"
 #include "core/input/InputManager.h"
+#include "core/input/SimpleInputState.h"
+#include "core/input/InputBuffer.h"
 #include "GraphicsEngine.h"
 
@@ -66,7 +68,4 @@
         , consoleOverlayBorder_(0)
         , consoleOverlayTextAreas_(0)
-        , emptySceneManager_(0)
-        , emptyCamera_(0)
-        , viewport_(0)
     {
         RegisterObject(InGameConsole);
@@ -118,4 +117,7 @@
     void InGameConsole::initialise()
     {
+        // create the corresponding input state
+        InputManager::createSimpleInputState("console", 40)->setKeyHandler(Shell::getInstance().getInputBuffer());
+
         // create overlay and elements
         Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr();
@@ -195,12 +197,4 @@
         Shell::getInstance().addOutputLevel(true);
 
-        // create a sceneManager in order to render in our own viewport
-        this->emptySceneManager_ = Ogre::Root::getSingleton()
-            .createSceneManager(Ogre::ST_GENERIC, "Console/EmptySceneManager");
-        this->emptyCamera_ = this->emptySceneManager_->createCamera("Console/EmptyCamera");
-        this->viewport_ = GraphicsEngine::getSingleton().getRenderWindow()->addViewport(emptyCamera_, 10);
-        this->viewport_->setOverlaysEnabled(true);
-        this->viewport_->setClearEveryFrame(false);
-
         COUT(4) << "Info: InGameConsole initialized" << std::endl;
     }
@@ -211,4 +205,11 @@
     void InGameConsole::destroy()
     {
+        this->deactivate();
+
+        // destroy the input state previously created
+        SimpleInputState * inputState = dynamic_cast<SimpleInputState*>(InputManager::getState("console"));
+        if (inputState)
+            InputManager::destroyState("console");
+
         Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr();
         if (ovMan)
@@ -467,8 +468,8 @@
                 if (output.size() > this->maxCharsPerLine_)
                 {
-                    if (Shell::getInstance().getInputBuffer().getCursorPosition() < this->inputWindowStart_)
-                        this->inputWindowStart_ = Shell::getInstance().getInputBuffer().getCursorPosition();
-                    else if (Shell::getInstance().getInputBuffer().getCursorPosition() >= (this->inputWindowStart_ + this->maxCharsPerLine_ - 1))
-                        this->inputWindowStart_ = Shell::getInstance().getInputBuffer().getCursorPosition() - this->maxCharsPerLine_ + 1;
+                    if (Shell::getInstance().getInputBuffer()->getCursorPosition() < this->inputWindowStart_)
+                        this->inputWindowStart_ = Shell::getInstance().getInputBuffer()->getCursorPosition();
+                    else if (Shell::getInstance().getInputBuffer()->getCursorPosition() >= (this->inputWindowStart_ + this->maxCharsPerLine_ - 1))
+                        this->inputWindowStart_ = Shell::getInstance().getInputBuffer()->getCursorPosition() - this->maxCharsPerLine_ + 1;
 
                     output = output.substr(this->inputWindowStart_, this->maxCharsPerLine_);
Index: code/branches/gui/src/orxonox/overlays/console/InGameConsole.h
===================================================================
--- code/branches/gui/src/orxonox/overlays/console/InGameConsole.h	(revision 1640)
+++ code/branches/gui/src/orxonox/overlays/console/InGameConsole.h	(revision 1641)
@@ -100,8 +100,4 @@
         Ogre::TextAreaOverlayElement** consoleOverlayTextAreas_;
 
-        Ogre::SceneManager* emptySceneManager_;     //!< dummy SceneManager to render overlays in empty windows
-        Ogre::Camera*       emptyCamera_;           //!< dummy camera to render overlays in empty windows
-        Ogre::Viewport*     viewport_;
-
         // config values
         float relativeWidth;
