Jump to content
  • Advertisement
Sign in to follow this  
TheToad

Questions about call the CreateDevice().

This topic is 4892 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'm going to label myself a Beginner and not a newbie as I have been running across this problem for a couple of years now and have yet to find someone with a definitive answer. I have an older PC (Dell with Intel) that I have just brought up to Windows XP, VC++ 6.0, and directX 9. I also have a pretty new PC (Alienware with a much newer graphics card) with the same setup. When calling the CreateDevice routine on my newer PC, I can use the _D3DDEVTYPE value of 'D3DDEVTYPE_HAL' as the second parameter and my program works beautifully in full screen mode. However, the exact same (a copy) of the code on my older PC fails. On older boxes, I have sometimes gotten around this by using 'D3DDEVTYPE_REF' as the second parameter in my call to CreateDevice(). However, I can't get my game to work on my older PC. My current guess is that my older PC does not support Hardware Acceleration. But if 'REF' doesnt work, what should? Does anyone know (or know of a tutorial) on how 'professional' games create their full windowed devices. Do they use the CreateDevice() routine or not? Is there some checking of the system hardware/software that can be done to properly construct the CreateDevice() parameters. Does anyone have experience with the RegisterSoftwareDevice() routine and using 'D3DDEVTYPE_SW' as the second parameter to CreateDevice().

Share this post


Link to post
Share on other sites
Advertisement
There are currently no TYPE_SW devices in DirectX. Apparently some groups are working on some, but I think none are currently available.

TYPE_REF exists when using the SDK debug libraries. A retail release of DirectX contains no REF. This is meant for debugging, checking if something is a card/driver issue, or something you're doing wrong in your use of the API.

TYPE_HAL is what you'll pretty much always want to use. It may fail because you've asked for a resolution, or depth that isn't valid. A combination of depth and backbuffer that isn't valid. Perhaps you've asked for hardware vertex processing, when only software processing is available.

If you go to the Control Panel, DirectX, Direct3D, turn on the debug libraries (should be two radio buttons for on and off), then re-run your game attached to VStudio (Choose Debug, or Press F5) when it fails your output window should include details about what CreateDevice did not like. If you don't have VStudio on the target machine, there is sysinternals.com's debugview, or dbMon in the platform SDK. Both of these will capture the debug spew from DirectX just like Visual Studio normally would.

Share this post


Link to post
Share on other sites
What do you mean by doesn't work? If your computer grinds to a halt using the reference device on the older PC, that makes sense, because REF is very slow and requires tons of resources. HAL is the hardware abstraction layer, so you'll always want to use that unless you suspect a bug in the drivers of the video card or you want to test something that isn't supported by your video card, in which case you would use the REF device. Hardly ever would you need to use the RegisterSoftwareDevice, so don't even worry about that.

You must use CreateDevice if you want to use Direct3D. There are MANY things that may not be supported by the older PC and video card that could cause it to "not work". You would have to debug the software to find out where it's failing. First thing's first though, we need to know what happens when you create the device with REF on the old PC (i.e. does the debugger step through that and create it okay or fail?)

Check your device capabilities (DEV CAPS) to find out what's supported on a video card. You can do this with a DirectX function call (and should), but for now you can just go to the utilities and run the program (I swear the name is on the tip of my tongue) caps...something. Anyway, it's in the utilities directory of your SDK installation (most likely).

Good luck,
Chris

Share this post


Link to post
Share on other sites
Thanks fellas,

This is bar far the most helpful responses I've received. My apologies to Chris in not including a more detailed description of what I meant by "doesn't work". I basically get the 'An error has occurred do you want to send it to Microsquish' message. I put in debug statements and various breakpoints in VC++ and ran in debug mode and (so far) could only narrow it down to the failure occurring somewhere in the call to CreateDevice().

Gonna double check my resolution params, depth, and the back buffer. Then dig in deeper with the debugging suggestion and finding my Device Capabilities.

Thanks for the help. Mungin' through the direct X docs on this is 'greek' at best. Any info helps!!

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!