Archived

This topic is now archived and is closed to further replies.

DavidClarke

Vertex Buffers and Dynamic Arrays

Recommended Posts

The number of vertices used in my program needs to vary when running i.e. I want to store vertices data dynamically and display them to the screen. I want to use a dynamic array to store the vertex data. However, I meet a brick wall when trying to copy my vertex data to the vertex buffer. From the examples I''ve seen on the net, Direct3D wants a static array i.e an array with a fixed size. Is there any way in which I can copy my size varying vertex data across to the vertex buffer when rendering?

Share this post


Link to post
Share on other sites
Do not make an absurdly large vertex buffer like 20 megabytes. Instead make a smaller one and fill it as needed. When it is full, render, then relock and continue filling.

Share this post


Link to post
Share on other sites