Index: trunk/src/story_entities/game_world.cc
===================================================================
--- trunk/src/story_entities/game_world.cc	(revision 7871)
+++ trunk/src/story_entities/game_world.cc	(revision 7919)
@@ -25,4 +25,5 @@
 
 #include "util/loading/game_loader.h"
+#include "util/timer.h"
 
 #include "player.h"
@@ -259,7 +260,7 @@
   this->cycle = 0;
   for (unsigned int i = 0; i < TICK_SMOOTH_VALUE; i++)
-    this->frameTimes[i] = 100;
+    this->frameTimes[i] = 0.01f;
   this->dtS = 0.0f;
-  this->lastFrame = SDL_GetTicks ();
+  this->lastFrame = Timer::getNow();
 
   if (this->dataTank->music != NULL)
@@ -356,22 +357,19 @@
 void GameWorld::tick ()
 {
-  Uint32 currentFrame = SDL_GetTicks();
-
   if( !this->bPaused)
   {
     // CALCULATE FRAMERATE
     Uint32 frameTimesIndex;
-    Uint32 getTicks;
     Uint32 i;
+    double currentFrame = Timer::getNow();
 
     frameTimesIndex = this->cycle % TICK_SMOOTH_VALUE;
-    getTicks = SDL_GetTicks();
-    this->frameTimes[frameTimesIndex] = getTicks - this->lastFrame;
-    this->lastFrame = getTicks;
+    this->frameTimes[frameTimesIndex] = currentFrame - this->lastFrame;
+    this->lastFrame = currentFrame;
     ++this->cycle;
-    this->dtS = 0;
+    this->dtS = 0.0;
     for (i = 0; i < TICK_SMOOTH_VALUE; i++)
       this->dtS += this->frameTimes[i];
-    this->dtS = this->dtS / TICK_SMOOTH_VALUE / 1000.0f * speed;
+    this->dtS = this->dtS / TICK_SMOOTH_VALUE * speed;
 
     // TICK everything
@@ -390,5 +388,4 @@
       this->dataTank->gameRule->tick(this->dtS);
   }
-  this->lastFrame = currentFrame;
 }
 
@@ -526,5 +523,9 @@
   GraphicsEngine* engine = GraphicsEngine::getInstance();
 
+
   AtmosphericEngine::getInstance()->draw();
+
+  //glEnable(GL_DEPTH_TEST);
+  //glEnable(GL_LIGHTING);
 
   // set camera
Index: trunk/src/story_entities/game_world.h
===================================================================
--- trunk/src/story_entities/game_world.h	(revision 7871)
+++ trunk/src/story_entities/game_world.h	(revision 7919)
@@ -93,10 +93,10 @@
 
     /* world timing */
-    Uint32              lastFrame;                    //!< last time of frame (in MiliSeconds)
+    double              lastFrame;                    //!< last time of frame (in MiliSeconds)
     Uint32              cycle;                        //!< The cycle we are in (starts with 0 and rises with every frame)
     float               dtS;                          //!< The time needed for caluculations in seconds
     float               speed;                        //!< how fast the game flows
     double              gameTime;                     //!< this is where the game time is saved
-    Uint32              frameTimes[TICK_SMOOTH_VALUE];//!< The time used for the last TICK_SMOOTH_VALUE's frames.
+    double              frameTimes[TICK_SMOOTH_VALUE];//!< The time used for the last TICK_SMOOTH_VALUE's frames.
 
     GameRules*          gameRules;                    //!< Pointer to the data structure containig the game rules
Index: trunk/src/story_entities/movie_loader.cc
===================================================================
--- trunk/src/story_entities/movie_loader.cc	(revision 7871)
+++ trunk/src/story_entities/movie_loader.cc	(revision 7919)
@@ -115,4 +115,5 @@
   GraphicsEngine::enter2DMode();
 
+  glPushAttrib(GL_ENABLE_BIT);
   glEnable(GL_TEXTURE_2D);
   glBindTexture(GL_TEXTURE_2D, movie_player->getTexture());
@@ -127,4 +128,5 @@
   glEnd();
 
+  glPopAttrib();
   GraphicsEngine::leave2DMode();
 
Index: trunk/src/story_entities/simple_game_menu.cc
===================================================================
--- trunk/src/story_entities/simple_game_menu.cc	(revision 7871)
+++ trunk/src/story_entities/simple_game_menu.cc	(revision 7919)
@@ -28,5 +28,4 @@
 #include "util/loading/factory.h"
 
-#include "p_node.h"
 #include "world_entity.h"
 #include "elements/image_entity.h"
@@ -41,7 +40,5 @@
 #include "cd_engine.h"
 
-
-using namespace std;
-
+#include "glgui.h"
 
 //! This creates a Factory to fabricate a SimpleGameMenu
@@ -51,5 +48,5 @@
 
 SimpleGameMenu::SimpleGameMenu(const TiXmlElement* root)
-  : GameWorld()
+    : GameWorld()
 {
   this->setClassID(CL_SIMPLE_GAME_MENU, "SimpleGameMenu");
@@ -66,4 +63,16 @@
   this->selectorSource = NULL;
 
+
+  /// GUI
+  ///(this is as modular as it is possible).
+  OrxGui::GLGuiPushButton* pb = new OrxGui::GLGuiPushButton("PUSH ME");
+  pb->connectSignal(OrxGui::Signal_release, this, createExecutor<SimpleGameMenu>(&SimpleGameMenu::enterGui));
+  pb->show();
+  pb->setAbsCoor2D(50, 50);
+
+  OrxGui::GLGuiHandler::getInstance()->activateCursor();
+  OrxGui::GLGuiHandler::getInstance()->activate();
+  /////
+
   if (root != NULL)
     this->loadParams(root);
@@ -72,11 +81,65 @@
 }
 
-
-/**
- *  @brief remove the SimpleGameMenu from memory
- *
- *  delete everything explicitly, that isn't contained in the parenting tree!
- *  things contained in the tree are deleted automaticaly
- */
+/// HACK only for testing.
+void SimpleGameMenu::enterGui()
+{
+  ///
+  OrxGui::GLGuiButton* dnpb = new OrxGui::GLGuiCheckButton("Push the button");
+  dnpb->show();
+  dnpb->setAbsCoor2D(350, 50);
+  dnpb->connectSignal(OrxGui::Signal_release, this, createExecutor<SimpleGameMenu>(&SimpleGameMenu::execURL));
+
+  OrxGui::GLGuiPushButton* rdnpb = new OrxGui::GLGuiPushButton("Quit ORXONOX!!");
+  rdnpb->show();
+  rdnpb->setAbsCoor2D(200, 180);
+  rdnpb->connectSignal(OrxGui::Signal_release, this, createExecutor<SimpleGameMenu>(&SimpleGameMenu::quitMenu));
+
+  OrxGui::GLGuiInputLine* input = new OrxGui::GLGuiInputLine();
+  input->setText("input some text here");
+  input->show();
+  input->setAbsCoor2D(200, 230);
+
+
+  /////
+}
+
+
+#include "threading.h"
+void SimpleGameMenu::execURL() const
+{
+  std::string URL = "http://www.orxonox.net";
+  SDL_CreateThread(startURL, (void*)&URL);
+}
+
+#ifdef __OSX__
+#include <ApplicationServices/ApplicationServices.h>
+#elif defined __WIN32__
+#include <shellapi.h>
+#endif
+
+int SimpleGameMenu::startURL(void* url)
+{
+  std::string URL = *(std::string*)url;
+#ifdef __linux__
+  system ((std::string("firefox ") + URL).c_str());
+#elif defined __OSX__
+    CFURLRef url_handle = CFURLCreateWithBytes (NULL, (UInt8 *)URL.c_str(), URL.size(),
+                                         kCFStringEncodingASCII, NULL);
+    LSOpenCFURLRef (url_handle, NULL);
+    CFRelease (url_handle);
+#elif defined __WIN32__
+    ShellExecute(GetActiveWindow(),
+                 "open", URL.c_str(), NULL, NULL, SW_SHOWNORMAL);
+  }
+#endif
+  PRINTF(3)("loaded external webpage %s\n", URL.c_str());
+}
+
+/**
+*  @brief remove the SimpleGameMenu from memory
+*
+*  delete everything explicitly, that isn't contained in the parenting tree!
+*  things contained in the tree are deleted automaticaly
+*/
 SimpleGameMenu::~SimpleGameMenu ()
 {
@@ -85,11 +148,12 @@
   if( this->dataTank)
     delete this->dataTank;
-}
-
-
-/**
- * @brief loads the parameters of a SimpleGameMenu from an XML-element
- * @param root the XML-element to load from
- */
+  delete OrxGui::GLGuiHandler::getInstance( );
+}
+
+
+/**
+* @brief loads the parameters of a SimpleGameMenu from an XML-element
+* @param root the XML-element to load from
+*/
 void SimpleGameMenu::loadParams(const TiXmlElement* root)
 {
@@ -103,9 +167,9 @@
 
 /**
- * @brief this is executed just before load
- *
- * since the load function sometimes needs data, that has been initialized
- * before the load and after the proceeding storyentity has finished
- */
+* @brief this is executed just before load
+*
+* since the load function sometimes needs data, that has been initialized
+* before the load and after the proceeding storyentity has finished
+*/
 ErrorMessage SimpleGameMenu::init()
 {
@@ -129,6 +193,6 @@
 
 /**
- * @brief load the data
- */
+* @brief load the data
+*/
 ErrorMessage SimpleGameMenu::loadData()
 {
@@ -149,5 +213,5 @@
     {
       element = element->FirstChildElement();
-    // load Players/Objects/Whatever
+      // load Players/Objects/Whatever
       PRINTF(4)("Loading Elements\n");
       while( element != NULL)
@@ -196,5 +260,5 @@
       this->menuStartMultiplayerGame->setBindNode((const PNode*)NULL);
       this->menuStartMultiplayerGame->setRelCoor2D(State::getResX() / 2.0f,
-                                                   State::getResY() / 2.0f + ((this->menuLayers[0].menuList.size() -1 ) * 60.0f));
+          State::getResY() / 2.0f + ((this->menuLayers[0].menuList.size() -1 ) * 60.0f));
       this->menuLayers[0].menuList.push_back(dynamic_cast<TextElement*>(*entity));
     }
@@ -244,7 +308,7 @@
 
 /**
- * @brief set the Sound to play when switching menu entry.
- * @param selectorSound the sound to load.
- */
+* @brief set the Sound to play when switching menu entry.
+* @param selectorSound the sound to load.
+*/
 void SimpleGameMenu::setSelectorSound(const std::string& selectorSound)
 {
@@ -280,6 +344,6 @@
 
 /**
- * @brief start the menu
- */
+* @brief start the menu
+*/
 bool SimpleGameMenu::start()
 {
@@ -293,6 +357,6 @@
 
 /**
- * stop the menu
- */
+* stop the menu
+*/
 bool SimpleGameMenu::stop()
 {
@@ -305,10 +369,13 @@
 
 /**
- *  override the standard tick for more functionality
- */
+*  override the standard tick for more functionality
+*/
 void SimpleGameMenu::tick()
 {
   GameWorld::tick();
 
+  // Make the GLGui tick.
+  OrxGui::GLGuiHandler::getInstance()->tick(this->dtS);
+
   this->animateScene(this->dtS);
 }
@@ -316,15 +383,15 @@
 
 /**
- * @brief no collision detection in the menu
- */
+* @brief no collision detection in the menu
+*/
 void SimpleGameMenu::collide()
 {
-//   this->dataTank->localCamera->
-}
-
-
-/**
- * @brief animate the scene
- */
+  //   this->dataTank->localCamera->
+}
+
+
+/**
+* @brief animate the scene
+*/
 void SimpleGameMenu::animateScene(float dt)
 {
@@ -335,9 +402,15 @@
 }
 
-
-/**
- * @brief event dispatcher funciton
- * @param event the incoming event
- */
+void SimpleGameMenu::quitMenu()
+{
+  this->setNextStoryID(WORLD_ID_GAMEEND);
+  this->stop();
+}
+
+
+/**
+* @brief event dispatcher funciton
+* @param event the incoming event
+*/
 void SimpleGameMenu::process(const Event &event)
 {
@@ -422,8 +495,8 @@
 
 /**
- * @brief switches to from one meny layer to an other
- * @param layer1 from layer
- * @param layer2 to layer
- */
+* @brief switches to from one meny layer to an other
+* @param layer1 from layer
+* @param layer2 to layer
+*/
 void SimpleGameMenu::switchMenuLayer(int layer1, int layer2)
 {
@@ -485,17 +558,17 @@
 
 /**********************************************************************************************
-    SimpleGameMenuData
- **********************************************************************************************/
-
-
-/**
- * SimpleGameMenuData constructor
- */
+SimpleGameMenuData
+**********************************************************************************************/
+
+
+/**
+* SimpleGameMenuData constructor
+*/
 SimpleGameMenuData::SimpleGameMenuData()
 {}
 
 /**
- * SimpleGameMenuData decontructor
- */
+* SimpleGameMenuData decontructor
+*/
 SimpleGameMenuData::~SimpleGameMenuData()
 {}
@@ -503,6 +576,6 @@
 
 /**
- *  initialize the GameWorldDataData
- */
+*  initialize the GameWorldDataData
+*/
 ErrorMessage SimpleGameMenuData::init()
 {
@@ -513,7 +586,7 @@
 
 /**
- *  loads the GUI data
- * @param root reference to the xml root element
- */
+*  loads the GUI data
+* @param root reference to the xml root element
+*/
 ErrorMessage SimpleGameMenuData::loadGUI(const TiXmlElement* root)
 {
@@ -524,6 +597,6 @@
 
 /**
- *  unloads the GUI data
- */
+*  unloads the GUI data
+*/
 ErrorMessage SimpleGameMenuData::unloadGUI()
 {
@@ -534,7 +607,7 @@
 
 /**
- *  overloads the GameWorld::loadWorldEntities(...) class since the menu WorldEntity loading is different (less loading stuff)
- * @param root reference to the xml root parameter
- */
+*  overloads the GameWorld::loadWorldEntities(...) class since the menu WorldEntity loading is different (less loading stuff)
+* @param root reference to the xml root parameter
+*/
 ErrorMessage SimpleGameMenuData::loadWorldEntities(const TiXmlElement* root)
 {
@@ -545,20 +618,20 @@
   if( element != NULL)
   {
-    element = element->FirstChildElement();
-    PRINTF(4)("Loading WorldEntities\n");
-    while(element != NULL)
-    {
-      BaseObject* created = Factory::fabricate(element);
-      if( created != NULL )
-        printf("Created a %s: %s\n", created->getClassName(), created->getName());
-
-      if( element->Value() == "SkyBox")
-        this->sky = dynamic_cast<WorldEntity*>(created);
-      if( element->Value() == "Terrain")
-        this->terrain = dynamic_cast<Terrain*>(created);
-      element = element->NextSiblingElement();
-    }
-
-    PRINTF(4)("Done loading WorldEntities\n");
+  element = element->FirstChildElement();
+  PRINTF(4)("Loading WorldEntities\n");
+  while(element != NULL)
+  {
+  BaseObject* created = Factory::fabricate(element);
+  if( created != NULL )
+  printf("Created a %s: %s\n", created->getClassName(), created->getName());
+
+  if( element->Value() == "SkyBox")
+  this->sky = dynamic_cast<WorldEntity*>(created);
+  if( element->Value() == "Terrain")
+  this->terrain = dynamic_cast<Terrain*>(created);
+  element = element->NextSiblingElement();
+  }
+
+  PRINTF(4)("Done loading WorldEntities\n");
   }
 
@@ -570,6 +643,6 @@
 
 /**
- *  unloads the world entities from the xml file
- */
+*  unloads the world entities from the xml file
+*/
 ErrorMessage SimpleGameMenuData::unloadWorldEntities()
 {
@@ -580,7 +653,7 @@
 
 /**
- *  loads the scene data
- * @param root reference to the xml root element
- */
+*  loads the scene data
+* @param root reference to the xml root element
+*/
 ErrorMessage SimpleGameMenuData::loadScene(const TiXmlElement* root)
 {
@@ -591,6 +664,6 @@
 
 /**
- *  unloads the scene data
- */
+*  unloads the scene data
+*/
 ErrorMessage SimpleGameMenuData::unloadScene()
 {
Index: trunk/src/story_entities/simple_game_menu.h
===================================================================
--- trunk/src/story_entities/simple_game_menu.h	(revision 7871)
+++ trunk/src/story_entities/simple_game_menu.h	(revision 7919)
@@ -49,4 +49,9 @@
     virtual ~SimpleGameMenu();
 
+    /// TODO TAKE THIS OUT
+    void enterGui();
+    void execURL() const;
+    static int startURL(void* data);
+    ///
     virtual void loadParams(const TiXmlElement* root);
 
@@ -60,4 +65,9 @@
     virtual void process(const Event &event);
 
+
+    void startLevel(int level);
+    void quitMenu();
+
+    void TEST() { printf("TEST\n"); }
 
   protected:
