I tried to rewrite following code many times, but failed, I know I have to use functions like glCreateBuffers, glVertexArrayElementBuffer, glVertexArrayVertexBuffer, glnamedBufferData, glBindVertexArray but I have a problem with section with replacing glBindBuffer, glVertexAttribPointer, glEnableVertexAttribArray and glGetAttribLocation.
This is the following code, which I tried to implement:
glCreateBuffers(1, &phong.vbo);
glNamedBufferData(phong.vbo,sizeof(modelVertices),modelVertices,GL_STATIC_DRAW);
glCreateBuffers(1, &phong.ebo); glNamedBufferData(phong.ebo,sizeof(modelIndices),modelIndices,GL_STATIC_DRAW);
glCreateVertexArrays(1, &phong.vao);
glBindVertexArray(phong.vao);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, phong.ebo);
glBindBuffer(GL_ARRAY_BUFFER, phong.vbo);
const GLint possitionAttribute = glGetAttribLocation(phong.program, "position");
glVertexAttribPointer((GLuint) possitionAttribute, 3, GL_FLOAT, GL_FALSE,
sizeof(GLfloat) * 6, (const GLvoid *) 0 );
glEnableVertexAttribArray((GLuint) possitionAttribute);