Jump to content
  • Advertisement
Sign in to follow this  
Frente

Dx9 CreateDevice Error

This topic is 4818 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 wrote these code in my program: LPDIRECT3DDEVICE9 g_pd3dDevice = NULL; LPDIRECT3D9 D3D = NULL; D3D = Direct3DCreate9( D3D_SDK_VERSION); D3DPRESENT_PARAMETERS d3dpp; ZeroMemory(&d3dpp,sizeof(d3dpp)); d3dpp.Windowed = true; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; d3dpp.BackBufferFormat = D3DFMT_UNKNOWN; d3dpp.BackBufferCount = 1; d3dpp.BackBufferWidth = 640; d3dpp.BackBufferHeight = 480; d3dpp.hDeviceWindow = hwnd; long result = D3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,hwnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp,&g_pd3dDevice); But everytime i got result : D3DERR_INVALIDCALL~~ Could anybody help me ? thx

Share this post


Link to post
Share on other sites
Advertisement
Use the Debug Direct3D runtime, that will tell you why CreateDevice() is returning D3DERR_INVALIDCALL.

For more details see the FAQ: http://www.gamedev.net/community/forums/showfaq.asp?forum_id=10#debugging


From the code you posted, those parameters look ok - though if your window handle (hwnd) was invalid or the wrong type of window (such as a child window), then you'd get an invalidcall error. The debug runtime will tell you for sure.

Share this post


Link to post
Share on other sites
Thank you~
But why i can't find the DirectX Control Panel in my Control Panel???
How could i install it?
I select Install Debug DirectX from the start menu,but it seems did not change anything~
What shoud i do?

Share this post


Link to post
Share on other sites
Oh I get it!
i install the April 2005 update,then i found the control panel.
The code fail because of the hwnd.
Thank You!!

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!