Jump to content
  • Advertisement
Sign in to follow this  

Copy data into VertexBuffer

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.


Share this post

Link to post
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 :D

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 :)

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!