HAL not available?

Started by
17 comments, last by S1CA 18 years ago
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.
------------------------------Support the Blue Skies in Games Campaign!A blog... of sorts.As a general rule, if you don't have a general rule in your signature, you aren't as awesome as someone who does. General rules roxor teh big one one ones.
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.

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

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.
------------------------------Support the Blue Skies in Games Campaign!A blog... of sorts.As a general rule, if you don't have a general rule in your signature, you aren't as awesome as someone who does. General rules roxor teh big one one ones.
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.
Sean Henley [C++ Tutor]Rensselaer Polytechnic Institute
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.
Sirob Yes.» - status: Work-O-Rama.
Do you zero your present parameters structure before using it?
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

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

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.
------------------------------Support the Blue Skies in Games Campaign!A blog... of sorts.As a general rule, if you don't have a general rule in your signature, you aren't as awesome as someone who does. General rules roxor teh big one one ones.
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?
------------------------------Support the Blue Skies in Games Campaign!A blog... of sorts.As a general rule, if you don't have a general rule in your signature, you aren't as awesome as someone who does. General rules roxor teh big one one ones.
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.

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

This topic is closed to new replies.

Advertisement