]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Texture.hh
cade lab fixes
[chaz/yoink] / src / Moof / Texture.hh
index 2ab4710cf55202dfd986808b820812be5b5fe5cf..4e311ea53a05f75689b0e7b2c31dfedf4b573135 100644 (file)
@@ -34,8 +34,6 @@
  * Image-loading and OpenGL texture loading.
  */
 
-#include <stdexcept>
-
 #include <boost/shared_ptr.hpp>
 
 #include <Moof/OpenGL.hh>
 namespace Mf {
 
 
+class Texture;
+typedef boost::shared_ptr<Texture> 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<TextureImpl> impl_;
+
+       class Impl;
+       boost::shared_ptr<Impl> mImpl;
 };
 
 
This page took 0.020934 seconds and 4 git commands to generate.