Hey everybody,
I've got a problem with the VBO in C++ (und Mac OS x Lion). First of all thats my code:
Init:
Code :
float vertexBuffer[8] = {
        0.0F, 0.0F,
        0.0F, h,
        w, h,
        0.0F, h
    };
    unsigned int vertexIndices[4] = {
        0, 1, 2, 3
    };
 
    glGenBuffers(2, bufferId);
    glBindBuffer(GL_ARRAY_BUFFER, bufferId[0]);
    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bufferId[1]);
    glBufferData(GL_ARRAY_BUFFER, sizeof(vertexBuffer), vertexBuffer, GL_STATIC_DRAW);
    glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(vertexIndices), vertexIndices, GL_STATIC_DRAW);
And render:
Code :
glBindBuffer(GL_ARRAY_BUFFER, bufferId[0]);
    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bufferId[1]);
    glEnableClientState(GL_VERTEX_ARRAY);
    glVertexPointer(2, GL_FLOAT, 8*sizeof(float), 0);
 
    glColor3f(1.0f, 1.0f, 1.0f);
    glDrawElements(GL_QUADS, 2, GL_UNSIGNED_INT, 0);
 
    glDisableClientState(GL_VERTEX_ARRAY);
    glBindBuffer(GL_ARRAY_BUFFER, 0);
    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
Now the problem is it displays nothing. No error or sth like that. Can somebody please help me? Thanks
Greedings,
CookieSoft