LWJGL draws nothing to the screen

Started by user1992, April 07, 2020, 18:51:23

Previous topic - Next topic

user1992

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

KaiHH

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.