mipre100
06-10-2005 12:07:49
I've got so far with setting up the vertex buffers, etc for a manual mesh, and come across a potentially fatal problem. Once we've setup the buffers, and bound them to the vertices, etc, you need to write the data to the buffer:
This has the following problems:
float[] positionVertexArray;
positionVertexArray = new float[3*numVertices];
//write positionVertexArray data...
positionVertexBuffer.get().WriteData(0,
positionVertexBuffer.get().GetSizeInBytes(), // size
positionVertexArray, // source
true);This has the following problems:
For simple compilation, we require the ability to pass a void pointer over the SWIG interface, and I don't think SWIG supports void pointers?
Even if we do pass the pointer over the SWIG interface, there is no way of ensuring the garbage collector dosen't just move the orriginal array of data we are writing from.
[/list:u]
Has anyone any idea how to work around this? I'm thinking I'm going to have to move at least this section back to C++ in it's own library with an appropiate SWIG wrapper.