Open
Description
- cocos2d-x version: 3.13.1
- devices test on: Windows 10
- developing environments
- VS version: 2013 Community
Steps to Reproduce:
- Create a mesh inside a class derived from Node, with an override Draw()
- Retain the mesh
- Add the instance of the derived class into a Scene with AddChild
- Try to access mesh->getVertexBuffer() inside the second call to overriden Draw()
This will throw an access violation. Other attributes of mesh remain correct, including the indexBuffer, but not the vertexBuffer.
A more extensive explanation can be found in this forum post: http://discuss.cocos2d-x.org/t/custom-draw-not-working-on-mesh-object/32748
The code is based on this one found in the wiki: http://www.cocos2d-x.org/wiki/3D_Graphics#Building-a-Mesh
A minimal example of the offending code is attached here:
MeshProblem.zip
If you need something else, just ask.