• Advertisement


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

CreateDevice failing...

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