i am currently working on a opengl project and the weirdest thing is happening while using vbo. This has never happend to me before and maybe someone can help me figuring out the reason why this is happening…
Imagin you have a class where you organaze all your geometry of the scene, basicly that class menages all the data including the managing of the VBO as well. (i´m pretty sure you have all done the same sometime)
Inside of that class, i have a structure (like everyone else) that hold the data fo the vertex.
This works fine while declaring the structure as an array…like this:
Now my Vertices are going to be built dymanicly using the operator new…when i declare this:
vertices = new Vertex[TOTAL_VERTICES];
The map of the Vbo is telling that dumps gargabe, only the first value is good the rest are just crazy …
Has this happend to someone before…?? can you point out some reason why this could be happening???
I have tried to debug the code but it´s all good until me map of the buffer…that tells it does not have the right info…
i found this very strange…maybe i´m doing something wrong…then again why it it working, when i don´t use the operator new in my structure…weired…i would love to listen to your thoughts…