วันเสาร์ที่ 26 ธันวาคม พ.ศ. 2552

Set the size of the XNA game window

in window mode, set the properties PreferredBackBufferWidth and PreferredBackBufferHeight to set the width and height of the XNA game window.

public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
graphics.PreferredBackBufferWidth = 1024;
graphics.PreferredBackBufferHeight = 768;
}

Exit XNA game in fullscreen mode

if there is no exit button or no other way to exit, just press Alt+F4

Run XNA in fullscreen mode

in Game1() constructor set the property IsFullScreen = true;

public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
graphics.IsFullScreen = true;
}

Drawing 3D Wireframe model in XNA

in LoadContent(), set property RenderState.FillMode = FillMode.WireFrame;

protected override void LoadContent()
{
device = graphics.GraphicsDevice;
device.RenderState.FillMode = FillMode.WireFrame;
myModel = Content.Load("tank");
}