thanks for the replies
pVerts is 1D array complVertex structure?
it's a pointer to the first element of a std::vector<complVertex>.
Did you forget to open the file in binary mode, such that an EOF character (Ctrl-Z, ascii 26 on Windows; Ctrl-D, ascii 4 on Unix) which happens to compose part of the binary vertex representation gets interpreted as the actual end of file?
don't think so. the ofstream is opened with:
std::ofstream ofs(filepath.asChar(),std::ios::out | std::ios::binary);
You might try checking the status of ofs after each write. It is possible that an error is ocurring that causes the ofs object to become bad. The fact that nothing gets written to the file after the attempt to write pVerts would seem to point to an error ocurring in that write call.
just checked. Yes the file get's bad. What can cause that? Maybe there something wrong with getting the pointer(it's a little more complex than just a pointer to a vector in the same scope).
I have a function which computes uv coordinates,tangents and binormals for every vertex and it's ouput is 2 pointers and 2 ints. one pointer for the vertexindices,one for the vertices itself,1 int for the indices count and 1 int for the vertices count.
To output those i need to pass a double pointer to the function like this:
createVertices(/*other parameters*/,complVertex **ppOutVerts,int **ppOutIndices,int *numVerts,int *numIndice);
and in the function i do:
and call it like this:
int vertCount,indexCount; createVertices(/*parameters*/,&pVerts,&vertCount,&pIndices,&indexCount);
is that correct?