Index: trunk/src/world_entities/environments/water.cc
===================================================================
--- trunk/src/world_entities/environments/water.cc	(revision 6467)
+++ trunk/src/world_entities/environments/water.cc	(revision 6470)
@@ -25,4 +25,6 @@
 #include "resource_manager.h"
 #include "shader.h"
+
+#include "skybox.h"
 
 
@@ -103,8 +105,12 @@
 void Water::draw() const
 {
-  this->waterShader->activateShader();
+  //SkyBox::enableCubeMap();
+
+ // this->waterShader->activateShader();
 //  this->waterMaterial->select();
   WorldEntity::draw();
-  Shader::deactivateShader();
+  //Shader::deactivateShader();
+
+  //SkyBox::disableCubeMap();
 }
 
Index: trunk/src/world_entities/skybox.cc
===================================================================
--- trunk/src/world_entities/skybox.cc	(revision 6467)
+++ trunk/src/world_entities/skybox.cc	(revision 6470)
@@ -21,5 +21,8 @@
 #include "factory.h"
 #include "static_model.h"
+
 #include "material.h"
+#include "texture.h"
+
 #include "network_game_manager.h"
 #include "converter.h"
@@ -77,4 +80,6 @@
       this->material[i]->setSpecular(0.0,0.0,0.0);
       this->material[i]->setAmbient(2.0, 2.0, 2.0);
+
+      this->texture[i] = NULL;
     }
   this->setParentMode(PNODE_MOVEMENT);
@@ -145,5 +150,6 @@
  * @param back the back texture.
 */
-void SkyBox::setTextures(const char* top, const char* bottom, const char* left, const char* right, const char* front, const char* back)
+void SkyBox::setTextures(const char* top, const char* bottom, const char* left,
+                          const char* right, const char* front, const char* back)
 {
   this->material[0]->setDiffuseMap(top);
@@ -153,5 +159,39 @@
   this->material[4]->setDiffuseMap(front);
   this->material[5]->setDiffuseMap(back);
-}
+  this->loadCubeMapTextures(top, bottom, left, right, front, back);
+  //this->enableCubeMap();
+}
+
+void SkyBox::loadCubeMapTextures(const char* top, const char* bottom, const char* left,
+                                  const char* right, const char* front, const char* back)
+{
+  this->texture[0] = new Texture (top, GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB);
+  this->texture[1] = new Texture (bottom, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB);
+  this->texture[2] = new Texture (left, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB);
+  this->texture[3] = new Texture (right, GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB);
+  this->texture[4] = new Texture (front, GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB);
+  this->texture[5] = new Texture (back, GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB);
+}
+
+void SkyBox::enableCubeMap()
+{
+  glEnable(GL_TEXTURE_CUBE_MAP_ARB);
+  glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_ARB);
+  glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_ARB);
+  glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_ARB);
+  glEnable(GL_TEXTURE_GEN_S);
+  glEnable(GL_TEXTURE_GEN_T);
+  glEnable(GL_TEXTURE_GEN_R);
+}
+
+void SkyBox::disableCubeMap()
+{
+  glDisable(GL_TEXTURE_CUBE_MAP_ARB);
+  glDisable(GL_TEXTURE_GEN_S);
+  glDisable(GL_TEXTURE_GEN_T);
+  glDisable(GL_TEXTURE_GEN_R);
+}
+
+
 
 /**
Index: trunk/src/world_entities/skybox.h
===================================================================
--- trunk/src/world_entities/skybox.h	(revision 6467)
+++ trunk/src/world_entities/skybox.h	(revision 6470)
@@ -15,4 +15,5 @@
 /* FORWARD DECLARATION */
 class Material;
+class Texture;
 
 //! A Class to handle a SkyBox
@@ -41,4 +42,10 @@
                    const char* right, const char* front, const char* back);
 
+  void loadCubeMapTextures(const char* top, const char* bottom, const char* left,
+                           const char* right, const char* front, const char* back);
+
+  static void enableCubeMap();
+  static void disableCubeMap();
+
   virtual int       writeBytes(const byte* data, int length, int sender);
   virtual int       readBytes(byte* data, int maxLength, int * reciever);
@@ -50,4 +57,6 @@
 
   Material*       material[6];     //!< Materials for the SkyBox. sorted by number (0-5) top, bottom, left, right, front, back
+  Texture*        texture[6];      //!< Textures for the CubeMap.
+
   float           size;            //!< Size of the SkyBox. This should match the frustum maximum range.
   char*           textureName;     //!< Name of the Texture
