X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FGraphic%2FTexture.hpp;h=54df61336cdecc4d6ba849d5fab29f9ba2a0a697;hb=331215c3d8ebfa4c6ac3f585b3e888857dc9bb86;hp=ab51cdb9653cf760fda40430c57fa60daeed262f;hpb=ed3662c0852c4312a612b4fc35bd03aba8d13db7;p=lugaru.git diff --git a/Source/Graphic/Texture.hpp b/Source/Graphic/Texture.hpp index ab51cdb..54df613 100644 --- a/Source/Graphic/Texture.hpp +++ b/Source/Graphic/Texture.hpp @@ -26,14 +26,11 @@ along with Lugaru. If not, see . #include #include #include - -using namespace std; +#include class TextureRes { private: - static vector list; - GLuint id; string filename; bool hasMipmap; @@ -49,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(); };