Commit b8e28275 authored by Robert Menzel's avatar Robert Menzel

added vertex divisor default value

parent d51c5373
......@@ -78,7 +78,7 @@ public:
GLint size; // #elements per attribute, size in bytes would be: size*sizeof(type)
GLuint offset; // offset in bytes into the array
GLboolean normalized; // int types can get normalzed to 0..1 / -1..1 by GL, useful e.g. for colors
GLuint divisor; // vertex divisor for instancing, supported since OpenGL 3.3
GLuint divisor; // vertex divisor for instancing, supported since OpenGL 3.3. Default is 0 (== off)
};
// ===================================================================================================== \/
......
......@@ -156,7 +156,7 @@ bool GeometryDataControlFileATB::load(SharedGeometryData& _geometry) const
std::memcpy(data, &dataVector[0], dataVector.size() * sizeof(GLfloat));
// Name the attribute according to the filename
ArrayBuffer::Attribute attr = { mAttributeName, GL_FLOAT, attributeDimension, 0, GL_FALSE };
ArrayBuffer::Attribute attr = { mAttributeName, GL_FLOAT, attributeDimension, 0, GL_FALSE, 0 };
_geometry->mAttributes.push_back(attr);
// Tell the _geometry object where it finds the data
......
......@@ -279,18 +279,18 @@ bool GeometryDataControlFileOBJ::load(SharedGeometryData& geometry) const
geometry->setData( (GLubyte*)data );
geometry->setStrideSize( components * sizeof(float) );
ArrayBuffer::Attribute apos = { "aPosition", GL_FLOAT, 4, 0, GL_FALSE };
ArrayBuffer::Attribute apos = { "aPosition", GL_FLOAT, 4, 0, GL_FALSE, 0 };
geometry->mAttributes.push_back( apos );
if (hasNormals) {
ArrayBuffer::Attribute anorm = { "aNormal", GL_FLOAT, 3, 4*sizeof(float), GL_FALSE };
ArrayBuffer::Attribute anorm = { "aNormal", GL_FLOAT, 3, 4*sizeof(float), GL_FALSE, 0 };
geometry->mAttributes.push_back( anorm );
}
if (texCoordDimension > 0) {
int offset = (hasNormals?7:4);
offset *= sizeof(float);
ArrayBuffer::Attribute atex = { "aTexCoord", GL_FLOAT, texCoordDimension, offset, GL_FALSE };
ArrayBuffer::Attribute atex = { "aTexCoord", GL_FLOAT, texCoordDimension, offset, GL_FALSE, 0 };
geometry->mAttributes.push_back( atex );
}
......
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