Index: trunk/src/lib/graphics/shader.cc
===================================================================
--- trunk/src/lib/graphics/shader.cc	(revision 5322)
+++ trunk/src/lib/graphics/shader.cc	(revision 5323)
@@ -23,4 +23,6 @@
 #include "debug.h"
 #include "array.h"
+
+#include "resource_manager.h"
 
 
@@ -102,4 +104,14 @@
 }
 
+Shader* Shader::getShader(const char* vertexShaderFile, const char* fragmentShaderFile)
+{
+  return (Shader*)ResourceManager::getInstance()->load(vertexShaderFile, SHADER,  RP_LEVEL, (void*)fragmentShaderFile);
+}
+
+bool Shader::unload(Shader* shader)
+{
+  return ResourceManager::getInstance()->unload(shader);
+}
+
 Shader* Shader::storedShader = NULL;
 
Index: trunk/src/lib/graphics/shader.h
===================================================================
--- trunk/src/lib/graphics/shader.h	(revision 5322)
+++ trunk/src/lib/graphics/shader.h	(revision 5323)
@@ -26,7 +26,9 @@
 class Shader : public BaseObject {
 
- public:
+  public:
   Shader(const char* vertexShaderFile = NULL, const char* fragmentShaderFile = NULL);
   virtual ~Shader();
+  static Shader* getShader(const char* vertexShaderFile, const char* fragmentShaderFile);
+  static bool unload(Shader* shader);
 
   bool loadShaderProgramm(SHADER_TYPE type, const char* fileName);
@@ -41,4 +43,5 @@
 
   inline static bool shaderActive() { return (Shader::storedShader != NULL)?true:false; };
+  inline static Shader* getActiveShader() { return Shader::storedShader; };
   inline static void suspendShader() { Shader* currShader = storedShader; if (storedShader!= NULL) { Shader::deactivateShader(); Shader::storedShader = currShader;} };
   inline static void restoreShader() { if (storedShader != NULL) storedShader->activateShader(); storedShader = NULL; };
Index: trunk/src/util/resource_manager.cc
===================================================================
--- trunk/src/util/resource_manager.cc	(revision 5322)
+++ trunk/src/util/resource_manager.cc	(revision 5323)
@@ -36,4 +36,7 @@
 #include "ogg_player.h"
 #endif /* NO_AUDIO */
+#ifndef NO_SHADERS
+#include "shader.h"
+#endif /* NO_SHADERS */
 
 #include "list.h"
@@ -190,13 +193,13 @@
 #ifndef NO_MODEL
 #define __IF_OK
-  if (!strncmp(fileName+(strlen(fileName)-4), ".obj", 4))
+  if (!strncasecmp(fileName+(strlen(fileName)-4), ".obj", 4))
     tmpType = OBJ;
   else if (!strncmp(fileName+(strlen(fileName)-4), ".md2", 4))
     tmpType = MD2;
-  else if (!strcmp(fileName, "cube") ||
-           !strcmp(fileName, "sphere") ||
-           !strcmp(fileName, "plane") ||
-           !strcmp(fileName, "cylinder") ||
-           !strcmp(fileName, "cone"))
+  else if (!strcasecmp(fileName, "cube") ||
+           !strcasecmp(fileName, "sphere") ||
+           !strcasecmp(fileName, "plane") ||
+           !strcasecmp(fileName, "cylinder") ||
+           !strcasecmp(fileName, "cone"))
     tmpType = PRIM;
 #endif /* NO_MODEL */
@@ -206,9 +209,9 @@
 #endif
 #define __IF_OK
-  if (!strncmp(fileName+(strlen(fileName)-4), ".wav", 4))
+  if (!strncasecmp(fileName+(strlen(fileName)-4), ".wav", 4))
     tmpType = WAV;
-  else if (!strncmp(fileName+(strlen(fileName)-4), ".mp3", 4))
+  else if (!strncasecmp(fileName+(strlen(fileName)-4), ".mp3", 4))
     tmpType = MP3;
-  else if (!strncmp(fileName+(strlen(fileName)-4), ".ogg", 4))
+  else if (!strncasecmp(fileName+(strlen(fileName)-4), ".ogg", 4))
     tmpType = OGG;
 #endif /* NO_AUDIO */
@@ -218,7 +221,15 @@
 #endif
 #define __IF_OK
- if (!strncmp(fileName+(strlen(fileName)-4), ".ttf", 4))
+ if (!strncasecmp(fileName+(strlen(fileName)-4), ".ttf", 4))
     tmpType = TTF;
 #endif /* NO_TEXT */
+#ifndef NO_SHADERS
+#ifdef __IF_OK
+  else
+#endif
+#define __IF_OK
+ if (!strncasecmp(fileName+(strlen(fileName)-5), ".vert", 5))
+    tmpType = SHADER;
+#endif /* NO_SHADERS */
 #ifndef NO_TEXTURES
 #ifdef __IF_OK
@@ -308,10 +319,10 @@
               if (param1 != NULL)
                 {
-                  tmpResource->skinFileName = new char[strlen((const char*)param1)+1];
-                  strcpy(tmpResource->skinFileName, (const char*) param1);
+                  tmpResource->secFileName = new char[strlen((const char*)param1)+1];
+                  strcpy(tmpResource->secFileName, (const char*) param1);
                 }
               else
-                tmpResource->skinFileName = NULL;
-              tmpResource->pointer = new MD2Data(fullName, tmpResource->skinFileName);
+                tmpResource->secFileName = NULL;
+              tmpResource->pointer = new MD2Data(fullName, tmpResource->secFileName);
             }
               break;
@@ -372,4 +383,35 @@
           break;
 #endif /* NO_TEXTURES */
+#ifndef NO_SHADERS
+          case SHADER:
+            if(ResourceManager::isFile(fullName))
+            {
+              char* secFullName = NULL;
+              if (param1 != NULL)
+              {
+                secFullName = ResourceManager::getFullName((const char*)param1);
+                printf("%s\n", secFullName);
+                if (ResourceManager::isFile(secFullName))
+                {
+                  printf("ok:: %s\n", secFullName);
+                  tmpResource->secFileName = new char[strlen((const char*)param1)+1];
+                  strcpy(tmpResource->secFileName, (const char*) param1);
+                }
+                else
+                {
+                  delete[] secFullName;
+                  secFullName = NULL;
+                  tmpResource->secFileName = NULL;
+                }
+              }
+              else
+                tmpResource->secFileName = NULL;
+              printf("%s::%s\n", fullName, secFullName);
+              tmpResource->pointer = new Shader(fullName, secFullName);
+              if (secFullName != NULL)
+                delete[] secFullName;
+            }
+            break;
+#endif /* NO_SHADERS */
         default:
           tmpResource->pointer = NULL;
@@ -458,4 +500,9 @@
               break;
 #endif /* NO_TEXTURES */
+#ifndef NO_SHADERS
+            case SHADER:
+              delete (Shader*)resource->pointer;
+              break;
+#endif /* NO_SHADERS */
             default:
               PRINTF(2)("NOT YET IMPLEMENTED !!FIX FIX!!\n");
@@ -537,8 +584,8 @@
               if (!param1)
                 {
-                  if (enumRes->skinFileName == NULL)
+                  if (enumRes->secFileName == NULL)
                     match = true;
                 }
-              else if (!strcmp(enumRes->skinFileName, (const char*)param1))
+              else if (!strcmp(enumRes->secFileName, (const char*)param1))
                 match = true;
               break;
@@ -555,4 +602,14 @@
               break;
 #endif /* NO_TEXT */
+#ifndef NO_SHADERS
+              case SHADER:
+                if (!param1)
+                {
+                  if (enumRes->secFileName == NULL)
+                    match = true;
+                }
+                else if (!strcmp(enumRes->secFileName, (const char*)param1))
+                  match = true;
+#endif /* NO_SHADERS */
             default:
               match = true;
@@ -862,4 +919,9 @@
       break;
 #endif
+#ifndef NO_SHADERS
+    case SHADER:
+      return "Shader";
+      break;
+#endif
     default:
       return "unknown Format";
Index: trunk/src/util/resource_manager.h
===================================================================
--- trunk/src/util/resource_manager.h	(revision 5322)
+++ trunk/src/util/resource_manager.h	(revision 5323)
@@ -43,6 +43,9 @@
 #endif /* NO_AUDIO */
 #ifndef NO_TEXTURES
-  IMAGE                 //!< loading an image
+  IMAGE,                //!< loading an image
 #endif /* NO_TEXTURES */
+#ifndef NO_SHADERS
+  SHADER,               //!< openGL-shader program
+#endif /* NO_SHADERS */
 };
 
@@ -75,5 +78,5 @@
   float             modelSize;         //!< the size of the model (OBJ/PRIM)
 #ifndef NO_MODEL
-  char*             skinFileName;      //!< skinFileName (MD2)
+  char*             secFileName;       //!< a seconf fileName
 #endif /* NO_MODEL */
 #ifndef NO_TEXT
Index: trunk/src/world_entities/npc2.cc
===================================================================
--- trunk/src/world_entities/npc2.cc	(revision 5322)
+++ trunk/src/world_entities/npc2.cc	(revision 5323)
@@ -32,7 +32,5 @@
 
   this->loadModelWithScale("models/ships/bolido.obj", 3);
-  this->shader = new Shader("toon.vert", "toon.frag");
-  this->shader->activateShader();
-  //exit(-1);
+  this->shader = Shader::getShader("toon.vert", "toon.frag");
 
   this->obj = gluNewQuadric();
@@ -44,7 +42,6 @@
 NPC2::~NPC2 ()
 {
-  delete this->shader;
+  Shader::unload(this->shader);
   gluDeleteQuadric(this->obj);
-
 }
 
@@ -87,5 +84,8 @@
   glMultMatrixf((float*)matrix);
 
-  shader->activateShader();
+  if (this->shader != NULL && this->shader != Shader::getActiveShader())
+  {
+    shader->activateShader();
+  }
   gluSphere(this->obj, 3, 10, 10);
   //shader->deactivateShader();
