Determining If Hardware Vertex Processing is Available

Started by
4 comments, last by 31337 20 years, 7 months ago
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.
OpenGL Revolutions http://students.hightechhigh.org/~jjensen/
Advertisement
1. Check the device capabilities with IDirect3DDevice*::GetDeviceCaps.

2. Try creating the device using hardware vertex processing. If that fails, try creating it with software vertex processing. If that fails, you have a problem.

---
Brent Gunning | My Site | Article Thoughts: "On Batching"
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.
OpenGL Revolutions http://students.hightechhigh.org/~jjensen/
Go for #1, just search the DirectX Forum. The code is easy as a bird!

.lick
Chances are you''ll have to check caps for other things anyway. So just get the caps.

I like pie.
[sub]My spoon is too big.[/sub]
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.
------------------------------BASIC programmers don't die, they just GOSUB and don't return.

This topic is closed to new replies.

Advertisement