Lastly the following 2 methods are different
GL20.glVertexAttribPointer(int index, int size, boolean unsigned, boolean normalized, int stride, java.nio.ByteBuffer buffer);
GL20.glVertexAttribPointer(int index, int size, boolean unsigned, boolean normalized, int stride, java.nio.ShortBuffer buffer);
They no longer have the 'unsigned' boolean variable but require an int 'type' variable. This is definitely a change for the better in LWJGL3.
I had another look at this and realized that LWJGL 3 already supports the virtual unsigned argument, it just wasn't applied to this particular function. I've pushed a commit that fixes functions that were missing it, so that all vertex pointer functions are consistent.
Now the question is, should we remove it? First, lets see what is generated now:
// Unsafe version, matches the native function
void nglVertexAttribPointer(int index, int size, int type, boolean normalized, int stride, long pointer)
// Direct mapping of the unsafe version to Java, ARRAY_BUFFER_BINDING == 0
void glVertexAttribPointer(int index, int size, int type, boolean normalized, int stride, ByteBuffer pointer)
// Direct mapping of the unsafe version to Java, ARRAY_BUFFER_BINDING != 0
void glVertexAttribPointer(int index, int size, int type, boolean normalized, int stride, long pointerOffset)
// Below are the "convenient" methods that we may want to change.
// type = GL_BYTE or GL_UNSIGNED_BYTE
void glVertexAttribPointer(int index, int size, boolean unsigned, boolean normalized, int stride, ByteBuffer pointer)
// type = GL_SHORT or GL_UNSIGNED_SHORT
void glVertexAttribPointer(int index, int size, boolean unsigned, boolean normalized, int stride, ShortBuffer pointer)
// type = GL_INT
void glVertexAttribPointer(int index, int size, boolean normalized, int stride, IntBuffer pointer)
// type = GL_FLOAT
void glVertexAttribPointer(int index, int size, boolean normalized, int stride, FloatBuffer pointer)
// type = GL_DOUBLE
void glVertexAttribPointer(int index, int size, boolean normalized, int stride, DoubleBuffer pointer)
There are a few issues here:
a) The unsigned argument. It does not exist in the native function and the signature is different for different buffer types.
b) Why is a GL_UNSIGNED_INT version missing?
c) What if we want to use GL30.GL_HALF_FLOAT with a ShortBuffer or GL12#UNSIGNED_INT_2_10_10_10_REV with an IntBuffer?
So, it might make sense to expose the type argument in the convenient methods too, i.e.:
void glVertexAttribPointer(int index, int size, int type, boolean normalized, int stride, ShortBuffer pointer)
void glVertexAttribPointer(int index, int size, int type, boolean normalized, int stride, IntBuffer pointer)
void glVertexAttribPointer(int index, int size, int type, boolean normalized, int stride, FloatBuffer pointer)
void glVertexAttribPointer(int index, int size, int type, boolean normalized, int stride, DoubleBuffer pointer)
The pros are that we have full flexibility and one less method (the ByteBuffer version already exists). The cons are:
a) The type argument for the FloatBuffer and DoubleBuffer versions is useless. I don't think it'll ever be anything other than GL_FLOAT and GL_DOUBLE respectively.
b) We break LWJGL 2 compatibility for these functions.
A hybrid solution would be: Replace unsigned with type for integer buffers and hide type for floating point buffers.