Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DX9 DrawPrimitive not displaying

30 views
Skip to first unread message

listechtony

unread,
Nov 26, 2009, 11:57:01 PM11/26/09
to
I have many vertex buffers and iterate through this list drawing points and
lines using

hResult = p3DDevice->DrawPrimitive( D3DPT_LINELIST, iNumDone,
(int)(iNumMaxVerts/2) );

and

hResult = p3DDevice->DrawPrimitive( D3DPT_POINTLIST, iNumDone,
(int)(iNumMaxVerts) );

where iNumMaxVerts is gained by querying the capabilities of the Device
(1048575).

I am finding that after some time, after I do an EndScene ahd Present to the
sceen, I am not getting any rendering occurring. It is as if there is a
maximum number of primitives that can be rendered to a device on any one
rendering. Is this correct? If I call LINESTRIP rather than LINELIST for
example it seems to work OK, but then I am creating one long line then rather
than many short two point lines, which I is what am want in this case. Note
that I am not exceeding the MaxPrimitiveCount per DrawPrimitive call.

The DrawPrimitive calls are happening for many vertext buffers...

for (int i = 0; i < pCrossVBs.GetCount(); i++){

p3DDevice->SetStreamSource(0, pCrossVBs[i], 0, sizeof( CROSSVERTEX ));
p3DDevice->SetFVF( D3DFVF_CROSSVERTEX );
if (iNumLeftA > iNumMaxVerts ){
hResult = p3DDevice->DrawPrimitive( D3DPT_LINELIST, iNumDone,
(int)(iNumMaxVerts/2) );
iNumDone += iNumMaxVerts;
iNumLeftA -= iNumMaxVerts;


... etc

Richard [Microsoft Direct3D MVP]

unread,
Nov 30, 2009, 6:49:36 PM11/30/09
to
[Please do not mail me a copy of your followup]

Standard questions apply:

- all HRESULTs checked?
- no messages from the debug runtime?
- works the same on REF?
--
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
<http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/>

Legalize Adulthood! <http://legalizeadulthood.wordpress.com>

0 new messages