Jump to content
  • Advertisement
Sign in to follow this  
Deemo24

DirectX Version Confusion

This topic is 4332 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 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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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,

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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,

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!