Jump to content
  • Advertisement
Sign in to follow this  
stenny

[fixed] Freeze at CreateDevice()

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

Heya GameDev! I've got a problem with setting up my Direct3DSystem, and I was wondering if you guys could help me out. Whenever I'm debugging (VSC++EE) my code and the debugger reaches this line of code:
if(FAILED(m_pD3D->CreateDevice(D3DADAPTER_DEFAULT, (m_bHAL) ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &m_D3Dpp, &m_pD3DDevice)))


and I press F11 to go to the next line, the debugger, the app...everything freezes. These are my D3DPRESENT_PARAMETER settings:
m_D3Dpp.Windowed			= bWindowed;
m_D3Dpp.SwapEffect			= D3DSWAPEFFECT_FLIP;
m_D3Dpp.BackBufferWidth			= m_nWidth;
m_D3Dpp.BackBufferHeight		= m_nHeight;
m_D3Dpp.FullScreen_RefreshRateInHz	= D3DPRESENT_RATE_DEFAULT;
m_D3Dpp.PresentationInterval		= D3DPRESENT_INTERVAL_IMMEDIATE;
m_D3Dpp.BackBufferFormat		= Format;


I'm going fullscreen, and doing this through a DLL. Does anyone know where the problem could lie? If you need anymore information, please be so kind to ask. Thanks for helping me out, - Stijn [Edited by - stenny on June 16, 2008 4:13:10 PM]

Share this post


Link to post
Share on other sites
Advertisement
So break into the debugger while it's frozen and take a look. What is it doing? Remember to set up with the Microsoft symbol server and look at all the running threads.

Share this post


Link to post
Share on other sites
Quote:
Original post by Buckeye
Does it work if you don't do it "through a DLL?"

Yeah, sorry. I knew I was a bit too abstract with that term. My whole Direct3D engine is stored inside a DLL. I'll try and see if these same settings work in a testproject without the DLL.

Quote:
Original post by Promit
So break into the debugger while it's frozen and take a look. What is it doing? Remember to set up with the Microsoft symbol server and look at all the running threads.

That's the problem, the debugger freezes too. And I wouldn't have a clue as to what that Microsoft Symbol Server is and how to set it up, sorry :p. I guess I'm not that advanced yet.

Share this post


Link to post
Share on other sites
When I put all code in another project, I came accross the fact that the WinAPI's ShowWindow() and UpdateWindow() functions hadn't been called before Direct3D was initialized. Apparently HWND's aren't completely functional when those functions haven't been called yet. Anyway, calling them worked.

Thanks for helping out guys, and sorry for making such a stupid (oh well, I learnt from it ;D) mistake.

- Stijn

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!