Jump to content
  • Advertisement
Sign in to follow this  

Create Device problem

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

When I call createDevice a problem appears;


This is what I get from the HRESULT of the call:

Invalid call
I want to use the windowed mode,here's the code for the initialization:
I'm passing 0 to some members because that's what you are supposed to pass for windowed mode.
        d3dpp.Windowed = true;
	d3dpp.hDeviceWindow = deviceWindow;
	d3dpp.BackBufferHeight = 0;
	d3dpp.BackBufferWidth = 0;
	d3dpp.MultiSampleQuality = 0;
	d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE;
	d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
	d3dpp.EnableAutoDepthStencil = true;
	d3dpp.AutoDepthStencilFormat = D3DFMT_D24S8;
	d3dpp.FullScreen_RefreshRateInHz = 0;
	d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_ONE;
	d3dpp.BackBufferCount = 0;

        pD3D = Direct3DCreate9(D3D_SDK_VERSION);
What exactly am i doing wrong?
Edited by noatom

Share this post

Link to post
Share on other sites

I'm not seeing where you're setting the BackBufferFormat member, which should be D3DFMT_UNKNOWN for windowed modes.  Also, you haven't said what hardware you're using - most hardware will support D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_PUREDEVICE but you should be certain that your's does.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!