Jump to content
  • Advertisement
Sign in to follow this  
Metty

[MDX] Problem with starting application in Fullscreen mode

This topic is 4483 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 just changing the present parameter "windowed" to false, and so switching to fullscreen, the application crashes with a "d3d invalid call exception" when starting... How to change to fullscreen correctly?

Share this post


Link to post
Share on other sites
Advertisement
For the fullscreen mode you have to set some additional parameters.

BackBufferWidth and BackBufferHeight need to be set to a size that your card and display supports.
IDirect3D9::EnumAdapterModes helps you to find valid modes.

BackBufferFormat need to be set to a format that your GPU supports.
IDirect3D9::CheckDeviceType helps you to find a valid format.

EDIT: Sorry have not see the MDX.

In this case you need:

Manager.CheckDeviceType

AdapterInformation.SupportedDisplayModes

[Edited by - Demirug on March 14, 2006 1:50:41 PM]

Share this post


Link to post
Share on other sites
Yep, you need to specify resolution and bitdepth etc etc. This code will allow fullsreen:

pp = new PresentParameters();
pp.Windowed = windowed;
pp.BackBufferWidth = screenWidth;
pp.BackBufferHeight = screenHeight;
pp.AutoDepthStencilFormat = DepthFormat.D16;
pp.BackBufferCount = 2;
pp.BackBufferFormat = Format.R5G6B5;
pp.DeviceWindow = CreateAndUpdateGameWindowTask.GameWindow;
pp.DeviceWindowHandle = CreateAndUpdateGameWindowTask.GameWindow.Handle;
pp.EnableAutoDepthStencil = true;
pp.MultiSample = MultiSampleType.None;
pp.PresentationInterval = PresentInterval.Immediate;
pp.PresentFlag = PresentFlag.None;
pp.SwapEffect = SwapEffect.Discard;
pp.ForceNoMultiThreadedFlag = true;

// Create the device
device = new Microsoft.DirectX.Direct3D.Device(0, DeviceType.Hardware, CreateAndUpdateGameWindowTask.GameWindow, CreateFlags.SoftwareVertexProcessing, pp);



I ripped right out of my engine, you probably want to remove/edit values.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!