Hey guys, im trying to display a quad using OpenGL 4.5, but it draws nothing on the screen. I have VBA, VBO, EBO, shader(compiled and linked), but it only draws the clear color .
Here is my main java class: https://hastebin.com/ehumuqaqap.cpp
You have two errors in your code:
1.
Change:
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, elementBufferObject);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, elementBufferObject, GL_STATIC_DRAW);
to:
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, elementBufferObject);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, indices, GL_STATIC_DRAW);
And then do not disable the shader by calling glUseProgram(0); // <- will DISABLE the shader.