Jump to content

  • Log In with Google      Sign In   
  • Create Account

Question!


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 lomateron   Members   -  Reputation: 342

Like
0Likes
Like

Posted 15 March 2012 - 12:27 PM

Is there any way of changing a vertex buffer, like the position, in the c++ code file(not in the .fx), after being created.

Sponsor:

#2 Washu   Senior Moderators   -  Reputation: 5178

Like
0Likes
Like

Posted 15 March 2012 - 12:29 PM

Depends on the flags you passed when creating the vertex buffer.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.
ScapeCode - Blog | SlimDX


#3 lomateron   Members   -  Reputation: 342

Like
0Likes
Like

Posted 15 March 2012 - 12:32 PM

Ok, itis D3D10_USAGE_DYNAMIC, now how is the code to change it, the vertex buffer only has one vertice and it only is position, no more that that.

#4 MJP   Moderators   -  Reputation: 11307

Like
0Likes
Like

Posted 15 March 2012 - 12:43 PM

Call Map on the ID3D10Buffer, and pass D3D10_MAP_WRITE_DISCARD. You can then use the pointer you get from the ppData parameter to fill in the vertex data. Call Unmap when you're done, and it's ready to use.

#5 lomateron   Members   -  Reputation: 342

Like
0Likes
Like

Posted 15 March 2012 - 01:06 PM

What?! /(*-*)/
Got this
ID3D10Buffer* g_pVertexBuffer = NULL;
Now pass this as flag in the description? D3D10_MAP_WRITE_DISCARD?
the ppData parameter?What?! Where is that?
Call Unmap?
:(
Can you show me the code?

#6 lomateron   Members   -  Reputation: 342

Like
0Likes
Like

Posted 15 March 2012 - 01:27 PM

ok now i know i found the explanation in the Franks D. Luna book




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS