Jump to content
  • Advertisement
Sign in to follow this  
programwizard

HAL not available?

This topic is 4552 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

Whenever I call CreateDevice, it returns D3DERR_NOTAVAILABLE. I'm guessing it has something to do with the D3DDEVTYPE_HAL parameter, because HAL doesn't show up in the D3D Cps Viewer Utility, only a folder for Reference, although there is a bit of text about a D3D HAL driver in the DirectX portion in the Control Panel, and the box "Enable Hardware Accelerating" is checked. Here is my CreateDevice function: D3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &Device); And here are my D3D Present Parameters: d3dpp.Windowed=TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; d3dpp.BackBufferFormat = D3DFMT_UNKNOWN; I'm using the February 2006 SDK. If anyone could tell me why this isn't working, I'd greatly appreciate it.

Share this post


Link to post
Share on other sites
Advertisement
If HAL doesn't show up in the caps viewer, then it could indicate one of a few things:

1) The driver for your graphics card is too old to be recognised by newer versions of Direct3D. You'll need at least DirectX 6 level drivers for newer versions of D3D to see the HAL of the card.

2) DirectX isn't properly installed or has somehow become broken.

3) The "Hardware acceleration" slider in the Advanced section of your Display Properties is set to None.

4) Some other part of your Windows installation has somehow become broken (including manually installed/maintained drivers and bad drivers for system components like PCI routing).

5) The drivers for your graphics card are broken/incorrectly installed.

6) You have an old (or laptop) multi monitor configuration on your machine and/or that configuration has become broken. Some multimonitor configurations show up as multiple HAL's - when broken/old, one of those has no usable features.

7) a bad BIOS setting causing problems for your graphics card (interrupts, port mapping ranges, AGP aperture size, etc - all can provide hours of 'fun' if incorrectly set).


Try running DXDIAG (type DXDIAG into Start->Run...)and run all the tests for the display adapter(s) in the system, that will give you a better idea of what DirectX /really/ thinks is installed in your system.

If DXDIAG still thinks you have no hardware devices, first check the obvious things above, then try re-installing DirectX and the drivers for your graphics hardware.

Share this post


Link to post
Share on other sites
I updated the drivers for my video card, so DXDIAG runs all of its D3D tests perfectly, the SDK Samples no longer display a dialog about switching to REF, and HAL appears in the D3D Caps Viewer. However, my CreateDevice function is now returning D3D_INVALIDCALLL. The SDK samples all use DXUT, so it's hard to tell how they are calling CreateDevice. The syntax of my CreateDevice function hasn't changed, nor have my D3D Present Parameters. If anyone could explain the meaning of this error, I'd greatly appreciate it.

Share this post


Link to post
Share on other sites
Is it not outputting any error info along with it? For me, directx would usually spit out a more specific problem in the output window of visual studio.

Share this post


Link to post
Share on other sites
Your presentation parameter list seems incomplete. Is this all you have, or did you not post all of it?

I'm not sure if they are required, but I think it'll be a good idea to specify the backbuffer height and width, as a minimum. I'd also specify the AutoDepthStencilEnable value, and the AutoDepthStencil format, even if this isn't used (as someone here said recently).
If it's still failing, I'd specify as many of the values as I could, just to be sure I wasn't missing anything.

Hoep this helps.

Share this post


Link to post
Share on other sites
Quote:
Original post by programwizard
The SDK samples all use DXUT, so it's hard to tell how they are calling CreateDevice.
Try looking at the six tutorials (in the Samples\tutorials\ folder) rather than the actual samples. D3D9 tutorials don't use DXUT, so you can see the "pure" function calls...

hth
Jack

Share this post


Link to post
Share on other sites
I saw those tutorials, they use the same PP's as I am using. Could there be a problem in how I am creating a window?

Yes, I am using ZeroMemory.

No, the error message isn't very complete. I'm not doing a whole lot to error check; all I have is is the function returns INVALIDCALL, the program quits.

I'll try specifying BackBufferWidth and Height.

Share this post


Link to post
Share on other sites
My Present Parameters now look as such:

D3DPRESENT_PARAMETERS d3dpp;

ZeroMemory( &d3dpp, sizeof(d3dpp) );
d3dpp.Windowed=TRUE;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.BackBufferFormat=D3DFMT_UNKNOWN;
d3dpp.BackBufferCount=1;
d3dpp.BackBufferHeight=0;
d3dpp.BackBufferWidth=0;

I'm not sure if any of these are correct for a HAL device, but these are the exact same parameters used by the D3D tutorials in the SDK. However, I'm still getting an INVALIDCALL.

I have a breakpoint right before the CreateDevice function, but after the pp's are created. While debugging, it informs me that d3dpp.BackBufferFormat is D3DFMT_X8R8G8B8, even though it's clearly being set to D3DFMT_UNKNOWN. Could this be the problem?

Share this post


Link to post
Share on other sites
Quote:
Original post by programwizard
I'm not sure if any of these are correct for a HAL device, but these are the exact same parameters used by the D3D tutorials in the SDK. However, I'm still getting an INVALIDCALL.


Whenever Direct3D returns an error such as D3DERR_INVALIDCALL, it usually tells you **why** in the debug output stream.
1) Link with d3d9d.lib and d3dx9d.lib (notice the d's).
2) run your program in the debugger (press F5 in MSVC).
3) when D3D returns the error, look at the "Output" window/tab in the IDE.
4) some more explanation for the error will be there.

Since your presentation parameters and other flags look ok, a problem with the window handle you're passing is the next thing I suspect - the debug output should tell us more.

Quote:
I have a breakpoint right before the CreateDevice function, but after the pp's are created. While debugging, it informs me that d3dpp.BackBufferFormat is D3DFMT_X8R8G8B8, even though it's clearly being set to D3DFMT_UNKNOWN. Could this be the problem?


Specifying D3DFMT_UNKNOWN is valid when Windowed is TRUE - it simply means "please use the same format as the desktop". CreateDevice() can and will modify members of the D3DPRESENT_PARAMETERS structure you passed to it. It's likely doing that with the format - replacing the UNKNOWN with the current known format.

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!