Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


CreateDevice failing...

This topic is 5477 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 have the following code:
HRESULT CEngine::Create(HWND hWnd, int width, int height)
	//Get default window handle

	mhWnd = hWnd;

	//Create D3D handle

	mpd3d = Direct3DCreate9(D3D_SDK_VERSION);
	if (mpd3d == NULL)
		return E_FAIL;

	//Set up display parameters

	ZeroMemory(&mparams, sizeof(mparams));
	mparams.Windowed = TRUE;
	mparams.hDeviceWindow = mhWnd;
	mparams.BackBufferCount = 1;
	mparams.BackBufferFormat = D3DFMT_UNKNOWN;
	mparams.SwapEffect = D3DSWAPEFFECT_DISCARD;
	mparams.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;

	//Create D3D device

	if (mpdev == NULL)
		return E_FAIL;

	return D3D_OK;
and it fails on CreateDevice. I''m doing nothing out of this world. What''s the problem?? Thanks, Ivan

Share this post

Link to post
Share on other sites

  • 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!