X-Git-Url: https://git.sur5r.net/?p=fstl;a=blobdiff_plain;f=src%2Fvertex.h;fp=src%2Fvertex.h;h=9738a753e4cd4da269f5c3ad3c3b61174927da71;hp=0000000000000000000000000000000000000000;hb=0da9fdf2b9623665a991990e57485a007645eba6;hpb=5dd213695da2eb22219ac5143aa8b5cfe7c89559 diff --git a/src/vertex.h b/src/vertex.h new file mode 100644 index 0000000..9738a75 --- /dev/null +++ b/src/vertex.h @@ -0,0 +1,30 @@ +#ifndef VEC3_H +#define VEC3_H + +#include + +/* + * Represents an optionally-indexed vertex in space + */ +struct Vertex +{ + Vertex() {} + Vertex(float x, float y, float z) : x(x), y(y), z(z) {} + + GLfloat x, y, z; + GLuint i=0; + + bool operator!=(const Vertex& rhs) const + { + return x != rhs.x || y != rhs.y || z != rhs.z; + } + bool operator<(const Vertex& rhs) const + { + if (x != rhs.x) return x < rhs.x; + else if (y != rhs.y) return y < rhs.y; + else if (z != rhs.z) return z < rhs.z; + else return false; + } +}; + +#endif