|
-
Sep 17th, 2002, 06:43 AM
#1
Thread Starter
Evil Genius
Does the pc support HAL?
I'm doing the tutorials off the DirectX4VB sites, which are going pretty well, now I've hit this bit of code.
Surely there's a better way to distinquish whether HAL is supported or not!
Have any of you written alternatives to this one?
VB Code:
Direct3D.GetDeviceCaps AdapterName, D3DDEVTYPE_HAL, CapsReturnValue
If Err.Number = D3DERR_NOTAVAILABLE Then
' Doesn't Support HAL Layer
Thanks!
-
Sep 17th, 2002, 09:28 AM
#2
Lively Member
why dont u like the code?
-
Sep 17th, 2002, 09:36 AM
#3
Thread Starter
Evil Genius
I usually try to trap the error before it happens & use the error handling routine as a very last resort. This is an example below, 99% of the time I can do this type of thing, I wondered if I could using this GetDeviceCaps call. 
VB Code:
If Not (Dx Is Nothing) Then
Set D3D = Dx.Direct3DCreate
Else
'Error Handled Here
End If
As opposed to:
VB Code:
On error goto errHandler
Set D3D = Dx.Direct3DCreate
errHandler:
'Error Handled Here
-
Sep 17th, 2002, 10:40 AM
#4
Frenzied Member
Its not an error handler. All COM objects SHOULD return an HRESULT from ALL functions. Since VB is COM aware, it hides this away from you, and instead, just sticks the value into Err.Number. It does not actually cause an error (at least, it shouldnt =).
Z.
-
Sep 17th, 2002, 10:43 AM
#5
Lively Member
Im afraid I cant help u on that 1. Maybe 1 of the other guys can. Good to see some1 else working through the tutorials. I am now on lesson 16 so if u get stuck on earlier lessons its all pretty fresh in my head if u need help. Coded every lesson 3 times over just to get it to sink in. Hope it goes well for u .
Dan
-
Sep 17th, 2002, 12:40 PM
#6
Thread Starter
Evil Genius
You too Dan, some of the stuff you can do with the DirectX libraries look pretty funky - I'm going to have some fun by the time I've finished them, thanks for the suggestion, I'll bear that in mind. 
Zaei, ok you're right, I'm just probably paranoid, but I like to keep the code in a readable state too, rather than stepping through code & it zooming off to the error handler, I've got a bit more control over the structure - I just prefer writing it like this.
Whilst you're right, do you know of any other way to do this please?
-
Sep 17th, 2002, 12:43 PM
#7
Frenzied Member
D3D.GetDeviceCaps().
Check the DeviceType Member of the D3DCAPS8 type. Check the SDK Docs for more info.
Z.
-
Sep 17th, 2002, 02:36 PM
#8
Frenzied Member
HAL is part of the NT-Win2K-XP-Alpha family. If you check the OS, you know if HAL support is there or not. Consumer Windows doesn't have a HAL - Hardware Abstraction Layer
Which is of course, bass-ackwards from what you wanted.
-
Sep 17th, 2002, 02:43 PM
#9
Frenzied Member
Seems DirectX is using HAL in a new, not really right, manner =).
Thanks for the extra info, jim! =).
Z.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|