diff --git a/src/IndexedMesh.cpp b/src/IndexedMesh.cpp index d34d5d348..156735018 100644 --- a/src/IndexedMesh.cpp +++ b/src/IndexedMesh.cpp @@ -41,10 +41,10 @@ void IndexedMesh::draw() { case GL_UNSIGNED_SHORT: case GL_INT: case GL_UNSIGNED_INT: - glVertexAttribIPointer(ait->location, ait->size, ait->type, ait->stride, ait->pointer); + glVertexAttribIPointer(ait->attribute, ait->size, ait->type, ait->stride, ait->pointer); break; default: - glVertexAttribPointer(ait->location, ait->size, ait->type, GL_FALSE, ait->stride, ait->pointer); + glVertexAttribPointer(ait->attribute, ait->size, ait->type, GL_FALSE, ait->stride, ait->pointer); } /* Unbind buffer */ diff --git a/src/Math/Matrix.h b/src/Math/Matrix.h index edcecd6e6..eadd8377e 100644 --- a/src/Math/Matrix.h +++ b/src/Math/Matrix.h @@ -102,6 +102,7 @@ template class Matrix { /** @brief Equality operator */ inline bool operator==(const Matrix& other) const { + /** @bug NaN comparisons! */ for(size_t row = 0; row != size; ++row) { for(size_t col = 0; col != size; ++col) if(std::abs(at(row, col) - other.at(row, col)) >= EPSILON) return false; diff --git a/src/Math/Vector.h b/src/Math/Vector.h index 96ed4e9b4..458a0db28 100644 --- a/src/Math/Vector.h +++ b/src/Math/Vector.h @@ -87,6 +87,7 @@ template class Vector { /** @brief Equality operator */ inline bool operator==(const Vector& other) const { + /** @bug NaN comparisons! */ for(size_t pos = 0; pos != size; ++pos) if(std::abs(at(pos) - other.at(pos)) >= EPSILON) return false; diff --git a/src/Mesh.cpp b/src/Mesh.cpp index 8a7ed35d9..91618da3e 100644 --- a/src/Mesh.cpp +++ b/src/Mesh.cpp @@ -59,10 +59,10 @@ void Mesh::draw() { case GL_UNSIGNED_SHORT: case GL_INT: case GL_UNSIGNED_INT: - glVertexAttribIPointer(ait->location, ait->size, ait->type, ait->stride, ait->pointer); + glVertexAttribIPointer(ait->attribute, ait->size, ait->type, ait->stride, ait->pointer); break; default: - glVertexAttribPointer(ait->location, ait->size, ait->type, GL_FALSE, ait->stride, ait->pointer); + glVertexAttribPointer(ait->attribute, ait->size, ait->type, GL_FALSE, ait->stride, ait->pointer); } /* Unbind buffer */ @@ -129,7 +129,7 @@ void Mesh::bindAttribute(Buffer* buffer, GLuint attribute, GLint size, GLenum ty if(found == _buffers.end()) return; Attribute a; - a.location = attribute; + a.attribute = attribute; a.size = size; a.type = type; a.stride = 0; diff --git a/src/Mesh.h b/src/Mesh.h index 40be35942..a739da0e6 100644 --- a/src/Mesh.h +++ b/src/Mesh.h @@ -134,12 +134,13 @@ class Mesh { virtual void draw(); protected: + /** @brief Vertex attribute */ struct Attribute { - GLuint location; - GLint size; - GLenum type; - GLsizei stride; - const GLvoid* pointer; + GLuint attribute; /**< @brief Attribute ID */ + GLint size; /**< @brief How many items of @c type are in the attribute */ + GLenum type; /**< @brief Attribute item type */ + GLsizei stride; /**< @brief Distance of two adjacent attributes of this type in interleaved buffer */ + const GLvoid* pointer; /**< @brief Pointer to first attribute of this type in the buffer */ }; /**