Index: branches/std/src/lib/graphics/shader.cc
===================================================================
--- branches/std/src/lib/graphics/shader.cc	(revision 7202)
+++ branches/std/src/lib/graphics/shader.cc	(revision 7203)
@@ -36,10 +36,10 @@
  * standard constructor
 */
-Shader::Shader (const char* vertexShaderFile, const char* fragmentShaderFile)
+Shader::Shader (const std::string& vertexShaderFile, const std::string& fragmentShaderFile)
 {
    this->setClassID(CL_SHADER, "Shader");
 
-   this->fragmentShaderFile = NULL;
-   this->vertexShaderFile = NULL;
+   this->fragmentShaderFile = "";
+   this->vertexShaderFile = "";
    this->shaderProgram = 0;
    this->vertexShader = 0;
@@ -52,7 +52,7 @@
        this->shaderProgram = glCreateProgramObjectARB();
 
-       if (vertexShaderFile != NULL)
+       if (!vertexShaderFile.empty())
          this->loadShaderProgramm(SHADER_VERTEX, vertexShaderFile);
-       if (fragmentShaderFile != NULL)
+       if (!fragmentShaderFile.empty())
          this->loadShaderProgramm(SHADER_FRAGMENT, fragmentShaderFile);
        glLinkProgramARB(this->shaderProgram);
@@ -103,5 +103,5 @@
 }
 
-Shader* Shader::getShader(const char* vertexShaderFile, const char* fragmentShaderFile)
+Shader* Shader::getShader(const std::string& vertexShaderFile, const std::string& fragmentShaderFile)
 {
   return (Shader*)ResourceManager::getInstance()->load(vertexShaderFile, SHADER,  RP_LEVEL, fragmentShaderFile);
@@ -116,5 +116,5 @@
 
 
-bool Shader::loadShaderProgramm(SHADER_TYPE type, const char* fileName)
+bool Shader::loadShaderProgramm(SHADER_TYPE type, const std::string& fileName)
 {
   GLhandleARB shader = 0;
@@ -129,6 +129,5 @@
   if (type == SHADER_VERTEX && GLEW_ARB_vertex_shader)
   {
-    this->vertexShaderFile = new char[strlen(fileName)+1];
-    strcpy(this->vertexShaderFile, fileName);
+    this->vertexShaderFile = fileName;
 
     shader = this->vertexShader = glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB);
@@ -137,6 +136,5 @@
   if (type == SHADER_FRAGMENT && GLEW_ARB_fragment_shader)
   {
-    this->fragmentShaderFile = new char[strlen(fileName)+1];
-    strcpy(this->fragmentShaderFile, fileName);
+    this->fragmentShaderFile = fileName;
 
     shader = this->fragmentShader = glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB);
@@ -146,5 +144,6 @@
   {
     GLint status = 0;
-    glShaderSourceARB(shader, program->size(), (const char**)&(*program)[0], NULL);
+    /// FIXME do it back
+    //    glShaderSourceARB(shader, program->size(), (const std::string&)&(*program)[0], NULL);
     glCompileShaderARB(shader);
     // checking on error.
@@ -160,5 +159,5 @@
 }
 
-char* Shader::fileRead(const char* fileName)
+char* Shader::fileRead(const std::string& fileName)
 {
   FILE* fileHandle;
@@ -167,8 +166,8 @@
   int count = 0;
 
-  if (fileName == NULL)
+  if (fileName.empty())
     return NULL;
 
-  fileHandle = fopen(fileName, "rt");
+  fileHandle = fopen(fileName.c_str(), "rt");
 
   if (fileHandle == NULL)
@@ -187,11 +186,11 @@
 
 
-std::vector<char*>* Shader::fileReadArray(const char* fileName)
+std::vector<char*>* Shader::fileReadArray(const std::string& fileName)
 {
   FILE*    stream;           //< The stream we use to read the file.
 
-  if( (stream = fopen (fileName, "rt")) == NULL)
-  {
-    PRINTF(1)("Shader could not open %s\n", fileName);
+  if( (stream = fopen (fileName.c_str(), "rt")) == NULL)
+  {
+    PRINTF(1)("Shader could not open %s\n", fileName.c_str());
     return NULL;
   }
@@ -234,6 +233,5 @@
   if (type == SHADER_VERTEX && this->vertexShader != 0)
   {
-    delete[] this->vertexShaderFile;
-    this->vertexShaderFile = NULL;
+    this->vertexShaderFile = "";
     glDetachObjectARB(this->shaderProgram, this->vertexShader);
     glDeleteObjectARB(this->vertexShader);
@@ -245,6 +243,5 @@
   else if (type == SHADER_FRAGMENT && this->fragmentShader != 0)
   {
-    delete[] this->fragmentShaderFile;
-    this->fragmentShaderFile = NULL;
+    this->fragmentShaderFile = "";
     glDetachObjectARB(this->shaderProgram, this->fragmentShader);
     glDeleteObjectARB(this->fragmentShader);
