Hello there.
I'm trying to load a texture and draw a simple textured triangle. Everything works fine, but I don't understand why using GL_UNSIGNED_BYTE type in this call
GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGB, texture.getWidth(), texture.getHeight(), 0, GL12.GL_BGR, GL11.GL_UNSIGNED_BYTE, texture.getByteBuffer());
produces different colors than when I use GL_BYTE. As far as I know Java uses two's complement byte representation and so does OpenGL.
So for a red component of a pixel it is like this, for example:
Red = 208 (dec unsigned byte) = 11010000(bin) = -48(dec in java). What am I missing?
Thanks for any answer.