[2.1+] BillboardSet Material is lost when pool is resized

Minor issues with the Ogre API that can be trivial to fix
Post Reply
Frankincense
Kobold
Posts: 29
Joined: Mon May 05, 2014 5:36 pm
x 3

[2.1+] BillboardSet Material is lost when pool is resized

Post by Frankincense »

If I set the material for a BillboardSet and then at some point in the future have the pool resized then the material is lost and it is reset to the default datablock I think.

What I believe happens;
  • BillboardSet is first initialised and '_createBuffers' is called which then calls 'setDatablock' or 'setMaterialName'
  • 'setMaterialName' eventually calls 'setDatablock' which clears the mMaterialName
  • BillboardSet pool is resized and '_createBuffers' is called for a second time
  • mMaterialName is now empty and the default HLMS datablock is used instead

This appears to be a logical bug, but I am unsure what the best solution would be. Maybe finding the current active datablock in '_createBuffers', or not clearing the mMaterialName in 'setDatablock'?

Post Reply