Vertex Buffers and Dynamic Arrays

Started by
1 comment, last by DavidClarke 20 years, 8 months ago
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?
Advertisement
Yes, D3D wants a fixed size buffer, which should be set to your maximum size, or larger. You can tell it to use a subset of the vertex buffer when drawing.
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.
____________________________________________________________AAAAA: American Association Against Adobe AcrobatYou know you hate PDFs...

This topic is closed to new replies.

Advertisement