Discussion:
Drawing range of vertex array using DrawUserPrimitives
(too old to reply)
m***@gmail.com
2008-01-30 07:24:54 UTC
Permalink
Hi,

is it possible to render using DrawUserPrimitives starting from non 0
array index?

for example, below code renders all data from array vdata:

CustomVertex.PositionNormalColored vdata = new
CustomVertex.PositionNormalColored[30];
dev.DrawUserPrimitives(PrimitiveType.TriangleList, vdata.Length,
vdata);

but suppose I would like to render only second half:

CustomVertex.PositionNormalColored vdata = new
CustomVertex.PositionNormalColored[30];
dev.DrawUserPrimitives(PrimitiveType.TriangleList, vdata.Length/2,
&vdata[15]); //<- Wrong!

How to refere to second array half without creating new array?

Martin
legalize+ (Richard [Microsoft Direct3D MVP])
2008-02-01 01:30:28 UTC
Permalink
[Please do not mail me a copy of your followup]
Post by m***@gmail.com
is it possible to render using DrawUserPrimitives starting from non 0
array index?
Use a vertex buffer (and possibly an index buffer) instead.
--
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
<http://www.xmission.com/~legalize/book/download/index.html>

Legalize Adulthood! <http://blogs.xmission.com/legalize/>
Loading...