Copy data into VertexBuffer

This topic is 2717 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Hello,
I attached my source. So, what's is the problem ? Let's open the code.

You can see, i created five copies of ST struct and i added them to the list. I copied them from the list to the vertexbuffer.
This is working very well.

But what if i want to make a list of pointers of these structures ? ( commented code ). I don't know, how to dereference them while copying them into memory.
Is there any way, how to copy these structures into vertexbuffer, when deque list contains pointers to data structures ??

I am checking the content in PIX.

Thank you very much.

[attachment=1005:Structtest.zip]

Share on other sites
hmm, i just figure it out.

I wonder, why i always solve a problem after i wrote a message on this forum

Anyway. I used modified function of std::copy

 deque< ST* >::iterator first = list.begin(); deque< ST* >::iterator last = list.end(); ST* data2 = (ST*) data; while(first!=last) *data2++ = **first++; 

I just dereferenced the first variable for a second

1. 1
2. 2
3. 3
4. 4
Rutin
18
5. 5

• 11
• 12
• 9
• 12
• 37
• Forum Statistics

• Total Topics
631420
• Total Posts
2999990
×