Archived

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

31337

Determining If Hardware Vertex Processing is Available

Recommended Posts

31337    100
I''m going through the NeXe tutorials (I''m trying to learn DirectX), and I''m at http://nexe.gamedev.net/tutorials/ViewTutorial.asp?tutorialfile=Pages/Tutorial2.myxml And the author states - "Next we tell it to use software vertex processing, if we took some extra time we could make some code to check for a T&L device and use hardware vertex processing if it''s there. I might show you how to do that later, but you can look it up in the SDK if you want to know now." And that is in reference to - "g_hr=g_pDirect3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, g_hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &presentParameters, &g_pDevice ); " So my question, as you''ve probably guessed so far, is how do I detect a hardware vertex processing capable video card? I''ve checked through the SDK but I couldn''t find it Please help, thanks a bunch.

Share this post


Link to post
Share on other sites
31337    100
I would take route #1, but the D3DCAPS9 structure is fricken huge! So I''m going to opt for route #2. Actually, maybe I will just bust out route #1, ugh this is a tough decision

By the way nice website.

Share this post


Link to post
Share on other sites
GarlandIX    212
Here is how I do it:

// note: this is D3D8 code (the last time I wrote a DX program was before DX9 was released), so I''m not sure if its different in DX9 (probably not)


D3DCAPS8 caps;
pD3D->GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &caps);
if (caps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT)
{
behavior = D3DCREATE_HARDWARE_VERTEXPROCESSING;
sprintf(szDeviceStats, "Hardware Vertex Processing -");
}
else
{
behavior = D3DCREATE_SOFTWARE_VERTEXPROCESSING;
sprintf(szDeviceStats, "Software Vertex Processing -");
}
// and then behavior is passed to CreateDevice()

hr = pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, behavior, &d3dpp, &pDevice);


------------------------------
BASIC programmers don''t die, they just GOSUB and don''t return.

Share this post


Link to post
Share on other sites