Jump to content
  • Advertisement
Sign in to follow this  
ta0soft

ATI issue?

This topic is 2655 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

I've tested my program on various pc's with Nvidia cards and everything runs fine, but today I sent it to a friend on a ATI Radeon 5770 system and it failed creating the d3d device.


DWORD CreateDevice()
{
p_Object = Direct3DCreate9(D3D_SDK_VERSION);
if (!BeforeCreateDevice()) return BEFORECREATE_FAILED;
if (FAILED(p_Object->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, p_Window->Get_Handle(), D3DCREATE_HARDWARE_VERTEXPROCESSING, &p_PresentParams, &p_Device))) return CREATEDEVICE_FAILED;
return 0;
}

bool BeforeCreateDevice()
{
if (FAILED(p_Object->GetAdapterIdentifier(D3DADAPTER_DEFAULT, 0, &p_AdapterId))) return false;
if (FAILED(p_Object->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &p_DisplayMode))) return false;

p_PresentParams.AutoDepthStencilFormat = D3DFMT_D16;
p_PresentParams.BackBufferCount = 1;
p_PresentParams.BackBufferFormat = p_DisplayMode.Format;
p_PresentParams.EnableAutoDepthStencil = TRUE;
p_PresentParams.Flags = D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL;
p_PresentParams.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
p_PresentParams.hDeviceWindow = p_Window->Get_Handle();
p_PresentParams.SwapEffect = D3DSWAPEFFECT_DISCARD;

if (p_FullScreen)
{
p_PresentParams.BackBufferWidth = p_Window->Get_ScreenWidth();
p_PresentParams.BackBufferHeight = p_Window->Get_ScreenHeight();
p_PresentParams.Windowed = FALSE;
}
else
{
p_PresentParams.BackBufferWidth = 0;
p_PresentParams.BackBufferHeight = 0;
p_PresentParams.Windowed = TRUE;
}

if (p_VSync) p_PresentParams.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
else p_PresentParams.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;

return true;
};


I'm not using any nvidia-specific code as far as I know, I don't know whats causing it to fail :(

Share this post


Link to post
Share on other sites
Advertisement
Sorry for the late reply, I took a much needed break from coding lol.

CreateDevice() returns D3DERR_INVALIDCALL. I still can't figure out whats causing it. This is the full code:


DWORD CreateDevice()
{
p_Object = Direct3DCreate9(D3D_SDK_VERSION);
if (!BeforeCreateDevice()) return BEFORECREATE_FAILED;

HRESULT hr = p_Object->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, p_Window->Get_Handle(), D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_PUREDEVICE, &p_PresentParams, &p_Device);
if (FAILED(hr))
{
hr = p_Object->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, p_Window->Get_Handle(), D3DCREATE_HARDWARE_VERTEXPROCESSING, &p_PresentParams, &p_Device);
if (FAILED(hr))
{
error->Set(CREATEDEVICE_FAILED, Get_D3DErrorW(hr), L"IDirect3D9::CreateDevice()");
return CREATEDEVICE_FAILED;
}
}

if (!AfterCreateDevice()) return AFTERCREATE_FAILED;
return 0;
}


The strange thing is his card supports DX11, he should be able to run this program just fine. He can run other D3D9 games. Here's a screenshot of his dxdiag screen: http://dl.dropbox.co...1628/dxdiag.png

Share this post


Link to post
Share on other sites
If you're not doing it elsewhere, you might try zeroing out the present parameters to ensure you're getting what you think you're asking for.


ZeroMemory( &p_PresentParams, sizeof( D3DPRESENT_PARAMETERS));

p_PresentParams.AutoDepthStencilFormat = ....;
// etc.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!