DirectX Version Confusion

Started by
4 comments, last by pulpfist 17 years, 5 months ago
I posted this in the DirectX forum but didn't get a response, i guess in all honesty its a begginer thing. Basically i'd like to know what i need to take into consideration when writing for a DX7 environment. I understand that there are certain things you can't do certain things (normal maps etc.) but my misunderstanding comes a bit lower than that. I've been going through some DirectX 9 tutorials and i want to write a game for a system that is only DirectX7 compatible. But do i need to set up my compiler differently (looking at DX7 librarys instead of DX9)? do i need to create a DX7 device, serface etc.? or will the DX9 one work but just drops to DX7 level? What i would ultimatly like to to is get my game to query the hardware and then set up the correct things for the best level, is that possible? and if so does anyone know any resources i could look at? Any help would be great.
Advertisement
// Check for hardware T&L
D3DCAPS9 D3DCaps;
g_pD3D9->GetDeviceCaps( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &D3DCaps );
DWORD vertexProcessing = 0;
if ( D3DCaps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT )
{
vertexProcessing = D3DCREATE_HARDWARE_VERTEXPROCESSING;
// Check for pure device
if ( D3DCaps.DevCaps & D3DDEVCAPS_PUREDEVICE )
{
vertexProcessing |= D3DCREATE_PUREDEVICE;
}
}
else
{
vertexProcessing = D3DCREATE_SOFTWARE_VERTEXPROCESSING;
}


The above is taken from an online tutorial. Is this the part of the code that decides what the current machine is capable of?
Nope, unfortunately that code is pretty much worthless for what you want to do..;P

You're going to just have to point your compiler include and library paths to the DX7 SDK, and you'll have to use the DX7 API to create the Direct3D surfaces you want.

To answer your other question, no you can't create a DX9 one and then expect the system to "drop it down" to DX7. The API between DX7 and DX9 has changed (a lot) for device creation, so the best bet is to go through the DX7 samples that are bundled with the SDK (or find a really old book that uses the DX7 SDK).

Once you create your Direct3D surfaces, you can then do the querying you need.

hth,
Yeah that does help thanks.

Although i have just looked at the latest DirectX SDK and in the lib and include files there doesn't seem to be anything that jumps out as being DX7. I can see D3D8.lib, but nothing to for 7. Is that because it just uses DirectDraw?

Also if you could point me to the samples that would be most useful as i'm having trouble finding them in the Sample folder.

Thanks again.
Oh you're not gonna find anything other then DX9.0c related in the current SDK's. :)

For DX7 samples and libraries, you need to have the SDK itself (which MS hasn't hosted for years).

Here's where I pull any Directx SDK archive from:

http://ftp.ncnu.edu.tw/MsDownload/directx/

hth,
DirectDraw has not been under development since version 7, but is still shipped along with the latest versions as ddraw.h and ddraw.lib.

They contain all you need to set up a so called flipping chain and create surfaces

This topic is closed to new replies.

Advertisement