Index: branches/water/src/lib/graphics/shader.cc
===================================================================
--- branches/water/src/lib/graphics/shader.cc	(revision 7798)
+++ branches/water/src/lib/graphics/shader.cc	(revision 7818)
@@ -40,6 +40,4 @@
    this->setClassID(CL_SHADER, "Shader");
 
-   this->fragmentShaderFile = "";
-   this->vertexShaderFile = "";
    this->shaderProgram = 0;
    this->vertexShader = 0;
@@ -48,17 +46,13 @@
    if (GLEW_ARB_shader_objects && GLEW_ARB_shading_language_100)
      {
-       GLint status = 0;
-
        this->shaderProgram = glCreateProgramObjectARB();
 
        if (!vertexShaderFile.empty())
-         this->loadShaderProgramm(SHADER_VERTEX, vertexShaderFile);
+         this->loadShaderProgramm(Shader::Vertex, vertexShaderFile);
        if (!fragmentShaderFile.empty())
-         this->loadShaderProgramm(SHADER_FRAGMENT, fragmentShaderFile);
-       glLinkProgramARB(this->shaderProgram);
-       // link error checking
-       glGetObjectParameterivARB(this->shaderProgram, GL_OBJECT_LINK_STATUS_ARB, &status);
-       if (status == GL_INVALID_VALUE || status == GL_INVALID_OPERATION)
-         this->printError(this->shaderProgram);
+         this->loadShaderProgramm(Shader::Fragment, fragmentShaderFile);
+
+       this->linkShaderProgram();
+
     }
    else
@@ -78,6 +72,6 @@
 
   // delete what has to be deleted here
-  this->deleteProgram(SHADER_VERTEX);
-  this->deleteProgram(SHADER_FRAGMENT);
+  this->deleteProgram(Shader::Vertex);
+  this->deleteProgram(Shader::Fragment);
 
   if (this->fragmentShader != 0)
@@ -116,9 +110,9 @@
 
 
-bool Shader::loadShaderProgramm(SHADER_TYPE type, const std::string& fileName)
+bool Shader::loadShaderProgramm(Shader::Type type, const std::string& fileName)
 {
   GLhandleARB shader = 0;
 
-  if (type != SHADER_VERTEX && type != SHADER_FRAGMENT)
+  if (type != Shader::Vertex && type != Shader::Fragment)
     return false;
   this->deleteProgram(type);
@@ -127,5 +121,5 @@
   std::vector<char*>* program = fileReadArray(fileName);
 
-  if (type == SHADER_VERTEX && GLEW_ARB_vertex_shader)
+  if (type == Shader::Vertex && GLEW_ARB_vertex_shader)
   {
     this->vertexShaderFile = fileName;
@@ -134,5 +128,5 @@
   }
 
-  if (type == SHADER_FRAGMENT && GLEW_ARB_fragment_shader)
+  if (type == Shader::Fragment && GLEW_ARB_fragment_shader)
   {
     this->fragmentShaderFile = fileName;
@@ -158,4 +152,17 @@
   delete program;
 }
+
+
+void Shader::linkShaderProgram()
+{
+  GLint status = 0;
+
+  glLinkProgramARB(this->shaderProgram);
+       // link error checking
+  glGetObjectParameterivARB(this->shaderProgram, GL_OBJECT_LINK_STATUS_ARB, &status);
+  if (status == GL_INVALID_VALUE || status == GL_INVALID_OPERATION)
+    this->printError(this->shaderProgram);
+}
+
 
 char* Shader::fileRead(const std::string& fileName)
@@ -228,8 +235,8 @@
 
 
-void Shader::deleteProgram(SHADER_TYPE type)
+void Shader::deleteProgram(Shader::Type type)
 {
   GLint status = 0;
-  if (type == SHADER_VERTEX && this->vertexShader != 0)
+  if (type == Shader::Vertex && this->vertexShader != 0)
   {
     this->vertexShaderFile = "";
@@ -241,5 +248,5 @@
     this->vertexShader = 0;
   }
-  else if (type == SHADER_FRAGMENT && this->fragmentShader != 0)
+  else if (type == Shader::Fragment && this->fragmentShader != 0)
   {
     this->fragmentShaderFile = "";
Index: branches/water/src/lib/graphics/shader.h
===================================================================
--- branches/water/src/lib/graphics/shader.h	(revision 7798)
+++ branches/water/src/lib/graphics/shader.h	(revision 7818)
@@ -12,17 +12,19 @@
 
 
-typedef enum
-{
-  SHADER_NONE       = 0,
-  SHADER_FRAGMENT   = 1,
-  SHADER_VERTEX     = 0,
-
-} SHADER_TYPE;
-
 // FORWARD DECLARATION
 
 
 //! A class for ...
-class Shader : public BaseObject {
+class Shader : public BaseObject
+{
+  public:
+  typedef enum
+  {
+    None       = 0,
+    Fragment   = 1,
+    Vertex     = 2,
+
+    Program    = 4,
+  } Type;
 
   public:
@@ -32,13 +34,19 @@
   static bool unload(Shader* shader);
 
-  bool loadShaderProgramm(SHADER_TYPE type, const std::string& fileName);
+
+  static bool checkShaderAbility();
   void activateShader();
   static void deactivateShader();
-  void deleteProgram(SHADER_TYPE type);
+
+
+  bool loadShaderProgramm(Shader::Type type, const std::string& fileName);
+  void deleteProgram(Shader::Type type);
+
+  void linkShaderProgram();
+
 
   char* fileRead(const std::string& fileName);
   std::vector<char*>* fileReadArray(const std::string& fileName);
 
-  static bool checkShaderAbility();
 
   inline static bool shaderActive() { return (Shader::storedShader != NULL)? true : false; };
@@ -47,17 +55,20 @@
   inline static void restoreShader() { if (storedShader != NULL) storedShader->activateShader(); storedShader = NULL; };
 
-  GLhandleARB getProgram() { return this->shaderProgram; }
-  GLhandleARB getVertexS() { return this->vertexShader; }
-  GLhandleARB getFragmentS() { return this->fragmentShader; }
 
-  void printError(GLhandleARB program);
+  GLhandleARB getProgram() const { return this->shaderProgram; }
+  GLhandleARB getVertexS() const { return this->vertexShader; }
+  GLhandleARB getFragmentS() const { return this->fragmentShader; }
+
   void debug() const;
 
-  private:
+  static void printError(GLhandleARB program);
+
 
  private:
    std::string            fragmentShaderFile;
    std::string            vertexShaderFile;
+
    GLhandleARB            shaderProgram;
+
    GLhandleARB            vertexShader;
    GLhandleARB            fragmentShader;
