From 6d51edf278effec3145d4036712cda7a2a5b0aef Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 2 Mar 2012 20:51:17 +0300 Subject: Move texture settings. --- src/resources/image.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/resources/image.cpp') diff --git a/src/resources/image.cpp b/src/resources/image.cpp index 1e2bd6b51..c63fcab99 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -765,15 +765,16 @@ Image *Image::_GLload(SDL_Surface *tmpImage) if (SDL_MUSTLOCK(tmpImage)) SDL_LockSurface(tmpImage); + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + glTexParameteri(mTextureType, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(mTextureType, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexImage2D(mTextureType, 0, 4, tmpImage->w, tmpImage->h, 0, GL_RGBA, GL_UNSIGNED_BYTE, tmpImage->pixels); #ifdef DEBUG_OPENGL_LEAKS textures_count ++; #endif - glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - glTexParameteri(mTextureType, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(mTextureType, GL_TEXTURE_MAG_FILTER, GL_NEAREST); if (SDL_MUSTLOCK(tmpImage)) SDL_UnlockSurface(tmpImage); -- cgit v1.2.3-70-g09d2