Index: code/branches/objecthierarchy/src/orxonox/objects/Camera.cc
===================================================================
--- code/branches/objecthierarchy/src/orxonox/objects/Camera.cc	(revision 2020)
+++ code/branches/objecthierarchy/src/orxonox/objects/Camera.cc	(revision 2023)
@@ -29,23 +29,17 @@
 #include "OrxonoxStableHeaders.h"
 #include "Camera.h"
-#include "CameraHandler.h"
 
 #include <string>
 #include <cassert>
 
+#include <OgreCamera.h>
 #include <OgreSceneManager.h>
 #include <OgreSceneNode.h>
-#include <OgreRenderWindow.h>
 #include <OgreViewport.h>
 
-#include "tinyxml/tinyxml.h"
-#include "util/SubString.h"
-#include "util/Math.h"
-#include "util/String.h"
-#include "util/Debug.h"
 #include "core/CoreIncludes.h"
 #include "core/ConfigValueIncludes.h"
-#include "GraphicsEngine.h"
 #include "objects/Scene.h"
+#include "objects/CameraHandler.h"
 
 namespace orxonox
Index: code/branches/objecthierarchy/src/orxonox/objects/Camera.h
===================================================================
--- code/branches/objecthierarchy/src/orxonox/objects/Camera.h	(revision 2020)
+++ code/branches/objecthierarchy/src/orxonox/objects/Camera.h	(revision 2023)
@@ -30,9 +30,7 @@
 #define _Camera_H__
 
+#include "OrxonoxPrereqs.h"
+
 #include <OgrePrerequisites.h>
-#include <OgreSceneNode.h>
-#include <OgreCamera.h>
-
-#include "OrxonoxPrereqs.h"
 #include "objects/worldentities/PositionableEntity.h"
 #include "objects/Tickable.h"
Index: code/branches/objecthierarchy/src/orxonox/objects/CameraHandler.cc
===================================================================
--- code/branches/objecthierarchy/src/orxonox/objects/CameraHandler.cc	(revision 2020)
+++ code/branches/objecthierarchy/src/orxonox/objects/CameraHandler.cc	(revision 2023)
@@ -29,25 +29,25 @@
 #include "CameraHandler.h"
 
-#include <OgreSceneManager.h>
-#include <OgreRenderWindow.h>
+#include <OgreViewport.h>
 
-#include "core/ObjectList.h"
 #include "core/Core.h"
 #include "Camera.h"
-#include "GraphicsEngine.h"
 
-#include <OgreCamera.h>
 
 namespace orxonox
 {
-    CameraHandler::CameraHandler()
+    CameraHandler* CameraHandler::singletonRef_s = 0;
+
+    CameraHandler::CameraHandler(Ogre::Viewport* viewport)
+        : viewport_(viewport)
     {
-//        GraphicsEngine::getInstance().getViewport()->setCamera(this->cam_);
+        assert(singletonRef_s == 0);
+        singletonRef_s = this;
     }
 
-    CameraHandler& CameraHandler::getInstance()
+    CameraHandler::~CameraHandler()
     {
-        static CameraHandler instance;
-        return instance;
+        assert(singletonRef_s != 0);
+        singletonRef_s = 0;
     }
 
@@ -71,5 +71,5 @@
         // add to list
         this->cameraList_.push_front(camera);
-        camera->setFocus(GraphicsEngine::getInstance().getViewport());
+        camera->setFocus(this->viewport_);
     }
 
@@ -87,5 +87,5 @@
             // set new focus if necessary
             if (cameraList_.size() > 0)
-                cameraList_.front()->setFocus(GraphicsEngine::getInstance().getViewport());
+                cameraList_.front()->setFocus(this->viewport_);
         }
         else
Index: code/branches/objecthierarchy/src/orxonox/objects/CameraHandler.h
===================================================================
--- code/branches/objecthierarchy/src/orxonox/objects/CameraHandler.h	(revision 2020)
+++ code/branches/objecthierarchy/src/orxonox/objects/CameraHandler.h	(revision 2023)
@@ -38,8 +38,7 @@
 #include "OrxonoxPrereqs.h"
 
+#include <cassert>
 #include <list>
-#include <OgreCamera.h>
-
-#include "core/BaseObject.h"
+#include <OgrePrerequisites.h>
 
 namespace orxonox
@@ -48,5 +47,6 @@
     {
         public:
-            static CameraHandler& getInstance();
+            CameraHandler(Ogre::Viewport* viewport);
+            ~CameraHandler();
 
             Camera* getActiveCamera() const;
@@ -55,9 +55,13 @@
             void releaseFocus(Camera* camera);
 
+            static CameraHandler& getInstance() { assert(singletonRef_s); return *singletonRef_s; }
+
         private:
-            CameraHandler();
-            ~CameraHandler() {}
+            CameraHandler(const CameraHandler&);
 
             std::list<Camera*> cameraList_;
+            Ogre::Viewport* viewport_;
+
+            static CameraHandler* singletonRef_s;
     };
 }
Index: code/branches/objecthierarchy/src/orxonox/objects/Scene.cc
===================================================================
--- code/branches/objecthierarchy/src/orxonox/objects/Scene.cc	(revision 2020)
+++ code/branches/objecthierarchy/src/orxonox/objects/Scene.cc	(revision 2023)
@@ -31,9 +31,10 @@
 
 #include <OgreRoot.h>
-#include <OgreSceneManager.h>
+#include <OgreSceneManagerEnumerator.h>
 #include <OgreSceneNode.h>
 #include <OgreLight.h>
 
 #include "core/CoreIncludes.h"
+#include "core/Core.h"
 #include "core/XMLPort.h"
 
@@ -49,17 +50,26 @@
         this->bShadows_ = false;
 
-        if (Ogre::Root::getSingletonPtr())
+        if (Core::showsGraphics())
         {
-            this->sceneManager_ = Ogre::Root::getSingleton().createSceneManager(Ogre::ST_GENERIC);
-            this->rootSceneNode_ = this->sceneManager_->getRootSceneNode();
+            if (Ogre::Root::getSingletonPtr())
+            {
+                this->sceneManager_ = Ogre::Root::getSingleton().createSceneManager(Ogre::ST_GENERIC);
+                this->rootSceneNode_ = this->sceneManager_->getRootSceneNode();
+            }
+            else
+            {
+                this->sceneManager_ = 0;
+                this->rootSceneNode_ = 0;
+            }
         }
         else
         {
-            this->sceneManager_ = 0;
-            this->rootSceneNode_ = 0;
+            // create a dummy SceneManager of our own since we don't have Ogre::Root.
+            this->sceneManager_ = new Ogre::DefaultSceneManager("");
+            this->rootSceneNode_ = this->sceneManager_->getRootSceneNode();
         }
 
         // test test test
-        if (this->sceneManager_)
+        if (Core::showsGraphics() && this->sceneManager_)
         {
             Ogre::Light* light;
@@ -80,6 +90,7 @@
             Ogre::Root::getSingleton().destroySceneManager(this->sceneManager_);
         }
-        else
+        else if (!Core::showsGraphics())
         {
+            delete this->sceneManager_;
         }
     }
@@ -104,5 +115,5 @@
     void Scene::setSkybox(const std::string& skybox)
     {
-        if (this->sceneManager_)
+        if (Core::showsGraphics() && this->sceneManager_)
             this->sceneManager_->setSkyBox(true, skybox);
 
@@ -112,5 +123,5 @@
     void Scene::setAmbientLight(const ColourValue& colour)
     {
-        if (this->sceneManager_)
+        if (Core::showsGraphics() && this->sceneManager_)
             this->sceneManager_->setAmbientLight(colour);
 
@@ -120,5 +131,5 @@
     void Scene::setShadow(bool bShadow)
     {
-        if (this->sceneManager_)
+        if (Core::showsGraphics() && this->sceneManager_)
         {
             if (bShadow)
Index: code/branches/objecthierarchy/src/orxonox/objects/worldentities/WorldEntity.cc
===================================================================
--- code/branches/objecthierarchy/src/orxonox/objects/worldentities/WorldEntity.cc	(revision 2020)
+++ code/branches/objecthierarchy/src/orxonox/objects/worldentities/WorldEntity.cc	(revision 2023)
@@ -37,5 +37,4 @@
 #include "util/Convert.h"
 
-#include "GraphicsEngine.h"
 #include "objects/Scene.h"
 
