]> git.tdb.fi Git - libs/gl.git/blob - source/tag.h
Copy the material slot of RenderPass
[libs/gl.git] / source / tag.h
1 #ifndef MSP_GL_TAG_H_
2 #define MSP_GL_TAG_H_
3
4 #include <string>
5
6 namespace Msp {
7 namespace GL {
8
9 /**
10 Provides transparent string-to-hash conversion for faster comparison.  An empty
11 string is guaranteed to have an id of 0.
12 */
13 struct Tag
14 {
15         unsigned id;
16
17         Tag(): id(0) { }
18         Tag(const char *);
19         Tag(const std::string &s);
20
21         bool operator<(const Tag &t) const { return id<t.id; }
22         bool operator==(const Tag &t) const { return id==t.id; }
23 };
24
25 } // namespace GL
26 } // namespace Msp
27
28 #endif