Results 1 to 9 of 9

Thread: Does the pc support HAL?

  1. #1

    Thread Starter
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538

    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:
    1. Direct3D.GetDeviceCaps AdapterName, D3DDEVTYPE_HAL, CapsReturnValue
    2.    
    3. If Err.Number = D3DERR_NOTAVAILABLE Then
    4.     ' Doesn't Support HAL Layer

    Thanks!

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  2. #2
    Lively Member
    Join Date
    Jul 2002
    Posts
    118
    why dont u like the code?

  3. #3

    Thread Starter
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    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:
    1. If Not (Dx Is Nothing) Then
    2.     Set D3D = Dx.Direct3DCreate
    3. Else
    4.     'Error Handled Here
    5. End If
    As opposed to:
    VB Code:
    1. On error goto errHandler
    2.     Set D3D = Dx.Direct3DCreate
    3.  
    4. errHandler:
    5.     'Error Handled Here

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  4. #4
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    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.

  5. #5
    Lively Member
    Join Date
    Jul 2002
    Posts
    118
    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

  6. #6

    Thread Starter
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    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?

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  7. #7
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    D3D.GetDeviceCaps().

    Check the DeviceType Member of the D3DCAPS8 type. Check the SDK Docs for more info.

    Z.

  8. #8
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    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.

  9. #9
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    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
  •  



Click Here to Expand Forum to Full Width