I have two ByteBuffers, they are completely identical but somehow behave differently when used in the GL11.glTexImage2D(); method.
My code:
IntBuffer width = BufferUtils.createIntBuffer(1);
IntBuffer height = BufferUtils.createIntBuffer(1);
IntBuffer comp = BufferUtils.createIntBuffer(1);
ByteBuffer data = STBImage.stbi_load("dsc8x12.bmp", width, height, comp, 4);
byte[] bytes = new byte[data.limit()];
for (int i = 0; i < bytes.length; i++) {
bytes[i] = data.get(i);
}
ByteBuffer data2 = ByteBuffer.wrap(bytes);
System.out.println(data.equals(data2));
GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, 1024, 12, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, data);
The console output is true
Here is how the window looks when the final argument in the GL11.glTexImage2D(); is either data or data2
When data is used:

When data2 is used:
