You are on page 1of 18

Introduction to XNA Game Studio 4.

0 Page 1 of 18

XNA Game Studio 4.0

Introduction to XNA Game Studio 4.0

This section provides helpful prerequisities for installing and using Microsoft XNA Game Studio 4.0.

In This Section
What's New in XNA Game Studio 4.0
Describes new features and changes in XNA Game Studio 4.0.
Hardware and Operating System Requirements
Describes the operating systems that fully support XNA Game Studio, and the computing hardware you
need to use XNA Game Studio.
Software Install Requirements
Describes the software required to use XNA Game Studio 4.0.
Software Installation Notes
Describes various scenarios under which XNA Game Studio 4.0 may be installed.
Setting up your Firewall
Describes required settings for third-party firewall products.
Getting Additional Help
Describes additional resources for developing with the XNA Framework.

© 2010 Microsoft Corporation. All rights reserved.


Send feedback to xnags@microsoft.com.
Version: 4.0.20823.0

XNA Game Studio 4.0

What's New in XNA Game Studio 4.0

Describes new features and changes in XNA Game Studio 4.0.


 Overview of New Features
 New Classes and Methods
 New In the XNA Game Studio Preview Refresh

Overview of New Features


 Develop Games for Windows Phone 7
 Leverage Windows Phone-specific Features Through Silverlight
 Simplified Graphics Interfaces
 Configurable Effects
 Built-in State Objects
 System Support for Scalars and Orientation
 Cross-Platform Input API
 Enhanced Audio Support
 Music and Picture Enumeration and Video Playback

Develop Games for Windows Phone 7


XNA Game Studio and the XNA Framework are designed for cross-platform gaming scenarios with support
for Windows Phone 7, Xbox 360, and Windows-based PCs. This allows you to target more platforms from the
same code base. It also allows developers to focus game design for each platform on real device differences
such as the device capabilities and experience, as opposed to writing with different frameworks for each
targeted device.

Tasks

file://C:\Users\Aaron\AppData\Local\Temp\~hh5908.htm 01/11/2010
Introduction to XNA Game Studio 4.0 Page 2 of 18

Developing Windows Phone Games


Describes how to develop games for Windows Phone.
Migrating from Zune to Windows Phone
Discusses how to migrate games written for Zune and Zune HD on XNA Game Studio 3.1 to Windows
Phone with XNA Game Studio 4.0.

Leverage Windows Phone-specific Features Through Silverlight


When you develop games for Windows Phone 7, you can leverage platform-specific features such as
location, accelerometer, and vibration interfaces that are provided through Silverlight 4.0. Similarly, most of
the XNA Framework can be accessed from Silverlight applications.

Tasks
Retrieving Accelerometer Input (Windows Phone)
Demonstrates how to detect and use accelerometer input in an XNA Game Studio game on Windows
Phone.

On Windows Phone, writable user storage is handled by Silverlight, not by XNA Game Studio. You can use
the XNA Game Studio content pipeline to preprocess read-only game assets that are accessed by the content
manager at run time.

Concepts
What Is Storage?
Storage refers to memory locations used for reading and writing data.

Tasks
Writing Data (Windows Phone)
Describes how to save game data on Windows Phone.
Adding Game Data Files to Title Storage
Describes how to add game data files to the title storage location.
Reading Game Data from Title Storage
Describes how to load game data from the title storage location.
XML Elements for XMLImporter
Describes the elements of an XML file that can be processed by the XmlImporter Class.
Adding an XML Content File to a Visual Studio Project
Describes how to add custom game data as an XML file through the Content Pipeline.
Loading XML Content at Runtime
Describes how to load custom game data at game runtime through the Content Pipeline.
Using an XML File to Specify Content
Describes how to use XML files for custom game data through the Content Pipeline.
Creating an XML File
Describes how to use IntermediateSerializer from a Windows application to generate XML content to add
to a XNA Game Studio application.

Simplified Graphics Interfaces


XNA Game Studio 4.0 introduces the concept of XNA Framework profiles. These profiles (Reach and HiDef)
allow you to create a clear development environment while targeting broad or specific platform releases. The
Reach profile is designed for compatibility across the largest possible range of devices, including Windows
Phone 7, Windows-based PCs, and Xbox 360 consoles. Choosing the HiDef platform in your development
environment allows you to use platform showcase features.
Both the Reach and HiDef profiles are hardware accelerated.

Concepts
What Is a Profile?
A profile is a feature set that is implemented in hardware. The Reach profile implements high-level shader
language (HLSL) Shader Model 2.0 and the HiDef profile implements HLSL Shader Model 3.0.

Reference
GraphicsDeviceInformation.GraphicsProfile Property
Gets the graphics profile, which determines the graphics feature set.

file://C:\Users\Aaron\AppData\Local\Temp\~hh5908.htm 01/11/2010
Introduction to XNA Game Studio 4.0 Page 3 of 18

GraphicsDeviceManager.GraphicsProfile Property
Gets the graphics profile, which determines the graphics feature set.
GraphicsAdapter.IsProfileSupported Method
Tests to see if the adapter supports the requested profile.
ContentWriter.TargetProfile Property
Gets or sets the target graphics profile.
ContentProcessorContext.TargetProfile Property
Gets the current content build target profile.
BuildContent.TargetProfile Property
Gets or sets the target graphics profile.
BuildXact.TargetProfile Property
Gets or sets the target graphics profile.
CleanContent.TargetProfile Property
Gets or sets the target graphics profile.

Configurable Effects
Game Studio 4.0 introduces new and updated configurable effects that will add more variety to your
rendering options. These configurable effects are available for both Reach and HiDef profiles and for all
platforms, including Windows Phone 7, Windows-based PCs, and Xbox 360 consoles.
 Basic Effects—A basic effect includes transforms and basic lighting for Blinn-Phong shading. You have the
option of adding up to three more directional lights, fog, and a texture. Use one light for the fastest
performance, and use three lights for more interesting 3D lighting.
 Dual Texture Effects—A dual texture effect uses two textures with two independent sets of texture
coordinates. When you blend the two textures, you generate a lot more visual complexity if the first
texture contains the basic color or detail, and the second texture contains complex lighting.
 Alpha Test Effects—An alpha test effect uses a reference alpha and an alpha function to implement alpha
testing. This can greatly improve rendering performance by only updating pixels where objects are being
drawn in a scene. Alpha testing is common when depth/stencil buffers are not used.
 Skinned Effects—A skinned effect uses bones and weights to influence vertex positions, that is, to move
or deform an object. This works very well for character animation and instancing. The effect supports up
to 72 bones, with up to 4 weights per bone.
 Environment Map Effects—An environment map effect uses a diffuse texture to color or detail an object,
and a cube map texture containing an environment map to shade the object due to the environment.
Because the object reflects the scene, this makes the object look more like it is in a real scene. Also, you
can use the fresnel parameter to tune the amount of light reflected (shininess) based on the geometry of
the surface.

Concepts
What Is a Configurable Effect?
A configurable effect is an optimized rendering effect designed for Windows, Xbox 360, and Windows
Phone. A configurable effect is created using a built-in object with options for user configuration.
What Is an Effect?
An effect initializes the graphics pipeline for performing transforms, lighting, applying textures, and
adding per-pixel visual effects such as a glow or a lens flare. Under the covers, an effect implements at
least one shader for processing vertices and at least one shader for processing pixels.

Tasks
Creating a Custom Effect
Demonstrates how to create a custom effect that transforms an object and applies a texture.

Reference
BasicEffect Class
Contains a basic rendering effect.
SkinnedEffect Class
Contains a configurable effect for rendering skinned character models.
EnvironmentMapEffect Class
Contains a configurable effect that supports environment mapping.
DualTextureEffect Class

file://C:\Users\Aaron\AppData\Local\Temp\~hh5908.htm 01/11/2010
Introduction to XNA Game Studio 4.0 Page 4 of 18

Contains a configurable effect that supports two-layer multitexturing.


AlphaTestEffect Class
Contains a configurable effect that supports alpha testing.

Built-in State Objects


Many of the individual state properties have been replaced with a more organized set of immutable state
objects. There are fewer states to manage.

Tasks
Creating a State Object
Demonstrates how to create a state object using any of the state object classes: BlendState,
DepthStencilState, RasterizerState, or SamplerState.

ConceptsReference
What Is Blend State?
Blend state controls how color and alpha values are blended when combining rendered data with existing
render target data.
What Is Depth Stencil State?
Depth stencil state controls how the depth buffer and the stencil buffer are used.
BlendState Class
Contains blend state for the device.
DepthStencilState Class
Contains depth-stencil state for the device.
GraphicsDevice.RasterizerState Property
Gets or sets rasterizer state. The default value is RasterizerState.CullCounterClockwise.
SamplerState Class
Contains sampler state, which determines how to sample texture data.

System Support for Scalars and Orientation


With new system support for scalars and orientation, you can write your game without worrying about native
resolution or orientation. Scalars can significantly improve game performance. This support comes
automatically when you use the XNA Framework.

Reference
DisplayOrientation Enumeration
Defines the display orientation.
PresentationParameters.DisplayOrientation Property
Gets or sets the orientation of the display. The default value is DisplayOrientation.Default, which
means orientation is determined automatically from your BackBufferWidth and BackBufferHeight.
GraphicsDeviceManager.SupportedOrientations Property
Gets or sets the display orientations that are available if automatic rotation and scaling is enabled.
GraphicsDeviceManager.DefaultBackBufferHeight Field
Specifies the default minimum back-buffer height.
GameWindow.CurrentOrientation Property
Gets the current display orientation, which reflects the physical orientation of the phone in the user's
hand.
GameWindow.OrientationChanged Event
Describes the event raised when the display orientation of the GameWindow changes. When this event
occurs, the XNA Framework automatically adjusts the game orientation based on the value specified by
the developer with SupportedOrientations.
GameWindow.OnOrientationChanged Method
Called when the GameWindow display orientation changes.
GameWindow.SetSupportedOrientations Method
Sets the supported display orientations.
TouchPanel.DisplayOrientation Property
Gets or sets the display orientation of the touch panel.
TouchPanel.DisplayWidth Property
Gets or sets the display width of the touch panel.

file://C:\Users\Aaron\AppData\Local\Temp\~hh5908.htm 01/11/2010
Introduction to XNA Game Studio 4.0 Page 5 of 18

TouchPanel.DisplayHeight Property
Gets or sets the display height of the touch panel.

Cross-Platform Input API


While the design of an input strategy for your game is likely to be highly specific to a particular game or
device experience, the XNA Framework provides a cross-platform input interface where an input capability is
likely to be available across multiple platforms. In this release, multitouch support has been added for
Windows and Windows Phone-based applications that use the XNA Framework. The XNA Framework input
classes are orientation-aware and resolution-aware, allowing for greater portability of code and fewer #ifdefs
in your game design.

Tasks
Working with Touch Input (Windows Phone)
Demonstrates how to detect and use multitouch input in an XNA game.

Reference
Microsoft.Xna.Framework.Input.Touch
Contains classes that enable access to touch-based input on devices that support it.
TouchPanel
Provides methods for retrieving touch panel device information.
TouchPanelCapabilities
Provides access to information about the capabilities of the touch input device.
TouchLocation
Provides methods and properties for interacting with a touch location on a touch screen device.
TouchLocationState
Defines the possible states of a touch location.

Enhanced Audio Support


The XNA Framework Audio namespace now allows for audio capture and playback through the Microphone
and DynamicSoundEffect classes. You now have the ability to play back synthesized or buffered audio,
capturing audio through a microphone or Bluetooth headset, and playing it through a headset or speakers.

Reference
Microphone Class
Provides properties, methods, and fields and events for capturing audio data with microphones.
DynamicSoundEffectInstance Class
Provides properties, methods, and events for play back of the audio buffer.

Music and Picture Enumeration and Video Playback


You can now do the following:
 Use a uniform resource location to play songs.
 Select, edit, and publish photos.
 Play back video using an interface that allows you to show or hide the video controls.

Tasks
Playing a Song from a URI
Demonstrates how to use the MediaPlayer to play a song from a Uniform Resource Identifier (URI).

Reference
Song.FromUri Method
Constructs a new Song object based on the specified URI.
MediaLibrary.SavePicture Method
Saves the image to the media library.

New Classes and Methods

Microsoft.Xna.Framework

file://C:\Users\Aaron\AppData\Local\Temp\~hh5908.htm 01/11/2010
Introduction to XNA Game Studio 4.0 Page 6 of 18

Color has moved from the Microsoft.Xna.Framework.Graphics namespace to Microsoft.Xna.Framework.


Color Structure
Represents a four-component color using red, green, blue, and alpha data.
GraphicsDeviceInformation.GraphicsProfile Property
Gets the graphics profile, which determines the graphics feature set.
GraphicsDeviceManager.GraphicsProfile Property
Gets the graphics profile, which determines the graphics feature set.
TitleContainer Class
Provides file stream access to the title's default storage location.

Microsoft.Xna.Framework.Audio
DynamicSoundEffectInstance Class
Provides properties, methods, and events for play back of the audio buffer.
Microphone Class
Provides properties, methods, and fields and events for capturing audio data with microphones.
NoMicrophoneConnectedException Class
The exception that is thrown when Microphone API calls are made on a disconnected microphone.
AudioChannels Enumeration
Defines the number of channels in the audio data.
MicrophoneState Enumeration
Current state of the Microphone audio capture (started or stopped).
SoundEffect.FromStream Method
Creates a SoundEffect object based on the specified data stream.
SoundEffect.GetSampleDuration Method
Returns the sample duration based on the specified sample size and sample rate.
SoundEffect.GetSampleSizeInBytes Method
Returns the size of the audio sample based on duration, sample rate, and audio channels.

Microsoft.Xna.Framework.Input.Touch
Microsoft.Xna.Framework.Input.Touch Namespace
Contains classes that enable access to touch-based input on devices that support it.

Microsoft.Xna.Framework.Media
Album.GetAlbumArt Method
Returns the stream that contains the album art image data.
MediaLibrary.SavePicture Method
Saves the image to the media library.
Picture.GetImage Method
Returns the stream that contains the image data.
Picture.GetThumbnail Method
Returns the stream that contains the picture's thumbnail image data.
Song.FromUri Method
Constructs a new Song object based on the specified URI.

Microsoft.Xna.Framework.Graphics.PackedVector
Bgra4444 Structure
Packed vector type containing unsigned normalized values, ranging from 0 to 1, using 4 bits each for x, y,
z, and w.

Microsoft.Xna.Framework.Storage
Storage device selection has moved from the GamerServices namespace to the Storage namespace.
StorageDevice.BeginShowSelector Method
Overloaded methods for showing the storage device selector asynchronously.
StorageDevice.EndShowSelector Method

file://C:\Users\Aaron\AppData\Local\Temp\~hh5908.htm 01/11/2010
Introduction to XNA Game Studio 4.0 Page 7 of 18

Ends the display of the storage selector user interface.

Microsoft.Xna.Framework.Content.Pipeline
Effect compilation from the Framework to the Content Pipeline.

In This Section
ContentWriter.TargetProfile Property
Gets or sets the target graphics profile.
AlphaTestMaterialContent Class
Provides properties for modifying an effect that supports alpha testing.
DualTextureMaterialContent Class
Provides properties for modifying an effect that supports two-layer multitexturing.
EffectMaterialContent.CompiledEffect Property
Gets or sets the compiled Effect.
EnvironmentMapMaterialContent Class
Provides properties for modifying an effect that supports environment mapping.
SkinnedMaterialContent Class
Provides properties for modifying an effect for rendering skinned character models.
ContentImporterContext Constructor
Initializes a new instance of ContentImporterContext.
ContentProcessorContext Constructor
Initializes a new instance of ContentProcessorContext.
ContentProcessorContext.TargetProfile Property
Gets the current content build target profile.
EffectImporter Class
Provides methods for reading effect (.fx) files for use in the Content Pipeline.
FbxImporter Class
Provides methods for reading AutoDesk (.fbx) files for use in the Content Pipeline.
Mp3Importer Class
Provides methods for reading MP3 audio files for use in the Content Pipeline.
TextureImporter Class
Provides methods for reading texture files for use in the Content Pipeline.
WavImporter Class
Provides methods for reading .wav audio files for use in the Content Pipeline.
WmaImporter Class
Provides methods for reading Windows Media Audio (.wma) files for use in the Content Pipeline.
WmvImporter Class
Provides methods for reading Windows Media Video (.wmv) files for use in the Content Pipeline.
XImporter Class
Provides methods for reading DirectX Object (.x) files for use in the Content Pipeline.
TargetPlatform Enumeration
Identifiers for the target platform.
CompiledEffectContent Class
Represents a compiled Effect.
EffectProcessor.DebugMode Property
The debug mode for compiling effects.
EffectProcessor.Defines Property
Define assignments for the effect.
FontTextureProcessor.PremultiplyAlpha Property
Specifies whether alpha premultiply of font textures is enabled.
MaterialProcessor.DefaultEffect Property
The default effect type for this instance of MaterialProcessor.
MaterialProcessor.PremultiplyTextureAlpha Property
Specifies whether alpha premultiply of textures is enabled.
ModelMeshPartContent.IndexBuffer Property

file://C:\Users\Aaron\AppData\Local\Temp\~hh5908.htm 01/11/2010
Introduction to XNA Game Studio 4.0 Page 8 of 18

Gets the index buffer associated with this mesh part.


ModelMeshPartContent.VertexBuffer Property
Gets the vertex buffer associated with this mesh part.
ModelMeshPartContent.VertexOffset Property
Gets the offset, in bytes, from the first index of the of vertex buffer for this mesh part.
ModelProcessor.DefaultEffect Property
The default effect type for this instance of ModelProcessor.
ModelProcessor.PremultiplyTextureAlpha Property
Specifies whether alpha premultiply of textures is enabled.
TextureProcessor.PremultiplyAlpha Property
Specifies whether alpha premultiply of textures is enabled.
VertexBufferContent.VertexDeclaration Property
Gets the associated VertexDeclarationContent object.
BuildContent.TargetProfile Property
Gets or sets the target graphics profile.
BuildXact.TargetProfile Property
Gets or sets the target graphics profile.
CleanContent.TargetProfile Property
Gets or sets the target graphics profile.

Microsoft.Xna.Framework.Graphics
 New overloads to SpriteBatch.Begin provide an explicit way to draw sprites with a custom pixel shader.
 VertexBuffers are now strongly typed. VertexDeclaration usage has changed in XNA Game Studio
4.0. Each VertexBuffer now has an associated VertexDeclaration, which becomes immutable after the
buffer has been created, allowing for the XNA Framework to automatically adjust the bit layout of vertex
data as required for different platforms.

BlendState Class
Contains blend state for the device.
DepthStencilState Class
Contains depth-stencil state for the device.
GraphicsDevice.RasterizerState Property
Gets or sets rasterizer state. The default value is RasterizerState.CullCounterClockwise.
SamplerState Class
Contains sampler state, which determines how to sample texture data.
AlphaTestEffect Class
Contains a configurable effect that supports alpha testing.
BasicEffect Class
Contains a basic rendering effect.
DirectionalLight Class
Creates a DirectionalLight object.
DualTextureEffect Class
Contains a configurable effect that supports two-layer multitexturing.
Effect.Clone Method
Copies data from an existing object to this object.
Effect.OnApply Method
Applies the effect state just prior to rendering the effect.
EffectMaterial Class
Contains an effect subclass which is used to load data for an EffectMaterialContent type.
EffectPass.Apply Method
Begins this pass.
EnvironmentMapEffect Class
Contains a configurable effect that supports environment mapping.
GraphicsAdapter.IsProfileSupported Method
Tests to see if the adapter supports the requested profile.
GraphicsAdapter.QueryBackBufferFormat Method

file://C:\Users\Aaron\AppData\Local\Temp\~hh5908.htm 01/11/2010
Introduction to XNA Game Studio 4.0 Page 9 of 18

Queries the adapter for support for the requested back buffer format.
GraphicsAdapter.QueryRenderTargetFormat Method
Queries the adapter for support for the requested render target format.
GraphicsAdapter.UseNullDevice Property
Gets or sets a NULL device.
GraphicsAdapter.UseReferenceDevice Property
Gets or sets a reference device.
GraphicsDevice.Clear Method
Clears resource buffers.
GraphicsDevice.DrawInstancedPrimitives Method
Draws a series of instanced models.
GraphicsDevice.DrawUserIndexedPrimitives Method
Renders geometric primitives.
GraphicsDevice.DrawUserPrimitives Method
Renders geometric primitives.
GraphicsDevice.GetBackBufferData Method
Gets the contents of the back buffer.
GraphicsDevice.GetRenderTargets Method
Gets a render target surface.
GraphicsDevice.GetVertexBuffers Method
Gets the vertex buffers.
GraphicsDevice.SetRenderTargets Method
Sets an array of render targets.
GraphicsDevice.SetVertexBuffer Method
Sets or binds a vertex buffer to a device.
GraphicsDevice.SetVertexBuffers Method
Sets the vertex buffers.
GraphicsDevice.Adapter Property
Gets the graphics adapter.
GraphicsDevice.BlendFactor Property
Gets or sets the color used for a constant-blend factor during alpha blending. The default value is
Color.White.
GraphicsDevice.BlendState Property
Gets or sets a system-defined instance of a blend state object initialized for alpha blending. The default
value is BlendState.Opaque.
GraphicsDevice.DepthStencilState Property
Gets or sets a system-defined instance of a depth-stencil state object. The default value is
DepthStencilState.Default.
GraphicsDevice.GraphicsProfile Property
Gets the graphics profile. The default value is GraphicsProfile.Reach.
GraphicsDevice.MultiSampleMask Property
Gets or sets a bitmask controlling modification of the samples in a multisample render target. The default
value is -1 (0xffffffff).
GraphicsDevice.ReferenceStencil Property
Gets or sets a reference value for stencil testing. The default value is zero.
IEffectFog Interface
Gets or sets fog parameters for the current effect.
IEffectLights Interface
Gets or sets lighting parameters for the current effect.
IEffectMatrices Interface
Gets or sets transformation matrix parameters for the current effect.
IndexBuffer.IndexCount Property
Gets the number of indices in this buffer.
IVertexType Interface
Vertex type interface which is implemented by a custom vertex type structure.

file://C:\Users\Aaron\AppData\Local\Temp\~hh5908.htm 01/11/2010
Introduction to XNA Game Studio 4.0 Page 10 of 18

Model.Draw Method
Render a model after applying the matrix transformations.
ModelMeshPart.IndexBuffer Property
Gets the index buffer for this mesh part.
ModelMeshPart.VertexBuffer Property
Gets the vertex buffer for this mesh part.
ModelMeshPart.VertexOffset Property
Gets the offset (in vertices) from the top of vertex buffer.
NoSuitableGraphicsDeviceException Class
Thrown when no available graphics device fits the given device preferences.
PresentationParameters.Bounds Property
Gets the size of this resource.
PresentationParameters.DepthStencilFormat Property
Gets or sets the depth stencil data format.
PresentationParameters.MultiSampleCount Property
Gets or sets a value indicating the number of sample locations during multisampling.
RasterizerState Class
Contains rasterizer state, which determines how to convert vector data (shapes) into raster data (pixels).
RenderTarget2D Class
Contains a 2D texture that can be used as a render target.
RenderTargetBinding Structure
Binds an array of render targets.
RenderTargetCube Class
Represents a cubic texture resource that will be written to at the end of a render pass.
SkinnedEffect Class
Contains a configurable effect for rendering skinned character models.
SpriteBatch.Begin Method
Begins a sprite batch operation.
SpriteBatch.Dispose Method
Releases unmanaged resources used by this object.
SpriteBatch.DrawString Method
Adds a string to a batch of sprites to be rendered.
SpriteBatch.Draw Method
Adds a sprite to a batch of sprites to be rendered.
SpriteFont Class
Represents a font texture.
Texture.Format Property
Gets the format of the texture data.
Texture2D Constructor
Creates an uninitialized Texture2D resource of the specified dimensions. To initialize a Texture2D from an
existing file, see the static method ContentManager.Load.
Texture2D.FromStream Method
Methods for loading an image.
Texture2D.SaveAsJpeg Method
Saves texture data as a .jpg.
Texture2D.SaveAsPng Method
Saves texture data as a .png.
Texture2D.SetData Method
Sets data to the texture.
Texture2D.Bounds Property
Gets the size of this resource.
Texture3D Constructor
Creates a new instance of this object.
Texture3D.SetData Method
Sets data.

file://C:\Users\Aaron\AppData\Local\Temp\~hh5908.htm 01/11/2010
Introduction to XNA Game Studio 4.0 Page 11 of 18

VertexBuffer Constructor
Creates an instance of this object.
VertexBuffer.VertexCount Property
Gets the number of vertices.
VertexBuffer.VertexDeclaration Property
Defines per-vertex data in a buffer.
VertexBufferBinding Structure
Binding structure that specifies a vertex buffer and other per-vertex parameters (such as offset and
instancing) for a graphics device.
VertexDeclaration Class
A vertex declaration, which defines per-vertex data.
VertexElement Constructor
Initializes a new instance of the VertexElement class.
VertexPositionColor Constructor
Initializes a new instance of the VertexPositionColor class.
VertexPositionColor.Color Field
The vertex color.
VertexPositionColor.Position Field
XYZ position.
VertexPositionColor.VertexDeclaration Field
Vertex declaration, which defines per-vertex data.
VertexPositionColorTexture Structure
Describes a custom vertex format structure that contains position, color, and one set of texture
coordinates.
VertexPositionNormalTexture Structure
Describes a custom vertex format structure that contains position, normal data, and one set of texture
coordinates.
VertexPositionTexture Structure
Describes a custom vertex format structure that contains position and one set of texture coordinates.
Viewport Constructor
Creates an instance of this class.
Viewport.Bounds Property
Gets the size of this resource.
GraphicsProfile Enumeration
Identifies the set of supported devices for the game based on device capabilities.

New In the XNA Game Studio Preview Refresh


 New Code Samples, Conceptual Content, and Tutorials
 New Samples Upgraded to XNA Game Studio 4.0

New Code Samples, Conceptual Content, and Tutorials


Media
Playing a Song from a URI
Demonstrates how to use the MediaPlayer to play a song from a Uniform Resource Identifier (URI).

Storage and Content Pipeline


Writing Data (Windows Phone)
Describes how to save game data on Windows Phone.
Adding Game Data Files to Title Storage
Describes how to add game data files to the title storage location.
Reading Game Data from Title Storage
Describes how to load game data from the title storage location.
XML Elements for XMLImporter
Describes the elements of an XML file that can be processed by the XmlImporter Class.

file://C:\Users\Aaron\AppData\Local\Temp\~hh5908.htm 01/11/2010
Introduction to XNA Game Studio 4.0 Page 12 of 18

Adding an XML Content File to a Visual Studio Project


Describes how to add custom game data as an XML file through the Content Pipeline.
Loading XML Content at Runtime
Describes how to load custom game data at game runtime through the Content Pipeline.
Using an XML File to Specify Content
Describes how to use XML files for custom game data through the Content Pipeline.
Creating an XML File
Describes how to use IntermediateSerializer from a Windows application to generate XML content to add
to a XNA Game Studio application.

Graphics
What Is Blend State?
Blend state controls how color and alpha values are blended when combining rendered data with existing
render target data.
What Is Depth Stencil State?
Depth stencil state controls how the depth buffer and the stencil buffer are used.
What Is a Back Buffer?
A back buffer is a render target whose contents will be sent to the device when GraphicsDevice.Present is
called.
What Is a Configurable Effect?
A configurable effect is an optimized rendering effect designed for Windows, Xbox 360, and Windows
Phone. A configurable effect is created using a built-in object with options for user configuration.
What Is an Effect?
An effect initializes the graphics pipeline for performing transforms, lighting, applying textures, and
adding per-pixel visual effects such as a glow or a lens flare. Under the covers, an effect implements at
least one shader for processing vertices and at least one shader for processing pixels.
What Is a Profile?
A profile is a feature set that is implemented in hardware. The Reach profile implements high-level shader
language (HLSL) Shader Model 2.0 and the HiDef profile implements HLSL Shader Model 3.0.
What Is Rasterizer State?
Rasterizer state determines how to render 3D data such as position, color, and texture onto a 2D surface.
What Is a Render Target?
A render target is a memory buffer for rendering pixels. One common use for a render target is offscreen
rendering.
What Is Sampler State?
Sampler state determines how texture data is sampled using texture addressing modes, filtering, and
level of detail.
What Is a View Frustum?
A view frustum is a 3D volume that defines how models are projected from camera space to projection
space. Objects must be positioned within the 3D volume to be visible.
What Is a Viewport?
A viewport is a 2D rectangle that defines the size of the rendering surface onto which a 3D scene is
projected.

New Samples Upgraded to XNA Game Studio 4.0


Drawing 3D Primitives using Lists or Strips
Demonstrates how to draw 3D primitives using lines and triangles arranged as strips or lists.
Using a Basic Effect with Texturing
Demonstrates how to create and draw a simple quad—two triangles that form a rectangle or square—
using DrawUserIndexedPrimitives.
Creating a Custom Effect
Demonstrates how to create a custom effect that transforms an object and applies a texture.
Loading Content from a Game Library
Demonstrates how to load content from a game library.
Animating a Sprite
Demonstrates how to animate a sprite from a texture using a custom class.
What Is a Sprite?

file://C:\Users\Aaron\AppData\Local\Temp\~hh5908.htm 01/11/2010
Introduction to XNA Game Studio 4.0 Page 13 of 18

Summarizes the basics of using sprites.


Drawing a Masked Sprite over a Background
Demonstrates how to draw a foreground and background sprite using the SpriteBatch class, where only
part of the foreground sprite masks the background.
Drawing Text with a Sprite
Demonstrates how to import a SpriteFont into a project and to draw text using DrawString.
Making a Scrolling Background
Demonstrates how to draw a scrolling background sprite using the SpriteBatch class.
Rotating a Sprite
Demonstrates how to rotate a sprite around its center.
Rotating a Group of Sprites
Demonstrates how to rotate a group of sprites around a single point using a rotation Matrix.
Scaling a Sprite
Demonstrates how to scale a sprite using a uniform scale.
Scaling Sprites Based On Screen Size
Demonstrates how to scale sprites using a matrix that is created based on the viewport width.
Tinting a Sprite
Demonstrates how to tint a sprite using a Color value.
Dynamically Updating Vertices
Describes several techniques for implementing dynamic vertex buffers in an XNA Framework game.

© 2010 Microsoft Corporation. All rights reserved.


Send feedback to xnags@microsoft.com.
Version: 4.0.20823.0

XNA Game Studio 4.0

Hardware and Operating System Requirements

This topic describes the operating systems that fully support XNA Game Studio, and the computing hardware
you need to use XNA Game Studio.

Supported Operating Systems


The following operating systems fully support XNA Game Studio.

Operating system Supported versions

Windows XP (see remarks below)


 Home Edition
 Professional
 Media Center Edition
 Tablet PC Edition

Windows Vista
 Home Basic
 Home Premium
 Business
 Enterprise
 Ultimate

Windows 7
 Home Basic
 Home Premium
 Professional
 Enterprise
 Ultimate

file://C:\Users\Aaron\AppData\Local\Temp\~hh5908.htm 01/11/2010
Introduction to XNA Game Studio 4.0 Page 14 of 18

Remarks
 Microsoft Windows Phone Developer Tools does not support Windows XP.
 Windows Vista requires, at a minimum, Service Pack 2.
 Although XNA Game Studio itself is available only in English, it is supported under any of the available
language settings on Windows.
 Administrator permissions are not required to run XNA Game Studio, but they are to install it. For
Windows 7 and Windows Vista, elevated administrator permissions are required.

Hardware Requirements
To run XNA Framework games on a computer running a Windows operating system, you need a graphics
card that supports, at a minimum, Shader Model 1.1 and DirectX 9.0c. We recommend using a graphics card
that supports Shader Model 2.0, which is required by some samples and starter kits.
To execute and debug XNA Framework games for Windows Phone with the Windows Phone emulator, you
need a graphics card that supports, at minimum, DirectX 10, with a supporting WDDM 1.1 driver.
Ensure your graphics card is using the latest driver. Check with your hardware vendor or access Microsoft
Update to find the latest version of a driver.
To develop XNA Framework games for Xbox 360, you will need to have a hard drive installed on your Xbox
360 console.
Other hardware requirements for XNA Game Studio are identical to those for Microsoft Visual Studio 2010.
For information on Microsoft Windows Phone Developer Tools requirements, see the Microsoft Windows
Phone Developer Tools documentation..

© 2010 Microsoft Corporation. All rights reserved.


Send feedback to xnags@microsoft.com.
Version: 4.0.20823.0

XNA Game Studio 4.0

Software Install Requirements

This topic describes the software required to use XNA Game Studio 4.0.

XNA Game Studio 4.0


To download XNA Game Studio 4.0 itself, go to the Creators Club Online.

Microsoft Visual Studio 2010


XNA Game Studio 4.0 leverages the Microsoft Visual Studio 2010 development environment, extending it for
game development. XNA Game Studio 4.0 works with any of the following Microsoft Visual Studio 2010
products.
 Microsoft Visual Studio 2010 Express for Windows Phone
 Microsoft Visual C# 2010 Express Edition
 Microsoft Visual Studio 2010 Standard Edition
 Microsoft Visual Studio 2010 Professional Edition
Microsoft Visual Studio 2010 Express for Windows Phone and XNA Game Studio 4.0 are only available as
part of the Microsoft Windows Phone Developer Tools. You can install Microsoft Windows Phone Developer
Tools from the Microsoft Windows Phone Developer Tools website.

Note
Only members of the Microsoft Visual Studio 2010 product line support XNA Game Studio 4.0. XNA
Game Studio 4.0 is incompatible with Visual Studio 2008 or previous editions.

Microsoft .NET Framework 4.0


XNA Game Studio requires the Microsoft .NET Framework 4.0. The setup program for Microsoft Windows

file://C:\Users\Aaron\AppData\Local\Temp\~hh5908.htm 01/11/2010
Introduction to XNA Game Studio 4.0 Page 15 of 18

Phone Developer Tools installs the .NET Framework if it is not installed already on your computer. You also
can install the .NET Framework from the Microsoft .NET Framework Developer Center.

Additional Required Software Installed by Setup


The XNA Game Studio setup program also installs the following required software.

DirectX Runtime
XNA Game Studio setup installs the DirectX runtime, which is required to use the XNA Framework Game API.

Microsoft Cross-platform Audio Creation Tool


XNA Game Studio Setup installs multiple versions of the Microsoft Cross-platform Audio Creation Tool
(XACT). You can use XACT to author audio content for your game. Games written using XNA Framework 3.1
and later are required to use XACT 3 projects, which are not backward compatible. Games written using XNA
Framework 3.0 are required to use XACT 2 projects.

Games for Windows - LIVE


XNA Game Studio Setup installs Microsoft Games for Windows – LIVE Redistributable, version 2.0.687.0.
This software provides support for various gamer services such as retrieving player preferences for local
accounts, as well as programmatically displaying various LIVE Guide user interface screens.

© 2010 Microsoft Corporation. All rights reserved.


Send feedback to xnags@microsoft.com.
Version: 4.0.20823.0

XNA Game Studio 4.0


Software Installation Notes

XNA Game Studio 4.0 leverages the Microsoft Visual Studio 2010 development environment, extending it for
game development. It can be installed as a discrete setup component, or as part of the Microsoft Windows
Phone Developer Tools setup.

Microsoft Windows Phone Developer Tools Setup


The Microsoft Windows Phone Developer Tools provide a complete development package for Windows Phone.
It includes Microsoft Visual Studio 2010 Express edition, as well as all project templates and assemblies for
developing Windows Phone applications.
Microsoft Windows Phone Developer Tools setup also installs XNA Game Studio 4.0. In addition to the XNA
Game Studio 4.0 components for developing Windows and Xbox 360 games and game libraries, the
Microsoft Windows Phone Developer Tools install extensions to develop games and game libraries for
Windows Phone.
After the Microsoft Windows Phone Developer Tools package is installed, all supported versions of Visual
Studio 2010 will include XNA Game Studio project templates for the following platforms:
 Windows Games
 Windows Game Libraries
 Xbox 360 Games
 Xbox 360 Game Libraries
 Windows Phone Games
 Windows Phone Game Libraries
 Content Pipeline Libraries
These XNA Game Studio 4.0 project templates will also be available in all installed editions of Microsoft
Visual Studio 2010.

Multiple Editions of Microsoft Visual Studio 2010


Windows will support multiple editions (Professional or Express) of Microsoft Visual Studio 2010 installed on
the same computer. This includes the Express edition of Visual Studio installed as part of the Microsoft

file://C:\Users\Aaron\AppData\Local\Temp\~hh5908.htm 01/11/2010
Introduction to XNA Game Studio 4.0 Page 16 of 18

Windows Phone Developer Tools.


After XNA Game Studio 4.0 or the Microsoft Windows Phone Developer Tools package is installed, associated
project templates and assemblies are available in all installed versions of Microsoft Visual Studio 2010.

Side-by-side Installations of XNA Game Studio


It is possible to have both XNA Game Studio 4.0 and previous versions of XNA Game Studio (such as XNA
Game Studio 3.1) installed on the same computer without conflict.
This is possible in part because XNA Game Studio 4.0 is compatible only with Visual Studio 2010, while
earlier versions of XNA Game Studio are compatible only with a previous edition of Visual Studio. To install
(or retain) an earlier version of XNA Game Studio, the compatible edition of Visual Studio must also be (or
remain) installed. The project templates and assemblies for the older version of XNA Game Studio will only
be available in that edition of Visual Studio.
For example, XNA Game Studio 3.1 requires Visual Studio 2008. To create and build XNA Game Studio 3.1
games, you will use Visual Studio 2008. Creating and building XNA Game Studio 4.0 games can be
performed only within Visual Studio 2010.

© 2010 Microsoft Corporation. All rights reserved.


Send feedback to xnags@microsoft.com.
Version: 4.0.20823.0

XNA Game Studio 4.0

Setting up your Firewall

The XNA Game Studio setup program adjusts Windows Firewall settings to allow the XnaTransX.exe
application to send and receive network traffic. This is necessary for your Windows-based development
computer to communicate with the Xbox 360 console. Similarly, the setup program adjusts Windows Firewall
settings for the XnaLiveProxy.exe application to enable network communications for networked games.
If you are using a firewall product other than Windows Firewall—that is, any third-party firewall—you will
need to configure this firewall to allow XnaTransX.exe and XnaLiveProxy.exe to send and receive network
traffic. Some firewall products enable you to unblock entire applications, some enable you to unblock specific
ports, and some, such as Windows Firewall, enable you to do both.
To unblock the entire XnaTransX.exe application, specify the following executable:
<install dir>\Common Files\Microsoft Shared\XNA\XnaTrans\v4.0\XnaTransX.exe
For the XnaLiveProxy.exe application, specify the following executable:
<install dir>\Microsoft XNA\XNA Game Studio\v4.0\Bin\XnaLiveProxy.exe

Note
In the above paths, <install dir> refers to the directory in which XNA Game Studio is installed. By
default, this directory is %ProgramFiles%.

To unblock specific ports, configure your firewall using the following information.

Application Port Protocol Inbound or outbound

XnaTransX.exe 1001 TCP outbound

XnaTransX.exe 1001 UDP inbound/outbound

XnaTransX.exe 3825 UDP inbound/outbound

XnaTransX.exe 3835 UDP inbound/outbound

XnaLiveProxy.exe 1000 UDP inbound/outbound

XnaLiveProxy.exe 3074 UDP inbound/outbound

Firewall Settings for Connectivity to Xbox LIVE


You may also need to unblock ports on firewall devices between your Xbox 360 console and the external
network to allow the console to connect to the Xbox LIVE service. For more information, see the following

file://C:\Users\Aaron\AppData\Local\Temp\~hh5908.htm 01/11/2010
Introduction to XNA Game Studio 4.0 Page 17 of 18

Knowledge Base article: Xbox 360: Port settings for Xbox LIVE.

© 2010 Microsoft Corporation. All rights reserved.


Send feedback to xnags@microsoft.com.
Version: 4.0.20823.0

XNA Game Studio 4.0


Getting Additional Help

If you need more help in developing with the XNA Framework, here are some additional resources.

Setting Up Your Xbox 360 Console to Run Games Created with XNA Game
Studio
For help with obtaining XNA Game Studio Connect and an XNA Creators Club membership, or with
connecting your computer to an Xbox 360 console, contact Xbox 360 customer support.
http://www.xbox.com/support/contact
Xbox 360 customer support for help developing games in XNA Game Studio is not provided.

Developing Games with XNA Game Studio


There are many resources available for help developing games with XNA Game Studio.

Resource Description

XNA Creators Club Online Your primary information source for developing games with XNA
Game Studio.

XNA Creators Club Online Forums Ask questions and exchange ideas with other game developers. The
game development forums include forums specifically for XNA Game
Studio and the XNA Framework, and for game design and other
topics.

XNA Developer Center on MSDN The MSDN site for XNA Game Studio.

XNA Game Studio blog The XNA Game Studio blog is a great place to keep up to date with
the latest information from the XNA Game Studio team. Learn
about:
 What the team is working on, including feature roadmaps.
 Insights into the people on the XNA Game Studio team.
 Why and how decisions are made about the product.
 Responses to questions and comments from the community.
 Pointers to cool articles and information about XNA Game Studio
and Xbox LIVE Indie Games.
 Tips and tricks for using XNA Game Studio.

MSDN Library The MSDN Library is an essential resource for developers using
Microsoft tools, products, and technologies. It contains technical
programming information, sample code, documentation, technical
articles, and reference guides.

Reporting Issues and Making Suggestions


To report an issue with XNA Game Studio or the XNA Framework, or to suggest how these products could be
improved, use the appropriate link available at Microsoft Connect: XNA Game Studio.

© 2010 Microsoft Corporation. All rights reserved.


Send feedback to xnags@microsoft.com.

file://C:\Users\Aaron\AppData\Local\Temp\~hh5908.htm 01/11/2010
Introduction to XNA Game Studio 4.0 Page 18 of 18

Version: 4.0.20823.0

file://C:\Users\Aaron\AppData\Local\Temp\~hh5908.htm 01/11/2010

You might also like