I'm trying to display a point scatter in LWJGL. However, I can't find a way for LWJGL to set point sizes or add sprites.
The tutorials I find on the internet are all using a C++ OpenGL binding. I can't figure out which methods to use.
This is the method that is called to render the scene. It must somehow include the commands to set the point size.
public void loopCycle() {
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
GL20.glUseProgram(pId);
// Bind to the VAO that has all the information about the vertices
GL30.glBindVertexArray(vaoId);
GL20.glEnableVertexAttribArray(0);
GL20.glEnableVertexAttribArray(1);
// Draw the vertices and adjust size....
GL11.glDrawArrays(GL11.GL_POINTS, 0, vertexCount);
// Put everything back to default (deselect)
GL15.glBindBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER, 0);
GL20.glDisableVertexAttribArray(0);
GL20.glDisableVertexAttribArray(1);
GL30.glBindVertexArray(0);
GL20.glUseProgram(0);
}
You can set the size (diameter) of points using glPointSize()
.
The maximum supported size is implementation specific. You can check that range by checking GL_ALIASED_POINT_SIZE_RANGE
.