Index: /trunk/src/lib/graphics/graphics_engine.cc
===================================================================
--- /trunk/src/lib/graphics/graphics_engine.cc	(revision 6522)
+++ /trunk/src/lib/graphics/graphics_engine.cc	(revision 6523)
@@ -474,5 +474,5 @@
 void GraphicsEngine::wireframe()
 {
-  glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+  glPolygonMode(GL_FRONT, GL_LINE);
 }
 
Index: /trunk/src/lib/graphics/importer/texture.cc
===================================================================
--- /trunk/src/lib/graphics/importer/texture.cc	(revision 6522)
+++ /trunk/src/lib/graphics/importer/texture.cc	(revision 6523)
@@ -276,5 +276,6 @@
                0,
                GL_RGBA,
-               surface->w, surface->h,
+               surface->w,
+               surface->h,
                0,
                GL_RGBA,
@@ -294,5 +295,6 @@
     PRINTF(1)("Error while loading texture (mipmap generation), gluBuild2DMipmaps returned %i\n", errorCode);
 
-  glBindTexture(target, 0);
+  if (target == GL_TEXTURE_2D)
+    glBindTexture(target, 0);
   return texture;
 }
Index: /trunk/src/world_entities/environments/water.cc
===================================================================
--- /trunk/src/world_entities/environments/water.cc	(revision 6522)
+++ /trunk/src/world_entities/environments/water.cc	(revision 6523)
@@ -120,7 +120,17 @@
 void Water::draw() const
 {
-  SkyBox::enableCubeMap();
-
- // this->waterShader->activateShader();
+  //SkyBox::enableCubeMap();
+
+  glBindTexture(GL_TEXTURE_2D, 15);
+  glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+
+  glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
+  glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
+  glEnable(GL_TEXTURE_GEN_S);
+  glEnable(GL_TEXTURE_GEN_T);
+
+  glEnable(GL_BLEND);
+  glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+  // this->waterShader->activateShader();
 //  this->waterMaterial->select();
   WorldEntity::draw();
Index: /trunk/src/world_entities/skybox.cc
===================================================================
--- /trunk/src/world_entities/skybox.cc	(revision 6522)
+++ /trunk/src/world_entities/skybox.cc	(revision 6523)
@@ -102,5 +102,8 @@
   this->setModel(NULL); //< so that WorldEntity does not try to delete it again.
   for (int i = 0; i < 6; i++)
+  {
     delete this->material[i];
+    delete this->cubeTexture[i];
+  }
 }
 
@@ -159,6 +162,6 @@
   this->material[4]->setDiffuseMap(front);
   this->material[5]->setDiffuseMap(back);
-  this->loadCubeMapTextures(top, bottom, left, right, front, back);
-  //this->enableCubeMap();
+  if (GLEW_EXT_texture_cube_map)
+    this->loadCubeMapTextures(top, bottom, left, right, front, back);
 }
 
@@ -166,28 +169,33 @@
                                   const char* right, const char* front, const char* back)
 {
-  this->cubeTexture[0] = new Texture (top, GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB);
-  this->cubeTexture[1] = new Texture (bottom, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB);
-  this->cubeTexture[2] = new Texture (left, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB);
-  this->cubeTexture[3] = new Texture (right, GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB);
-  this->cubeTexture[4] = new Texture (front, GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB);
-  this->cubeTexture[5] = new Texture (back, GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB);
+  this->cubeTexture[0] = new Texture (top, GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT);
+  this->cubeTexture[1] = new Texture (bottom, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT);
+  this->cubeTexture[2] = new Texture (left, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT);
+  this->cubeTexture[3] = new Texture (right, GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT);
+  this->cubeTexture[4] = new Texture (front, GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT);
+  this->cubeTexture[5] = new Texture (back, GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT);
 }
 
 void SkyBox::enableCubeMap()
 {
-  glEnable(GL_TEXTURE_CUBE_MAP_ARB);
   glEnable(GL_TEXTURE_2D);
-  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_CUBE_MAP_EXT);
+  glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_EXT);
+  glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_EXT);
+  glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_EXT);
   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_CUBE_MAP_EXT);
   glDisable(GL_TEXTURE_2D);
+  glDisable(GL_TEXTURE_GEN_S);
+  glDisable(GL_TEXTURE_GEN_T);
+  glDisable(GL_TEXTURE_GEN_R);
+
   glDisable(GL_TEXTURE_GEN_S);
   glDisable(GL_TEXTURE_GEN_T);
