X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FTexture.hh;h=4e311ea53a05f75689b0e7b2c31dfedf4b573135;hp=d2b2359f0eb4e28d09194cac40816e66dd0536a0;hb=3f6e44698c38b74bb622ad81ea9d2daa636981d2;hpb=29e3d45f7bbbf31eadf793c41ff2b3d9c47b7539 diff --git a/src/Moof/Texture.hh b/src/Moof/Texture.hh index d2b2359..4e311ea 100644 --- a/src/Moof/Texture.hh +++ b/src/Moof/Texture.hh @@ -34,8 +34,6 @@ * Image-loading and OpenGL texture loading. */ -#include - #include #include @@ -45,14 +43,26 @@ namespace Mf { +class Texture; +typedef boost::shared_ptr TextureP; + + class Texture : public Resource { public: - Texture(const std::string& name); + + static TextureP alloc(const std::string& name) + { + return TextureP(new Texture(name)); + } + + explicit Texture(const std::string& name); void bind() const; GLuint getObject() const; + static void resetBind(); + unsigned getWidth() const; unsigned getHeight() const; @@ -61,17 +71,12 @@ public: void setWrapS(GLuint wrap); void setWrapT(GLuint wrap); - static std::string getPathToResource(const std::string& name); - - struct Exception : std::runtime_error - { - explicit Exception(const std::string& what_arg) : - std::runtime_error(what_arg) {} - }; + static std::string getPath(const std::string& name); private: - class TextureImpl; - boost::shared_ptr impl_; + + class Impl; + boost::shared_ptr mImpl; };