unique_ptr based management for SDL_Surfaces

This commit is contained in:
2015-03-08 13:59:08 +01:00
parent 31e3a307b5
commit ffbc59140a
6 changed files with 80 additions and 50 deletions

View File

@@ -61,6 +61,7 @@ private:
class Texture2D {
public:
Texture2D();
Texture2D(unsigned width, unsigned height, bool alpha = false);
Texture2D(std::string const& file);
Texture2D(SDL_Surface *surface);
@@ -76,7 +77,11 @@ public:
void bind() const;
void copyFromSurface(SDL_Surface *src);
SDL_Surface* copyToSurface();
SDLSurfaceUPtr copyToSurface();
unsigned getWidth() const { return width_; }
unsigned getHeight() const { return height_; }
bool getAlpha() const { return alpha_; }
private: