[lwjgl] GL33 function replacements for GL31

Hi!

I`m trying to make my game compatybile with HD3000 graphics (GL31 instead od GL33).

So i replaced
GL32.glFramebufferTexture(GL30.GL_FRAMEBUFFER, GL30.GL_DEPTH_ATTACHMENT, texture, 0);
with
GL30.glFramebufferTexture2D(GL30.GL_FRAMEBUFFER, GL30.GL_COLOR_ATTACHMENT0, GL11.GL_TEXTURE_2D, texture, 0);
Is this correct?

And also i`m searching for replacement for ‘GL33.glVertexAttribDivisor’ function.
For temporary fix i just commented it out and game is starting but i got maany artifacts. No suprise.

Here`s my code:

public void addInstancedAttribute(int vao, int vbo, int attribute, int dataSize, int instancedDataLength, int offset) {
GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, vbo);
GL30.glBindVertexArray(vao);
GL20.glVertexAttribPointer(attribute, dataSize, GL11.GL_FLOAT, false, instancedDataLength * 4, offset * 4);

// ---> GL33.glVertexAttribDivisor(attribute, 1);
GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0);
GL30.glBindVertexArray(0);

}

Thanks for your time!!

No. Obviously, in the first call you were attaching a texture to the depth attachment of your FBO, whereas in the second call you are now using the color attachment 0. Those are two different things. You probably meant to use GL_DEPTH_ATTACHMENT in the second call as well.

glVertexAttribDivisor is only available since OpenGL 3.3. If you want to use OpenGL 3.1, then you can only rely on the extension GL_ARB_instanced_arrays being available. So test for this extension in the GLCapabilities object and if it is true/available, use it via ARBInstancedArrays.glVertexAttribDivisorARB().

It works, thanks!!