X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FTexture.hh;h=4e311ea53a05f75689b0e7b2c31dfedf4b573135;hp=2ab4710cf55202dfd986808b820812be5b5fe5cf;hb=c9e20ac06383b20ceb5404c9237e319c2e90d157;hpb=16d1a05b0777e97a45c48e2874aa4e5cc791282e diff --git a/src/Moof/Texture.hh b/src/Moof/Texture.hh index 2ab4710..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,33 +43,40 @@ namespace Mf { +class Texture; +typedef boost::shared_ptr TextureP; + + class Texture : public Resource { public: - Texture(const std::string& name); - void bind(); - GLuint getObject(); + static TextureP alloc(const std::string& name) + { + return TextureP(new Texture(name)); + } + + explicit Texture(const std::string& name); - unsigned getWidth(); - unsigned getHeight(); + void bind() const; + GLuint getObject() const; + + static void resetBind(); + + unsigned getWidth() const; + unsigned getHeight() const; void setMinFilter(GLuint filter); void setMagFilter(GLuint filter); 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; };