summaryrefslogtreecommitdiff
path: root/texturesdl.cpp
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2010-06-30 23:31:01 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2010-06-30 23:31:01 +0200
commitab8c1e0eeffedb0e5979874fba64b305effdb2d3 (patch)
tree8b6f3b996a0333587c5546527ab148d4740ab79d /texturesdl.cpp
parentd74b4f20e722ecd732e70e76985c7c936d0f82a2 (diff)
Changed Texture-API.
Diffstat (limited to 'texturesdl.cpp')
-rw-r--r--texturesdl.cpp8
1 files changed, 2 insertions, 6 deletions
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);
}