• Create Account

### #Actualmhagain

Posted 19 January 2013 - 07:16 PM

Something seriously wrong if that's the way you're drawing in D3D; the equivalent D3D code should look more like this:

device->SetStreamSource (...);
device->SetVertexDeclaration (...);
device->SetIndices (...);
device->DrawIndexedPrimitive (...);

However, from the look of things, you're not even using vertex buffers at all, but system memory pointers instead, so the following may be more appropriate if so:

device->SetVertexDeclaration (...);
device->DrawIndexedPrimitiveUP (...);

What's more, if you're just using the fixed pipeline, you don't even need to bother creating a vertex declaration at all, so it becomes:

device->SetFVF (D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1);
device->DrawIndexedPrimitiveUP (...);

As you can see, all of these cases are substantially simpler than the GL code.

### #2mhagain

Posted 19 January 2013 - 07:15 PM

Something seriously wrong if that's the way you're drawing in D3D; the equivalent D3D code should look more like this:

device->SetStreamSource (...);
device->SetVertexDeclaration (...);
device->SetIndices (...);
device->DrawIndexedPrimitive (...);

However, from the look of things, you're not even using vertex buffers at all, but system memory pointers instead, so the following may be more appropriate if so:

device->SetVertexDeclaration (...);
device->DrawIndexedPrimitiveUP (...);

What's more, if you're just using the fixed pipeline, you don't even need to bother creating a vertex declaration at all, so it becomes:

device->SetFVF (D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX0);
device->DrawIndexedPrimitiveUP (...);


As you can see, all of these cases are substantially simpler than the GL code.

### #1mhagain

Posted 19 January 2013 - 07:11 PM

Something seriously wrong if that's the way you're drawing in D3D; the equivalent D3D code should look more like this:

	device->SetStreamSource (...);
device->SetVertexDeclaration (...);
device->SetIndices (...);
device->DrawIndexedPrimitive (...);


However, from the look of things, you're not even using vertex buffers at all, but system memory pointers instead, so the following may be more appropriate if so:

	device->SetVertexDeclaration (...);
device->DrawIndexedPrimitiveUP (...);


As you can see, both cases are substantially simpler than the GL code.

PARTNERS