Results 1 to 3 of 3

Thread: Graphic acceleration

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2000
    Location
    Sweden
    Posts
    37

    Cool

    I was just wondering how u use the computers graphic acc. card (if there is any). Is this handled automaticly by DirectX? Or do u have to write special code to use it?
    I'm not asking for a mile of code ...just an explanation on how this procedure works.

    Thanks!
    Balder = Viking God
    VB6/VC++ Enterprise Editions

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Something along the following lines ...

    Code:
    Set g_D3DDevice = g_D3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, d3dpp)
    
    Set g_D3DDevice = g_D3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, d3dpp)
    Im not an expert on DirectX, but I know that in the code you can tell it whether to use Software or Hardware Rendering etc.

    - jamie
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  3. #3
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Generally you don't have to tell it to, DirectX will allow you to either access the hardware acceleration through the HAL (Hardware Abstraction Layer) or, if what you're doing isn't available in hardware, it will arrange for it to be done in software for you in the HEL (Hardware Emulation Layer).

    It's all a very sensible idea. There are a few things that are supported in the HAL only, in most cases because they are just too slow in software. An example is bitmap rotation. This is supported in the HAL, but MS found however well they wrote the code in software, it was far too slow, so if you want to do it you have to either hope the hardware allows it (which is rare at the moment) or write your own software rotation routine.

    You can check the capabilities of the system at run-time anyway, and adjust your program accordingly. In C you would probably use function pointers or polymorphism to achieve this, but in VB I think you'd have to either have a lot of Select Case and If statements, which slows things down a little (not much) or use CallByName. Not sure how fast that is.
    Harry.

    "From one thing, know ten thousand things."

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