Sign in to follow this  
Metty

[MDX] Problem with starting application in Fullscreen mode

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this