Merge pull request #28 from devnexen/odr_fix

Resolve ODR conflict in mesh loaders via unique namespaces.
This commit is contained in:
Amy Ackermann
2018-07-29 09:17:53 -07:00
committed by GitHub
2 changed files with 12 additions and 4 deletions
+8 -4
View File
@@ -43,10 +43,7 @@ const char* bmfHead = "BMF ";
namespace render {
struct UV {
float u, v;
};
namespace bmf {
struct VertexIndex {
unsigned a, b, c;
@@ -57,7 +54,14 @@ struct VertexIndex {
return memcmp(this, &other, sizeof(unsigned) * 3) < 0;
}
};
}
using namespace bmf;
struct UV {
float u, v;
};
void loadBinaryMesh(const char* filename, Mesh& mesh) {
static_assert(sizeof(vec3f) == 12, "vec3f must be the size of 3 floats");
+4
View File
@@ -9,6 +9,7 @@
namespace render {
namespace obj {
struct VertexIndex {
int a, b, c;
@@ -18,6 +19,9 @@ struct VertexIndex {
return memcmp(this, &other, sizeof(int) * 3) < 0;
}
};
}
using namespace obj;
void loadMeshOBJ(const char* filename, Mesh& mesh) {
// Read all the appropriate separate data arrays