Author Topic: Texture.overrideTexelData  (Read 2198 times)

Offline raft

  • quad
  • ******
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Texture.overrideTexelData
« on: October 01, 2014, 04:46:49 pm »
* 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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Texture.overrideTexelData
« Reply #1 on: October 01, 2014, 08:51:38 pm »
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.