Commit 3b550c48 authored by Robert Menzel's avatar Robert Menzel
Browse files

Merge branch 'master' of...

Merge branch 'master' of ssh://beatrix.informatik.rwth-aachen.de/data/git-repository/acgl/libraries/acgl
parents 7a43dc85 09934f6f
......@@ -6,7 +6,7 @@
#ifndef ACGL_ACGL_HH
#define ACGL_ACGL_HH
/*
/*!
* Include this in all ACGL (header)-files. It will include stuff that is used in
* almost every file:
* the used datatypes
......
......@@ -73,14 +73,17 @@ void RenderObject::enableVertexBufferObject (void) const
for(AttributeMappingVec::size_type i = 0; i < mAttributeMappings.size(); i++)
{
if(mpVertexBufferObject->getAttributes()[mAttributeMappings[i].attributeID].bufferID != currentArrayBufferID)
if(mAttributeMappings[i].attributeLocation != -1)
{
mpVertexBufferObject->getArrayBuffers()[mpVertexBufferObject->getAttributes()[mAttributeMappings[i].attributeID].bufferID]->bind();
currentArrayBufferID = mpVertexBufferObject->getAttributes()[mAttributeMappings[i].attributeID].bufferID;
if(mpVertexBufferObject->getAttributes()[mAttributeMappings[i].attributeID].bufferID != currentArrayBufferID)
{
mpVertexBufferObject->getArrayBuffers()[mpVertexBufferObject->getAttributes()[mAttributeMappings[i].attributeID].bufferID]->bind();
currentArrayBufferID = mpVertexBufferObject->getAttributes()[mAttributeMappings[i].attributeID].bufferID;
}
mpVertexBufferObject->setAttributePointer(mpVertexBufferObject->getAttributes()[mAttributeMappings[i].attributeID].attributeID, mAttributeMappings[i].attributeLocation);
glEnableVertexAttribArray(mAttributeMappings[i].attributeLocation);
openGLRareError();
}
mpVertexBufferObject->setAttributePointer(mpVertexBufferObject->getAttributes()[mAttributeMappings[i].attributeID].attributeID, mAttributeMappings[i].attributeLocation);
glEnableVertexAttribArray(mAttributeMappings[i].attributeLocation);
openGLRareError();
}
}
......@@ -89,13 +92,16 @@ void RenderObject::disableVertexBufferObject (void) const
int currentArrayBufferID = -1;
for(AttributeMappingVec::size_type i = 0; i < mAttributeMappings.size(); i++)
{
if(mpVertexBufferObject->getAttributes()[mAttributeMappings[i].attributeID].bufferID != currentArrayBufferID)
if(mAttributeMappings[i].attributeLocation != -1)
{
mpVertexBufferObject->getArrayBuffers()[mpVertexBufferObject->getAttributes()[mAttributeMappings[i].attributeID].bufferID]->bind();
currentArrayBufferID = mpVertexBufferObject->getAttributes()[mAttributeMappings[i].attributeID].bufferID;
if(mpVertexBufferObject->getAttributes()[mAttributeMappings[i].attributeID].bufferID != currentArrayBufferID)
{
mpVertexBufferObject->getArrayBuffers()[mpVertexBufferObject->getAttributes()[mAttributeMappings[i].attributeID].bufferID]->bind();
currentArrayBufferID = mpVertexBufferObject->getAttributes()[mAttributeMappings[i].attributeID].bufferID;
}
glDisableVertexAttribArray(mAttributeMappings[i].attributeLocation);
openGLRareError();
}
glDisableVertexAttribArray(mAttributeMappings[i].attributeLocation);
openGLRareError();
}
}
......
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