]> Dogcows Code - chaz/yoink/blob - src/moof/sprite.hh
pch support
[chaz/yoink] / src / moof / sprite.hh
1
2 /*] Copyright (c) 2009-2011, Charles McGarvey [*****************************
3 **] All rights reserved.
4 *
5 * Distributable under the terms and conditions of the 2-clause BSD license;
6 * see the file COPYING for a complete text of the license.
7 *
8 *****************************************************************************/
9
10 #ifndef _MOOF_SPRITE_HH_
11 #define _MOOF_SPRITE_HH_
12
13 #include <string>
14
15 #include <moof/image.hh>
16 #include <moof/math.hh>
17
18
19 /**
20 * \file sprite.hh
21 * Image-loading and OpenGL texture loading.
22 */
23
24 namespace moof {
25
26
27 class sprite
28 {
29 public:
30
31 sprite() {}
32 explicit sprite(const std::string& name, int tile = image::no_tile);
33 explicit sprite(const image_handle& image, int tile = image::no_tile);
34 explicit sprite(const sprite& sprite, int tile = image::no_tile);
35
36 void image(const std::string& name);
37 void tile(int tile);
38
39 void bind() const;
40 static void reset_binding();
41
42 void draw(const vector3 vertices[4]) const;
43
44 private:
45
46 image_handle image_;
47 scalar tile_[8];
48 };
49
50
51 } // namespace moof
52
53 #endif // _MOOF_SPRITE_HH_
54
This page took 0.032819 seconds and 4 git commands to generate.