• Advertisement

Archived

This topic is now archived and is closed to further replies.

3D HAL

This topic is 6378 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hr = g_directDraw3D->CreateDevice(IID_IDirect3DHALDevice, g_ddrawsBackBuffer, &g_direct3DDevice) ) ) If I try to create the device above I get an error but I know it works because the demo microsoft progs. work with HAL. My question is how can i get HAL to work without enumeration?? ???

Share this post


Link to post
Share on other sites
Advertisement
You don''t have to enumerate to get an HAL device, here''s what I do:

    
if (lpD3D->CreateDevice(IID_IDirect3DTnLHalDevice,lpddsback,&lpD3DDevice) == D3D_OK)
Write_Debug("A TnL Direct3D device was created"); // we got a TnL device

else
if (lpD3D->CreateDevice(IID_IDirect3DHALDevice,lpddsback,&lpD3DDevice) == D3D_OK)
Write_Debug("An HAL Direct3D device was created"); // we got an HAL device

else
if (lpD3D->CreateDevice(IID_IDirect3DMMXDevice,lpddsback,&lpD3DDevice) == D3D_OK)
Write_Debug("A Software MMX Direct3D device was created"); // we got a software MMX device

else
if (lpD3D->CreateDevice(IID_IDirect3DRGBDevice,lpddsback,&lpD3DDevice) == D3D_OK)
Write_Debug("A Software Direct3D device was created"); // we got a software device :/

else
{
Write_Debug("No Direct3D device was created, halting...");
return(0);
}


This code basically tries to create a TnL device, if no go it tries to create an HAL device and so on.
Easier than enumerating



The road to success is always under construction

Share this post


Link to post
Share on other sites

  • Advertisement