Click to See Complete Forum and Search --> : Graphic acceleration
Balder
Feb 14th, 2001, 06:30 AM
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!
plenderj
Feb 14th, 2001, 06:36 AM
Something along the following lines ...
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
HarryW
Feb 14th, 2001, 07:40 AM
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.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.