Ming_Lei
Active member
Also I am writing a program that uses DirectX in full screen. I have the following code to create a device, but the system stops at the last line because theres a bug in the parameters. Here is the code:
====================================================
// Set our presentation parameters
PresentParameters presentParams = new PresentParameters();
presentParams.Windowed = false;
presentParams.SwapEffect = SwapEffect.Discard;
presentParams.AutoDepthStencilFormat = DepthFormat.D16;
presentParams.EnableAutoDepthStencil = true;
Format current = Manager.Adapters[0].CurrentDisplayMode.Format;
if(Manager.CheckDeviceType(0, DeviceType.Hardware, current, current, false)) // check valid
{
presentParams.BackBufferCount = 1;
presentParams.BackBufferWidth = ScreenWidth;
presentParams.BackBufferHeight = ScreenHeight;
presentParams.BackBufferFormat = current;
}
// Create our device
device = new Device(0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, presentParams);
==============================================
What is the bug??
====================================================
// Set our presentation parameters
PresentParameters presentParams = new PresentParameters();
presentParams.Windowed = false;
presentParams.SwapEffect = SwapEffect.Discard;
presentParams.AutoDepthStencilFormat = DepthFormat.D16;
presentParams.EnableAutoDepthStencil = true;
Format current = Manager.Adapters[0].CurrentDisplayMode.Format;
if(Manager.CheckDeviceType(0, DeviceType.Hardware, current, current, false)) // check valid
{
presentParams.BackBufferCount = 1;
presentParams.BackBufferWidth = ScreenWidth;
presentParams.BackBufferHeight = ScreenHeight;
presentParams.BackBufferFormat = current;
}
// Create our device
device = new Device(0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, presentParams);
==============================================
What is the bug??