Commit 47806418 authored by Janis Born's avatar Janis Born

fix warnings in GeometryDataLoadStoreOBJ

parent ba6ca2ce
......@@ -194,7 +194,7 @@ SharedGeometryData loadGeometryDataFromOBJ(const std::string& _filename, bool _c
std::vector<IndexTuple> pointIndices = parseIndices(parameters);
// points are just added in order
for(int i = 0; i < pointIndices.size(); ++i)
for(size_t i = 0; i < pointIndices.size(); ++i)
{
indices.push_back(pointIndices[i]);
}
......@@ -211,7 +211,7 @@ SharedGeometryData loadGeometryDataFromOBJ(const std::string& _filename, bool _c
std::vector<IndexTuple> lineIndices = parseIndices(parameters);
// add line segments for the line strip defined by the vertices
for(int i = 0; i < lineIndices.size() - 1; ++i)
for(size_t i = 0; i < lineIndices.size() - 1; ++i)
{
indices.push_back(lineIndices[i]);
indices.push_back(lineIndices[i+1]);
......@@ -229,7 +229,7 @@ SharedGeometryData loadGeometryDataFromOBJ(const std::string& _filename, bool _c
std::vector<IndexTuple> faceIndices = parseIndices(parameters);
// triangulate the polygon defined by the indices
for(int i = 1; i < faceIndices.size() - 1; ++i)
for(size_t i = 1; i < faceIndices.size() - 1; ++i)
{
indices.push_back(faceIndices[0]);
indices.push_back(faceIndices[i]);
......@@ -249,7 +249,7 @@ SharedGeometryData loadGeometryDataFromOBJ(const std::string& _filename, bool _c
GLfloat* abData = new GLfloat[abDataElements];
size_t pos = 0;
for(int i = 0; i < indices.size(); ++i)
for(size_t i = 0; i < indices.size(); ++i)
{
const glm::vec4& position = positionData[indices[i].position];
abData[pos++] = position.x;
......@@ -276,14 +276,14 @@ SharedGeometryData loadGeometryDataFromOBJ(const std::string& _filename, bool _c
}
size_t strideSize = 0;
ArrayBuffer::Attribute attrPosition = { "aPosition", GL_FLOAT, positionDimension, 0, GL_FALSE, 0, GL_FALSE };
ArrayBuffer::Attribute attrPosition = { "aPosition", GL_FLOAT, positionDimension, (GLuint)0, GL_FALSE, 0, GL_FALSE };
strideSize += positionDimension * sizeof(GLfloat);
data->mAttributes.push_back(attrPosition);
if(hasTexCoords)
{
ArrayBuffer::Attribute attrTexCoord = { "aTexCoord", GL_FLOAT, texCoordDimension, strideSize, GL_FALSE, 0, GL_FALSE };
ArrayBuffer::Attribute attrTexCoord = { "aTexCoord", GL_FLOAT, texCoordDimension, (GLuint)strideSize, GL_FALSE, 0, GL_FALSE };
strideSize += texCoordDimension * sizeof(GLfloat);
data->mAttributes.push_back(attrTexCoord);
......@@ -291,7 +291,7 @@ SharedGeometryData loadGeometryDataFromOBJ(const std::string& _filename, bool _c
if(hasNormals)
{
ArrayBuffer::Attribute attrNormal = { "aNormal", GL_FLOAT, normalDimension, strideSize, GL_FALSE, 0, GL_FALSE };
ArrayBuffer::Attribute attrNormal = { "aNormal", GL_FLOAT, normalDimension, (GLuint)strideSize, GL_FALSE, 0, GL_FALSE };
strideSize += normalDimension * sizeof(GLfloat);
data->mAttributes.push_back(attrNormal);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment