X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Frender%2Ftag.h;fp=source%2Frender%2Ftag.h;h=28b4fa010e8b0f12980df476f7ac8160a2c922fb;hb=7aaec9a70b8d7733429bec043f8e33e02956f266;hp=0000000000000000000000000000000000000000;hpb=bec07999d95b76f4b47cffcc564d0cd0afc0435e;p=libs%2Fgl.git diff --git a/source/render/tag.h b/source/render/tag.h new file mode 100644 index 00000000..28b4fa01 --- /dev/null +++ b/source/render/tag.h @@ -0,0 +1,28 @@ +#ifndef MSP_GL_TAG_H_ +#define MSP_GL_TAG_H_ + +#include + +namespace Msp { +namespace GL { + +/** +Provides transparent string-to-hash conversion for faster comparison. An empty +string is guaranteed to have an id of 0. +*/ +struct Tag +{ + unsigned id; + + Tag(): id(0) { } + Tag(const char *); + Tag(const std::string &s); + + bool operator<(const Tag &t) const { return id