Original Post
Hello!
Instead of reading a model from a huge obj-file (21 mb) I made a simple binary format which i wrote data to. But when I try to read it I get problems. It happens when I want to read an array of vertices. I get an access violation on the read line.
[source lang="cpp"]vertices = new TextureVertex[numVertices];
buffer.read((char*) &vertices, sizeof(TextureVertex) * numVertices);[/source]
The value of numVertices is 10920, and the data IS in the stream I read from.
Is it possible that the memory that is allocated to vertices is not sequential? If it isnt, how do I force it to be? Is it something else?
(The data is read from an object which also has a "TextureVertex* vertices" of the same length.
Instead of reading a model from a huge obj-file (21 mb) I made a simple binary format which i wrote data to. But when I try to read it I get problems. It happens when I want to read an array of vertices. I get an access violation on the read line.
[source lang="cpp"]vertices = new TextureVertex[numVertices];
buffer.read((char*) &vertices, sizeof(TextureVertex) * numVertices);[/source]
The value of numVertices is 10920, and the data IS in the stream I read from.
Is it possible that the memory that is allocated to vertices is not sequential? If it isnt, how do I force it to be? Is it something else?
(The data is read from an object which also has a "TextureVertex* vertices" of the same length.