Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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:

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...