X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FTexture.hh;h=4e311ea53a05f75689b0e7b2c31dfedf4b573135;hp=e858093e1a44afa06b44d50dcc5eac80503855e7;hb=3f6e44698c38b74bb622ad81ea9d2daa636981d2;hpb=c2321281bf12a7efaedde930422c7ddbc92080d4 diff --git a/src/Moof/Texture.hh b/src/Moof/Texture.hh index e858093..4e311ea 100644 --- a/src/Moof/Texture.hh +++ b/src/Moof/Texture.hh @@ -34,46 +34,49 @@ * Image-loading and OpenGL texture loading. */ -#include - #include -#include #include +#include 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)); + } - unsigned getWidth(); - unsigned getHeight(); + explicit Texture(const std::string& name); - void setMinFilter(GLuint filter); - void setMaxFilter(GLuint filter); - void setWrapU(GLuint wrap); - void setWrapV(GLuint wrap); + void bind() const; + GLuint getObject() const; - void applyChanges(); + static void resetBind(); - static std::string getPathToResource(const std::string& name); + unsigned getWidth() const; + unsigned getHeight() const; - struct Exception : std::runtime_error - { - explicit Exception(const std::string& what_arg) : - std::runtime_error(what_arg) {} - }; + void setMinFilter(GLuint filter); + void setMagFilter(GLuint filter); + void setWrapS(GLuint wrap); + void setWrapT(GLuint wrap); + + static std::string getPath(const std::string& name); private: - class TextureImpl; - boost::shared_ptr impl_; + + class Impl; + boost::shared_ptr mImpl; };