Partager via


Game.GraphicsDevice Property

Gets the current GraphicsDevice.

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

Syntax

public GraphicsDevice GraphicsDevice { get; }

Property Value

The current GraphicsDevice.

Exceptions

Exception type Condition
InvalidOperationException This property requires a graphics device service in the game service container.

Remarks

Do not access this property until LoadContent is called.

See Also

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP