I have made a class that looks like this:
Than I made the STL list and iterator:Code:class DLLIMPORT Object { private: float x, y, z; public: LPDIRECT3DVERTEXBUFFER9 vertexbuffer; //Main point here Object(); void AddVertexBuffer(VERTEXBUFFER buf); };
Than I tried to use the iter to get the vertexbuffer from the class and use it:Code:list<Object> objects; list<Object>::iterator iter;
It compiles fine but when I run it, it gives a windows error saying the program had to close. Am I not alowed to use a varaible from the class or is there a better way? I can not use STL vectors or stacks/deques for certain reasons I already looked over.Code:for (iter = objects.begin(); iter != objects.end(); iter++) { device->SetStreamSource(0, iter->vertexbuffer, 0, sizeof(CUSTOMVERTEX)); //Main point here } device->SetFVF(D3DFVF_CUSTOMVERTEX); device->DrawPrimitive(D3DPT_TRIANGLELIST, 0, objects.size());



LinkBack URL
About LinkBacks



Want to add some