I"m trying to use tesselator to draw my surfaces and am getting a memory access error on the “vertex[i] += weight[2]…” line.
This occurs after about 100+ calls, so I’m a little confused. The malloc call is not failing. In looking at the disassembled code, it looks like it is a problem with vertex_data[2][i].
I’ve copied the code from the red book example. I’m running on windows XP and Visual Studio 2005sp1.
Make sure that “vertex_data” is 2D array and 6 elements for each vertex, for example, (x, y, z, r, g, b).
I concern more on the deallocation of the local array variable, “vertex”, in the combine callback function. How and when do you deallocate the memory from outside of this callback function?