Archived

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

vertex processing in direct3d

This topic is 5516 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i heard that for maximum compatibility i shoud use D3DCREATE_SOFTWARE_VERTEXPROCESSING when creating a device in direct3d Is that right ? is there a way to test if the hardware is able to perform hardware processing, so i could use the flag D3DCREATE_HARDWARE_VERTEXPROCESSING i am a little bit lost.....

Share this post


Link to post
Share on other sites
Yes, before you create the device, call:
IDirect3D8::GetDeviceCaps()
with the adapter (often D3DADAPTER_DEFAULT) and device type (almost always D3DDEVTYPE_HAL), and a pointer to a D3DCAPS8 struct.

Then, check:
(Caps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT)

if it's greater than 0 (ie it's true), then the device supports transform and lighting in hardware, and you can use the D3DCREATE_HARDWARE_VERTEXPROCESSING flag when you create the device. If it's 0 (ie false) then you've got to use software vertex processing.

EDIT ::
On a more general note, you should always check the caps flags before using features that you aren't certain will be supported (in fact, you should always check the caps and dump out gracefully if the card you're running on doesn't support a feature that you really need).

Hope that helps,

John B

[edited by - JohnBSmall on November 9, 2002 8:10:36 AM]

Share this post


Link to post
Share on other sites