GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: No Line Numbers


VBO stuff by luke
1
 
/* this is the bit where i put the data into a vbo */
if(GLext_ARB_vertex_buffer_object)
{
    if(node->VBODataBuffID)    glDeleteBuffersARB(1, &node->VBODataBuffID);
    glGenBuffersARB(1, &node->VBODataBuffID);
    glBindBufferARB(GL_ARRAY_BUFFER_ARB, node->VBODataBuffID);
    glBufferDataARB(GL_ARRAY_BUFFER_ARB, node->numFaces*24*sizeof(GLfloat), node->data, GL_STATIC_DRAW_ARB);
}

/* this is how i render (different function) */
if(GLext_ARB_vertex_buffer_object)
{
    glBindBufferARB(GL_ARRAY_BUFFER_ARB, node->VBODataBuffID);
    glInterleavedArrays(GL_T2F_N3F_V3F, 0, 0);
}
else
{
    glInterleavedArrays(GL_T2F_N3F_V3F, 0, node->data);
}

glDrawArrays(GL_TRIANGLES, 0, node->numFaces*3);