After taking a quick look at the documentation, you should call the function giGetIndexedMesh
twice. First, to retrieve the required sizes (vcount
and icount
) by setting the last parameter to NULL. And the second time to retrieve the indices.
In your code snippet, you allocate the array using an old value of icount
. The required value is determined later, but you must determine it before:
GIuint vcount, icount;
giGetIndexedMesh(&vcount, &icount, NULL);
GIunit *indices = malloc (...);
giGetIndexedMesh(&vcount, &icount, indices);
I didn’t find enough information on the array layout. Thus, I didn’t completed the malloc
call. You should also check the return value of malloc
an giGetIndexedMesh
.
3
solved Reading pointer data [closed]