共用方式為


Microsoft.Xna.Framework.IGraphicsDeviceManager.CreateDevice Method

Called to ensure that the device manager has created a valid device.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

Syntax

private void Microsoft.Xna.Framework.IGraphicsDeviceManager.CreateDevice ()

Exceptions

Exception type Condition
NoSuitableGraphicsDeviceException

One of the following conditions has occurred:

  • Could not find a Direct3D device that has a Direct3D9-level driver and supports a minimum of Pixel Shader Model 1.1.
  • Could not find a Direct3D device compatible with the current device preferences.
  • The process of ranking devices removed all compatible devices.
  • Direct3D hardware acceleration is not available or has been disabled. Verify that a Direct3D-enabled graphics device is installed, and check the display properties to verify that Hardware acceleration is set to Full.
  • Remote Desktop is in use. Direct3D is not available when you are using Remote Desktop.
InvalidOperationException

This graphics device manager has not been added to Services and registered as the graphics device manager for the application. Device settings cannot be changed or committed unless the device has been registered.

ArgumentException

Invalid arguments have been requested for the creation of the graphics device.

Invalid back buffer options have been requested:

Invalid PresentationParameters.PresentationInterval or SwapEffect options have been requested:

Invalid multisampling options have been requested:

Invalid depth stencil options have been requested:

IsFullScreen is true, but:

IsFullScreen is false, but:

See Also

Reference

GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace

Platforms

Xbox 360, Windows XP SP2, Windows Vista