From a524cfdd2756ac945040ca9bed576fb2f68f8c9f Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Sun, 16 May 2010 21:44:32 +0200 Subject: Imported project. --- texturesdl.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 texturesdl.cpp (limited to 'texturesdl.cpp') diff --git a/texturesdl.cpp b/texturesdl.cpp new file mode 100644 index 0000000..8e112ef --- /dev/null +++ b/texturesdl.cpp @@ -0,0 +1,17 @@ +#include +#include +#include +#include "texturesdl.h" + +TextureSDL::TextureSDL(const char* filename) { + SDL_Surface* image = IMG_Load(filename); + + width = image->w; + height = image->h; + byte_per_pixel = image->format->BytesPerPixel; + data = (unsigned char*)image->pixels; + + build(); + + SDL_FreeSurface(image); +} -- cgit v1.2.3