summaryrefslogtreecommitdiff
path: root/texturesdl.cpp
blob: ea7d9ac57cb1fad47caf151f9ec7f8af9c826396 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
#include <stdexcept>
#include <SDL_image/SDL_image.h>
#include "texturesdl.h"

TextureSDL::TextureSDL(const char* filename) {
	SDL_Surface* image = IMG_Load(filename);
	
	width = image->w;
	height = image->h;
	data = (unsigned char*)image->pixels;
	
	build();
	
	SDL_FreeSurface(image);
}