Merge branch 'feature/sdl2'
[supertux.git] / src / video / gl / gl_texture.cpp
index 9618bef..10dfa2d 100644 (file)
@@ -93,11 +93,11 @@ GLTexture::GLTexture(SDL_Surface* image) :
   image_height = image->h;
 
 #if SDL_BYTEORDER == SDL_BIG_ENDIAN
-  SDL_Surface* convert = SDL_CreateRGBSurface(SDL_SWSURFACE,
+  SDL_Surface* convert = SDL_CreateRGBSurface(SDL_HWSURFACE,
                                               texture_width, texture_height, 32,
                                               0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff);
 #else
-  SDL_Surface* convert = SDL_CreateRGBSurface(SDL_SWSURFACE,
+  SDL_Surface* convert = SDL_CreateRGBSurface(SDL_HWSURFACE,
                                               texture_width, texture_height, 32,
                                               0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000);
 #endif
@@ -138,17 +138,14 @@ GLTexture::GLTexture(SDL_Surface* image) :
       SDL_LockSurface(convert);
     }
 
-    if (true)
-    { // no not use mipmaps
-      glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texture_width,
+    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texture_width,
                  texture_height, 0, sdl_format,
                  GL_UNSIGNED_BYTE, convert->pixels);
-    }
-    else
-    { // build mipmaps
-      gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, texture_width,
-                        texture_height, sdl_format,
-                        GL_UNSIGNED_BYTE, convert->pixels);
+
+    // no not use mipmaps
+    if(false)
+    {
+      glGenerateMipmap(GL_TEXTURE_2D);
     }
 
     if(SDL_MUSTLOCK(convert))