Skip to content

Mesh generates access violation in Vertexbuffer on second Draw() call #16722

Open
@satanorz

Description

@satanorz
  • cocos2d-x version: 3.13.1
  • devices test on: Windows 10
  • developing environments
    • VS version: 2013 Community

Steps to Reproduce:

  1. Create a mesh inside a class derived from Node, with an override Draw()
  2. Retain the mesh
  3. Add the instance of the derived class into a Scene with AddChild
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions