X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FGraphic%2FTexture.hpp;h=54df61336cdecc4d6ba849d5fab29f9ba2a0a697;hb=a3775aa01cd00672b37785365675f6842b9db2dc;hp=0f1282898053bd6b56310860f7db2fd046dd5d5d;hpb=3f8ee86c6085b5d6c7ee31b916d0e022239750ab;p=lugaru.git diff --git a/Source/Graphic/Texture.hpp b/Source/Graphic/Texture.hpp index 0f12828..54df613 100644 --- a/Source/Graphic/Texture.hpp +++ b/Source/Graphic/Texture.hpp @@ -26,8 +26,7 @@ along with Lugaru. If not, see . #include #include #include - -using namespace std; +#include class TextureRes { @@ -47,17 +46,20 @@ public: TextureRes(const string& filename, bool hasMipmap, GLubyte* array, int* skinsize); ~TextureRes(); void bind(); + + /* Make sure TextureRes never gets copied */ + TextureRes(TextureRes const& other) = delete; + TextureRes & operator=(TextureRes const& other) = delete; }; class Texture { private: - TextureRes* tex; + std::shared_ptr tex; public: - inline Texture(): tex(NULL) {} + inline Texture(): tex(nullptr) {} void load(const string& filename, bool hasMipmap); void load(const string& filename, bool hasMipmap, GLubyte* array, int* skinsizep); - void destroy(); void bind(); };