X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2Ftexture.hh;h=1be4c5a004287fe51fc7e0832870e638055d13fe;hp=6fa4e326c7a51c16d83641e5759ca58853a85723;hb=6dfcfbd4a612230f2037cf891dd98520cb80c997;hpb=79b5f738f2e38acb60cda7e09f54802933a17105 diff --git a/src/texture.hh b/src/texture.hh index 6fa4e32..1be4c5a 100644 --- a/src/texture.hh +++ b/src/texture.hh @@ -29,8 +29,16 @@ #ifndef _TEXTURE_HH_ #define _TEXTURE_HH_ +/** + * @file texture.hh + * Image-loading and OpenGL texture loading. + */ + +#include + #include +#include "resource.hh" #include "opengl.hh" @@ -39,18 +47,22 @@ namespace dc { class texture_impl; -class texture +class texture : public resource { public: - texture(const std::string& filePath, bool keepInMemory = false); - - const std::string& filePath(); + texture(const std::string& name, bool keepInMemory = false); void bind(); - GLuint object(); + GLuint getObject(); + + unsigned getWidth(); + unsigned getHeight(); - unsigned width(); - unsigned height(); + struct exception : std::runtime_error + { + explicit exception(const std::string& what_arg) : + std::runtime_error(what_arg) {} + }; private: boost::shared_ptr impl;