For a performance boost, don't scan the file to count the number of vertices, normals, texCoords, faces.
Instead provide parameters to the function. These default to -1.
If vertices is -1, then scan the file and count.
Otherwise, allocate arrays to those initial sizes. If the provided size is greater than the actual encountered, print a message to the screen informing the user they allocated too much memory. If the provided size is too small, print a message to the screen informing the user they didn't allocate enough memory. TBD - resize the array? Or fail?
For a performance boost, don't scan the file to count the number of vertices, normals, texCoords, faces.
Instead provide parameters to the function. These default to -1.
If vertices is -1, then scan the file and count.
Otherwise, allocate arrays to those initial sizes. If the provided size is greater than the actual encountered, print a message to the screen informing the user they allocated too much memory. If the provided size is too small, print a message to the screen informing the user they didn't allocate enough memory. TBD - resize the array? Or fail?