Jump to content
  • Advertisement
Sign in to follow this  
scitmon

unable to create create D3D device

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

OK, check this code out:
D3DPRESENT_PARAMETERS d3dpp;
ZeroMemory( &d3dpp, sizeof(d3dpp) );

d3dpp.Windowed               = TRUE;
d3dpp.EnableAutoDepthStencil = FALSE;
d3dpp.AutoDepthStencilFormat = D3DFMT_D16;
d3dpp.SwapEffect             = D3DSWAPEFFECT_DISCARD;
d3dpp.BackBufferWidth        = BBWidth;
d3dpp.BackBufferHeight       = BBHeight;
d3dpp.BackBufferFormat       = D3DFMT_X8R8G8B8;
d3dpp.PresentationInterval   = D3DPRESENT_INTERVAL_IMMEDIATE;

HRESULT hWnd2;

hWnd2 = g_pD3D->CreateDevice(D3DADAPTER_DEFAULT, 
			     D3DDEVTYPE_HAL, 
			     hWnd,
			     D3DCREATE_SOFTWARE_VERTEXPROCESSING,
			     &d3dpp, 
			    &g_pd3dDevice );
	
if(FAILED(hWnd2))
{
     if(hWnd2 == D3DERR_INVALIDCALL)
	MessageBox(NULL, "Parameters invalid","", MB_OK);
		
     if(hWnd2 == D3DERR_NOTAVAILABLE)
	MessageBox(NULL, "device does not support","", MB_OK);
		
     if(hWnd2 == D3DERR_OUTOFVIDEOMEMORY)
	MessageBox(NULL, "Out of Memory","", MB_OK);
}

On my Ati Radeon X800 system, it works perfectly. However, on my GeForce FX 5200 system (running Dual View if that matters), it returns the "device does not support" error message. I'm puzzled why one works but not the other... can someone enlighten me?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by DrunkenHyena
If you have the debug runtime installed, the debug spew will tell you why it's failing. See the D3D debugging section in the Forum FAQ.


I'm not exactly sure what you mean by the "debug spew".

I added the DXTRACE_ERR_MSGBOX to my code like the article suggested, which told me the device was failing with a "D3DERR_NOTAVAILABLE" error. Which was nothing i didn't know already...

Share this post


Link to post
Share on other sites
He means the debug output that the debug dx runtime produces.

If you have the debug runtime installed, there should be an option to use that instead of the release runtime somewhere on your start menu. Switch to the debug runtime, restart, and then go to the control panel, open the DirectX properties dialog and whack the direct3d debug output settings up.

Now when you run the application it should vomit forth a whole load of debug output that should help you narrow it down.

Share this post


Link to post
Share on other sites
From the FAQ:

How do I debug a DirectX application?

More or less the same way as you debug anything else. However, there are some useful DirectX-specific things I should mention here. First, the DirectX debug runtime can be configured to print out debugging messages, which are often extremely useful. Through the DirectX Control Panel, you can set the level
of messages that you want (the highest level will tell you about anything and everything that DirectX does, while the lower levels will only tell you about particularly important events, like errors). To view the messages, you need a debug viewer; Microsoft Visual Studio has one built in (the "Debug" pane), while people using other setups could use a utility like DebugView.

Share this post


Link to post
Share on other sites
Quote:
Original post by DrunkenHyena
From the FAQ:

How do I debug a DirectX application?

More or less the same way as you debug anything else. However, there are some useful DirectX-specific things I should mention here. First, the DirectX debug runtime can be configured to print out debugging messages, which are often extremely useful. Through the DirectX Control Panel, you can set the level
of messages that you want (the highest level will tell you about anything and everything that DirectX does, while the lower levels will only tell you about particularly important events, like errors). To view the messages, you need a debug viewer; Microsoft Visual Studio has one built in (the "Debug" pane), while people using other setups could use a utility like DebugView.


Ok I understand. Currently there isn't anything DirectX related being spewed to the debug pane. So I guess i need to set it to in the "DirectX Control Panel". Is this something within Visual Studio (i am using v6)? I cant seem to find this control panel...

Thanks for your help so far BTW :)

Share this post


Link to post
Share on other sites
Quote:
Original post by Sandman
No, it should be an icon in the windows control panel, e.g Start->Settings->Control Panel.


nothing there....

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!