From ab8c1e0eeffedb0e5979874fba64b305effdb2d3 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Wed, 30 Jun 2010 23:31:01 +0200 Subject: Changed Texture-API. --- texturesdl.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'texturesdl.cpp') diff --git a/texturesdl.cpp b/texturesdl.cpp index bab760b..94e1e2d 100644 --- a/texturesdl.cpp +++ b/texturesdl.cpp @@ -6,18 +6,14 @@ TextureSDL::TextureSDL(const char* filename) { SDL_Surface* image = IMG_Load(filename); - width = image->w; - height = image->h; - + unsigned int format; if(image->format->BytesPerPixel == 4) { format = image->format->Bshift ? GL_RGBA : GL_BGRA; } else { format = image->format->Bshift ? GL_RGB : GL_BGR; } - data = (unsigned char*)image->pixels; - - build(); + build(image->pixels, format, image->w, image->h); SDL_FreeSurface(image); } -- cgit v1.2.3