diff options
Diffstat (limited to 'src/Textures.cpp')
-rw-r--r-- | src/Textures.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Textures.cpp b/src/Textures.cpp index 0f829dc..dbd3674 100644 --- a/src/Textures.cpp +++ b/src/Textures.cpp @@ -48,7 +48,7 @@ GLuint loadTexture(const char* filename_, GLenum minFilter, GLenum magFilter, bo format = GL_BGR; }; }; - + //well, our textures are upside down. Fixing it here. Uint32 bytesPerRow = surface->format->BytesPerPixel*surface->w; char * buf = new char[bytesPerRow]; @@ -61,13 +61,12 @@ GLuint loadTexture(const char* filename_, GLenum minFilter, GLenum magFilter, bo memcpy(&p[offset2], buf, bytesPerRow); } delete[] buf; - + glTexImage2D(GL_TEXTURE_2D, 0, numColors, surface->w, surface->h, 0, format, GL_UNSIGNED_BYTE, surface->pixels); if (mipmaps) gluBuild2DMipmaps(GL_TEXTURE_2D, format, surface->w, surface->h, format, GL_UNSIGNED_BYTE, surface->pixels); } - + delete surface; return tex; } - |