Advertisement Jump to content
Sign in to follow this  

ID3DDevice9 - Error when trying to create in Full Screen (SOLVED)

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

This is a particular topic I have been hassling with since I first switched over to Direct3D. I am not sure about the exact reason why I am getting an invalid call error because I have looked on the MSDN about the function, yet I can't find an explanation as to why my code won't work... I am trying to create a device in fullscreen mode, but I keep on getting D3DERR_INVALIDCALL. It all works find when it is windowed (bool isWindowed=true), but never when I try to make it fullscreen. Please note that this in the initializing part of my program. Here's the basic layout:
 //Get the current desktop display mode
 //Note that the Direct3D9 object has already been created
 ZeroMemory( &d3dpp, sizeof(d3dpp) );
 d3dpp.Windowed = isWindowed;
 d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
 d3dpp.BackBufferFormat = d3ddm.Format;
 if (!isWindowed) {
  //Fullscreen: (aren't these the proper changes?)
  d3dpp.FullScreen_RefreshRateInHz=D3DPRESENT_RATE_DEFAULT; //d3ddm.RefreshRate;

I have looked at other source code, but I can't find any differences that really 'pop out' at me. SIDE NOTE: It doesn't work when the width and height is 400x300 or 640x480 either. [Edited by - deadimp on July 21, 2005 2:15:43 PM]

Share this post

Link to post
Share on other sites
I'm no Direct3D guru by any means, but are you setting the depth buffer to any specific value? Try...

d3dParameters->EnableAutoDepthStencil = TRUE;

Also, try setting your BackBuffer depth to D3DFMT_X8R8G8B8, as I know when I tried to go fullscreen my card/drivers didn't support 24 bit, only 32 bit.

Share this post

Link to post
Share on other sites
Are you tring to do triple buffering? Try setting the BackBufferCount to 0 or 1 (do the same thing - make a single back buffer) and see if that works. Your card might not be able to do triple buffering.

Share this post

Link to post
Share on other sites
I started out only using 1 back buffer, but then I saw antoher tutorial online that had two (which worked), so I tried that one. I'll try these changes out.
On a side note, I think skyfire360 was right about the depth format, becuase I remembered trying to go 24 bit in DirectDraw and it wouldn't let me (D'oh). I can't compile it right now because I have some erroneus code that I need to debug.
I'll post if it works or not.

Share this post

Link to post
Share on other sites
It works! It actually works!
Thanks y'all. The only problem I'm having now is there is a little tearing at the bottom of the screen.

EDIT: Fixed the tearing. Simply eliminted the D3DSWAPEFFECT_FLIP in the full screen conditional. Thanks again.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!