Commit 8aca5fa6 authored by Jan Möbius's avatar Jan Möbius

Fixed f... 4 hour bug. Primitives should unbind their vbo after rendering or QT goes nuts

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@13326 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 86e142e1
......@@ -126,6 +126,15 @@ void GLPrimitive::bindVBO()
glTexCoordPointer(2, GL_FLOAT, 32, (GLvoid*) 24);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
}
//------------------------------------------------------------------------
void GLPrimitive::unBindVBO()
{
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
}
//------------------------------------------------------------------------
......@@ -134,6 +143,8 @@ void GLPrimitive::draw()
bindVBO();
glDrawArrays(GL_TRIANGLES, 0, getNumTriangles() * 3);
unBindVBO();
}
//========================================================================
......
......@@ -87,6 +87,8 @@ protected:
void bindVBO();
void unBindVBO();
private:
int numTris_;
......
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