mShaderProgram.setAttributeBuffer(inPositionLocation, GL_FLOAT, 0, 3, sizeof(MyVertex));
mShaderProgram.setAttributeBuffer(inColorLocation, GL_FLOAT, 12, 3, sizeof(MyVertex));
mShaderProgram.setAttributeBuffer(inPositionLocation, GL_FLOAT, 0, 3, sizeof(MyVertex));
mShaderProgram.setAttributeBuffer(inColorLocation, GL_FLOAT, 12, 3, sizeof(MyVertex));
To copy to clipboard, switch view to plain text mode
From the docs:
if (mVBO1.bind()) {
mShaderProgram.setAttributeBuffer(inPositionLocation, GL_FLOAT, 0, 3, sizeof(MyVertex));
mShaderProgram.setAttributeBuffer(inColorLocation, GL_FLOAT, 12, 3, sizeof(MyVertex));
glDrawArrays(GL_LINES,0,nVertices1);
}
if (mVBO2.bind())
{
mShaderProgram.setAttributeBuffer(inPositionLocation, GL_FLOAT, 0, 3, sizeof(MyVertex));
mShaderProgram.setAttributeBuffer(inColorLocation, GL_FLOAT, 12, 3, sizeof(MyVertex));
glDrawArrays(GL_LINES,0,nVertices2);
}
if (mVBO1.bind()) {
mShaderProgram.setAttributeBuffer(inPositionLocation, GL_FLOAT, 0, 3, sizeof(MyVertex));
mShaderProgram.setAttributeBuffer(inColorLocation, GL_FLOAT, 12, 3, sizeof(MyVertex));
glDrawArrays(GL_LINES,0,nVertices1);
}
if (mVBO2.bind())
{
mShaderProgram.setAttributeBuffer(inPositionLocation, GL_FLOAT, 0, 3, sizeof(MyVertex));
mShaderProgram.setAttributeBuffer(inColorLocation, GL_FLOAT, 12, 3, sizeof(MyVertex));
glDrawArrays(GL_LINES,0,nVertices2);
}
To copy to clipboard, switch view to plain text mode
So in your case these commands were executed with second buffer still bound from the previous call (and hence crash when you tried to release buffer).
Bookmarks