XNA/DirectX 10/11 - Can VertexBuffer be reused? -


i use vertexbuffers in xna. question can reused? mean is: 1. put data in vertexbuffer 2. after time data becomes obsolete 3. put new data sam vertexbuffer (without disposing)

in code this

var verts = new ... vertexbuffer vb = new ... vb.setdata(verts); ...some time passes vb becomes obsolete... var verts2 = new ... vb.setdata(verts2); 

yes... although you'll want declare vertex buffer type dynamicvertexbuffer (instead of plain old vertexbuffer) , subscribe contentlost event repopulate buffer in case it's lost (due memory pressure on graphics card example).


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -