X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2Fmoof%2Fsprite.hh;fp=src%2Fmoof%2Fsprite.hh;h=3cee87281382c85800ead800267bd0190172ad18;hp=0000000000000000000000000000000000000000;hb=382626aad0a683ed8642a6a807eea743db45f7f8;hpb=1da520638918096276158ecdfaeebc14a3d70be7 diff --git a/src/moof/sprite.hh b/src/moof/sprite.hh new file mode 100644 index 0000000..3cee872 --- /dev/null +++ b/src/moof/sprite.hh @@ -0,0 +1,57 @@ + +/*] Copyright (c) 2009-2010, Charles McGarvey [************************** +**] All rights reserved. +* +* vi:ts=4 sw=4 tw=75 +* +* Distributable under the terms and conditions of the 2-clause BSD license; +* see the file COPYING for a complete text of the license. +* +**************************************************************************/ + +#ifndef _MOOF_SPRITE_HH_ +#define _MOOF_SPRITE_HH_ + +/** + * \file sprite.hh + * Image-loading and OpenGL texture loading. + */ + +#include + +#include +#include + + +namespace moof { + + +class sprite +{ +public: + + sprite() {} + explicit sprite(const std::string& path, int tile = image::no_tile); + explicit sprite(const image_handle& image, int tile = image::no_tile); + explicit sprite(const sprite& sprite, int tile = image::no_tile); + + void image(const std::string& path); + void tile(int tile); + + void bind() const; + static void reset_binding(); + + void draw(const vector3 vertices[4]) const; + + +private: + + image_handle image_; + scalar tile_[8]; +}; + + +} // namespace moof + +#endif // _MOOF_SPRITE_HH_ +