Index: trunk/src/lib/graphics/importer/texture.cc
===================================================================
--- trunk/src/lib/graphics/importer/texture.cc	(revision 5836)
+++ trunk/src/lib/graphics/importer/texture.cc	(revision 5856)
@@ -80,5 +80,5 @@
         {
           SDL_Surface* tmpSurf;
-          if (this->texture)
+          if (this->texture != 0 && glIsTexture(this->texture))
             glDeleteTextures(1, &this->texture);
           // load the new Image to memory
@@ -88,5 +88,6 @@
             PRINTF(4)("loading Image %s\n", imageName);
             if (this->prepareSurface(tmpSurf))
-              loadTexToGL();
+              this->texture = Texture::loadTexToGL(this->image);
+
             SDL_FreeSurface(tmpSurf);
             return true;
@@ -110,5 +111,5 @@
 bool Texture::rebuild()
 {
-  if (this->texture != 0)
+  if (this->texture != 0 && glIsTexture(this->texture))
     {
       glDeleteTextures(1,&this->texture);
@@ -119,5 +120,5 @@
     {
       PRINTF(3)("Reloading Texture of %s '%s'\n", this->getClassName(), this->getName());
-      this->loadTexToGL();
+      this->texture = loadTexToGL(this->image);
     }
 
@@ -199,16 +200,18 @@
  * @returns The ID of the texture.
  */
-GLuint Texture::loadTexToGL ()
-{
-  if (this->texture != 0 && glIsTexture(this->texture))
-    glDeleteTextures(1, &this->texture);
-  this->texture = 0;
-
-  if (this->image == NULL)
+GLuint Texture::loadTexToGL (const SDL_Surface* surface)
+{
+//   if (this->texture != 0 && glIsTexture(this->texture))
+//     glDeleteTextures(1, &this->texture);
+//   this->texture = 0;
+
+  GLuint texture;
+
+  if (surface == NULL)
     return 0;
 
   /* Create an OpenGL texture for the image */
-  glGenTextures(1, &this->texture);
-  glBindTexture(GL_TEXTURE_2D, this->texture);
+  glGenTextures(1, &texture);
+  glBindTexture(GL_TEXTURE_2D, texture);
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
@@ -217,18 +220,18 @@
                0,
                GL_RGBA,
-               this->image->w, this->image->h,
+               surface->w, surface->h,
                0,
                GL_RGBA,
                GL_UNSIGNED_BYTE,
-               this->image->pixels);
+               surface->pixels);
   // build the MipMaps
   gluBuild2DMipmaps(GL_TEXTURE_2D,
                     GL_RGBA,
-                    this->image->w,
-                    this->image->h,
+                    surface->w,
+                    surface->h,
                     GL_RGBA,
                     GL_UNSIGNED_BYTE,
-                    this->image->pixels);
+                    surface->pixels);
   glBindTexture(GL_TEXTURE_2D, 0);
-  return this->texture;
-}
+  return texture;
+}
Index: trunk/src/lib/graphics/importer/texture.h
===================================================================
--- trunk/src/lib/graphics/importer/texture.h	(revision 5836)
+++ trunk/src/lib/graphics/importer/texture.h	(revision 5856)
@@ -34,9 +34,13 @@
       inline bool hasAlpha() const {return bAlpha;}
 
+      static GLuint loadTexToGL (const SDL_Surface* surface);
+
+      const SDL_Surface* const getStoredImage() { return this->image; };
+
     protected:
       bool prepareSurface(SDL_Surface* input);
       bool setSurface(SDL_Surface* newSurface);
+      bool setTexture(GLuint texture) { this->texture = texture; };
 
-      GLuint loadTexToGL ();
 
     private:
Index: trunk/src/lib/graphics/text_engine/font.cc
===================================================================
--- trunk/src/lib/graphics/text_engine/font.cc	(revision 5836)
+++ trunk/src/lib/graphics/text_engine/font.cc	(revision 5856)
@@ -182,5 +182,7 @@
   }
   if (this->prepareSurface(surface))
-    this->loadTexToGL( );
+  {
+    this->setTexture(Texture::loadTexToGL(this->getStoredImage()));
+  }
 
   // initializing the Glyphs.
@@ -491,5 +493,5 @@
 
   if (this->setSurface(tmpSurf))
-    loadTexToGL();
+    (this->setTexture(Texture::loadTexToGL(tmpSurf)));
 }
 
Index: trunk/src/lib/sound/sound_engine.cc
===================================================================
--- trunk/src/lib/sound/sound_engine.cc	(revision 5836)
+++ trunk/src/lib/sound/sound_engine.cc	(revision 5856)
@@ -281,5 +281,5 @@
 
   // INITIALIZING THE DEVICE:
-  ALchar deviceName[] =
+  ALubyte deviceName[] =
 #ifdef __WIN32__
       "native";
