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