Jump to content
  • Advertisement
Sign in to follow this  
noatom

Create Device problem

This topic is 1832 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:

D3DERR_INVALIDCALL
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.Flags = D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL;
	d3dpp.BackBufferCount = 0;

        pD3D = Direct3DCreate9(D3D_SDK_VERSION);
	
  
	
    
        hr = pD3D->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,NULL,
	D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_PUREDEVICE,
	&d3dpp,&pDevice);
	
What exactly am i doing wrong?
Edited by noatom

Share this post


Link to post
Share on other sites
Advertisement

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.

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!