X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fvideo%2Ftexture.cpp;h=9c41ddde98de97730ca38c7e1780aa24d4a513ab;hb=a113d3bd1feddd510e3b2852b0d42522735eee40;hp=8e792b814e3f1b6a9916182ed34b8d3dd91d82cc;hpb=ff4c6994b952e26b854461d739eb3bcbfc30719f;p=supertux.git diff --git a/src/video/texture.cpp b/src/video/texture.cpp index 8e792b814..9c41ddde9 100644 --- a/src/video/texture.cpp +++ b/src/video/texture.cpp @@ -37,10 +37,10 @@ Texture::Texture(unsigned int w, unsigned int h, GLenum glformat) this->width = w; this->height = h; - + assert_gl("before creating texture"); glGenTextures(1, &handle); - + try { glBindTexture(GL_TEXTURE_2D, handle); @@ -61,13 +61,13 @@ Texture::Texture(SDL_Surface* image, GLenum glformat) throw std::runtime_error("image has no power of 2 size"); if(format->BitsPerPixel != 24 && format->BitsPerPixel != 32) throw std::runtime_error("image has no 24 or 32 bit color depth"); - + this->width = image->w; this->height = image->h; assert_gl("before creating texture"); glGenTextures(1, &handle); - + try { GLenum sdl_format; if(format->BytesPerPixel == 3) @@ -85,7 +85,7 @@ Texture::Texture(SDL_Surface* image, GLenum glformat) assert_gl("creating texture"); - set_texture_params(); + set_texture_params(); } catch(...) { glDeleteTextures(1, &handle); throw; @@ -107,4 +107,3 @@ Texture::set_texture_params() assert_gl("set texture params"); } -