Hey,
Finally got myself an OpenGL 4.5 capable hardware and I have been playing around with the DSA.
Yet, I can’t seem to get a simple rendering example to work.
For instance I have converted the following old code (_vao = vertex array object, _vbo = buffer object):
glBindVertexArray(_vao);
glBindBuffer(GL_ARRAY_BUFFER, _vbo);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0 , nullptr);
glEnableVertexAttribArray(0);
into:
glEnableVertexArrayAttrib(_vao, 0);
glVertexArrayAttribBinding(_vao, 0, 0);
glVertexArrayAttribFormat(_vao, 0, 3, GL_FLOAT, GL_FALSE, 0);
glVertexArrayVertexBuffer(_vao, 0, _vbo, 0, 0);
The contents of the buffer are vertices for a sphere which are later drawn with glDrawArrays().
If I use the old approach with the DSA style glCreate* functions for the VAO and buffer, it works fine. However if I switch to the new approach (based on the code in https://www.opengl.org/registry/specs/ARB/direct_state_access.txt examples sections), I get a blank screen.
Do i need to update my shaders to compile with #version 450?
Am i missing something crucial?
Thanks!