Archived

This topic is now archived and is closed to further replies.

Jankey

Memmory problems ....

Recommended Posts

I''ve got a Problem with the Memmory! I try to Allocate some Memory for 3D Models in OpenGL, so i usw the "new" command, the first time when i use the command it works, the second time it does''nt... there is enought free Memmory, and i don''t use Malloc, so where is the Error? J@n

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
double check your numbers, once instead of doing something like new char[end-start], I''ve done new char[start-end] which makes a humongous unsigned number. also, try recompiling and restarting.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
And the Funniest thing is that it allready Worked....
________________________________________________________

// SPLATEN ZEILEN SPITZEN
int numvertex = (res) * (res - 1) + 2;
// MITTELBLATT 2 * SPITZEN
int numfaces = 2 * (res-2) * res + (res * 2);

object.nvertices = numvertex;
object.nfaces = numfaces;

object.pvertices = new Point3f[numvertex+1];
object.pfaces = new Face[numfaces+1];

________________________________________________________

Share this post


Link to post
Share on other sites