LWJGL OpenGL VBO Issue on Linux

I struggled for a while with some code that generates 2 triangles using indices with more modern OpenGL methods. It worked fine when run on my windows boxes but not on my 2011 MBP running linux. There were no errors or anything i could see (i may not have configured the error checking correctly)

The issue was resolved by replacing the video driver. The xorg driver while it did support some OpenGL functions, did not apparently allow VBO. So if you notice issue with VBO/VBA code on linux where it runs fine on windows, try swapping out your graphics card drivers.

Below is the code used for the loader class thanks to ThinMatrix @ youtube who has some excellent tutorials for lwjgl.

package Engine;

import org.lwjgl.BufferUtils;
import org.lwjgl.opengl.*;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.util.ArrayList;
import java.util.List;

public class Loader {

    private List<Integer> vaos = new ArrayList<Integer>();
    private List<Integer> vbos = new ArrayList<Integer>();

    public Model LoadToVAO(float[] points, int[]indicies)throws OpenGLException
        int vaoID = CreateVAO();
        return new Model(vaoID,indicies.length);

    private void BindIndiciesBuffer(int[] indicies){

        int vboID= GL15.glGenBuffers();
        IntBuffer buffer  =StoreDataInIntBuffer(indicies);
        GL15.glBufferData(GL15.GL_ELEMENT_ARRAY_BUFFER,buffer, GL15.GL_STATIC_DRAW);
    private IntBuffer StoreDataInIntBuffer(int[] data){
        IntBuffer buffer = BufferUtils.createIntBuffer(data.length);
        return buffer;

    private int CreateVAO() throws OpenGLException {

        int vaoID = GL30.glGenVertexArrays();
        return vaoID;

    private void StoreDataInAttributeList(int attributeNumber, float[] data) throws OpenGLException{

        int vboID = GL15.glGenBuffers();

        GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, vboID);
        FloatBuffer buffer = storeDataInFloatBuffer(data);

        GL15.glBufferData(GL15.GL_ARRAY_BUFFER, buffer, GL15.GL_STATIC_DRAW);
        GL20.glVertexAttribPointer(attributeNumber, 3, GL11.GL_FLOAT, false, 0, 0); //stride here maybe
        GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0);

    private FloatBuffer storeDataInFloatBuffer(float[] data) {
        FloatBuffer buffer = BufferUtils.createFloatBuffer(data.length);
        return buffer;

    private void UnBindVAO() {

    public void Clean() {
        for (int vao : vaos) {

        for (int vbo : vbos) {


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s