DirectX in full screen

Ming_Lei

Freshman
Joined
May 6, 2004
Messages
41
Location
Seattle, WA
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 there's 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?? :confused:
 
Back
Top