Sign in to follow this  

D3DDEVTYPE_HAL causing problems

Recommended Posts

For some reason when calling CreateDevice(), D3DDEVTYPE_HAL is causing the initialization to fail. D3DDEVTYPE_REF works.. how ever I'm working off my gaming comp that has a geforce 8800 gts, so there is no reason that D3DDEVTYPE_HAL should be causing the call to fail. Does anyone have any ideas what could be causing the problem?

Share this post

Link to post
Share on other sites
heres my code, I'll post debug info when I wake up in the morning (im really tired)

this->width = width;
this->height = height;
this->winHandle = hwnd;
this->winInstance = hInstance;
this->windowed = windowed;
this->direct3D9 = Direct3DCreate9(D3D_SDK_VERSION);

ZeroMemory(&this->engineParameters, sizeof(D3DPRESENT_PARAMETERS));

this->engineParameters.BackBufferCount = 1;
this->engineParameters.Windowed = FALSE;
this->engineParameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
this->engineParameters.hDeviceWindow = this->winHandle;
this->engineParameters.BackBufferFormat = D3DFMT_X8R8G8B8;
this->engineParameters.BackBufferWidth = this->width;
this->engineParameters.BackBufferHeight = this->height;
this->engineParameters.EnableAutoDepthStencil = TRUE;
this->engineParameters.AutoDepthStencilFormat = D3DFMT_D16_LOCKABLE;

//creating device
this->direct3D9->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &this->engineParameters, &this->device);

Share this post

Link to post
Share on other sites
You are probably using some combination of parameters that you GPU doesn't support. D3DDEVTYPE_REF is microsofts software reference driver, so it supports everything, and is pretty much garanteed to not fail on initialization.

My best bet would be that your card doesn't support D3DFMT_D16_LOCKABLE for AutoDepthStencilFormat. Try changing it to D3DFMT_D16 and see if it still fails.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this