Index: /branches/water/src/lib/graphics/importer/material.cc
===================================================================
--- /branches/water/src/lib/graphics/importer/material.cc	(revision 8088)
+++ /branches/water/src/lib/graphics/importer/material.cc	(revision 8089)
@@ -103,5 +103,5 @@
  * @brief sets the material with which the following Faces will be painted
  */
-bool Material::select() const
+  bool Material::select() const
 {
   if (unlikely(this == Material::selectedMaterial))
Index: /branches/water/src/lib/graphics/importer/texture.cc
===================================================================
--- /branches/water/src/lib/graphics/importer/texture.cc	(revision 8088)
+++ /branches/water/src/lib/graphics/importer/texture.cc	(revision 8089)
@@ -115,9 +115,27 @@
 
 
-Texture::Texture(GLenum target)
+Texture::Texture(GLenum target, unsigned int width, unsigned int height, unsigned int channels, GLenum type)
 {
   this->init();
-  GLuint texture;
+  GLuint texture = 0;
   Texture::generateTexture(texture, target);
+
+  glBindTexture(target, texture);
+
+  unsigned int* pixels = new unsigned int[width * height * channels];
+  memset(pixels, 0, width * height * channels * sizeof(unsigned int));
+  
+  
+  glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
+  glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
+  glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+  glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+
+  glTexImage2D(target, 0, channels, width, height, 0, type, GL_UNSIGNED_INT, pixels);
+  
+  
+  
+  delete[] pixels;
+
   this->data->setTexture(texture);
 }
@@ -346,4 +364,8 @@
   //  printf("%s, w:%d h:%d, 0x%x\n", this->getName(), surface->w, surface->h, target);
 
+  /* control the mipmap levels */
+  glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_MIN_LOD, 5);
+  glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_MAX_LOD, 0);
+
   // build the MipMaps automaticaly
   errorCode = gluBuild2DMipmaps(target, format,
@@ -372,6 +394,3 @@
   glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
 
-  /* control the mipmap levels */
-  glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_MIN_LOD, 5);
-  glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_MAX_LOD, 0);
-}
+}
Index: /branches/water/src/lib/graphics/importer/texture.h
===================================================================
--- /branches/water/src/lib/graphics/importer/texture.h	(revision 8088)
+++ /branches/water/src/lib/graphics/importer/texture.h	(revision 8089)
@@ -50,5 +50,5 @@
   Texture();
   Texture(const Texture& texture);
-  Texture(GLenum target);
+  Texture(GLenum target, unsigned int width, unsigned int height, unsigned int channels, GLenum type);
   Texture(const std::string& imageName, GLenum target = GL_TEXTURE_2D);
   Texture(SDL_Surface* surface, GLenum target = GL_TEXTURE_2D);
Index: /branches/water/src/lib/gui/gl_gui/glgui_cursor.cc
===================================================================
--- /branches/water/src/lib/gui/gl_gui/glgui_cursor.cc	(revision 8088)
+++ /branches/water/src/lib/gui/gl_gui/glgui_cursor.cc	(revision 8089)
@@ -32,6 +32,6 @@
     this->init();
 
-    this->subscribeEvent(ES_MENU,  EV_MOUSE_MOTION);
-    this->subscribeEvent(ES_MENU, EV_WINDOW_FOCUS);
+    this->subscribeEvent(ES_ALL,  EV_MOUSE_MOTION);
+    this->subscribeEvent(ES_ALL, EV_WINDOW_FOCUS);
 
 
Index: /branches/water/src/lib/gui/gl_gui/glgui_handler.cc
===================================================================
--- /branches/water/src/lib/gui/gl_gui/glgui_handler.cc	(revision 8088)
+++ /branches/water/src/lib/gui/gl_gui/glgui_handler.cc	(revision 8089)
@@ -40,10 +40,10 @@
 
 
-    EventHandler::getInstance()->withUNICODE(ES_MENU, true );
+    EventHandler::getInstance()->withUNICODE(ES_ALL, true );
 
     this->cursor = NULL;
     for (unsigned int i = 0; i < EV_NUMBER; i++)
     {
-      this->subscribeEvent(ES_MENU, i);
+      this->subscribeEvent(ES_ALL, i);
     }
   }
Index: /branches/water/src/lib/gui/gl_gui/glgui_widget.cc
===================================================================
--- /branches/water/src/lib/gui/gl_gui/glgui_widget.cc	(revision 8088)
+++ /branches/water/src/lib/gui/gl_gui/glgui_widget.cc	(revision 8089)
@@ -204,4 +204,5 @@
 
 
+
   void GLGuiWidget::hide()
   {
Index: /branches/water/src/lib/gui/gl_gui/glgui_widget.h
===================================================================
--- /branches/water/src/lib/gui/gl_gui/glgui_widget.h	(revision 8088)
+++ /branches/water/src/lib/gui/gl_gui/glgui_widget.h	(revision 8089)
@@ -42,5 +42,4 @@
     void show();
     void hide();
-
 
     void setParentWidget(GLGuiWidget* parent);
Index: /branches/water/src/story_entities/game_world.cc
===================================================================
--- /branches/water/src/story_entities/game_world.cc	(revision 8088)
+++ /branches/water/src/story_entities/game_world.cc	(revision 8089)
@@ -107,4 +107,86 @@
 
 
+
+
+/// HACK only for testing.
+void GameWorld::enterGui()
+{
+  OrxGui::GLGuiBox* imageSelector = new OrxGui::GLGuiBox();
+  {
+    image = new OrxGui::GLGuiImage();
+    image->setWidgetSize(300, 300);
+    image->setAbsCoor2D(300, 300);
+    imageSelector->pack(image);
+
+    imageName = new OrxGui::GLGuiInputLine();
+    imageSelector->pack(imageName);
+
+    OrxGui::GLGuiSlider* slider = new OrxGui::GLGuiSlider();
+    slider->setWidgetSize(200, 30);
+    slider->setRange(0, 200);
+    slider->setStep(1);
+    
+    
+    slider->setValue(slider->min());
+    slider->connect(SIGNAL(slider, valueChanged), this, SLOT(GameWorld, setImage));
+
+    imageSelector->pack(slider);
+    slider->setValue(getImage("/home/stefalie/svn/orxonox/data/trunk/pictures/dudvmap.bmp"));
+  }
+  imageSelector->showAll();
+  imageSelector->setAbsCoor2D(400, 30);
+    OrxGui::GLGuiHandler::getInstance()->activateCursor();
+
+  /////
+}
+
+
+#include "class_list.h"
+void GameWorld::setImage(int i)
+{
+  const std::list<BaseObject*>* textures = ClassList::getList(CL_TEXTURE);
+
+  if(textures)
+  {
+    std::list<BaseObject*>::const_iterator test = textures->begin();
+    std::list<BaseObject*>::const_iterator lastOK = textures->begin();
+    while (true)
+    {
+      if (--i == 0 || test == textures->end())
+        break;
+      if (dynamic_cast<Texture*>(*test)->getTexture() != 0)
+        lastOK = test;
+      test++;
+    }
+    this->image->loadImageFromTexture(*dynamic_cast<Texture*>(*lastOK));
+    this->imageName->setText((*lastOK)->getName());
+    printf(">>>>> %d\n", dynamic_cast<Texture*>(*lastOK)->getTexture());
+  }
+}
+
+int GameWorld::getImage(const std::string& name)
+{
+  const std::list<BaseObject*>* textures = ClassList::getList(CL_TEXTURE);
+
+
+  if(textures)
+  {
+    int number = 0;
+    std::list<BaseObject*>::const_iterator test = textures->begin();
+    std::list<BaseObject*>::const_iterator lastOK = textures->begin();
+    while (true)
+    {
+      if (test == textures->end())
+        return 0;
+      if ((*test)->getName() == name)
+        return number;
+      number++;
+      test++;
+    }
+  }
+}
+
+
+
 /**
  * loads the parameters of a GameWorld from an XML-element
@@ -225,4 +307,7 @@
   PRINTF(3)("GameWorld::stop() - got stop signal\n");
   this->bRunning = false;
+  
+  OrxGui::GLGuiHandler::getInstance()->deactivateCursor(true);
+  delete OrxGui::GLGuiHandler::getInstance();
 }
 
@@ -256,4 +341,7 @@
 {
   PRINTF(3)("GameWorld::mainLoop() - Entering main loop\n");
+
+  this->enterGui();
+
 
   // initialize Timing
@@ -387,4 +475,8 @@
     if( likely(this->dataTank->gameRule != NULL))
       this->dataTank->gameRule->tick(this->dtS);
+      
+      
+    OrxGui::GLGuiHandler::getInstance()->tick(this->dtS);
+
   }
 }
@@ -446,5 +538,5 @@
   this->renderPassReflection();
   // redner the refraction texture
-  this->renderPassRefraction();
+  //this->renderPassRefraction();
   // render all
   this->renderPassAll();
@@ -559,6 +651,6 @@
   AtmosphericEngine::getInstance()->draw();
 
-  //glEnable(GL_DEPTH_TEST);
-  //glEnable(GL_LIGHTING);
+  glEnable(GL_DEPTH_TEST);
+  glEnable(GL_LIGHTING);
 
   // set camera
Index: /branches/water/src/story_entities/game_world.h
===================================================================
--- /branches/water/src/story_entities/game_world.h	(revision 8088)
+++ /branches/water/src/story_entities/game_world.h	(revision 8089)
@@ -11,4 +11,6 @@
 #include "game_world_data.h"
 #include "playable.h"
+
+#include "glgui.h"
 
 namespace OrxShell { class Shell; };
@@ -32,4 +34,12 @@
     GameWorld ();
     virtual ~GameWorld ();
+
+//// HACK NOT TO THE TRUNK //
+    void enterGui();
+    void setImage(int i);
+    int getImage(const std::string& name);
+    OrxGui::GLGuiImage* image;
+    OrxGui::GLGuiInputLine* imageName;
+/////////////////////////////
 
     virtual void loadParams(const TiXmlElement* root);
Index: /branches/water/src/world_entities/environments/mapped_water.cc
===================================================================
--- /branches/water/src/world_entities/environments/mapped_water.cc	(revision 8088)
+++ /branches/water/src/world_entities/environments/mapped_water.cc	(revision 8089)
@@ -207,4 +207,5 @@
   glViewport(0,0, textureSize, textureSize);
 
+  glMatrixMode(GL_MODELVIEW);
   glPushMatrix();
 
@@ -261,4 +262,5 @@
   glViewport(0,0, textureSize, textureSize);
 
+  glMatrixMode(GL_MODELVIEW);
   glPushMatrix();
 
