Texture.overrideTexelData

Started by raft, October 01, 2014, 04:46:49 PM

Previous topic - Next topic

raft

* I've noticed that, regardless of Texture is using alpha or not, Texture.overrideTexelData requires 4 bytes per pixel. is this intentional?

* Texture.overrideTexelData requires the given ByteBuffer must be direct and in LITTLE_ENDIAN order. however ByteBuffer.wrap(byte[])  returns an indirect BIG_ENDIAN buffer on my windows 8 machine. is this restriction necessary?

note: this post is intentionally on desktop jPCT board

EgonOlsen

Yes, these 4 bytes/pixel are intentional because that's the format that the textures internally have. Even textures without an alpha channel defined in the file have one.

And yes, the restriction is necessary or otherwise, it won't work. Any other format would force me to convert it on the fly and that's out of the scope of this method.