XNA Game Studio 2.0 En-Us
XNA Game Studio 2.0 En-Us
0
Copyright© 2017 Microsoft Corporation
The content in this document is retired and is no longer updated or supported. Some links might not work. Retired content represents the
latest updated version of this content.
XNA Game Studio 2.0
Microsoft.Xna.Framework (Other)
Class/Type Action Ta Breaki Workaround/Benefit
ken ng
BoundingSphere.Transform Added No Can be used to translate a BoundingSphere from object space to world space.
Matrix.CreateWorld Added No Can be used to create a world transform Matrix given a position vector and tw
o orientation vectors.
Vector2.Reflect Added No Can be used to calculate a reflection Vector2 given a source vector and a norm
al vector.
Microsoft.Xna.Framework.Audio
Class/Type Action T Brea Workaround/Benefit
aken king
SoundBank.PlayCue Added ov No Overload takes an AudioListener and AudioEmitter to allow playing of 3D audio without
erload having to hold onto a Cue object.
InstancePlayLimitEx Removed Yes It is no longer necessary to catch this exception - playing a Cue above its specified instanc
ception e limit will silently fail rather than throw an exception.
Microsoft.Xna.Framework.GamerServices
New namespace for XNA Game Studio 2.0, see Microsoft.Xna.Framework.GamerServices.
Microsoft.Xna.Framework.Graphics
Class/Type Act Br Workaround/Benefit
ion e
Tak a
en ki
n
g
ResourceUsage Re Y Methods that take ResourceUsage now take BufferUsage or TextureUsage. Se
mo es e below for methods that have been changed.
ved
DisplayMode.AspectRatio Ad N Can be used to retrieve the aspect ratio of a DisplayMode, useful in Xbox 360 pr
ded o ogramming.
DynamicVertexBuffer and Ad N Can be used for vertex and index buffers that you expect will be changed contin
DynamicIndexBuffer ded o uously. See Dynamic Vertex Buffers in XNA. Note that you must hook and respo
nd to the DynamicVertexBuffer.ContentLost and
DynamicIndexBuffer.ContentLost if you choose to use dynamic vertex and index
buffers.
VertexBuffer.SetData and Cha Y Does not take a SetDataOptions parameter. Dynamic vertex and index buffer s
IndexBuffer.SetData nge es etting can be accomplished using DynamicVertexBuffer and
d DynamicIndexBuffer objects.
VertexBuffer.ResourceUsage and Index Cha Y Replaced with VertexBuffer.BufferUsage and IndexBuffer.BufferUsage
Buffer.ResourceUsage nge es
d
VertexBuffer.ResourceManagementMo Re Y Resource management in non-dynamic vertex and index buffers is automaticall
de and IndexBuffer.ResourceManagem mo es y handled.
entMode ved
Effect.Lost and Effect.Reset events Re Y Effects will now handle device reset and lost events automatically.
mo es
ved
GraphicsAdapter.IsWideScreen Ad N Can be used to determine if the adapter is displaying in wide screen mode. Usef
ded o ul for Xbox 360 programming.
GraphicsAdapter.CheckDeviceFormat Cha Y Now takes a TextureUsage parameter instead of a ResourceUsage parameter.
nge es
d
GraphicsDevice.Reset Ad N You can now call Reset with a new GraphicsAdapter, useful in multi-monitor sc
ded o enarios.
ove
rloa
d
GraphicsDevice.ResolveBackBuffer Cha Y Now takes a ResolveTexture2D instead of a Texture2D. ResolveTexture2D is a
nge es type of Texture2D that is configured to hold render target data.
d
GraphicsDeviceCapabilities.NumberSi Ren N Renamed to MaxSimultaneousRenderTargets.
multaneousRenderTargets am o
ed
PrimitiveCaps.SupportsClipPlaneScale Re Y Removed, as these are fixed-function pipeline-related capabilities flags and are
dPoints, PrimitiveCaps.SupportsPerSta mo es unsupported in programmable-pipeline primitives.
geConstant, PrimitiveCaps.SupportsTex ved
tureStageStateArgumentTemp
GraphicsDeviceCreationParameters.Cr Re Y Removed, as it is no longer necessary to manually recreate a device.
eationOptions mo es
ved
OcclusionQuery Ad N Can be used in draw testing using occlusion queries, which test whether pixels f
ded o rom draw calls were actually rendered to the screen. See OcclusionQuery for an
example.
RenderTarget.RenderTargetUsage Ad N Can be used to control whether render target contents are preserved or discard
ded o ed each frame.
RenderTarget.ResourceManagementM Re Y Removed, it is no longer necessary to manually manage resources of a
ode mo es RenderTarget.
ved
ResolveTexture2D Ad Y Can be used to hold the contents of a RenderTarget. You will only need to const
ded es ruct this manually when calling GraphicsDevice.ResolveBackBuffer.
Texture2D, Texture3D, TextureCube co Cha Y Now takes TextureUsage instead of ResourceUsage.
nstructors nge es
d
Viewport.AspectRatio Ad N Can be used to retrieve the aspect ratio of a Viewport, useful in setting up proje
ded o ction matrices.
Microsoft.Xna.Framework.Input
Class/Type Actio Bre Workaround/Benefit
n Tak aki
en ng
GamePadState.IsButtonUp an Adde No Can be used to check multiple button states in the new Buttons enumeration.
d d
GamePadState.IsButtonDown
GamePadType enumeration Chan No Added Guitar and DrumKit types.
ged
Keys enumeration Chan No Added Pause value, as well as ChatpadGreen and ChatpadOrange values to suppo
ged rt the Chatpad.
Keyboard.GetState Adde No New overload takes a PlayerIndex, used to get input from a Chatpad device connecte
d over d to the player's controller. PlayerIndex.One corresponds to a plugged-in USB keyboa
load rd as well as player one's Chatpad.
Microsoft.Xna.Framework.Net
New namespace for XNA Game Studio 2.0, see Microsoft.Xna.Framework.Net.
Microsoft.Xna.Framework.Storage
Class/Type Actio Bre Workaround/Benefit
n Tak aki
en ng
BeginShowStorageDeviceGui Move Yes Moved to the GamerServices namespace, see
de and EndShowStorageDevi d Guide.BeginShowStorageDeviceSelector and Guide.EndShowStorageDeviceSelector.
ceGuide
ShowStorageDeviceGuide Remo Yes You may no longer show the device selection guide synchronously. Use
ved Guide.BeginShowStorageDeviceSelector and Guide.EndShowStorageDeviceSelector i
n the GamerServices namespace.
XNA Game Studio 2.0
Documentation Roadmap
The XNA Game Studio 2.0 documentation contains information on how to use supported versions of Microsoft Visual Studio
tools with the XNA Framework to develop games for Microsoft platforms. The documentation provides a reference to the
classes exposed by the XNA Framework and includes How To information for common development tasks. The documentation
also describes the ways in which XNA Game Studio extends the Microsoft Visual Studio development environment.
The XNA Framework is intended to complement the .NET Framework. Therefore, the XNA Framework documentation links into
the .NET Framework documentation. Similarly, XNA Game Studio takes advantage of the Microsoft Visual Studio integrated
development environment (IDE). Therefore, you will need the documentation for supported versions of Microsoft Visual Studio
tools as well.
Required Software
Describes the additional software required to use XNA Game Studio.
Microsoft Visual Studio 2005
XNA Game Studio leverages the Microsoft Visual Studio 2005 development environment, extending it for game development.
You can use XNA Game Studio with supported versions of Visual Studio tools. Click on one of the following links for more
information about using XNA Game Studio with Visual Studio 2005
Microsoft Visual C# Express Edition
Microsoft Visual Studio 2005
Note
XNA Game Studio is not supported on any member of the Microsoft Visual Studio 2008 product line or any pre-released ver
sion of Microsoft Visual Studio 2008.
In the above path, <install dir> refers to the directory beneath 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
XnaTrans.exe 1001 TCP outbound
XnaTrans.exe 1001 UDP inbound/outbound
XnaTrans.exe 3825 UDP inbound/outbound
XnaTrans.exe 3835 UDP inbound/outbound
XnaLiveProxy.exe 1000 UDP inbound/outbound
XnaLiveProxy.exe 3074 UDP inbound/outbound
Step 3B. On Your Windows-Based Computer, Enter the Connection Key and Initiate the Connection
1. From the Start menu, click Programs.
2. Click Microsoft XNA Game Studio 2.0.
3. Click XNA Game Studio Device Center.
4. Click the Add Device button.
Alternatively, the XNA Game Studio Device Management 2.0 toolbar allows you to directly launch XNA Game Studio
Device Center and add a device. Visual Studio 2005 displays the XNA Game Studio Device Management 2.0 toolbar
by default when an Xbox 360 game is open in Visual Studio.
5. Enter a name for this Xbox 360 console. This name serves only to identify your Xbox 360 console to XNA Game Studio.
The name does not need to correspond to any other computer or Xbox 360 name.
6. Click Next.
7. On the Xbox 360 display, enter the connection key displayed in XNA Game Studio Connect.
Note
The connection key might be somewhat hard to read on a standard television screen. Look at the guide below to help y
ou distinguish between specific letters and numbers:
The number "1" has a small tick at its top left, whereas the capital letter "I" does not.
The number "8" does not have a straight side at the left, whereas the capital letter "B" does.
The number "3" has no straight side at the left, whereas the capital letter "B" does.
The number "0" and the capital letter "O" are so similar, XNA Game Studio Connect treats those characters as the
same character. Therefore, the number "0" and the capital letter "O" are interchangeable.
If the connection key seems difficult to read, press the X controller button to generate a new connection key.
8. Once you are sure that the two keys match, Click Next on the XNA Game Studio Devices dialog box. XNA Game Studio
Device Center will test the connection with the Xbox 360 console.
If the connection is successful, the XNA Game Studio Device Center on the Windows-based computer will display
"Successfully connected to the Xbox 360 console." XNA Game Studio Connect on the Xbox 360 console will display
"Waiting for computer connection" followed by the name you have chosen for your Xbox 360 console in the XNA Game
Studio Device Center.
If the XNA Game Studio Device Center fails to connect to the Xbox 360 console, click Try again to edit the connection key
and try again. If the connection continues to fail, make a careful note of the error message displayed at the bottom of the
XNA Game Studio Devices dialog box. This error message can help you or a technician diagnose the cause of the
connection failure, if it did not result from mismatched keys. For more information about troubleshooting a failed
connection, see Troubleshooting Xbox 360 Game Deployment.
9. Click Finish. The name you gave to your Xbox 360 console will be listed in the XNA Game Studio Device Center. From
now on, your computer and your console can connect to each other easily.
What's Next?
You have successfully deployed your first Xbox 360 game. This game, like every game you deploy, will now appear in the My
Games section of Games Library on your Xbox 360 console. Using Games Library, you can play any of the games you have
deployed to your Xbox 360 console. From Games Library, you can also delete games you do not want to keep.
A good next step would be to try some of the tutorials. The code used in the tutorials works on both Windows-based
computers and on the Xbox 360 console, so you can try either platform to get a feel for how to develop for both. Start with
Tutorial 1: Displaying a 3D Model on the Screen for your first taste of game development.
See Also Troubleshooting Xbox 360 Game Deployment
Deploying an Xbox 360 Game
Using XNA Game Studio Device Center
Third-Party Firewall Settings
XNA Game Studio 2.0
Make sure the call to ContentManager.Load is using the "Asset Name" you saw in the Properties window in the
previous step. This code will load and prepare your graphic to be drawn, and will reload your graphic if the graphics
device is reset (such as in the case of the game window being resized).
7. Now, add code to the Draw loop so it looks like this:
C#
protected override void Draw(GameTime gameTime)
{
graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
base.Draw(gameTime);
}
base.Update(gameTime);
}
This adds a little bit of logic that will move the sprite around each frame and cause the sprite to change direction if it hits the
edges of the game window.
Step 6: Explore!
From here, you can do just about anything. If you're ready to jump into a more complex example, including 3D graphics, input,
and audio, see Going Beyond: XNA Game Studio in 3D.
Here are some more ideas to extend this sample:
Experiment with the call to SpriteBatch.Draw. Change the Color parameter to tint the sprite. See How To: Tint a Sprite.
Add a second sprite, and use BoundingBox objects to allow the sprites to collide with one another. (See
How To: Detect Whether Two Models Collide.)
Use Keyboard, Mouse, or GamePad to make the sprite respond to movements of an input device. (See Input Overview.)
Create some audio events so that the sprite makes sounds as it moves. (See
How To: Add a Sound File to Your Game Using XACT and How To: Play a Sound.)
Instead of a sprite, use a 3D primitive that moves around in 3D space. (See
How To: Draw Points, Lines, and Other 3D Primitives.)
Get more ideas and resources at XNA Creators Club Online.
XNA Game Studio 2.0
In This Section
Tutorial 1: Displaying a 3D Model on the Screen
This article details how to use the XNA Framework Content Pipeline to load a 3D model and its associated textures, and it
presents the code necessary to display the model on the screen.
Tutorial 2: Making Your Model Move Using Input
This article details how to use the XNA Framework Input API to take user input from an Xbox 360 Controller and apply it to
the model displayed in Tutorial 1.
Tutorial 3: Making Sounds with XNA Game Studio and XACT
This article details how to use the Microsoft Cross-Platform Audio Creation Tool (XACT) to make sounds for an XNA Game
Studio game, and how to use the XNA Framework Audio API to play them.
Tutorial 4: Make a Game in 60 Minutes
This tutorial helps you learn about the process of game construction, while guiding you through writing a relatively complete
game.
Tutorial 5: Adding Multiplayer and Networking Support to the Game
This tutorial adds two-player competitive game play to the game completed in Tutorial 4.
XNA Game Studio 2.0
Note that you do not see the texture you added in Solution Explorer. When you add a model, the textures that the model uses
do not need to be added to the Content Pipeline. If you need to add textures that you will access manually (such as textures
used for 2D sprite drawing), do so via Solution Explorer. Otherwise, you can simply copy the texture files to the appropriate
folder.
When the files are added to the project, the Content Pipeline automatically identifies them as content files and sets the
appropriate processors to run when you build your project. This will happen silently; you will not need to do anything. If you
would like to learn more about the Content Pipeline, see Content Pipeline.
Note
Model files contain path information for the textures they use. All models in the Spacewar Windows Starter Kit (2.0) expect to
find their textures in a Textures folder that exists alongside the folder the models are in. For this tutorial, and any time you int
end to use Spacewar content, you must replicate the folder structure in Solution Explorer as noted in this tutorial. Models you
create or retrieve from other sources may have different path requirements and therefore may require different folder setup
s. You can determine the correct texture paths by examining the model files, or by compiling the model as part of your game
using XNA Game Studio and noting any Content Pipeline path errors that are returned.
myModel = Content.Load<Model>("Models\\p1_wedge");
aspectRatio = (float)graphics.GraphicsDevice.Viewport.Width /
(float)graphics.GraphicsDevice.Viewport.Height;
}
In that step, you have told the Content Pipeline to load your model into your game when LoadContent is called at the
beginning of your game. Note how you have to pass in the path to the asset relative to your project directory. Also note that
there is no extension on the asset anymore. The name of the asset can be anything you want, but by default it is the name of
the asset file minus its extension. To see more information on how to change the name of your asset, see
Game Asset Properties.
The code now loads the model. Your next step is to get it showing on the screen.
Step 4: Display the Model on the Screen (and Make It Rotate)
You will want to modify two of the methods in your Game1.cs file.
In the Draw method, you will draw the model on the screen with texture and lighting.
In the Update method, you will make the model change its orientation based on time, so it appears to rotate over time.
Do the harder work first—drawing the model. The first step is to use some XNA Framework methods to set up the model's
position and lighting.
In the code, find the Draw method.
Modify the code (including adding the lines shown above the method) to look like this:
C#
// Set the position of the model in world space, and set the rotation.
Vector3 modelPosition = Vector3.Zero;
float modelRotation = 0.0f;
// Set the position of the camera in world space, for our view matrix.
Vector3 cameraPosition = new Vector3(0.0f, 50.0f, 5000.0f);
This code uses helper methods provided by the XNA Framework to set up the necessary 3D math and lighting to display the
model on the screen. Use the World matrix to change the position of the model in the world, the View matrix to change the
position and direction of the camera (your eye), and the Projection matrix to control how the view of the 3D world is turned
into a 2D image (projected) on your screen.
The call to CopyAbsoluteBoneTransformsTo and associated code inside the setup of the World matrix are not strictly necessary
for this model. However, when using more complicated models, which often use heirarchical structure (where mesh positions,
scales, and rotations are controlled by "bones"), this code ensures that any mesh is first transformed by the bone that controls
it, if such a bone exists. The mesh is then transformed relative to the bone transformation.
If you compile and run your code now, you will see your model on the screen! It is a spaceship with detail texture. But if you
can resist the urge to compile your project and run, you can easily make the model rotate in real-time so you can see all of it:
In the code, find the Update method.
Modify the code (including adding the lines shown above the method) to look like this:
C#
protected override void Update(GameTime gameTime)
{
// Allows the game to exit
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
this.Exit();
base.Update(gameTime);
}
And that's it. Compile and run your project by hitting the F5 key or clicking the Debug menu, and then clicking Start
Debugging.
Congratulations!
You did it. There is a lot to making games, but you have taken the first step. A 3D model with lighting and movement in real
time. From here, there is no limit to where you could go!
For simplicity's sake, we took some shortcuts that could be optimized for better performance. An obvious improvement would
be to precalculate the View and Projection matrices instead of calculating them every time Draw is called, since they do not
change. Try out this optimization as a first step. When you are ready to make your game interactive, go to the next tutorial.
Next...
Tutorial 2: Making Your Model Move Using Input
Ideas to Expand
Got the urge to tinker with the project a bit? Try these ideas.
Modify the lighting parameters in the Draw call. Look at BasicEffect for an idea of what you can modify.
Instead of looking at a blue background, try adding an image as your background. See
How To: Make a Scrolling Background for guidance. Hint: Make sure you use a call to SpriteBatch.Draw that allows you to
specify a layerDepth parameter, and set that depth to 1.0f.
Get more ideas and resources at XNA Creators Club Online.
XNA Game Studio 2.0
base.Update(gameTime);
}
The code you've just added to input runs every frame, and does a few different things. First, it gets rid of the code that
automatically rotates the ship; you'll be controlling that using your controller. Next, it calls a method named UpdateInput.
That method does not exist yet; you'll have to create it in the next step. Last, it adds the velocity of our model to its position,
moving it in the world by its velocity, and decays the velocity so that eventually the model will slow down.
Step 3: Take Input from the User
Now that the model is set up to move with velocity, you now need to provide some logic that will change the velocity based on
controller input.
A simple system that we can use is an orientation thrust method: in essence, you can point the front of your model in different
directions using your controller's thumbstick, then apply thrust in the direction you are pointing using your controller's trigger.
By building up thrust in a direction, the model will begin to move. This is similar to how the ships in the Spacewar Windows
Starter Kit (2.0) move.
We can map our controls to the game this way.
Pressing left or right on the left thumbstick will increase or decrease the value of the modelRotation variable by some
amount.
Pressing on the right trigger will add a vector in the direction of our modelRotation variable to our modelVelocity vector.
Pressing the A button will reset the position, velocity, and rotation values of the model to "warp" the ship back to the
center of the screen.
Note
Both the triggers and the thumbsticks are analog controls, meaning that they can report their movements in varying a
mounts, rather than just on or off. On the Xbox 360 Controller, the two thumbsticks and two triggers are analog control
s, and all other buttons are digital buttons.
GamePad.SetVibration(PlayerIndex.One, currentState.Triggers.Right,
currentState.Triggers.Right);
That method does a lot. Let's take it piece by piece to investigate exactly what you're doing with input and the model.
// Get the game pad state.
GamePadState currentState = GamePad.GetState(PlayerIndex.One);
This call to GetState retrieves a GamePadState object, which contains the information we need about the controller—in this
case, thumbstick and trigger positions.
// Rotate the model using the left thumbstick, and scale it down.
modelRotation -= currentState.ThumbSticks.Left.X * 0.10f;
Retrieving the x-axis value of the left thumbstick (left and right movement) returns a value that is added to the modelrotation
variable. The value is scaled down so that the rotation isn't too fast.
// Create some velocity if the right trigger is down.
Vector3 modelVelocityAdd = Vector3.Zero;
A little math here helps translate the rotation of the ship into a vector. Taking the sine value of the rotation gives us the proper
amount of X (left and right) movement, and the cosine gives us the Z (forward and back) movement. Then, we take the vector
and lengthen it by how hard the player is holding down the right trigger.
// Finally, add this vector to our velocity.
modelVelocity += modelVelocityAdd;
Finally, the created vector is added to the current velocity vector to create the final velocity vector that will be applied to move
the model around.
GamePad.SetVibration(PlayerIndex.One, currentState.Triggers.Right,
currentState.Triggers.Right);
We're using the right trigger values to give some feedback to the player with the Xbox 360 Controller vibration motors, using
SetVibration . The Xbox 360 Controller has two motors that run at different speeds, so experiment to find the best combination
for the action that's happening in the game.
// In case you get lost, press A to warp back to the center.
if (currentState.Buttons.A == ButtonState.Pressed)
{
modelPosition = Vector3.Zero;
modelVelocity = Vector3.Zero;
modelRotation = 0.0f;
}
This little extra will move the model back to its original position and orientation in case it leaves the screen.
Congratulations!
At this point, your ship moves and gives you feedback through your Xbox 360 Controller. The player is in control of the action.
When you're ready, let's add the final element—audio—to get you on your way. Once the player can control the action, and
see and hear the results of their actions, you're well on your way to creating a game.
Next...
Tutorial 3: Making Sounds with XNA Game Studio and XACT
Ideas to Expand
Want to play around some more with input? Try these ideas.
Change the game to view your model from the top, as in a top-down arcade game. (Hint: Play with the cameraPosition
vector; note that you can't set it exactly up and down because the camera vector cannot be the same as the "up" vector.)
Scale the vibration to occur more powerfully as the ship approaches the viewer. (Hint: Use the distance between
modelPosition and cameraPosition.)
Try using a keyboard to control the ship; see the Keyboard class. (Hint: You can plug a USB keyboard into your Xbox 360
console.)
Get more ideas and resources at XNA Creators Club Online.
XNA Game Studio 2.0
XACT will launch. Once you see the XACT window, create and save a new project as follows:
From the XACT window, click the File menu, and then click New Project.
From the dialog box that appears, browse to your project folder, then to the Content\Audio folder.
Name your project MyGameAudio.
Click OK.
The project is saved in your game project folder under Contents\Audio. You will load this XACT project through the Content
Pipeline later. First, put your wave files in the project so that when the XACT project loads, there will be sounds to play.
The screen contains an empty project. In the empty project, you must first create a wave bank. To do this, right-click
Wave Banks, and then click New Wave Bank. A new wave bank appears in the tree view under Wave Banks with the
default name "Wave Bank." Press ENTER to accept the default name.
Create a new sound bank. To do this, right-click Sound Banks, and then click New Sound Bank. A new sound bank
appears in the tree view under Sound Banks with the default name "Sound Bank." Press ENTER to accept the default
name.
At this point, two new windows have appeared: one for the wave bank and one for the sound bank. To arrange these
windows for easier viewing, click Window, and then click Tile Horizontally. The windows should now look similar to
the following:
Add both of your wave files to the wave bank window. Make sure the wave bank window is active by clicking on it, then
click Wave Banks, and click Insert Wave File(s). Browse to your game project folder, and into the
Content\Audio\Waves folder. Select both wave files. If you successfully added them, they appear in the wave bank
window, which will look similar to the following:
For each wave listed in the wave bank window, drag the wave from the wave bank window to the sound bank window,
and drop it on the Cue Name panel. XACT automatically creates a new cue that is linked to a new sound that plays this
wave file. It should look similar to the following:
If the lower-left corner of the sound bank window does not have any entries, you must add entries to it by dragging each
sound from the upper-left panel of the sound bank to the lower-left panel of the sound bank. This action creates cues
that correspond to the sounds.
The last thing to do before saving is make sure your engine_2 sound loops when you play it. You do not want it to just
play once and stop. Click engine_2 in the upper-left panel of the sound bank. When you do this, a tree structure will
appear in the upper-right panel of the sound bank.
In the upper-right panel of the sound bank, click the Play Wave item. Notice that the Property pane in the far lower-left
panel of your XACT window will change and list a set of properties.
In this Property pane, find the Looping section. Inside that section, select the Infinite checkbox. It should look like this:
Save the XACT project by clicking the File menu and then clicking Save Project.
Notice that you need to load three files for your audio.
An AudioEngine by passing in the name of the XACT project file with an .xgs extension.
A WaveBank by passing in your AudioEngine and the name of the wave bank you created in the XACT project with an
.xwb extension.
A SoundBank by passing in your AudioEngine and the name of the sound bank you created in the XACT project with an
.xsb extension.
Once you have done this, you are ready to add the code to play your sounds when game events happen.
Step 4: Play Sounds Using the Audio API
Sounds you wish to play in your game are accessed through a Cue object, which you can get by calling GetCue, or play directly
by calling PlayCue.
In this tutorial, you do both. For your looping engine sound, call GetCue to get and hold the engine cue, and pause and resume
the cue as your engines turn on and off when the user holds the trigger. When the player presses the A button to warp, play
the hyperspace sound by calling PlayCue.
Find the UpdateInput method. Modify it to look like this:
C#
// Cue so we can hang on to the sound of the engine.
Cue engineSound = null;
GamePad.SetVibration(PlayerIndex.One, currentState.Triggers.Right,
currentState.Triggers.Right);
else if (engineSound.IsPaused)
{
engineSound.Resume();
}
}
else
{
if (engineSound != null && engineSound.IsPlaying)
{
engineSound.Pause();
}
}
Many things are happening here. Here is a breakdown of what you are doing.
// Cue so we can hang on to the sound of the engine.
Cue engineSound = null;
The Cue represents an instance of a sound. In this case, this Cue will represent the sound of your engines when you hold the
right trigger.
// Set some audio based on whether we're pressing a trigger.
if (currentState.Triggers.Right > 0)
{
if (engineSound == null)
{
engineSound = soundBank.GetCue("engine_2");
engineSound.Play();
}
else if (engineSound.IsPaused)
{
engineSound.Resume();
}
}
else
{
if (engineSound != null && engineSound.IsPlaying)
{
engineSound.Pause();
}
}
This code manages the engine sound. Since you enter this code once every frame, you have to make sure you do not
continually try to play the same sound. You only want to modify the state of the Cue if there is a change, such as the trigger
being released after being held. This code uses GetCue the very first time through the loop to ready the Cue to play, and play it
if the trigger is down.
From that point forward, each release of the trigger will call Pause and halt playback of the Cue. Subsequently holding the
trigger again will call Resume and playback will continue.
// In case you get lost, press A to warp back to the center.
if (currentState.Buttons.A == ButtonState.Pressed)
{
modelPosition = Vector3.Zero;
modelVelocity = Vector3.Zero;
modelRotation = 0.0f;
Finally, pressing the A button warps, gets, and plays a sound all at once using PlayCue. Since you do not need to stop or pause
this sound, but can just let it play, there is no reason to hold onto the sound in a Cue object.
Congratulations!
At this point, you have a spaceship floating in 3D space, that moves around when you use your Xbox 360 Controller, and
makes sounds and gives you feedback in your controller. You have created the very beginnings of a 3D game using XNA Game
Studio, and you are only just getting started. There is so much more to explore!
Next...
Tutorial 4: Make a Game in 60 Minutes
Ideas to Expand
If you are ready to go further with this sample, why not try a few of these ideas?
Use some of the advanced runtime parameter control (RPC) functionality of XACT to change the volume and pitch of
your engines as you change pressure on your right trigger. (For more information about how to do this, see
XACT Audio Authoring.)
Add some background music and try setting volumes using categories. (See How To: Change Sound Volume Levels.)
Get more ideas and resources at XNA Creators Club Online.
XNA Game Studio 2.0
namespace GoingBeyond4_Tutorial
{
class Ship
{
public Model Model;
public Matrix[] Transforms;
if (rotation != newVal)
{
rotation = newVal;
RotationMatrix = Matrix.CreateRotationY(rotation);
}
}
}
You can see that the Ship class now does a lot—it holds onto the ship's position, velocity, rotation, and 3D model, and has its own
Update method that will move the ship around.
Now that you have created the Ship class, you need to change the code in the Game1.cs code file to take advantage of this new,
encapsulated data. Double-click on Game1.cs in your Solution Explorer.
Start with drawing the ship's model. Your original drawing code was inside the Draw method, but that will not scale up to multiple
objects very well. You will be drawing Model objects on the screen, so create a method that will draw a chosen Model. Below the Draw
method, add a new method called DrawModel, like so:
C#
public void DrawModel(Model model, Matrix modelTransform, Matrix[] absoluteBoneTransforms)
{
//Draw the model, a model can have multiple meshes, so loop
foreach (ModelMesh mesh in model.Meshes)
{
//This is where the mesh orientation is set
foreach (BasicEffect effect in mesh.Effects)
{
effect.World = absoluteBoneTransforms[mesh.ParentBone.Index] * modelTransform;
}
//Draw the mesh, will use the effects set above.
mesh.Draw();
}
}
This DrawModel method takes your model-drawing algorithm and applies it to any Model object passed into it, drawing the Model on
the screen. Next, modify the Draw call so that it calls this new method:
C#
protected override void Draw(GameTime gameTime)
{
graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
The code from the previous tutorial contained declarations for modelPosition and modelRotation values above the Draw call. Delete
those—you will not need them anymore. Also delete the cameraPosition variable—you will recreate this later.
Next, modify the Update and UpdateInput methods to use the values in the new Ship class as follows:
C#
protected override void Update(GameTime gameTime)
{
// Allows the game to exit
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
this.Exit();
// Get some input.
UpdateInput();
// Update audioEngine.
audioEngine.Update();
// Add velocity to the current position.
ship.Position += ship.Velocity;
base.Update(gameTime);
}
protected void UpdateInput()
{
// Get the game pad state.
GamePadState currentState = GamePad.GetState(PlayerIndex.One);
if (currentState.IsConnected)
{
ship.Update(currentState);
else if (engineSound.IsPaused)
{
engineSound.Resume();
}
}
else
{
if (engineSound != null && engineSound.IsPlaying)
{
engineSound.Pause();
}
}
// In case you get lost, press A to warp back to the center.
if (currentState.Buttons.A == ButtonState.Pressed)
{
ship.Position = Vector3.Zero;
ship.Velocity = Vector3.Zero;
ship.Rotation = 0.0f;
Above the UpdateInput method, remove the Cue variable engineSound—you will recreate this elsewhere. Do the same for the
modelVelocity variable above Update - it is no longer needed.
Finally, you need to make a change to the way your initialization and content loading are handled. Starting from the top of the Game
class and continuing down to just above the call to Update, modify the code as follows:
C#
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
//Camera/View information
Vector3 cameraPosition = new Vector3(0.0f, 0.0f, -5000.0f);
float aspectRatio;
Matrix projectionMatrix;
Matrix viewMatrix;
//Audio components
AudioEngine audioEngine;
WaveBank waveBank;
SoundBank soundBank;
// Cue so we can hang on to the sound of the engine.
Cue engineSound = null;
//Visual components
Ship ship = new Ship();
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
aspectRatio = (float)GraphicsDeviceManager.DefaultBackBufferWidth / GraphicsDeviceManager.D
efaultBackBufferHeight;
}
base.Initialize();
}
private Matrix[] SetupEffectDefaults(Model myModel)
{
Matrix[] absoluteTransforms = new Matrix[myModel.Bones.Count];
myModel.CopyAbsoluteBoneTransformsTo(absoluteTransforms);
foreach (ModelMesh mesh in myModel.Meshes)
{
foreach (BasicEffect effect in mesh.Effects)
{
effect.EnableDefaultLighting();
effect.Projection = projectionMatrix;
effect.View = viewMatrix;
}
}
return absoluteTransforms;
}
While it may seem like a lot of work, the modified code is a good example of encapsulation, and will come in handy as you develop
your game.
Step 2: Camera Work
Now that you have a ship object ready, the next step is to get the ship flying around the screen from a top-down point of view. You
will accomplish this by simply changing the camera's angle and distance. Finally, you will adjust the rotation mechanics on the user
input, so that it matches the behavior you want.
Reverse the camera position along the z-axis by simply altering the value from negative 5000 to positive 25000. The
cameraPosition member is declared near the start of the Game1 class. Now your cameraPosition declaration will look like this:
C#
Vector3 cameraPosition = new Vector3(0.0f, 0.0f, 25000.0f);
Unfortunately, if you run the tutorial with only that change, the ship does not show up. This is because the "projection matrix" of the
camera is not correct. The formal term that describes the problem is "bounding frustum culling" (also called "viewing frustum
culling"). Look in the XNA Game Studio documentation for the BoundingFrustum class, which includes a key diagram to help you
learn more about frustums and how they relate to the camera. A camera's near and far plane is set in a specific way to (usually)
address performance concerns. In this case, the camera's original near plane is 1 and the far plane is at 10,000. When the camera
was set at 5,000 units, like in Figure 1, the ship was in the camera's view space.
C#
projectionMatrix = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45.0f),
aspectRatio, 1.0f, 10000.0f);
You need to change the near and far clipping planes of the frustum so that the ship is back in the viewing space. You determine the
near and far clipping planes by simple math. The camera is 25,000 units away from the ship, so you set the near plane 5,000 units
"closer" to the camera, and the far plane 5,000 units "further away," like this:
C#
projectionMatrix = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45.0f),
aspectRatio, 20000.0f, 30000.0f);
This corrects the viewing space so that the ship is inside it, as in Figure 3.
Figure 3. Corrected viewing space
Running the program now will show you the view facing the back end of the ship, rather than facing the nose end. If you fly the ship
toward or away from you, you will see the ship disappear as it moves outside the frustum after a few seconds. Now alter the
orientation of the ship and how it responds to your input.
In the Ship class, you will change the default orientation of the ship so that it starts from a "top-down" perspective. Double-click on
Game1.cs in Solution Explorer.
If the ship is initially facing away from you, a 90-degree rotation along the x-axis will give you the top-down view. Don't forget, you
are looking at the ship down the z-axis, so from your perspective, changes in x are "left/right" and changes in y are "up/down". Thus,
rotating the ship on the x-axis flips the ship around as if it were spinning on the wings. In the XNA Framework, angular
measurements are given in radians, which means you are rotating the ship Pi/2 radians.
C#
public Matrix RotationMatrix = Matrix.CreateRotationX(MathHelper.PiOver2);
Now, every time you change the ship's rotation (in the ship's Rotation property "set" method), you alter the rotation matrix to
include this default rotation, plus the rotation amount along the z-axis supplied by the player's controller. You could just as well
rotate along any other axis, provided you:
Position the camera properly.
Perform your translation and rotation calculations in relation to the correct axis.
Failing to properly calculate translation and rotation movement can yield some surprising, if not frustrating, results.
C#
if (rotation != value)
{
rotation = value;
RotationMatrix = Matrix.CreateRotationX(MathHelper.PiOver2) *
Matrix.CreateRotationZ(rotation);
}
You should notice that you ship appears to be flying slowly now. That is because your view is much further away than it used to be.
Just under the declaration of Velocity, add a floating-point constant that you can use to adjust the ship's velocity:
C#
private const float VelocityScale = 5.0f; //amplifies controller speed input
At the end of the ship's Update method, insert the VelocityScale value to give the ship a little extra speed (more accurately, it
increases the number of units per frame in the game):
C#
Velocity += RotationMatrix.Forward * VelocityScale * controllerState.Triggers.Right;
Running with these changes will now give you a top-down view of the ship, which you can fly around on the screen. If you fly off
the screen, press the warp button. It's a good idea to change the original use of the A button to another button, as you will be using
the A button to fire in a later step.
Step 3: You Need Rocks. Lots of Them.
You have a ship in the game, so now add asteroids to it. For the sake of simplicity, you are only going to track each asteroid's
position, direction, and speed. Create a simple class that has only those three members. Right-click on the MyFirstGame project in
Solution Explorer, click Add, and then click New Item. Then select a Class file. Name it Asteroid.cs. (Don't forget to add a using
statement for Microsoft.Xna.Framework). Because this class is "lightweight," you will change it from a class to a struct. (Literally,
change the word "class" to "struct" in the file.) There are many nuances about when to use and not use a struct (called a "value type"
in C# parlance), which are beyond the scope of this document, many of the issues relate to performance and garbage collection
(GC). In a blog post by the Compact Framework team
(http://blogs.msdn.com/netcfteam/archive/2006/12/22/managed-code-performance-on-xbox-360-for-xna-part-2-gc-and-tools.aspx)
they say this about value types:
"Games typically have lots of small objects that represent game state. The obvious optimization here is to reduce live object count.
You can do that by defining those data structures as structs which are value types (to use more general terminology). Value types
stay off the GC heap... of course that assumes that your structs don't get boxed in to objects, which can often happen unknowingly
in your code."
In this case, you will use a value type for the Asteroid (and later for bullets) to reduce garbage collection events, as well as to keep
the implementation simple.
Add these three members to the struct:
C#
public Vector3 position;
public Vector3 direction;
public float speed;
Double-click on your Game1.cs file. Inside your Game1 class, you will create a simple array that contains asteroids. Add some
additional members to your Game1 class to render the asteroids. After the declaration for the ship (Ship ship = new Ship();), add
the following:
C#
Model asteroidModel;
Matrix[] asteroidTransforms;
Asteroid[] asteroidList = new Asteroid[GameConstants.NumAsteroids];
Random random = new Random();
There is something new in each of these four lines, so look at each one. The first line is an object that holds on to a lot of
information that describes the actual asteroid model loaded by the Content Pipeline processor. You will do that shortly. The second
line retains state information related to specific lighting and effect transformations on the asteroid. Because you are not adding any
special lighting effects, you will set up a default effect on the model and leave it. The third line is a simple array of asteroids, but you
will notice the introduction of the GameConstants class, which will generally hold values that you might want to change as you
develop and test the game. There will be more about that shortly. The final line creates a random number generator, which you will
use for a few purposes in the game.
Leook at this new GameConstants class briefly. One nice design trick for simple games like this is to gather game parameters, which
you might want to customize, into a single location. Create that class now. Click Add, and then click New Item. Then select a Class
file. Name it GameConstants.cs. Once the file opens, add these constants to the class (you will use the PlayfieldSize constants
later):
C#
//camera constants
public const float CameraHeight = 25000.0f;
public const float PlayfieldSizeX = 16000f;
public const float PlayfieldSizeY = 12500f;
//asteroid constants
public const int NumAsteroids = 10;
As you might guess from the addition of the camera constants, you will want to modify the CameraPosition declaration in the Game1
class to look like this now:
C#
Vector3 cameraPosition = new Vector3(0.0f, 0.0f, GameConstants.CameraHeight);
Turn your attention back to the Asteroid class again. To render the asteroid, you need to add an asteroid model to the Content
Pipeline. You already have a Content/Models directory in your game, since it is storing your ship model. Add the "asteroid1.x"
model to that directory by right-clicking on the directory, clicking Add, and then clicking Existing Item. Then navigate to your
Spacewar directory. (Remember, you had to do this when you did "Tutorial 1: Displaying a 3D Model on the Screen" from the
"Going Beyond: XNA Game Studio in 3D" series). Select the asteroid1.x file from your Content/Models directory (you might need
to select files of type "Content Pipeline Files" to see it) and add it to your Models directory. In addition to adding this model, you will
also need to manually copy the asteroid's texture file, "asteroid1.tga", from the Content/Textures directory in your Spacewar game
to the Content/Textures subfolder in your game project folder. Just manually copy it, do not use the Add and then Existing Item
approach. Also, be very careful about the copying process. A common beginner's mistake is to copy a Texture file into a Model
directory. This is a bad thing.
Now you will visit the LoadContent method in the Game1 class. This is where you will load the mesh model for your asteroid that you
just added. Just below the line where you added the p1_wedge model, load the asteroid model and transforms:
C#
asteroidModel = Content.Load<Model>("Models/asteroid1");
asteroidTransforms = SetupEffectDefaults(asteroidModel);
Next, populate the asteroidList with several asteroids at the end of the Initialize method in the Game1 class (before the
base.Initialize() call). When you create an asteroid, you will give it a starting speed and random direction. For now, start the
asteroids from the center of the screen. Create a separate method called ResetAsteroids, which will populate the list of asteroids.
Note
You will need to add two floating-point constants (code given below), AsteroidMinSpeed and AsteroidMaxSpeed, to the GameConst
ants class yourself. In this example, 100.0 is the minimum speed, and 300.0 is the maximum.
C#
public const float AsteroidMinSpeed = 100.0f;
public const float AsteroidMaxSpeed = 300.0f;
Then add the call to ResetAsteroids() just before the call to base.Initialize() in the Initialize method.
The direction values of the asteroids are using a basic trigonometric function to determine the x and y components of the direction,
based on the starting angle. Do not modify the z value because the game only plays in two dimensions.
Now that you have created the asteroids, you need to render them. You should recognize that this should go in the Draw() method.
Indeed, you will simply look through the asteroidList and render each asteroid in the same manner as the ship. So, add this code
after the completion of the rendering of the ship in the Draw() method.
C#
for (int i = 0; i < GameConstants.NumAsteroids; i++)
{
Matrix asteroidTransform =
Matrix.CreateTranslation(asteroidList[i].position);
DrawModel(asteroidModel, asteroidTransform, asteroidTransforms);
}
If you run this code as-is right now, you will see the ship and single asteroid rendered in the center. There are actually 10 asteroids
there, but they are stacked one on top of the other.
The next step is to give the asteroids some motion. This is accomplished in the Update() method by simply iterating over the list
and updating their position. Do that just after you update the ship's velocity:
C#
for (int i = 0; i < GameConstants.NumAsteroids; i++)
{
asteroidList[i].Update(timeDelta);
}
One thing you added is a time delta. This is a small efficiency trick. Calculate the timeDelta value once per update, rather than
repeatedly calling the property to check for the total seconds passed. This will be the first line of the Update() method (in the Game1
class):
C#
float timeDelta = (float)gameTime.ElapsedGameTime.TotalSeconds;
Notice that you are calling each asteroid's Update() method in this loop, so you will need to add that method to the Asteroid struct
(inside the structs braces, not outside it). Thanks to the expressiveness of the XNA Framework Math library, this can be written in a
very simple manner:
Note
You will need to add the floating-point constant, AsteroidSpeedAdjustment, to the GameConstants class. In this case, use a default
value of 5.0.
If everything went well, you will see the asteroids all flying away from the ship in random directions until they all disappear from
the screen.
What is wrong with this picture?
Keep the asteroids in the game by wrapping the asteroid around the screen. This is accomplished by allowing the asteroids to drift
off the screen, then shifting them to the other side once they have disappeared. The values of playfield size constants were made
from some rough approximations based on the actual viewing space. A properly designed game will carefully calculate the field of
view area and determine the limits based on asteroid model sizes, and other parameters. In this case, use the PlayfieldSize
constants in a simple fashion to determine the "wraparound" trigger areas. After you update the asteroid's position in the Asteroid
class's Update method, you then determine if you need to move the asteroid around:
C#
if (position.X > GameConstants.PlayfieldSizeX)
position.X -= 2 * GameConstants.PlayfieldSizeX;
if (position.X < -GameConstants.PlayfieldSizeX)
position.X += 2 * GameConstants.PlayfieldSizeX;
if (position.Y > GameConstants.PlayfieldSizeY)
position.Y -= 2 * GameConstants.PlayfieldSizeY;
if (position.Y < -GameConstants.PlayfieldSizeY)
position.Y += 2 * GameConstants.PlayfieldSizeY;
Now you should see your asteroids calmly wrapping around the screen as they drift through space. Perfect! Well, almost. This game
will not be very interesting if you start all the asteroids in the center, since that would result in a collision with the ship. Add some
code to start the asteroids on the left or right edge of the screen.
Choosing where to start the asteroid is a little tricky. For the x value of the asteroid's position, you must first choose to start on the
left or right side of the screen. Use the random number generator to pick either a 0 or 1. If it's 0, you will start on the left. If it's 0,
you will start will be on the right. To do this, call random.Next(2), which generates a number between 0 and up to, but not including,
the passed value (so it only returns a 0 or 1). For the y value of the asteroid's position, simply choose a random number that is
within the playfield's y range. This means you will modify the line that assigns the asteroid position a value of Vector3.Zero so that
the final method looks like this:
C#
private void ResetAsteroids()
{
float xStart;
float yStart;
for (int i = 0; i < GameConstants.NumAsteroids; i++)
{
if (random.Next(2) == 0)
{
xStart = (float)-GameConstants.PlayfieldSizeX;
}
else
{
xStart = (float)GameConstants.PlayfieldSizeX;
}
yStart = (float)random.NextDouble() * GameConstants.PlayfieldSizeY;
asteroidList[i].position = new Vector3(xStart, yStart, 0.0f);
double angle = random.NextDouble() * 2 * Math.PI;
asteroidList[i].direction.X = -(float)Math.Sin(angle);
asteroidList[i].direction.Y = (float)Math.Cos(angle);
asteroidList[i].speed = GameConstants.AsteroidMinSpeed +
(float)random.NextDouble() * GameConstants.AsteroidMaxSpeed;
}
}
Note
Do not forget to declare the two floating-point values, xStart and yStart, just before the for loop.
It might look a little confusing, but run through the math calculations a couple times to get comfortable with what is going on. At
this point, you have a ship in the center of the screen, with several asteroids starting on the sides, moving in random directions and
speeds.
Step 4: When Ships and Asteroids Collide
Now, add a few more content items to your game, which you will use in Steps 3 and 4. You will add one model and three sounds to
the game:
1. Add "pea_proj.x" (the bullet model) to the Models section in your project. To do this, right-click Models, click Add, and then
click Existing Item. Do not forget you might need to change the Files of Type drop-down to Content Pipeline Files. The
model is located in your Spacewar directory under Content/Models (the same place the asteroid model was lurking. You will
also need to copy the "pea_proj.tga" file from the Spacewar game's Content/Texture location to your Content/Textures
location. ((Again, do not use Add and then Existing Item here.)
2. Just like you did in Tutorial 3 ("Making Sounds with XNA Game Studio and XACT"), reach into the Content/Audio/Waves
directory in your Spacewar game and copy weapons/explosion3.wav, explosions/explosion2.wav, and weapons/tx0_fire1.wav
into your Content/Audio/Waves directory. Then run XACT and add those waves to your XACT sound bank. Do not forget to
also add them to the list of cues.
You have something visually interesting now. You have a ship, with sound effects, that you can move around. You also have
asteroids happily flying around on the screen. Unfortunately, you cannot shoot the asteroids. On the other hand, the asteroids also
cannot hurt you—yet. Add some collision detection between the ship and the asteroids. In a later step, you will get even by shooting
back.
With the XNA Framework, simple collision detection is easy. In this step, you will be using a BoundingSphere, which is an object that
creates the smallest-sized sphere (by default) that can enclose the target model. The BoundingSphere contains many different
intersection tests, including the ability to detect intersections with planes, rays, boxes, and, of course, other spheres (among other
things). Hence, you will put an invisible bubble around each object you want to test, and then determine if they intersect each other.
One trick to remember in gameplay is that you should consider different rules for collisions, depending on the context. In this case,
you will deliberately create a bounding sphere around the ship that is smaller than the ship. This is a little game programming trick.
Most models are uneven in shape, but a BoundingSphere only takes into account the point farthest from the model's center when
creating the sphere's radius. This results in collisions that often appear like they were not near the player's ship. In addition, creating
a slightly smaller sphere gives a little more "forgiveness" in case a player gets too close to an asteroid. So, create two constants in
the GameConstants class that sets bounding sphere sizes for the asteroids and ship:
C#
public const float AsteroidBoundingSphereScale = 0.95f; //95% size
public const float ShipBoundingSphereScale = 0.5f; //50% size
Now, create the actual bounding sphere around the ship, just after you update the asteroid positions in the Update method of the
Game1 class. Then create a loop that visits each asteroid. Inside this loop, you create a temporary bounding sphere around the
asteroid and determine whether the ship and asteroid sphere are intersecting. If the two spheres intersect, you play an explosion
sound and break out of the loop:
C#
//ship-asteroid collision check
if (ship.isActive)
{
BoundingSphere shipSphere = new BoundingSphere(
ship.Position, ship.Model.Meshes[0].BoundingSphere.Radius *
GameConstants.ShipBoundingSphereScale);
for (int i = 0; i < asteroidList.Length; i++)
{
BoundingSphere b = new BoundingSphere(asteroidList[i].position,
asteroidModel.Meshes[0].BoundingSphere.Radius *
GameConstants.AsteroidBoundingSphereScale);
if (b.Intersects(shipSphere))
{
//blow up ship
soundBank.PlayCue("explosion3");
break; //exit the loop
}
}
}
Running this program now gives you some great feedback. First, the collision check seems to work pretty well. Second, you hear a
collision sound. Third, the sound does not seem right. This is because as the asteroid and ship move through each other, the
collision check is constantly firing every frame, with the XACT engine trying to play the explosion in every frame, causing garbled
sound. You can solve this problem by removing the colliding objects from the updating and rendering. In a real game, this means
the ship explodes and you lose a life. In the tutorial, simply remove the ship and the offending asteroid from the display and then
update.
Step 5: Boom - You're Dead
The code starts getting a little more complex now, but you will leverage some handy secrets in XNA Game Studio to make it easy. To
start, you need to create a Boolean flag that tells you if the ship is alive or dead. This will go in the Ship class, right after the
declaration of VelocityScale:
Before you test for a ship and asteroid collision, you need to verify the isActive flag is true. This is done by wrapping the collision
code you already wrote in an if statement. This is easy with XNA Game Studio. Highlight the entire block of code that does the
collision check (the BoundingSphere declaration and the loop right after it), then right-click the selected code and click Surround
With, then select the if statement (not the #if statement) from the list. You will see your code is now wrapped in an if statement,
awaiting a boolean condition. Now all you have to do is replace true with ship.isActive. Finally, set ship.isActive to false after
you play the explosion sound.
This fixes the explosion sound, but both the ship and the offending asteroid are still visible in the game. First remove the ship. Since
you have set the flag in the Update() method, that still leaves you the responsibility to not draw the ship anymore. So once again
wrap a chunk of code in the Draw() method with the if statement. By now you should be familiar with what portion of the code
draws the ship. Select the line of code that draws the ship, right-click, click Surround With, and insert an if (ship.isActive) test.
Running the code now should let you merrily smash your ship into an asteroid, with an accompanying explosion and the
disappearance of your ship.
Finally, you need to remove the colliding asteroid. This requires a flag just like the ship. Each asteroid needs an isActive flag that
tells whether you should draw or update the asteroid. This is accomplished in five steps, which you should attempt to do on your
own:
1. Create an isActive flag inside the Asteroid class, similar to what you did with the ship
2. Set the isActive flag to true when you create each asteroid in the LoadContent method in the Game1 class
3. In the code where you draw the asteroids, surround the drawing code in an if statement. This happens inside the loop where
you iterate through each asteroid
4. Similarly, you now need to do the same thing in the update section, checking to see whether an asteroid is active before you
execute a collision test with the ship
5. If a ship does collide with an asteroid, set that asteroid's active state to false just after you play the explosion sound.
If you did all the steps correctly, you should have an almost-functional game! Collisions, sounds, moving ships. It's all starting to
come together! This leads to the next question: What to do once you blow up the ship? Easy. Press the Warp button. In
Tutorial 2: Making Your Model Move Using Input, you wrote some code that reset the ship back to the center. It's still there and still
useful (except back then it was the A button). Now go ahead and add a shipAlive=true statement in the code block for pressing the
B button. (Hint: Look in the UpdateInput method in the Game1 class). Also, if you have not changed the Warp button from A to B,
now is the time to do it. Instant life-regeneration!
The next step will add bullets to the game, so you can shoot back. The good news is that all the work you have done up to now will
make the bullet work seem easy.
Step 6: Revenge of the Ship
In many ways, a bullet in the game is like an asteroid: it travels in a direction and collides with things. You are going to treat bullets
just a little differently though, giving the game a little fine-tuning in the process.
Conveniently, the Bullet class structure is exactly like the Asteroid class structure, so all you need to do is copy the Asteroid class
and rename the file to Bullet.cs and struct name to Bullet. In addition, you will want to add these new constants to the
GameConstants class for later use:
C#
public const int NumBullets = 30;
public const float BulletSpeedAdjustment = 100.0f;
Think ahead a little bit right now, though. How long do you want the bullets to fly around in space? Do you want them to wrap
around the screen? Maybe only live for a certain number of seconds or travel a certain distance? Do you want the bullets to be able
to collide with both asteroids and the ship? Any of these approaches are legitimate ways to make the game physics behave. In this
case, though, the bullets are simply going to disappear once they go off the screen. This means the Update() method in the Bullet
class will flag the bullet as inactive once it drifts off the view.
This is a simple check, similar to what was done with the Asteroid class:
C#
public void Update(float delta)
{
position += direction * speed *
GameConstants.BulletSpeedAdjustment * delta;
if (position.X > GameConstants.PlayfieldSizeX ||
position.X < -GameConstants.PlayfieldSizeX ||
position.Y > GameConstants.PlayfieldSizeY ||
position.Y < -GameConstants.PlayfieldSizeY)
isActive = false;
}
Just like the Asteroid class, you are now done with the actual Bullet class. However, you have to do several things to make the
bullets actually work in the game. You have done this all before with the asteroids, but review the basic steps:
1. Load the model into the Content Pipeline and set the effect transforms.
2. Create a list to track all bullets in the game.
3. Create a bullet and make a firing soundwhen a player presses a specific button.
4. Draw the bullet in-flight.
5. Test the asteroids and bullets for collisions. If they collide, make an explosion sound and remove the colliding bullet and
asteroid.
Begin by creating the needed instance variables. Underneath the same place that you created the asteroidList and asteroidModel
variables, create a list to hold the bullets and a model to hold the bullet's shape.
C#
Model bulletModel;
Matrix[] bulletTransforms;
Bullet[] bulletList = new Bullet[GameConstants.NumBullets];
Then in the LoadContent() method, assign the pea_proj model to bulletModel. Remember, you added pea_proj.x to the
Content/Models directory earlier:
C#
bulletModel = Content.Load<Model>("Models/pea_proj");
bulletTransforms = SetupEffectDefaults(bulletModel);
Unlike the asteroids, you do not create bullets inside LoadContent. Instead, create a bullet every time a user presses a the A button
on the controller. Add a new condition to the UpdateInput() method at the very end:
C#
//are we shooting?
if (ship.isActive && currentState.Buttons.A == ButtonState.Pressed)
{
//add another bullet. Find an inactive bullet slot and use it
//if all bullets slots are used, ignore the user input
for (int i = 0; i < GameConstants.NumBullets; i++)
{
if (!bulletList[i].isActive)
{
bulletList[i].direction = ship.RotationMatrix.Forward;
bulletList[i].speed = GameConstants.BulletSpeedAdjustment;
bulletList[i].position = ship.Position +
(200 * bulletList[i].direction);
bulletList[i].isActive = true;
soundBank.PlayCue("tx0_fire1");
break; //exit the loop
}
}
}
There is an interesting trick in the above code that needs explaining. When it calculate the initial position of the bullet, it appears as
if it's firing out the nose of the ship. Thus, the codes begin by determining where the bullet is starting from, which is the ship's
center. Then it translates the bullet 200 additional units in the direction of the bullet (200 is the rough approximation of the distance
from the ship's center to the nose of the ship).
This kind of "motion offset" is very common in game development. One "extra credit" feature you can do is to add the ship's current
velocity to the bullet's velocity.
At this point in time, it's actually possible to run your game and press the fire (A) button, but you will not yet be able to see the
bullets (because you have not drawn them). When you press the fire button (the A button), you might have observed that the sound
behaves just like the original problem you had with the asteroid/ship explosions. You are triggering the sound too many times. In
fact, you probably noticed that you can hold the fire button down and it will fire a continuous "stream" of bullets (until all the bullet
"slots" are used). There is a simple fix to the UpdateInput() method to fire the bullet only once every time the button is pressed.
The problem with UpdateInput is that it is failing to track the user's previous input state. Create a variable that does this. Just after
the ContentManager declaration (near the beginning of the Game1 class), add this variable:
C#
GamePadState lastState = GamePad.GetState(PlayerIndex.One);
Then, at the end of the UpdateInput method, save the user's game pad state:
C#
lastState = currentState;
Now all you need to do is change the if statement for the "fire" effect to verify that the button was not held down the last time the
code updated:
if (ship.isActive && currentState.Buttons.A == ButtonState.Pressed &&
lastState.Buttons.A == ButtonState.Released)
When you run the program, you will now hear a firing sound for every time you individually press the A button. Now that you see
how to do this, add the same check to your hyperspace button for consistency reasons. The next step is to draw the bullet as it is
flying around the screen. Conveniently, this code is identical to the code that draws the asteroids, except you replace the word
"asteroid" with "bullet":
C#
for (int i = 0; i < GameConstants.NumBullets; i++)
{
if (bulletList[i].isActive)
{
Matrix bulletTransform =
Matrix.CreateTranslation(bulletList[i].position);
DrawModel(bulletModel, bulletTransform, bulletTransforms);
}
}
Then you will again do exactly the same thing in the Update method. Just after the part where you update the asteroid positions (but
before you do the asteroid/ship collision test), add the code to update the bullets:
C#
for (int i = 0; i < GameConstants.NumBullets; i++)
{
if (bulletList[i].isActive)
{
bulletList[i].Update(timeDelta);
}
}
If you run the code at this point in time, you actually have an "almost working" game! All that is left is testing for collisions between
the bullet and the asteroids. This process is really quite easy, all you need to do is loop through each asteroid, checking to see if a
bullet is colliding with it. If so, deactivate both the colliding bullet and asteroid and continue through the list of asteroids until you
are done. The code is almost literally a copy of the ship/asteroid collision code, except instead of if (shipAlive) you have a loop
through each asteroid. One thing to note: Do this collision check before checking to see if the ship collides with an asteroid— that
way, the player gets credit for a "kill" before getting destroyed!
C#
//bullet-asteroid collision check
for (int i = 0; i < asteroidList.Length; i++)
{
if (asteroidList[i].isActive)
{
BoundingSphere asteroidSphere =
new BoundingSphere(asteroidList[i].position,
asteroidModel.Meshes[0].BoundingSphere.Radius *
GameConstants.AsteroidBoundingSphereScale);
for (int j = 0; j < bulletList.Length; j++)
{
if (bulletList[j].isActive)
{
BoundingSphere bulletSphere = new BoundingSphere(
bulletList[j].position,
bulletModel.Meshes[0].BoundingSphere.Radius);
if (asteroidSphere.Intersects(bulletSphere))
{
soundBank.PlayCue("explosion2");
asteroidList[i].isActive = false;
bulletList[j].isActive = false;
break; //no need to check other bullets
}
}
}
}
}
If everything went well, you can now fly a ship around, shoot asteroids, and collide with asteroids. Congratulations, you have written
your first XNA Framework game! But wait, the blue background looks, well, nothing at all like a good Asteroids game. You need a
space background and, of course, a way to keep score. That is the last step.
Step 7: Space, the Final Frontier
The last step will be to add finishing touches to the game to make it both visually appealing and to give it more of a game feel. You
will do this in two parts. The first part it to add a 2D background texture to the game to give it a nice space appearance. The second
part will be adding a simple scoring mechanism to the game. When it comes to doing either step, the first thing to remember is that
all 2D items are drawn as sprites. A background and score are no different in terms of how they are drawn, but as you will learn, it
does matter when they are drawn.
For the first step, you need to create a texture for the starry background. Begin by adding the stars Texture2D object in the same
place you declared your Asteroid and Bullet models:
C#
Texture2D stars;
Just after you create the bulletModel and bulletTransforms objects, load the texture:
C#
stars = Content.Load<Texture2D>("Textures/B1_stars");
Lastly, at the beginning of the Draw() method, just after you call Clear on the graphics device, draw the star background. It's
important to draw the background at the beginning instead of the end, otherwise, it will obscure everything already drawn
(asteroids, and so on) by laying the background on top of the previously drawn objects.
C#
spriteBatch.Begin(SpriteBlendMode.None, SpriteSortMode.Immediate, SaveStateMode.None);
spriteBatch.Draw(stars, new Rectangle(0, 0, 800, 600), Color.White);
spriteBatch.End();
Now add the B1_stars.tga file into the Content/Textures area in your project (right-click Textures, click Add, and then click Existing
Item. Then select the file in the Content/Textures area where your Spacewar game is located. Don't forget you will need to change
the Files of Type drop-down to Texture Files. When you run your game now, you should see a pretty star field in the background,
with all your gameplay in the foreground.
All that is left is keeping score in the game. This is accomplished in a few simple steps:
1. Create a sprite font and add it to the Content Pipeline processing.
2. Load the sprite font with the rest of your content.
3. Set the display string and call the DrawString method.
Creating the sprite font is simple. The first thing to do is create a new folder under the Content folder called Fonts. Then right-click
this folder, click Add, and then click New Item. From the menu, pick Sprite Font. The default file name for this file is
SpriteFont1.spritefont. While you could leave it that way, give it the same name as the font you want to use. Since you will be using
the Lucida Console font, name the file Lucida Console.spritefont. Feel free to experiment with different fonts later, once you are
comfortable with this process. Once you create the file, it will open to allow you to edit the different font parameters. Just accept the
settings and close it for now.
Note
Before you go on, it's important to understand that fonts are very technical pieces of art. The people and companies that create th
em pour an enormous amount of work in them. In many cases, fonts are protected under copyright and licensing terms that widel
y vary. Just because a font is installed on your computer does not mean you automatically have the right to redistribute the font t
o anybody else. Keep this in mind if you ever decide to share games that you write.
Now that you created the sprite font, add some code in the Game1 class so that you can display something. Just after you declare the
stars object, add a few more declarations:
C#
SpriteFont lucidaConsole;
int score;
Vector2 scorePosition = new Vector2(100, 50);
The first declaration will hold the sprite font. The second is a simple counter for the score. Finally, the scorePosition object will let
you position the score in screen coordinates. You could just as well move the scorePosition into the GameConstants class, but due
to compilation rules regarding the Vector2 class, you cannot make it a const value.
Loading the sprite font is a one-line addition to the end of the LoadContent method:
C#
lucidaConsole = Content.Load<SpriteFont>("Fonts/Lucida Console");
All that is left is to display the score on the screen. This is pretty simple, provided you respect the rules of drawing order. So far,
there are four very distinct drawing steps in the Draw method. Draw the background and then the game elements (ship, then
asteroids, then bullets). As mentioned previously, if you draw the background after the game elements, all you see is the star field,
because drawing the star field last covers the entire screen space. This same issue applies for the game score. Draw the game score
last so that it appears overlaid on the rest of the game.
Hopefully by now, you will realize that the score will be drawn just before the base.Draw call is made in the Draw method. The actual
code to draw the string is simply a sprite batch Begin/End pair, with the call to DrawString in between:
C#
spriteBatch.Begin(SpriteBlendMode.AlphaBlend,
SpriteSortMode.Immediate, SaveStateMode.None);
spriteBatch.DrawString(lucidaConsole, "Score: " + score,
scorePosition, Color.LightGreen);
spriteBatch.End();
When you run the game now, you should see a score displayed in the upper-left corner. You will also notice that the game elements
appear to render underneath the score, giving the effect you want. Now think about how you want to score the game.
Good gameplay not just about "running and gunning," it's about forcing the player to make decisions and tradeoffs to achieve one
or more goals. In this game, you are going to penalize the player for each round they fire (offensive actions come at a cost) and for
any time they press the Warp button (defensive actions come at a cost). You will also penalize the player for dying. In most video
games, you are given a limited number of lives, and you subtract a "life" when the player's avatar gets destroyed. However, in this
game, a multi-life system is not implemented (you should do that as "extra credit"), so simply take away points. Also, reward points
for each asteroid destroyed. First set up some scoring values in the GameConstants class:
C#
public const int ShotPenalty = 1;
public const int DeathPenalty = 100;
public const int WarpPenalty = 50;
public const int KillBonus = 25;
Now alter the scores in the appropriate places. For instance, the shot penalty would be added to the UpdateInput method, just after
it registers that the player fired a bullet, most likely just after the soundBank.PlayCue("tx0_fire1"); line:
score -= GameConstants.ShotPenalty;
You will need similar approaches in three other areas, which you should accomplish on your own:
When the ship is determined to have collided with an asteroid (subtract DeathPenalty from score).
When a bullet is determined to have collided with an asteroid (add KillBonus to score).
When the player presses the warp button (subtract WarpPenalty from score).
Finally
The initial goal of this tutorial was to show you that the tools, materials, and knowledge to write a game are right at your fingertips,
and to guide you through the process of writing your first game. By now, you have learned how to:
Change camera views to achieve different rendering perspectives.
Write simple collision-detection routines.
Create a game environment where many things appear to be happening at once.
Integrate 2D and 3D rendering.
Render text in your game.
Create a feel of "gameplay" where the player has both benefits and penalties with their decisions.
Hopefully, you have also enjoyed the process of making the game. After all, making a game should be just as much fun as playing
one! But this is only the beginning. While the game youmade is interesting, there are many things you can still do to make the
game more engaging and enjoyable. Here are several suggestions (but by no means a complete list) on how you can take your
game to the next level:
Wrap the ship around on the screen.
Vibrate the controller when a ship collides with an asteroid.
Split the big asteroids into successively smaller ones.
Add explosion effects when a bullet hits an asteroid.
Add engine particle effects as the ship flies around.
Add a smart "UFO" that attacks the player's ship.
Add a "high score" capability to the game.
Determine when the playing field is cleared and start a new level, perhaps with more or faster asteroids.
At this point, you've been given many of the basic elements you need to build a game: graphics, input, and sound. Even so, you may
be wondering, "How do I build a game?"
Games are an expressive process, with plenty of room for creative problem solving. There is truly no one right way to make a game.
With the example you have created, there are still many missing elements. What else does the ship interact with? Does it have a
goal? What obstacles prevent the ship from reaching the goal?
Answering these questions will define your game, and make it your own. Play some games that inspire you, check out the
XNA Creators Club Online, read up on the Programming Guide, explore the XNA Framework, and have fun building a game of your
very own. We hope you enjoy XNA Game Studio!
XNA Game Studio 2.0
Similarly, we will make new methods for the ship-asteroid collision check, and replace the corresponding code in the Update
method with the call to this new CheckForShipAsteroidCollision method.
C#
public bool CheckForShipAsteroidCollision(float shipRadius, float asteroidRadius )
{
//ship-asteroid collision check
if (ship.isActive)
{
BoundingSphere shipSphere = new BoundingSphere(
ship.Position, shipRadius *
GameConstants.ShipBoundingSphereScale);
for (int i = 0; i < asteroidList.Length; i++)
{
if (asteroidList[i].isActive)
{
BoundingSphere b = new BoundingSphere(asteroidList[i].position,
asteroidRadius *
GameConstants.AsteroidBoundingSphereScale);
if (b.Intersects(shipSphere))
{
//blow up ship
ship.isActive = false;
asteroidList[i].isActive = false;
score -= GameConstants.DeathPenalty;
return true;
}
}
}
}
return false;
}
This class uses the ship model, so while doing this, add a shipModel to the Game class and initialize it as you did the other
models. When we add a player class to the code, the players will all share the same ship model data.
C#
Model shipModel;
Model asteroidModel;
Model bulletModel;
Matrix[] shipTransforms;
Matrix[] asteroidTransforms;
Matrix[] bulletTransforms;
Initialize the ship model with the other models in the game class.
C#
protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
shipModel = Content.Load<Model>("Models/p1_wedge");
shipTransforms = SetupEffectDefaults(shipModel);
asteroidModel = Content.Load<Model>("Models/asteroid1");
asteroidTransforms = SetupEffectDefaults(asteroidModel);
bulletModel = Content.Load<Model>("Models/pea_proj");
bulletTransforms = SetupEffectDefaults(bulletModel);
stars = Content.Load<Texture2D>("Textures/B1_stars");
lucidaConsole = Content.Load<SpriteFont>("Fonts/Lucida Console");
}
ship.Position += ship.Velocity;
ship.Velocity *= 0.95f;
if (shipDestroyed)
{
soundBank.PlayCue("explosion3");
}
base.Update(gameTime);
}
Next, we will look for ways to simplify the UpdateInput method. The code used to shoot a bullet could be moved into a new
method, as well as the code to warp the ship to center and to play the engine sound.
C#
public void ShootBullet()
{
//add another bullet. Find an inactive bullet slot and use it
//if all bullets slots are used, ignore the user input
for (int i = 0; i < GameConstants.NumBullets; i++)
{
if (!bulletList[i].isActive)
{
bulletList[i].direction = ship.RotationMatrix.Forward;
bulletList[i].speed = GameConstants.BulletSpeedAdjustment;
bulletList[i].position = ship.Position
+ (200 * bulletList[i].direction);
bulletList[i].isActive = true;
score -= GameConstants.ShotPenalty;
return;
}
}
}
C#
public void WarpToCenter()
{
ship.Position = Vector3.Zero;
ship.Velocity = Vector3.Zero;
ship.Rotation = 0.0f;
ship.isActive = true;
score -= GameConstants.WarpPenalty;
}
C#
void PlayEngineSound()
{
if (engineSound == null)
{
engineSound = soundBank.GetCue("engine_2");
engineSound.Play();
}
else if (engineSound.IsPaused)
{
engineSound.Resume();
}
}
It is also possible to simplify the check for whether a current button is pressed. We will create a new method called
IsButtonPressed that takes only one parameter, the button to check. This method will check a set of global variables storing
the current and last states of the game pad.
C#
GamePadState currentState;
GamePadState lastState;
...
bool IsButtonPressed(Buttons button)
{
switch (button)
{
case Buttons.A:
return (currentState.Buttons.A == ButtonState.Pressed &&
lastState.Buttons.A == ButtonState.Released);
case Buttons.B:
return (currentState.Buttons.B == ButtonState.Pressed &&
lastState.Buttons.B == ButtonState.Released);
case Buttons.X:
return (currentState.Buttons.X == ButtonState.Pressed &&
lastState.Buttons.X == ButtonState.Released);
case Buttons.Back:
return (currentState.Buttons.Back == ButtonState.Pressed &&
lastState.Buttons.Back == ButtonState.Released);
case Buttons.DPadDown:
return (currentState.DPad.Down == ButtonState.Pressed &&
lastState.DPad.Down == ButtonState.Released);
case Buttons.DPadUp:
return (currentState.DPad.Up == ButtonState.Pressed &&
lastState.DPad.Down == ButtonState.Released);
}
return false;
}
Using these new methods in UpdateInput will result in the following simplified code:
C#
protected void UpdateInput()
{
// Get the game pad state.
currentState = GamePad.GetState(PlayerIndex.One);
if (currentState.IsConnected)
{
ship.Update(currentState);
namespace GoingBeyond5
{
public class Player
{
public Player()
{
}
}
}
Next, look at Game1.cs and determine what data should be associated with a player. The player object would keep the
information about the game pad state, ship, bullets, asteroids, and score. Move these to Player.cs. Upon inspection of the code,
you might notice that the random number generator is only used to reset the asteroids for a player, so let's move this to the
Player.cs file as well. You might also notice that the last gamepad state is something that would be associated with a player.
In addition to this data, we will store a picture for each player as a Texture2D.
C#
internal GamePadState lastState;
If you compile your project at this time, you will receive some warnings that these member variables no longer exist in
Game1.cs. These warnings can help you to determine which methods in Game1.cs deal primarily with the player data.
One of the warnings indicates that the asteroidList referenced the ResetAsteroids function does not exist in the current
context. Looking at this, you can see that the ResetAsteroids function deals with resetting the asteroids for a player. Move the
ResetAsteroids method into the Player class.
The ResetAsteroids method was previously called during game initialization, so also move the call to ResetAsteroids to the
Player constructor.
C#
using System;
using System.Collections;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
namespace GoingBeyond5
{
public class Player
{
internal GamePadState lastState;
public Player()
{
ResetAsteroids();
}
Continue moving methods associated with the player data into the Player class. Here, we move the WarpToCenter,
ShootBullet, CheckForShipAsteroidCollision, and CheckForBulletAsteroidCollision into the Player class.
There is also some code in the Update method which applies specifically to the player. Remove this code from Game.Update
and create a new method called Player.Update with the player specific code. This requires that you add a new instance of the
Player object to your Game class.
C#
Player player = new Player();
Make these changes to create the new Update function in Player class.
C#
internal void Update(GameTime gameTime)
{
float timeDelta = (float)gameTime.ElapsedGameTime.TotalSeconds;
// Add velocity to the current position.
ship.Position += ship.Velocity;
Change the Update function in the Game to use the new method.
C#
protected override void Update(GameTime gameTime)
{
player.Update(gameTime);
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
this.Exit();
UpdateInput();
audioEngine.Update();
if (player.CheckForBulletAsteroidCollision(
bulletModel.Meshes[0].BoundingSphere.Radius,
asteroidModel.Meshes[0].BoundingSphere.Radius))
{
soundBank.PlayCue("explosion2");
}
if (shipDestroyed)
{
soundBank.PlayCue("explosion3");
}
base.Update(gameTime);
}
When you are finished, your Player class will look like this:
C#
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
namespace GoingBeyond5
{
class Player
{
internal GamePadState lastState;
internal Ship ship = new Ship();
internal Asteroid[] asteroidList = new Asteroid[GameConstants.NumAsteroids];
internal Bullet[] bulletList = new Bullet[GameConstants.NumBullets];
public Player()
{
ResetAsteroids();
}
}
}
}
return false;
}
}
}
With this step complete, update the UpdateInput method of the game to use the new Player class.
C#
protected void UpdateInput()
{
// Get the game pad state.
currentState = GamePad.GetState(PlayerIndex.One);
lastState = player.lastState;
if (currentState.IsConnected)
{
player.ship.Update(currentState);
// Set some audio based on whether we're pressing a trigger.
if (currentState.Triggers.Right > 0)
{
PlayEngineSound();
}
else
{
if (engineSound != null && engineSound.IsPlaying)
{
engineSound.Pause();
}
}
Finally, change the Game.Draw so that it accesses the data from the new Player class.
C#
protected override void Draw(GameTime gameTime)
{
graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
spriteBatch.Begin(SpriteBlendMode.None, SpriteSortMode.Immediate, SaveStateMode.None);
spriteBatch.Draw(stars, new Rectangle(0, 0, 800, 600), Color.White);
spriteBatch.End();
Matrix shipTransformMatrix = player.ship.RotationMatrix
* Matrix.CreateTranslation(player.ship.Position);
if (player.ship.isActive)
{
DrawModel(shipModel, shipTransformMatrix, shipTransforms);
}
for (int i = 0; i < GameConstants.NumAsteroids; i++)
{
Matrix asteroidTransform =
Matrix.CreateTranslation(player.asteroidList[i].position);
if (player.asteroidList[i].isActive)
{
DrawModel(asteroidModel, asteroidTransform, asteroidTransforms);
}
}
for (int i = 0; i < GameConstants.NumBullets; i++)
{
if (player.bulletList[i].isActive)
{
Matrix bulletTransform =
Matrix.CreateTranslation(player.bulletList[i].position);
DrawModel(bulletModel, bulletTransform, bulletTransforms);
}
}
spriteBatch.Begin(SpriteBlendMode.AlphaBlend,
SpriteSortMode.Immediate, SaveStateMode.None);
spriteBatch.DrawString(lucidaConsole, "Score: " + player.score,
scorePosition, Color.LightGreen);
spriteBatch.End();
base.Draw(gameTime);
}
At this point, you should be able to compile and run your game! We have been making small, iterative changes to make the
code more elegant, but when you run the game, it should still look essentially the same. In the next step we will begin making
the changes to the game rendering to allow the players to see one another.
Step 3: Split the Screen
Now that we have a way to create multiple players, we need a place to display the second player. In Game1.cs, create three new
member variables to store the main viewport, the left viewport, and the right viewport.
C#
Viewport mainViewport;
Viewport leftViewport;
Viewport rightViewport;
When we use only half of the screen, the aspect ratio will change. In the constructor for the game, divide the aspect ratio by 2
to account for the split screen. If you compile and run your game after making this change, the game will be distorted due to
the fact that the aspect ratio is no longer equivalent to the width and height of the back buffer.
C#
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
In LoadContent, initialize the values for each viewport. We first set the main viewport to equal the graphics device viewport.
The left viewport and right viewport will have a width that is half of the main viewport, with the right viewport beginning one
pixel past the center of the screen.
C#
protected override void LoadContent()
{
spriteBatch = new SpriteBatch(GraphicsDevice);
shipModel = Content.Load<Model>("Models/p1_wedge");
shipTransforms = SetupEffectDefaults(shipModel);
asteroidModel = Content.Load<Model>("Models/asteroid1");
asteroidTransforms = SetupEffectDefaults(asteroidModel);
bulletModel = Content.Load<Model>("Models/pea_proj");
bulletTransforms = SetupEffectDefaults(bulletModel);
stars = Content.Load<Texture2D>("Textures/B1_stars");
lucidaConsole = Content.Load<SpriteFont>("Fonts/Lucida Console");
Notice that the Draw method in game contains all the code necessary to draw a player. Rename Draw to DrawPlayer, and
change the class to a private class that accepts two arguments, the Player to draw, and the Viewport to draw the player in. At
the beginning of DrawPlayer, set the graphics device viewport to the viewport argument.
C#
void DrawPlayer(Player player, Viewport viewport)
{
graphics.GraphicsDevice.Viewport = viewport;
Finally, recreate the Draw method, calling DrawPlayer in this new, shorter method, and move the call to
base.Draw(gameTime) into this method.
C#
protected override void Draw(GameTime gameTime)
{
DrawPlayer(player, leftViewport);
base.Draw(gameTime);
}
If you run your game now, you will see that the game for the local player is now showing on the left side of the screen:
While you are looking at the global variables for the game, comment out the Player instance that is declared there. We are
going to instead associate the player data with a person who has signed into the session.
C#
//Player player = new Player();
To use network services in a game, we need to add a GamerServicesComponent to the game. Once this component has been
added, we can respond to the event that occurs when a gamer signs in.
In the Game constructor, add a new GamerServicesComponent to the collection of game components. Also in the Game
constructor, add a new event handler for the SignedIn event.
C#
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
We want to look at the input for the list of signed-in gamers during gameplay. Rename the current Update function
HandleGameplayInput and set the accessibility level to "private." Also remove the call to base.Update. Change this method
to accept a Player argument in addition to the GameTime. Also update the network session when this method is called.
C#
private void HandleGameplayInput(Player player, GameTime gameTime)
{
if (IsButtonPressed(Buttons.Back))
this.Exit();
player.Update(gameTime);
networkSession.Update();
//base.Update(gameTime);
}
There is a static property called SignedInGamers that contains the list of all signed-in players. We will use this property in the
Update method to get the Player data from a SignedInGamer. Note that this loop wraps the update code that was already in
this method. We also change UpdateInput to accept an instance of Player. This method also updates the lastState and
currentState member variables, so the update of these variables can be removed from UpdateInput
C#
protected override void Update(GameTime gameTime)
{
if (!Guide.IsVisible)
{
foreach (SignedInGamer signedInGamer in SignedInGamer.SignedInGamers)
{
Player player = signedInGamer.Tag as Player;
lastState = player.lastState;
currentState = GamePad.GetState(signedInGamer.PlayerIndex);
if (networkSession != null)
{
// Handle the lobby input here...
}
else if (availableSessions != null)
{
// Handle the available sessions input here..
}
else
{
// Handle the title screen input here..
}
player.lastState = currentState;
}
}
base.Update(gameTime);
}
The UpdateInput method will stay the same, except that it now gets the player to update from the Player argument instead of
a global variable. There is also no need for the currentState and lastState variables to be updated in this method, so you can
comment out these lines.
C#
private void UpdateInput(Player player)
{
// Get the game pad state.
//currentState = GamePad.GetState(PlayerIndex.One);
// lastState = player.lastState;
...
// player.lastState = currentState;
}
Finally, rename the Draw method to DrawGameplay and set the accessibility to "private." In this method, we will check to see
if a network session has been created or joined before we start drawing the game. For each person in the networked game, we
will draw to a different area of the screen.
C#
private void DrawGameplay(GameTime gameTime)
{
GraphicsDevice.Viewport = mainViewport;
GraphicsDevice.Clear(Color.CornflowerBlue);
Player player;
if (networkSession != null)
{
If you compile and run your game at this point, you will see a blank screen. Do not panic! This is because we made the game
play state of the game contingent on the user signing in and creating or joining a network session. We will implement these
game states next.
The Title Screen
First, create a method to draw the title screen.
C#
private void DrawTitleScreen()
{
GraphicsDevice.Clear(Color.CornflowerBlue);
string message = "";
if (SignedInGamer.SignedInGamers.Count == 0)
{
message = "No profile signed in! \nPress the Home key on the keyboard or \nthe Xbo
x Guide Button on the controller to sign in.";
}
else
{
message += "Press A to create a new session\nX to search for sessions\nB to quit\n\
n";
}
spriteBatch.Begin();
spriteBatch.DrawString(lucidaConsole, message, new Vector2(101, 101), Color.Black);
spriteBatch.DrawString(lucidaConsole, message, new Vector2(100, 100), Color.White);
spriteBatch.End();
}
Next, change the Draw method so that it draws our new title screen if there is no network session available and no available
sessions to list.
C#
protected override void Draw(GameTime gameTime)
{
if (networkSession != null)
{
// If the session is not null, we're either in the lobby or playing the game...
}
else if (availableSessions != null)
{
// Show the available session...
}
else
{
DrawTitleScreen();
}
base.Draw(gameTime);
}
selectedSessionIndex = 0;
}
else if (IsButtonPressed(Buttons.B))
{
Exit();
}
}
HookSessionEvents();
}
When responding to the GamerJoined event, we want to either create a new Player if the player is not local, or get the player if
the player has already signed in and has a Player object associated with it.
C#
void networkSession_GamerJoined(object sender, GamerJoinedEventArgs e)
{
if (!e.Gamer.IsLocal)
{
e.Gamer.Tag = new Player();
}
else
{
e.Gamer.Tag = GetPlayer(e.Gamer.Gamertag);
}
}
C#
Player GetPlayer(String gamertag)
{
foreach (SignedInGamer signedInGamer in SignedInGamer.SignedInGamers)
{
if (signedInGamer.Gamertag == gamertag)
{
return signedInGamer.Tag as Player;
}
}
If you run your game, you will see the new title screen with sign-in instructions for the player. Because we have a
GamerServicesComponent added to the game, you can now sign in or view the Guide when you follow the instructions on the
screen.
Once a player signs in, the instructions for finding or creating a new network session will also be displayed.
The Lobby
First, we will create a game screen to display the players waiting in the lobby.
C#
private void DrawLobby()
{
GraphicsDevice.Clear(Color.CornflowerBlue);
spriteBatch.Begin();
float y = 100;
y += lucidaConsole.LineSpacing * 2;
if (player.picture == null)
{
GamerProfile gamerProfile = gamer.GetProfile();
player.picture = gamerProfile.GamerPicture;
}
if (gamer.IsReady)
text += " - ready!";
y += lucidaConsole.LineSpacing + 64;
}
spriteBatch.End();
Next, we will need a method to handle any input from the user while the user is in the lobby.
C#
protected void HandleLobbyInput()
{
// Signal I'm ready to play!
if (IsButtonPressed(Buttons.A))
{
foreach (LocalNetworkGamer gamer in networkSession.LocalGamers)
gamer.IsReady = true;
}
if (IsButtonPressed(Buttons.B))
{
networkSession = null;
availableSessions = null;
}
// The host checks if everyone is ready, and moves to game play if true.
if (networkSession.IsHost)
{
if (networkSession.IsEveryoneReady)
networkSession.StartGame();
}
Add code to the Draw method so that it will call the DrawLobby function if the user should be in the lobby.
C#
protected override void Draw(GameTime gameTime)
{
if (networkSession != null)
{
// Draw the Lobby
if (networkSession.SessionState == NetworkSessionState.Lobby)
DrawLobby();
}
else if (availableSessions != null)
{
// Show the available session...
}
else
{
DrawTitleScreen();
}
base.Draw(gameTime);
}
Finally, change the Update method of the game so it will call the method that handles the lobby input.
C#
protected override void Update(GameTime gameTime)
{
if (!Guide.IsVisible)
{
foreach (SignedInGamer signedInGamer in SignedInGamer.SignedInGamers)
{
Player player = signedInGamer.Tag as Player;
lastState = player.lastState;
currentState = GamePad.GetState(signedInGamer.PlayerIndex);
if (networkSession != null)
{
if (networkSession.SessionState == NetworkSessionState.Lobby)
HandleLobbyInput();
}
else if (availableSessions != null)
{
// Handle the available sessions input here...
}
else
{
HandleTitleScreenInput();
}
player.lastState = currentState;
}
}
base.Update(gameTime);
}
Compile and run the game. Sign in and create a session to see the lobby.
y += lucidaConsole.LineSpacing * 2;
int selectedSessionIndex = 0;
for (
int sessionIndex = 0;
sessionIndex < availableSessions.Count;
sessionIndex++)
{
Color color = Color.Black;
if (sessionIndex == selectedSessionIndex)
color = Color.Yellow;
spriteBatch.DrawString(lucidaConsole, availableSessions[sessionIndex].HostGamertag,
new Vector2(100, y), color);
y += lucidaConsole.LineSpacing;
}
spriteBatch.End();
}
C#
protected void HandleAvailableSessionsInput()
{
if (IsButtonPressed(Buttons.A))
{
// Join the selected session.
if (availableSessions.Count > 0)
{
networkSession = NetworkSession.Join(availableSessions[selectedSessionIndex]);
HookSessionEvents();
availableSessions.Dispose();
availableSessions = null;
}
}
else if (IsButtonPressed(Buttons.DPadUp))
{
// Select the previous session from the list.
if (selectedSessionIndex > 0)
selectedSessionIndex--;
}
else if (IsButtonPressed(Buttons.DPadDown))
{
// Select the next session from the list.
if (selectedSessionIndex < availableSessions.Count - 1)
selectedSessionIndex++;
}
else if (IsButtonPressed(Buttons.B))
{
// Go back to the title screen.
availableSessions.Dispose();
availableSessions = null;
}
}
Change the Draw and Update methods to call these methods when the game should show the list of available sessions.
C#
protected override void Draw(GameTime gameTime)
{
if (networkSession != null)
{
// Draw the Lobby
if (networkSession.SessionState == NetworkSessionState.Lobby)
DrawLobby();
}
else if (availableSessions != null)
{
DrawAvailableSessions();
}
else
{
DrawTitleScreen();
}
base.Draw(gameTime);
}
C#
protected override void Update(GameTime gameTime)
{
if (!Guide.IsVisible)
{
foreach (SignedInGamer signedInGamer in SignedInGamer.SignedInGamers)
{
Player player = signedInGamer.Tag as Player;
lastState = player.lastState;
currentState = GamePad.GetState(signedInGamer.PlayerIndex);
if (networkSession != null)
{
if (networkSession.SessionState == NetworkSessionState.Lobby)
HandleLobbyInput();
}
else if (availableSessions != null)
{
HandleAvailableSessionsInput();
}
else
{
HandleTitleScreenInput();
}
player.lastState = currentState;
}
}
base.Update(gameTime);
}
When a player joins an available session, the other players waiting in the lobby can now be seen.
if (!sender.IsLocal)
{
Player player = sender.Tag as Player;
player.ship.isActive = packetReader.ReadBoolean();
player.ship.Position = packetReader.ReadVector3();
player.ship.Rotation = packetReader.ReadSingle();
player.score = packetReader.ReadInt32();
if (packetReader.ReadBoolean())
{
player.ShootBullet();
}
if (packetReader.ReadBoolean())
{
player.ship.isActive = false;
}
for (int i = 0; i < GameConstants.NumAsteroids; i++)
{
player.asteroidList[i].isActive = packetReader.ReadBoolean();
player.asteroidList[i].position = packetReader.ReadVector3();
}
player.Update(gameTime);
}
}
}
Next, change the UpdateInput method to call ReceiveNetworkData for every signed-in player on the local system that
might receive data. Note that the ReceiveNetworkData needs an instance of GameTime to pass to the Player.Update
method, so we will update UpdateInput to take the GameTime as a parameter. At the end of the UpdateInput Method, send
the data from the local gamer to any network gamers in the game.
C#
private void HandleGameplayInput(Player player, GameTime gameTime)
{
...
UpdateInput(player, gameTime);
...
}
C#
private void UpdateInput(Player player, GameTime gameTime)
{
bool isFiring = false;
bool shipDestroyed = false;
foreach (LocalNetworkGamer gamer in networkSession.LocalGamers)
{
ReceiveNetworkData(gamer, gameTime);
// this code is the same code we have been using to update the player input
if (currentState.IsConnected)
{
player.ship.Update(currentState);
//are we shooting?
if (player.ship.isActive && IsButtonPressed(Buttons.A))
{
player.ShootBullet();
soundBank.PlayCue("tx0_fire1");
isFiring = true;
}
if (player.CheckForBulletAsteroidCollision(
bulletModel.Meshes[0].BoundingSphere.Radius,
asteroidModel.Meshes[0].BoundingSphere.Radius))
{
soundBank.PlayCue("explosion2");
}
shipDestroyed = player.CheckForShipAsteroidCollision(
shipModel.Meshes[0].BoundingSphere.Radius,
asteroidModel.Meshes[0].BoundingSphere.Radius);
if (shipDestroyed)
{
soundBank.PlayCue("explosion3");
}
}
packetWriter.Write(player.ship.isActive);
packetWriter.Write(player.ship.Position);
packetWriter.Write(player.ship.Rotation);
packetWriter.Write(player.score);
packetWriter.Write(isFiring);
packetWriter.Write(shipDestroyed);
for (int i = 0; i < GameConstants.NumAsteroids; i++)
{
packetWriter.Write(player.asteroidList[i].isActive);
packetWriter.Write(player.asteroidList[i].position);
}
gamer.SendData(packetWriter, SendDataOptions.None);
}
}
Finally, change Draw and Update so that each method calls the DrawGameplay and HandleGameplayInput method at the
appropriate time.
C#
protected override void Draw(GameTime gameTime)
{
if (networkSession != null)
{
if (networkSession.SessionState == NetworkSessionState.Lobby)
DrawLobby();
else
DrawGameplay(gameTime);
}
else if (availableSessions != null)
{
DrawAvailableSessions();
}
else
{
DrawTitleScreen();
}
base.Draw(gameTime);
}
C#
protected override void Update(GameTime gameTime)
{
if (!Guide.IsVisible)
{
foreach (SignedInGamer signedInGamer in SignedInGamer.SignedInGamers)
{
Player player = signedInGamer.Tag as Player;
lastState = player.lastState;
currentState = GamePad.GetState(signedInGamer.PlayerIndex);
if (networkSession != null)
{
if (networkSession.SessionState == NetworkSessionState.Lobby)
HandleLobbyInput( );
else
HandleGameplayInput(player, gameTime);
}
else if (availableSessions != null)
{
HandleAvailableSessionsInput();
}
else
{
HandleTitleScreenInput();
}
player.lastState = currentState;
}
}
base.Update(gameTime);
}
With this final change, your game can now be played by two players over the network.
Where do you go from here? Using the Player class, you could extend the game to allow for two players on the same local
machine. You could also change the game to display more than two players by splitting the screen again, or get rid of the split-
screen and implement code to allow the players to shoot at one another.
More advanced screen management techniques are available from the XNA Creators Club Online Web site, along with
numerous other game programming techniques that can be used to add functionality to this game.
XNA Game Studio 2.0
XNA Game Studio provides two project template types for Xbox 360, a content pipeline extension library template, and a
starter kit. For more information on project templates for Windows, see Creating a Windows Game or Library Project. These
templates are located in the XNA Game Studio 2.0 section of the Visual C# project types.
Xbox 360 Game (2.0). A project for creating an XNA Framework 2.0 game application for Xbox 360.
Xbox 360 Game Library (2.0). A project for creating an XNA Framework 2.0 game library for Xbox 360.
Content Pipeline Extension Library (2.0). A project for creating an XNA Framework 2.0 Content Pipeline Extension Library.
For more information, see Creating a Windows Game or Library Project.
Spacewar Xbox 360 Starter Kit (2.0). A project that builds the full version of the Spacewar game for Xbox 360. You can
extend the original game code by adding new features or modifying existing ones in this project.
Xbox 360 Game (2.0)
XNA Game Studio provides an Xbox 360 Game template that creates and loads a set of starter files. This new project contains
basic code that renders a colored background.
Results
The new starter project contains the following important features.
Project Properties
These properties control many aspects of your current project. Some examples include general application settings, debug
settings, and additional project resources. You can modify the values for these properties using the Project Designer.
In addition to these properties, assembly information (such as the game title) is stored in the AssemblyInfo.cs file. This
information can be modified using the Assembly Information dialog box or by manually editing the .cs file.
References
References to the Microsoft.Xna.Framework and Microsoft.Xna.Framework.Game assemblies exist in the project
alongside the mscorlib and System assemblies. In addition to these standard assemblies, you can add other assemblies,
depending on the project type.
Content
The nested Content project stores and builds content for the game.
Game1.cs File
This file is a good starting point for adding simple game logic and basic features. It implements a single class (derived from
Game and called Game1) and overrides five methods: LoadContent , UnloadContent, Initialize, Draw, and Update. In
addition, the Game1 constructor is defined by this file. Use these methods to initialize your game components, load and render
your game content, and handle any input from the user or changes to the game environment.
GameThumbnail.png
The icon displayed in the Games Library, and when this game is packed for distribution as a .ccgame. For more information on
distribution, see Sharing Your Game Package.
Program.cs File
This file also implements a single class (called Program) that provides an entry point to game execution. Usually, little code is
added to this file unless the game is fairly advanced.
To Create an Xbox 360 Game (2.0) Project
1. From the File menu, click New Project.
2. Select the Xbox 360 Game (2.0) project type.
3. Type the name for the game project in the Name text box. You can also modify the default values for the Location and
Solution Name controls.
4. Click OK to create and load the new project.
Xbox 360 Game Library (2.0)
XNA Game Studio provides an Xbox 360 Game Library (2.0) template that creates and loads a set of starter files. Typically,
projects of this type contain managed classes that implement basic or advanced features used by a game engine or 3D
renderer. Once completed, these class libraries can be referenced by other Xbox 360 projects and provide common
functionality without having that code reside within the game project.
The new project contains basic code that implements an empty library, usable by other Xbox 360 Game projects or Xbox 360
Game libraries.
Results
The new starter project contains the following important features.
Project Properties
These properties control many aspects of your current project. Some examples include general application settings, debug
settings, and additional project resources. You can modify the values for these properties using the Project Designer.
In addition to these properties, assembly information (such as the library title) is stored in the AssemblyInfo.cs file. This
information can be modified using the Assembly Information dialog box or manually editing the .cs file.
References
References to the Microsoft.Xna.Framework and Microsoft.Xna.Framework.Game assemblies exist in the project
alongside the mscorlib and System assemblies. In addition to these standard assemblies, you can add other assemblies,
depending on the project type.
Content
The nested Content project stores and builds content for the game.
Class1.cs File
This file implements an empty C# class within a namespace, providing a starting point for the class library.
To Create an Xbox 360 Game Library (2.0) Project
1. From the File menu, click New Project.
2. Select the Xbox 360 Game Library (2.0) project type.
3. Type the name for the library project in the Name text box. You can also modify the default values for the Location and
Solution Name controls.
4. Click OK to create and load the new project.
See Also Developing Xbox 360 Games
Sharing Your Game Package
XNA Game Studio 2.0
For more information about how to add Xbox 360 console devices to the XNA Game Studio Device Center dialog box, see
Connecting to Your Xbox 360 Console with XNA Game Studio 2.0. For more information about using the features of XNA
Game Studio Device Center, see Using XNA Game Studio Device Center.
Deployment Troubleshooting
If you are unable to deploy your Xbox 360 game successfully, see Troubleshooting Xbox 360 Game Deployment.
See Also Connecting to Your Xbox 360 Console with XNA Game Studio 2.0
Troubleshooting Xbox 360 Game Deployment
Using XNA Game Studio Device Center
Developing Xbox 360 Games
XNA Game Studio 2.0
Item templates contain a .vstemplate file that provides an XML description of the template. For Xbox 360 projects, XNA Game
Studio filters the item template list based on the contents of this file. To make an item template properly compatible with XNA
Game Studio projects, add the TemplateGroupID element to the .vstemplate file.
Values for the TemplateGroupID can be "XnaFramework-v2", "XnaFramework-v2-Xbox360", and "XnaFramework-v2-
Windows".
XNA Game Studio Xbox 360 projects will show templates with a TemplateGroupID of "XnaFramework-v2" or
"XnaFramework-v2-Xbox360".
XNA Game Studio Windows game projects will show templates with a TemplateGroupID of "XnaFramework-v2" or
"XnaFramework-v2-Windows" and a ShowByDefault element with a value of "false".
Example
The following example defines the TemplateGroupID element in the .vstemplate file of an Xbox 360 game-specific item
template.
. . .
<TemplateData>
<Name>MyX360Class</Name>
<Description>My custom Xbox 360 C# class.</Description>
<ProjectType>CSharp</ProjectType>
<TemplateGroupID>XnaFramework-v2-Xbox360</TemplateGroupID>
<ShowByDefault>false</ShowByDefault>
. . .
</TemplateData>
. . .
Alternatively, to access XNA Game Studio Device Center from the Start menu:
1. From the Start menu, choose Programs.
2. Choose Microsoft XNA Game Studio 2.0.
3. Choose XNA Game Studio Device Center.
When XNA Game Studio Device Center appears, it shows a list of Xbox 360 console devices available for deploying and
debugging XNA Game Studio games.
Adding an Xbox 360 Console to the List of Console Devices Available for Deployment
An Xbox 360 console device can be added from XNA Game Studio Device Center, or from within Visual Studio using the
XNA Game Studio Device Management 2.0 toolbar.
To add an Xbox 360 console device from the XNA Game Studio Device Center, click the Add Device button.
Alternatively, to add an Xbox 360 console device from within Visual Studio using the XNA Game Studio Device
Management 2.0 toolbar, click the Add a New Device button.
This brings up the XNA Game Studio Devices dialog box which allows you to create a connection between your Windows-
based PC and your Xbox 360 console device. Detailed step-by-step instructions on how to create this connection and add an
Xbox 360 console device to the List of Console Devices can be found in
Connecting to Your Xbox 360 Console with XNA Game Studio 2.0.
Setting the Default Xbox 360 Console for Deployment
The default device is the Xbox 360 console device automatically selected for deployment and debugging when developing
Xbox 360 console games with XNA Game Studio. The current default device is shared by all instances of XNA Game Studio that
are running.
To set an Xbox 360 console device as the default device, right-click the icon for the console device, and then select Set as
Default Xbox 360.
If you have only one Xbox 360 console device, that device will automatically be selected as the default device.
Removing an Xbox 360 Console from the List of Console Devices
To remove an Xbox 360 console device from the list of devices, right-click the icon for the device and select Remove, or press
the DELETE key.
The List of Console Devices is Unique to Each User
The list of devices in XNA Game Studio Device Center is unique to each user. Each user can have a different list of Xbox 360
console devices, and a different default device.
Troubleshooting Your Connection
If you are unable to successfully establish a connection between your computer and your Xbox 360 console, see
Troubleshooting Xbox 360 Game Deployment.
See Also Connecting to Your Xbox 360 Console with XNA Game Studio 2.0
Troubleshooting Xbox 360 Game Deployment
Developing Xbox 360 Games
XNA Game Studio 2.0
XNA Game Studio provides two project template types for Windows, a content pipeline extension library template, and a
starter kit. For more information on project templates for the Xbox 360, see Creating an Xbox 360 Game or Library Project.
These templates are located in the XNA Game Studio 2.0 section of the Visual C# project types.
Windows Game (2.0). A project for creating an XNA Framework 2.0 game application for Windows.
Windows Game Library (2.0). A project for creating an XNA Framework 2.0 game library for Windows.
Content Pipeline Extension Library (2.0). A project for creating an XNA Framework 2.0 Content Pipeline Extension Library.
Spacewar Windows Starter Kit (2.0). A project that builds the full version of the Spacewar game for Windows. You can
extend the original game code by adding new features or modifying existing ones in this project.
Windows Game (2.0)
XNA Game Studio provides a Windows Game (2.0) template that creates and loads a set of starter files. This new project
contains basic code that implements a simple, framed window with a colored background.
Results
The new starter project contains the following important features.
Project Properties
These properties control many aspects of your current project. Some examples include general application settings, debug
settings, and additional project resources. You can modify the values for these properties using the Project Designer.
In addition to these properties, assembly information (such as the game title) is stored in the AssemblyInfo.cs file. This
information can be modified using the Assembly Information dialog box or by manually editing the .cs file.
References
References to the Microsoft.Xna.Framework and Microsoft.Xna.Framework.Game assemblies exist in the project alongside the
mscorlib and System assemblies. In addition to these standard assemblies, you can add other assemblies, depending on the
project type.
Content
The nested content project stores and builds content for the game. For more information, see Game Content Project.
Game.ico File
A 32 × 32 default icon, representing your game.
Game1.cs File
This file is a good starting point for adding simple game logic and basic features. It implements a single class (derived from
Game and called Game1) and overrides five methods: LoadContent and UnloadContent, Initialize, Draw, and Update. In
addition, the Game1 constructor is defined. Use these methods to initialize your game components, load and render your game
content, and handle any input from the user or changes to the game environment.
GameThumbnail.png
The icon displayed when this game is packed for distribution as a .ccgame, which is described in Sharing Your Game Package.
Program.cs File
This file also implements a single class (called Program) that provides an entry point to game execution. Usually, little code is
added to this file unless the game is fairly advanced.
To create a Windows Game (2.0) project
1. On the File menu, click New Project.
2. Select the Windows Game (2.0) project type.
3. Type the name for the game project in the Name text box. You can also modify the default values for the Location and
Solution Name controls.
4. Click OK to create and load the new project.
Project Properties
These properties control many aspects of your current project. Some examples include general application settings, debug
settings, and additional project resources. You can modify the values for these properties using the Project Designer.
In addition to these properties, assembly information (such as the library title) is stored in the AssemblyInfo.cs file. This
information can be modified using the Assembly Information dialog box or manually editing the .cs file.
References
References to the Microsoft.Xna.Framework and Microsoft.Xna.Framework.Game assemblies exist in the project alongside the
mscorlib and System assemblies. In addition to these standard assemblies, you can add other assemblies, depending on the
project type.
Content
The nested Content project stores and builds content for the game.
Class1.cs File
This file implements an empty C# class within a namespace, providing a starting point for the class library.
To create a Windows Game Library (2.0) Project
1. On the File menu, click New Project.
2. Select the Windows Game Library (2.0) project type.
3. Type the name for the library project in the Name text box. You can also modify the default values for the Location and
Solution Name controls.
4. Click OK to create and load the new project.
In addition to the project template, there are additional code templates related to projects of this type. These items can be
added to your project with the Add New Item dialog. A basic description for each item is provided below.
Content Processor item
An item template comprised of a single code file (called ContentProcessorN.cs). The numerical suffix (N) guarantees
uniqueness within the project. This file is similar to the ContentProcessor1.cs file created for the Content Pipeline Extension
Library (2.0) template. The file declares a class derived from ContentProcessor with an override of the abstract Process
method.
Content Importer item
An item template comprised of a single code file called ContentImporterN.cs. The numerical suffix (N) guarantees
uniqueness within the project. The file declares a class derived from ContentImporter with an override of the abstract Import
method.
Content Type Writer item
An item template comprised of a single code file called ContentTypeWriterN.cs. The numerical suffix (N) guarantees
uniqueness within the project. The file declares a class derived from ContentTypeWriter with overrides of the abstract Write
and GetRuntimeReader methods.
Content Type Reader item
An item template comprised of a single code file called ContentTypeReaderN.cs. The numerical suffix (N) guarantees
uniqueness within the project. The file declares a class derived from ContentTypeReader with an override of the abstract
Write method.
Unlike the Content Type Writer item, this item is not available when adding a new item to a Content Pipeline Extensions
Library project. It is only available for XNA Game or Library projects.
Whenever items of this type are added to a project, references to any dependent assemblies are automatically added. These
references include assemblies which are likely to be required when customizing the newly-added class.
Results
The new starter project contains the following important features.
Project Properties
These properties control many aspects of your current project. Some examples include general application settings, debug
settings, and additional project resources. You can modify the values for these properties using the Project Designer.
In addition to these properties, assembly information (such as the library title) is stored in the AssemblyInfo.cs file. This
information can be modified using the Assembly Information dialog box or manually editing the .cs file.
References
References to the Microsoft.Xna.Framework, Microsoft.Xna.Framework.Game, and
Microsoft.Xna.Framework.Content.Pipeline assemblies exist in the project alongside the System assemblies.
ContentProcessor1.cs File
This file implements an empty C# processor within a namespace, providing a starting point for the custom content processor.
To create a Content Pipeline Extension Library (2.0) Project
1. On the File menu, click New Project.
2. Select the Content Pipeline Extension Library (2.0) project type.
3. Type the name for the library project in the Name text box. You can also modify the default values for the Location and
Solution Name controls.
4. Click OK to create and load the new project.
See Also Using XNA Game Studio
Sharing Your Game Package
XNA Game Studio 2.0
Property Pages
Game content projects have a subset of the project property pages associated with a standard XNA Framework game project.
Access these properties by right-clicking the Content node in Solution Explorer and choosing Properties.
Build Property Page
Specifies the output path for the compiled content of your game.
Build Events Property Page
Use the Build Events page to specify build configuration instructions. You can also specify the conditions under which any
post-build events are run.
Reference Paths Property Page
Specifies the folder path for assembly references used by the nested content project of your game.
Code-Only Builds
By manually editing a .csproj file, you can build your game project without also building the nested content project. If you are
using XNA Game Studio, open the related .csproj file and add the following property:
<SkipNestedContentBuild>true</SkipNestedContentBuild>
If you are building from the command-line, use the following command to skip the nested content project:
Msbuild /p:SkipNestedContentBuild=true WindowsGame1.csproj
For more information on using MSBuild with project files, see How To: Edit Project Files and
Visual Studio Integration (MSBuild).
In addition, you can build only the nested content project from the command-line by invoking MSBuild directly on the
.contentproj file of your nested content project.
See Also Using XNA Game Studio
XNA Game Studio 2.0
4. After adding the asset to the solution, open the Properties window to verify that the proper importer and processor are
specified (right-click on the file in Solution Explorer and choose Properties from the context menu). For this example, the
Content Importer is Texture - XNA Framework and the Content Processor is Texture - XNA Framework.
For more information on the Properties window of a game asset, see Game Asset Properties.
5. Save the solution.
See Also How To: Load Content
How To: Draw a Sprite
Content Pipeline
XNA Game Studio 2.0
To examine the properties of a game asset, right-click on the file in Solution Explorer and choose Properties on the context
menu. The Properties window then appears.
In addition to the standard properties, XNA Game Studio content files have additional custom properties: Asset Name,
Content Importer, and Content Processor.
Asset Name
The name of the managed object, generated by the Content Pipeline from the game asset. This name is used at run time to
load the managed asset, using the ContentManager.Load method. The default name is the original file name without the file
extension.
Content Importer
The name of the importer for the related game asset. The list contains both custom importers referenced by the content project
and standard importers provided by XNA Game Studio.
Content Processor
The name of the processor for the related game asset. The list contains both custom processors referenced by the content
project and standard processors provided by XNA Game Studio. Processors that have modifiable parameters are indicated with
a small plus sign next to the Content Processor row. Clicking this expands the Content Processor row to display any supported
parameters. Modify these paramter values as you would other properties in this pane. For more information on parameterized
processors, see Parameterized Processors.
See Also Overview of the Content Pipeline
Using a Custom Importer or Content Processor
Using XNA Game Studio
XNA Game Studio 2.0
If you would like to share your XNA Game Studio game with other XNA Game Studio users, but do not want to share your
source code and assets, you can use the XNA Game Studio Package Utility (xnapack.exe). The Package Utility can be used from
within supported versions of Microsoft Visual Studio tools, or from the command line.
Sharing with Another User
The XNA Game Studio Package Utility compresses your game's built executable and assets into a special compressed format
that other XNA Game Studio users can open and play. You may package only XNA Game Studio game projects; the Package
Utility does not support XNA Game Studio library projects.
To Package Your Game Using the XNA Game Studio Package Utility from the Visual Studio development environment
1. In XNA Game Studio, open the project you want to package.
2. On the Build menu, click Package [projname] as XNA Creators Club Game, where [projname] is the name of the
current project.
3. The Output window indicates the status of the packing operation. If the packing operation is successful, the package file
will be created with a .ccgame extension and placed in the appropriate output folder of the project.
For example, the package file for the release version of your Windows game would be located in the bin\x86\Release
folder. This example assumes that the default project settings have not been modified.
You may share this .ccgame file with other XNA Game Studio users. It is a compressed version of your project that contains no
source code or source assets. Other users can play it, but they will not be able to view or modify your source files.
To Package Your Game Using the XNA Game Studio Package Utility from the Command Line
1. Open an XNA Game Studio command line by opening the Start menu and clicking Microsoft XNA Game Studio 2.0,
then clicking Tools, and finally clicking XNA Game Studio Command Prompt.
2. From the command line, use the cd command to change the active folder to the appropriate output folder of the project
you want to package.
3. Enter a packing command using the following syntax:
xnapack assembly platform [options]
The command-line parameters are as follows:
Para Usage
mete
r
assem The startup assembly of your project. This is the .exe built by your XNA Game Studio project.
bly
platfo The platform the project is built for. This value can be "Windows" or "Xbox360", and must match your game's proj
rm ect type.
[optio
ns] Four optional switches:
/nologo – Suppress logo/copyright messages.
/output:file – The path and file name of the output file. By default, your game is created in the same folder
as the startup assembly with the same name. (Short form: /o:)
/quiet – Suppresses all non-error messages.
/thumbnail:file – Path to an optional thumbnail that is displayed with your game. (Short form: /th:)
For a Windows game, this thumbnail appears in the graphical unpacking utility. For an Xbox 360 game, the t
humbnail also appears in the My Games screen, located in the Games Library list.
The following example packs a Windows game called MyWinGame and suppresses the logo/copyright messages.
xnapack MyWinGame.exe Windows /nologo
4. The Command-line window indicates the current status of the packing operation. If the packing operation is successful,
the package file is created, in the same folder as the startup assembly, with a .ccgame extension.
After you have packed a game, you may share the .ccgame file with other XNA Game Studio users. It is a compressed version
of your project that contains no source code or source assets. Other users can play it, but they will not be able to view or
modify your source files.
Sharing from Another User
When you have received a .ccgame file from another XNA Game Studio user, you can unpack it using either the graphical
unpacking utility or the command-line utility.
Consider the following before unpacking.
You must have XNA Game Studio installed.
Unpacking a .ccgame file automatically deploys the assets and game assembly to the target platform.
For a Windows project, you must have the same version of the XNA Framework installed that the .ccgame file
was built with.
For an Xbox 360 project, you must already have at least one Xbox 360 console specified in XNA Game Studio
Device Center, a valid XNA Creators Club membership, and XNA Game Studio Connect must be running on the
Xbox 360 console being deployed to.
To Unpack a Packaged Game from Windows Explorer
1. From Windows Explorer, double-click the .ccgame file you want to unpack. A dialog box will appear.
2. Click Unpack to begin the unpacking process.
3. When the unpacking process is complete, the next step depends on the platform.
For a Windows project, when the unpacking is complete, a folder containing the game executable opens in
Windows Explorer. Run the game by double-clicking the executable.
For an Xbox 360 project, when the unpacking is complete, you can run the game from the My Games screen,
located in the Games Library list.
Caution
If the intended destination of an unpacked game already exists, the XNA Game Studio Package Utility deletes the existing des
tination and its contents. It then creates a new container or folder containing the contents of the new game package. This app
lies to games targeting both Xbox 360 and Windows platforms.
To Unpack a Packaged Game from the Command Line
1. Open an XNA Game Studio command prompt by opening the Start menu and clicking Microsoft XNA Game Studio
2.0, then clicking Tools, and finally clicking XNA Game Studio Command Prompt.
2. From the command line, use the cd command to change the active folder to the folder containing the appropriate
package.
3. Enter an unpacking command using the following syntax.
xnapack unpack package [options]
The command-line parameters are as follows:
Par Usage
am
eter
pac An XNA Framework game package, previously created with the XNA Game Studio Package Utility. If the game is int
kag ended for the Xbox 360 console, see Connecting to Your Xbox 360 Console with XNA Game Studio 2.0 for informati
e on about adding registered consoles to your computer.
[opt
ions Five optional switches:
] /console:name – If unpacking an Xbox 360 game, specifies the console being deployed to. If no console is sp
ecified, the default console is used. (Short form: /c:)
/nologo – Suppress logo/copyright messages.
/quiet – Suppresses all non-error messages.
/run – Run the game once installation is complete. Applies only to Xbox 360 games.
/showui – Displays the user interface for confirming and copying files
The following example unpacks an XNA Creators Club game package containing a Windows game called MyWinGame and
suppresses all non-error messages.
xnapack unpack MyWinGame-Windows.ccgame /quiet
4. When the unpacking process is complete, the next step depends on the platform.
For a Windows project, when the unpacking is complete, a folder containing the game executable opens in
Windows Explorer. Run the game by double-clicking the executable.
For an Xbox 360 project, when the unpacking is complete, you can run the game from the My Games screen
(located in the Games Library list) on your Xbox 360 console.
Caution
If the intended destination of an unpacked game already exists, the XNA Game Studio Package Utility deletes the existing des
tination and its contents. It then creates a new container or folder containing the contents of the new game package. This app
lies to games targeting both Xbox 360 and Windows platforms.
See Also Sharing Your Source Code and Assets
Distributing Your Finished Game
XNA Game Studio 2.0
Sharing your entire project, including source code and content, is useful when you want other users to review your code or
content, or make modifications. However, in some cases you may not want others to see your source code or assets. If you
want feedback on gameplay or existing game art, and don't explicitly need your code to be reviewed, consider the method
described in Sharing Your Game Package.
Sharing to Another User
To share your project, including source code, with an XNA Game Studio user
1. In XNA Game Studio, open the project you want to share.
2. On the Build menu, click Clean Solution. This removes any built and intermediate files, leaving only the source code
and assets.
If you do not have this menu item, see "Cleaning the Solution Before You Build" in Deploying an Xbox 360 Game.
3. Open Windows Explorer, and browse to the folder that contains the project you want to share.
4. Right-click on the project folder in Windows Explorer, click Send To, and then click Compressed (zipped) Folder.
The compressed file is ready to share.
Sharing from Another User
To open a project with source code as an XNA Game Studio user
1. Upon receiving a compressed file with source code and assets, extract the contents into a folder.
Tip
If it is a .zip file, you can right-click the file in Windows Explorer, click Open With, and then click Compressed (zipped
) Folders to begin the extraction process.
2. After the files are extracted, start XNA Game Studio.
3. In XNA Game Studio, click the File menu, and then click Open Project.
4. Use the dialog box to browse to the project folder you specified in Step 1, and select the .csproj file.
5. Click Open.
The project is loaded into XNA Game Studio and ready for viewing or modification.
See Also Sharing Your Game Package
Distributing Your Finished Game
XNA Game Studio 2.0
If you would like to share your XNA Game Studio game with other Windows users, but do not want to share your source code
and assets, you can create an installable package that contains your game binaries and the necessary redistributable files.
Sharing to Another Windows User
You may package XNA Game Studio game projects only for the Windows platform. Use this method for distributing your
compiled game code and asset files.
To Compile Your Game Binaries for Distribution
1. In XNA Game Studio, open the project you want to package.
2. From the Build menu, click Build Solution.
This creates the necessary files needed to run your game on other computers.
3. Package all files located in the appropriate output directory of your project, using an installation package tool of your
choice.
Notes for Independent Publishing
In addition to the requirements listed in the previous table, there are additional software prerequisites that must be installed on
a player's machine if the computer does not have XNA Game Studio installed.
The following software packages must be installed on the player's computer in order for your game to run.
The .NET Framework 2.0 Redistributable.
The XNA Framework Redistributable corresponding to the version your game was built against.
Tip
You can find this version number by loading your project in XNA Game Studio and clicking the project node in Solution
Explorer. The XNA Framework Version property is visible in the property pane.
To determine whether the player already has the redistributable installed, use the Windows Installer function
MsiQueryProductState with the product code for the version of the redistributable that you want to verify. The following
table lists the product codes for the various versions of the redistributable.
Redistributable Version Product Code
XNA Game Studio Express 1.0 E7A2604C-0131-4415-9D0A-717E1BB1EDD2
XNA Game Studio Express 1.0 Refresh 311F799A-FCE9-4D9E-B5D2-CBB8859B40BB
XNA Game Studio 2.0 245F6C7A-0C22-4de0-8202-2AAA620A1D3A
Note
The XNA Framework Redistributable does not support the Content Pipeline or networked games.
Programming Guide
When developing games in XNA Game Studio, you use the XNA Framework, a set of managed libraries for Windows and the
Xbox 360. These libraries enable you to be more productive developing C# games using a set of unified class libraries.
How To Get Started
If you are new to game programming, or just want to review the basic steps toward getting a simple game up and running in
XNA Game Studio, see the how-to articles in Game Programming Basics.
Content Pipeline
The XNA Game Studio Content Pipeline builds art assets that you have included in your project into a form your game can load
at run time on either Windows or the Xbox 360 game machines by calling ContentManager.Load.
This build process for art assets is controlled by Content Pipeline importers and content processors. When you press F5 to
build a game created with XNA Game Studio, the appropriate Content Pipeline importer and processor for each asset is
invoked, and that asset is automatically built into your game.
The flexibility of this process lets you create and update art assets using a wide variety of digital content creation (DCC) tools.
XNA Game Studio supplies importers for several popular export formats supported by DCC tools, and also lets you develop
custom importers for other formats.
In This Section
Overview of the Content Pipeline
The XNA Game Studio Content Pipeline lets you build art assets into your game automatically from whatever file formats
they are being maintained in.
Model Processing with the XNA Framework Content Pipeline
Describes the model conversion process implemented by XNA Framework Content Pipeline.
Content Pipeline Architecture
The architecture of the XNA Game Studio Content Pipeline build process is designed to be extensible, so that it can easily
support new input file formats and new types of conversion.
Standard Importers and Processors
XNA Game Studio ships with standard Content Pipeline importers and content processors that support various common art-
asset file formats.
Parameterized Processors
Many of the standard Content Pipeline content processors shipped with XNA Game Studio support parameter usage.
Developing with Parameterized Processors
Developing with parameterized processors, both standard and custom, requires additional thought and care.
Using a Custom Importer or Content Processor
This topic explains how to use a custom processor or importer in an existing game solution.
Extending an XNA Framework Standard Processor
XNA Game Studio lets you modify or extend the behavior of any of the standard Content Pipeline processors that ship with
the product.
Sprite Font XML Schema Reference
The following table lists the valid tags and values for Sprite-Font (.spritefont) XML files used by the Content Pipeline to create
SpriteFont textures:
How To: Write a Custom Importer and Processor
To add support for a new art asset file format, you will need to write a new content importer. Also, you may need to write a
custom processor, writer, and reader for the new art asset type after it has been imported.
How To: Extend the Font Description Processor to Support Additional Characters
This document describes the process of developing a custom content processor to add additional characters to a
FontDescription object based on the text that is required by the game.
See Also Programming Guide
XNA Game Studio 2.0
All GeometryContent objects, containing the actual triangles, are converted to ModelMeshPart objects. As mentioned
previously, a GeometryContent object contains a VertexContent, IndexCollection, and MaterialContent object. Although the
ModelProcessor modifies the data in the IndexCollections, it does not change the type. The VertexContent object, received as
input, has two corresponding output types: a VertexBufferContent Class, containing the optimized triangle data, and an array of
VertexElement Structure objects, specifying the data contained in the VertexBufferContent Class.
The last step hands off any MaterialContent objects in the scene by chaining to the MaterialProcessor.
See Also Content Pipeline
Content Pipeline Architecture
XNA Game Studio 2.0
Parameterized Processors
Many of the standard Content Pipeline content processors shipped with XNA Game Studio support parameter usage.
Parameterization makes a standard, or custom, processor more flexible and better able to meet the needs of your XNA
Framework application. In addition to specifying values for standard parameters, you can easily implement parameter support
for a new or existing custom processor. For more information, see Developing with Parameterized Processors.
When a game asset is selected, any parameters for the related asset processor are displayed in the Properties window. Use the
Properties window to modify these parameter values at any time.
Note
If the processor for a game asset is changed to a different processor, all parameter values are reset to their default values. Thi
s means that if you modify the Generate Mipmaps parameter value for the TextureProcessor, then switch to a different proc
essor (for example, FontTextureProcessor Class) the paramaters would be switched to the default values for that processor. If
you then swith back again, the modified values are reset to the default values of the original processor. They values do not re
vert to the modified values you originally input.
For more information on modifying and declaring parameter values programmatically, see
Developing with Parameterized Processors.
See Also Content Pipeline
XNA Game Studio 2.0
After adding the necessary parameters, pass the dictionary to the chained processor:
context.BuildAsset<TextureContent, TextureContent="">(
texture, typeof( TextureProcessor ).Name,
parameters,
null,
null );
The following code example defines a simple custom processor that switches the coordinate system of a model using a single
parameter (called switchCoordinateSystem):
public class SwitchCoordSystemProcessor : ModelProcessor
{
#region Processor Parameters
private bool switchCoordinateSystem = false;
In this code, the SwitchCoordSystemProcessor class is derived from ModelProcessor, indicating that this processor accepts a
model as input. The next few lines declare a single property called SwitchCoordinateSystem of type bool. Please note that
every parameter must have a set method. The property also has several attributes applied to it:
Attribu Usage
te Nam
e
Display Name of the property when it is displayed within the Properties window of XNA Game Studio. If not specified, the inte
Name rnal property name, declared in the source code, is used. For this example, "Switch Coordinate System" would be displ
ayed.
Default A UI hint specifying the default value the property could have. This value is used only as a UI hint. It will not be set on t
Value he property or override the default value declared in the code.
Descrip Descriptive text displayed when the property is selected within the Properties window of XNA Game Studio.
tion
This completes the definition of the SwitchCoordinateSystem property.
In the next code example, the class definition is continued with an override of the Process method:
//additional class code precedes...
public override ModelContent Process(NodeContent input, ContentProcessorContext c
ontext)
{
if (switchCoordinateSystem)
{
Matrix switchMatrix = Matrix.Identity;
switchMatrix.Forward = Vector3.Backward;
MeshHelper.TransformScene(input, switchMatrix);
}
This code passes the SwitchCoordinateSystem property (declared earlier) value to TransformScene; a helper method that
applies a transform to a scene hierarchy.
See Also Content Pipeline
Parameterized Processors
XNA Game Studio 2.0
The following procedure shows how to add such a custom importer and processor to an existing game project. These steps
assume that you have copied the new importer or processor to a local subfolder of the game project in question.
To Add a Custom Importer or Processor to a Game Project
1. Open XNA Game Studio.
2. Load the solution associated with your game.
3. From Solution Explorer, right-click the nested content project node and select Add Reference.
4. Navigate to the directory containing the assembly with the custom importer or processor and add it to the solution.
5. Save the solution.
The new importer or processor now appears as one of the available choices for importing or processing a newly added game
asset.
See Also Content Pipeline
Standard Importers and Processors
XNA Game Studio 2.0
Because this override is processing MaterialContent objects in memory rather than ExternalReference objects, it uses the
ContentProcessorContext.Convert function instead of BuildAsset to invoke the processor created by your first override.
After building and installing your new NoCompressionModelProcessor (see Using a Custom Importer or Content Processor),
you can assign it to any models whose textures are already compressed and no further compression will be applied to them.
See Also Overview of the Content Pipeline
Content Pipeline Architecture
Standard Importers and Processors
Using a Custom Importer or Content Processor
XNA Game Studio 2.0
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
<Asset Type="Graphics:FontDescription">
<FontName>Courier New</FontName>
<Size>18</Size>
<Spacing>0</Spacing>
<UseKerning>true</UseKerning>
<Style>Regular</Style>
<CharacterRegions>
<CharacterRegion>
<Start>32</Start>
<End>127</End>
</CharacterRegion>
</CharacterRegions>
</Asset>
</XnaContent>
See Also
Concepts
2D Graphics Overview
Tasks
How To: Draw Text
Reference
SpriteFont
XNA Game Studio 2.0
However, if you want to support a new type in the Content Pipeline, writing your own importer and processor can be fairly
straightforward.
Suppose, for example, that you want to compile HLSL source files into pixel shaders, somewhat like the EffectImporter and
EffectProcessor classes built into XNA Game Studio, but processing individual pixel shaders rather than complete effects. This a
good, simple example to illustrate the steps you would take to write an importer and processor, and also the writer and reader
needed to save and load the results. The sections below describe each of the steps in turn.
Creating a Content Pipeline Extension Library
Implementing a Simple Importer
Implementing a Processor to Compile the Shader
Implementing a Writer for the Compiled Shader
Implementing a Reader for the Pixel Shaders
Using the Output of the New Processor in Your Game
Creating a Content Pipeline Extension Library
The first step in writing an importer and processor is to create a new project for them. You need to do this because your
importer and processor are used by the Content Pipeline when your game is being built, but are not part of the game itself. As
a result, you need to provide them as a separate library assembly that the Content Pipeline can link to when it needs to build
the new file format you are supporting.
1. In XNA Game Studio, load a game solution you are developing (the sample uses "CPExtPixelShader").
2. From Solution Explorer, right-click the Solution node, then click Add, and then click New Project.
3. From the Add New Project dialog box, under the Visual C# node, from the Project types: pane, select the XNA Game
Studio 2.0 node.
4. Select the Content Pipeline Extension Library (2.0) template, assign a name to the new project at the bottom of the
dialog box (name this project PSProcessorLib), and click Ok.
5. From Solution Explorer, right-click the ContentProcessor1.cs item and select Delete.
The remaining steps create a reference to the PSProcessorLib content extension project.
6. From Solution Explorer, right-click the Content node of the CPExtPixelShader project, and then click Add Reference.
7. From the Projects tab, select your content extension project and click OK.
The new project is now ready for your custom importer and processor implementation.
Implementing a Simple Importer
First, create a class to hold the input data you are importing, which in this case takes the form of a string of HLSL source code.
Add a new C# class named PSSourceCode to the processor project. The first thing to do in the file containing your new class
definition is add the following using statement at the beginning of the file:
C#
using Microsoft.Xna.Framework.Content.Pipeline;
The next step is to write an importer class to import the HLSL source code. This class must be derived from ContentImporter
and implements the Import method. All it does is read a text file containing HLSL source code into your PSSourceCode class.
Using the New Item dialog box, add a new Content Importer item (called PSImporter) to the processor project.
Now define the class as follows:
C#
[ContentImporter(".psh", DefaultProcessor = "PSProcessor",
DisplayName = "Pixel Shader Importer")]
class PSImporter : ContentImporter<PSSourceCode>
{
public override PSSourceCode Import(string filename, ContentImporterContext context)
{
string sourceCode = System.IO.File.ReadAllText(filename);
return new PSSourceCode(sourceCode);
}
}
The ContentImporter attribute applied to the PSImporter class provides some context for the user interface of XNA Game
Studio. Since this importer supports files with a .psh extension, XNA Game Studio will automatically select the PSImporter
importer when a .psh file is added to the project. In addition, the DefaultProcessor argument specifies the correct processor
XNA Game Studio selects when a .psh file is added.
Note
To specify multiple file types, separate the file extensions, listed in the ContentImporterAttribute with a comma. For example,
[ContentImporter (".bmp",".dds",".tga")] declares an importer that accepts .bmp, .dds, and .tga file types. Normally, an
importer that accepts multiple file formats is specialized to generate one particular kind of output type, such as textures. How
ever, aside from difficulties of maintenance, there is nothing to prevent a single importer from being written to handle many
different content types.
When the game is built, the ContentImporter.Import function is called once for each XNA content item in the current project.
When invoked against an input file in the appropriate format, a custom importer is expected to parse the file and produce as
output one or more content objects of appropriate types. Since an importer's output is passed directly to a Content Pipeline
processor, each type that an importer generates must have at least one processor available that can accept it as input.
Tip
An importer that generates DOM objects may also automatically generate an intermediate XML cache file that serializes thes
e objects, provided that the importer has been implemented with the CacheImportedData attribute flag set to true (this flag i
s false by default). To set the attribute flag to true, begin the implementation of your Importer class like this:
[ContentImporter( ".MyExt", CacheImportedData = true )]
class PSImporter : ContentImporter<PSSourceCode>
{
...
}
Now you are ready to write the processor class, which converts a PSSourceCode object into a CompiledPS object. Using the
New Item dialog box, add a new Content Processor item (called PSProcessor) to the processor project.
Now define the class as follows:
C#
[ContentProcessor(DisplayName = "Pixel Shader Processor")]
class PSProcessor : ContentProcessor<PSSourceCode, CompiledPS>
{
public override CompiledPS Process(PSSourceCode input, ContentProcessorContext context)
{
CompiledShader shader = ShaderCompiler.CompileFromSource(input.SourceCode, null, nu
ll,
CompilerOptions.None, "main", ShaderProfile.PS_2_0, context.TargetPlatform);
if (!shader.Success)
{
throw new InvalidContentException(shader.ErrorsAndWarnings);
}
return new CompiledPS(shader.GetShaderCode());
}
}
The Framework.Graphics.ShaderCompiler class performs the actual compilation to code that will run on the game machine
your game targets, which is specified by the context.TargetPlatform argument. If an error occurs during compilation,
PSProcessor throws an InvalidContentException, which appears in the Error List window of XNA Game Studio.
Implementing a Writer for the Compiled Shader
The final design-time class to implement is a writer that saves the compiled pixel shader produced by your processor as a
binary .xnb file.
Using the New Item dialog box, add a new Content Type Writer item (called PSWriter) to the processor project.
Define the new class as follows:
C#
[ContentTypeWriter]
class PSWriter : ContentTypeWriter<CompiledPS>
{
protected override void Write(ContentWriter output, CompiledPS value)
{
output.Write(value.CompiledShader.Length);
output.Write(value.CompiledShader);
}
public override string GetRuntimeType(TargetPlatform targetPlatform)
{
return typeof(PixelShader).AssemblyQualifiedName;
}
public override string GetRuntimeReader(TargetPlatform targetPlatform)
{
return "CPExtPixelShader.PSReader, CPExtPixelShader, Version=1.0.0.0, Culture=neutr
al";
}
}
The GetRuntimeType method identifies the type of object your game should load from the .xnb file written by the writer object.
In this instance, the .xnb file contains the binary array from your custom CompiledPS type, and this method identifies how
that array will be mapped to a standard Framework.Graphics.PixelShader object type at load time.
The GetRuntimeReader method specifies what reader should be invoked to load the .xnb file in your game. It returns the
namespace and name of the reader class, followed by the name of the assembly in which that class is physically located. In
your code, change the assembly name to match the actual name of your game and its assembly, since that is where you will be
loading the shaders.
At this point, the code for your PSProcessorLib library is complete.
Implementing a Reader for the Pixel Shaders
Now move from the PSProcessorLib library project back to your game project and write the class that your game uses to load
the .xnb files that your processor creates. This is the class that your writer specified above as its reader.
In your game project, add a C# class called PSReader to your game project, and add the using statements you will need at the
top of the file:
C#
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
Deriving from the ContentTypeReader generic class for the PixelShader type, override the Read method, and define your class
as follows:
C#
class PSReader : ContentTypeReader<PixelShader>
{
/// <summary>
/// Loads an imported shader.
/// </summary>
protected override PixelShader Read(ContentReader input, PixelShader existingInstance)
{
int codeSize = input.ReadInt32();
byte[] shaderCode = input.ReadBytes(codeSize);
IGraphicsDeviceService graphicsDeviceService =
(IGraphicsDeviceService)input.ContentManager.ServiceProvider.GetService(
typeof(IGraphicsDeviceService));
return new PixelShader(graphicsDeviceService.GraphicsDevice, shaderCode);
}
}
At this point, build the processor project. Once it has completed, you are ready to use the new importer and processor to build
pixel shaders into your game.
Using the Output of the New Processor in Your Game
Try adding a test HLSL source file with a .psh extension to your game project and see how it works:
1. Copy some simple HLSL source file that you know to be free of bugs into a folder in your game project and rename it to
"Ripple.psh."
2. Right-click on your game project in Solution Explorer, select Add, then Existing Item, and then select Ripple.psh.
3. Once the file is added, right-click on it in Solution Explorer and select Properties.
4. You should now see entries in its Properties dialog box assigning PSImporter as its Content Importer and PSProcessor
as its Content Processor.
Next time you build your game, Ripple.psh will be built into TestShader.xnb in a form appropriate for your target platform.
To use the resulting pixel shader in your game, load it using ContentManager.Load as follows:
PixelShader shader = content.Load<PixelShader>( "TestShader" );
1. Add the new processor project to the game solution. From Solution Explorer, right-click the Solution node, click Add,
and then click New Project. From this dialog box, select the Content Pipeline Extension Library (2.0) template, enter
FontProcessor in the Name field, and then click OK.
2. The new project automatically contains references to the XNA Framework run-time and design–time Content Pipeline
assemblies.
To Extend the Font Processor
1. Add the following lines of code, after the last using statement:
C#
using System.IO;
using System.ComponentModel;
2. In ContentProcessor1.cs, remove the following code, located near the top of the file:
// TODO: replace these with the processor input and output types.
using TInput = System.String;
using TOutput = System.String;
3. Using attributes, add a processor parameter to the beginning of the class declaration. This parameter stores the name of
the text file that stores the messages displayed by the game.
C#
[DefaultValue("messages.txt")]
[DisplayName("Message File")]
[Description("The characters in this file will be automatically added to the font.")]
public string MessageFile
{
get { return messageFile; }
set { messageFile = value; }
}
private string messageFile = "..\\messages.txt";
This modification replaces the template parameter and return types with the proper types needed for the extended font
processor.
6. Register a Content Pipeline dependency on messages.txt. This dependency tells the Content Pipeline that if messages.txt
changes, the font must be rebuilt.
C#
string fullPath = Path.GetFullPath(MessageFile);
context.AddDependency(fullPath);
7. Read the contents of the file and add each letter to the input font one by one. Note that the Characters collection keeps
track of duplicates automatically. It is not necessary for the user to make sure that each letter is added only once. The
Characters collection will contain only one instance of each character; no matter how many times Add has been called.
C#
string letters = File.ReadAllText(fullPath, System.Text.Encoding.UTF8);
Note
In this example, messages.txt has been saved with Unicode UTF-8 encoding, which is why this encoding format is specif
ied in the call to File.ReadAllText. The default file encoding format for text files that have been added to a Visual Studio
project is Western European (Windows) encoding, corresponding to code page 1252. If your text file uses the default e
ncoding, specify the character encoding as follows:
string letters = File.ReadAllText( fullPath, System.Text.Encoding.GetEncoding( 125
2 ) );
8. Finally, call the existing Process method of the base FontDescriptionProcessor to build the font with the newly requested
characters.
C#
return base.Process(input, context);
Application Model
The application model provides functionality to accomplish common game development tasks.
In This Section
Application Model Overview
The XNA Framework Game class provides a framework for processing game simulation based on a fixed or variable time
interval.
How To: Load Content
This article demonstrates how to load content and ensure that the content will be reloaded at the appropriate times.
How To: Allow the Player to Resize a Game Window
Demonstrates how to let the player resize the game window.
How To: Pause a Game
Demonstrates how to add pause functionality to a game.
How To: Exit a Game
This example demonstrates how to exit a game without finishing the current update.
How To: Display a Game in Full-Screen Mode
This example demonstrates how to start a game in full-screen mode.
How To: Restrict Graphics Devices to Widescreen Aspect Ratios in Full-Screen Mode
Demonstrates how to create a custom GraphicsDeviceManager that only selects graphics devices with widescreen aspect
ratios in full-screen mode.
How To: Make a Game Time Out
Demonstrates how to make a game time out after a period of inactivity.
How To: Make a Game Use a Variable Time Step
Demonstrates how to make a game use a variable time step.
XNA Game Studio 2.0
Once a service is registered, the object providing the service can be retrieved by Game.Services.GetService and specifying the
desired service. For example, to retrieve IGraphicsDeviceService, you would use the following code.
IGraphicsDeviceService graphicsservice = (IGraphicsDeviceService)Services.GetService( t
ypeof(IGraphicsDeviceService) );
See Also
Concepts
Application Model Overview
How To: Draw a Sprite
Reference
Game Class
LoadContent
UnloadContent
Game Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
4. Add a function to poll the state of the pause key with Keyboard.GetState and KeyboardState.IsKeyDown. If the key has
changed from down to up, toggle the pause state.
C#
private void checkPauseKey(KeyboardState keyboardState, GamePadState gamePadState)
{
if (keyboardState.IsKeyDown(Keys.P) || (gamePadState.Buttons.Y == ButtonState.Pres
sed))
{
pauseKeyDown = true;
paused = true;
}
else if (pauseKeyDown)
{
pauseKeyDown = false;
paused = false;
}
}
5. Add a conditional around any update code so it will be called only if the game is not paused. You should also pause when
the Guide is active, as that will block user inputs from reaching the game.
C#
// Pause if the Guide is up, or if the user has paused
if ((paused == false) && (Guide.IsVisible == false))
{
base.Update(gameTime);
Simulate(gameTime);
}
XNA Game Studio 2.0
3. Call the method in Game.Update and return from Update if the method returned true.
C#
// Check to see if the user has exited
if (checkExitKey(keyboardState, gamePadState))
{
base.Update(gameTime);
return;
}
4. Create a method to handle the Game.Exiting event. The Exiting event will be issued at the end of the tick in which
Game.Exit is called.
C#
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
...
this.Exiting += new EventHandler(Game1_Exiting);
...
}
this.graphics.IsFullScreen = true;
}
XNA Game Studio 2.0
...
}
2. Add a WideScreenOnly property to the class. The property will be used to turn the widescreen only behavior on and off.
C#
private bool isWideScreenOnly;
public bool IsWideScreenOnly
{
get { return isWideScreenOnly; }
set { isWideScreenOnly = value; }
}
4. Override the RankDevices method of GraphicsDeviceManager. Note the call to base.RankDevices; it ensures that the new
version of RankDevices has an already-ranked list of available devices to work with.
C#
protected override void RankDevices( List<GraphicsDeviceInformation> foundDevices )
{
base.RankDevices( foundDevices );
...
}
6. In the if block, loop through all of the found devices. Check whether the PresentationParameters indicate the device is
full-screen. If the device is full-screen, determine the aspect ratio of the device by dividing the BackBufferWidth by the
BackBufferHeight. If the aspect ratio is less than the desired aspect ratio, remove the device from the list of found devices.
C#
for (int i = 0; i < foundDevices.Count; )
{
PresentationParameters pp = foundDevices[i].PresentationParameters;
if (pp.IsFullScreen == true)
{
float aspectRatio = (float)(pp.BackBufferWidth) / (float)(pp.BackBufferHeight)
;
// If the device does not have a widescreen aspect ratio, remove it.
if (aspectRatio < WideScreenRatio)
{
foundDevices.RemoveAt( i );
}
else { i++; }
}
else i++;
}
this.graphics.PreferMultiSampling = false;
this.graphics.PreferredBackBufferWidth = 1280;
this.graphics.PreferredBackBufferHeight = 720;
this.graphics.IsFullScreen = true;
this.graphics.IsWideScreenOnly = true;
graphics.ApplyChanges();
}
XNA Game Studio 2.0
3. Add a variable for tracking elapsed time since user activity took place.
C#
// Amount of time that has passed.
private double timeoutCount = 0;
4. When user input is checked, set a flag indicating whether any user activity has taken place.
C#
GamePadState blankGamePadState = new GamePadState(new GamePadThumbSticks(), new GamePa
dTriggers(),
new GamePadButtons(), new GamePadDPad());
bool checkActivity(KeyboardState keyboardState, GamePadState gamePadState)
{
// Check to see if the input states are different from last frame
//KeyboardState blankKeyboardState = new KeyboardState();
GamePadState nonpacketGamePadState = new GamePadState(gamePadState.ThumbSticks, ga
mePadState.Triggers, gamePadState.Buttons, gamePadState.DPad);
//if ((blankKeyboardState == keyboardState) && (blankGamePadState == nonpacketGame
PadState))
bool keybidle = keyboardState.GetPressedKeys().Length == 0;
bool gamepidle = blankGamePadState == nonpacketGamePadState;
if ( keybidle && gamepidle)
{
// no activity;
return false;
}
return true;
}
5. In Update, if no user activity has taken place, increment the tracking variable by the elapsed time since the last call to
Update. If user activity has taken place, set the tracking variable to zero.
C#
// Check to see if there has been any activity
6. Next, check whether the value of the tracking variable is greater than the time out limit. If the variable is greater than the
limit, perform some time out logic such as playing an idle animation or, in this case, exiting.
C#
// Timeout if idle long enough
if (timeoutCount > TimeOutLimit)
{
Exit();
base.Update(gameTime);
return;
}
XNA Game Studio 2.0
3. Since the amount of time between calls to Update will vary, specify any rates used in the game as units per millisecond
(ms).
C#
// Speed in world units per ms.
private double speed = 0.02f;
4. In Update get the value of gameTime.ElapsedGameTime.TotalMilliseconds. This gives the amount of time that has passed
since the last call to Update.
C#
// Time elapsed since the last call to update.
double elapsedTime = gameTime.ElapsedGameTime.TotalMilliseconds;
5. Determine the change that occurred since the last update by multiplying any rates being used by the elapsed time.
C#
// Multiply speed by elapsed time to get the distance moved.
double distance = (speed * elapsedTime);
XNA Game Studio 2.0
Graphics
The XNA Framework Graphics libraries provide low-level resource loading and rendering capabilities.
In This Section
Displays, Client Bounds, Viewports, and Back Buffers
This article describes the relationships between the display, client, viewport, and back buffer size properties.
Render Targets
Render targets can be an important part of your XNA Framework game when rendering simple or complex scenes. For a
description of a render target, see What Is a Render Target?.
Effect States
Effect states provide a mechanism for effects to control the graphics device state. Setting a state through an effect file has
exactly the same effect as setting the corresponding render state or sampler state from your C# code.
2D Graphics
This section discusses the basics of 2D rendering and includes examples of how to display sprites.
3D Graphics
This section contains an overview of the 3D Graphics classes as well as tutorials to demonstrate low-level 3D rendering.
XNA Game Studio 2.0
Figure 1. In this diagram, the Windows display is shown with a game that is not in full-screen mode to illustrate the
difference between the DisplayMode and ClientBounds dimensions. Note also that the same back buffer may
render differently on an Xbox 360 console compared to a Windows display because the outer 10 to 20 percent of
the Xbox 360 back buffer is not "title safe" and may not be visible.
DisplayMode Width and Height
The DisplayMode Width and Height properties correspond to the bounds of the display. The display bounds are different than
the bounds of the game window, which can be obtained from the ClientBounds dimensions.
When going into full-screen mode on Windows, it is useful to know the display mode width and height so the back buffer
dimensions can be set to match the resolution of the display. If the back buffer dimensions are not changed to match the
display mode dimensions, the resolution would change when going into full screen mode.
Xbox 360 games should display all text and menu items critical to game play within the inner 80 percent of the x and y
resolution for all display modes. This is known as the title safe region.
ClientBounds Width and Height
The ClientBounds Width and Height properties correspond to the bounds of the game window, which may be less than the
bounds of the display if the game is not full screen. ClientBounds.X and ClientBounds.Y correspond to the upper-left
coordinate of the game window relative to the display mode width and height. On Xbox 360, the ClientBounds Width and
Height properties are always equal to the DisplayMode Width and Height, and ClientBounds.X and ClientBounds.Y are
always (0, 0).
Viewport Width and Height
The Viewport Width and Height properties correspond to the current viewport dimensions, which can be thought of as the
view space width and height. These values are commonly used by methods to create projection matrices, such as
CreatePerspectiveFieldOfView. When creating a camera class, you would set the Viewport width and height to correspond to
the size of the camera viewport.
The dimensions of a viewport default to the dimensions of the render target, but may be a subset of the render target. For
example, you might render multiple viewports to a single render target to create a split screen game.
The Viewport dimensions do not correspond to the size of the game window (see ClientBounds for this information) or the
display (see DisplayMode for this information).
Back Buffer Width and Height
The back buffer is a specific render target that has been set to be the next render target presented when
GraphicsDevice.Present is called. To obtain the dimensions of the back buffer, use the GraphicsDevice.PresentationParameters
BackBufferWidth and BackBufferHeight properties.
On Windows, the back buffer is created to match the dimensions of the ClientBounds by default. For Xbox 360 game projects,
the back buffer is created with the dimensions that have been specified by the user.
When going into full-screen mode on Windows, it is often desirable to set the back buffer dimensions to match the
DisplayMode dimensions so that the game ("display") resolution does not change when going into full-screen mode.
The graphics back buffer created for an Xbox 360 game project is not necessarily the same size as the final resolution on the
television connected to the Xbox 360. The Xbox 360 automatically scales output to the television resolution selected by the user
in the System Blade. If the aspect ratio of the back buffer is different than the aspect ratio of the television display mode, the
Xbox 360 will automatically add "black bars" (letterboxing) if the user's display is not widescreen.
An error occurs if a graphics back buffer, with a resolution of 1920x1080 (e.g. 1080p), is created and displayed on a device with
480i resolution (e.g. a standard TV). However, resolutions for other modes (such as: 480p, 720p, 1080i) are permitted.
See Also
Tasks
How To: Use Viewports for Split Screen Gaming
XNA Game Studio 2.0
Render Targets
Render targets can be an important part of your XNA Framework game when rendering simple or complex scenes. For a
description of a render target, see What Is a Render Target?.
The following sections detail different aspects of render targets, useful when developing XNA Framework games.
Render Targets and Persistence
Resolving a Render Target
Multiple Render Targets
Render Targets and Persistence
Prior to XNA Game Studio 2.0, the persistence of render targets depended on the target platform. Now, the persistence
behavior can be specified, using RenderTargetUsage, in the constructor. For example, the following line of code constructs a
render target object that is never cleared when set.
Note
Persistence behavior for the related depth-stencil buffer matches that of the render target.
The following tables lists related persistence details, based on the target platform and the default value
RenderTargetUsage.DiscardContents, used by the constructor.
Creating the Render Target
Pl Details
at
fo
r
m
Xb Two surfaces are created: the render target and the resolve texture.
ox
36
0
Wi The default behavior creates two surfaces: the render target surface and the texture used as the output for resolve actions. I
nd f persistence is specified (for example, RenderTargetUsage.PreserveContents) and the render target does not have multisa
o mpling, only one surface is created. This surface is a render target texture that is both the surface and the output texture for
ws resolve actions.
Setting the Render Target
Plat Details
for
m
Xbo By default, the resolve texture data is deleted when the render target is set. If persistence is enabled, the resolve texture d
x 36 ata is moved back into the render target (emulating a persisted render target) before the new render target is set.
0
Win The current resolve texture data is saved when the render target is set.
dow
s
Resolving the Render Target
Plat Details
for
m
Xbo Resolution occurs when a new render target is set. The render target clears to a known, standard color rather than
x 36 Color.TransparentBlack.
0
Win Resolution occurs when a new render target is set. However, by default, the render target (always a separate surface) is cl
dow eared to a known, standard color rather than Color.TransparentBlack. If persistence is enabled, no action is taken.
s
In addition to RenderTargetUsage.PreserveContents and RenderTargetUsage.DiscardContents, there is a third option that is
platform-specific: RenderTargetUsage.PlatformContents.
This option creates a render target that has persistence for Windows but not for Xbox 360. However, for games targeting
Windows, if the render target is created without multisampling only a single texture is created. This texture is both the render
target surface as well as the resolved texture.
Resolving a Render Target
Prior to XNA Game Studio 2.0, you called ResolveRenderTarget to indicate that you were finished drawing to a render target.
This method is now considered obsolete and causes a compilation error if used in your code. The actual resolve operation
occurs automatically when a new render target is set (for example, a call to SetRenderTarget). Note that calling GetTexture on
the current render target throws an exception. This behavior ensures that a new render target has been set (and thus resolved)
before the texture can be used for anything else.
Multiple Render Targets
Multiple Render Targets (MRT) refers to the ability to render to multiple surfaces with a single draw call. For games targeting
Windows, this option is available on some graphics cards. For games targeting Xbox 360, this option is natively supported. This
feature can be used to perform some very nice effects such as deferred shading, or effects such as depth of field or refraction.
The following restrictions apply to MRTs on both platforms.
All render targets of an MRT must have the same bit depth. However, they can use different formats unless the
SupportsMultipleRenderTargetsIndependentBitDepths property is false.
All surfaces of an MRT should have the same width and height.
Antialiasing is not supported for MRTs.
Some MRT implementations do not apply the output write mask. Those that do (indicated by a value of true for the
SupportsColorWrite property) have independent color write masks. The number of independent color write masks
available is equal to the maximum number of elements the device is capable of supporting.
Some MRT implementations do not perform post-pixel shader operations, such as dithering, alpha testing, fogging, and
blending or masking (except for depth-buffer and depth-stencil testing). Those that do (indicated by a value of true for
the SupportsMultipleRenderTargetsPostPixelShaderBlending property).
For those devices that support post-pixel shader operations, use CheckDeviceFormat (passing PostPixelShaderBlending
for the queryUsages parameter value) to verify support for the specific surface format. If the result is false, no post-pixel
shader blending operations are available for that specific surface format. If true, the device is expected to apply the same
state to all simultaneous render targets as follows:
Alpha blend: The color value in oCi is blended with the ith render target.
Alpha test: Comparison uses oC0. If the comparison fails, the pixel test is terminated for all render targets.
Fog: Render target 0 is fogged. Other render targets are undefined. Implementations can choose to fog all by
using the same state.
Dithering: Undefined.
See Also
Conceptual
Graphics
XNA Game Studio 2.0
Effect States
Effect states provide a mechanism for effects to control the graphics device state. Setting a state through an effect file has
exactly the same effect as setting the corresponding render state or sampler state from your C# code.
The syntax for setting an effect state from an effect file is:
effect_state [ [index] ] = expression;
Where:
effect_state
A graphics device render state or sampler state to set. A complete list of states is listed below.
[ [index] ]
Optional integer index. The index identifies a particular state within an array of effect states. The outer brackets indicate that
an index is optional. If an index is used, be sure to use inner brackets.
expression
State assignment expression.
Caution
Effects that set render states that are not defined in this document may compile, but may fail to load due to run-time validati
on.
For Boolean render or sampler states, nonzero values are converted to true (1) and zero values are left alone (false).
Effect states can be divided into the following categories.
Render States
Pixel Pipe Render States
Vertex Pipe Render States
Sampler States
Sampler Stage States
Shader States
Shader Constant States
Pixel Shader Constant States
Vertex Shader Constant States
Texture States
Render States
Thre are two types of render states.
Pixel Pipe Render States
Vertex Pipe Render States
Pixel Pipe Render States
State Type Values
AlphaBlendEnab bool true or false. Equivalent to setting AlphaBlendEnable.
le
AlphaFunc dwor Any value of CompareFunction. Equivalent to setting AlphaFunction.
d
AlphaRef dwor Same values as ReferenceAlpha. Values can range from 0x00000000 through 0x000000FF.
d
AlphaTestEnable dwor true or false. Equivalent to setting AlphaTestEnable.
d
BlendOp dwor Same values as BlendFunction. Equivalent to setting BlendFunction.
d
ColorWriteEnabl dwor Bitwise combination of RED|GREEN|BLUE|ALPHA. Equivalent to setting ColorWriteChannels.
e d
DepthBias int Same values as DepthBias.
DestBlend dwor Same values as Blend, excluding BothSourceAlpha and BothInverseSourceAlpha, which are not su
d pported.
FillMode dwor Same values as FillMode.
d
SrcBlend dwor Same values as Blend, excluding BothSourceAlpha and BothInverseSourceAlpha, which are not su
d pported.
StencilEnable bool true or false. Equivalent to setting StencilEnable.
StencilFail dwor Keep, Zero, Replace, IncrSat, DecrSat, Invert, Incr, Dec, or TwoSided. Equivalent to setting StencilFail.
d
StencilFunc dwor Same values as CompareFunction. Equivalent to setting StencilFunction.
d
StencilMask dwor Same values as StencilMask.
d
StencilPass dwor Keep, Zero, Replace, IncrSat, DecrSat, Invert, Incr, Dec, or TwoSided. Equivalent to setting StencilPass.
d
StencilRef int Same values as ReferenceStencil.
StencilWriteMas dwor Same values as StencilWriteMask.
k d
StencilZFail dwor Keep, Zero, Replace, IncrSat, DecrSat, Invert, Incr, Dec, or TwoSided. Equivalent to setting
d StencilDepthBufferFail.
Wrap0–Wrap15 dwor
d Valid values are:
COORD0 (which corresponds to TextureWrapCoordinates.Zero)
COORD1 (which corresponds to TextureWrapCoordinates.One)
COORD2 (which corresponds to TextureWrapCoordinates.Two)
COORD3 (which corresponds to TextureWrapCoordinates.Three)
U
V
W
ZEnable dwor true or false.
d
ZFunc dwor Same values as CompareFunction. Equivalent to setting DepthBufferFunction.
d
ZWriteEnable bool true or false. Equivalent to setting DepthBufferWriteEnable.
Vertex Pipe Render States
State T Values
y
p
e
ClipPl d
aneE w Valid values are any DWORD in which the status of each bit (set or not set) toggles the activation state of a correspon
nable o ding user-defined clipping plane. The least significant bit (bit 0) controls the first clipping plane at index 0, and subseq
r uent bits control the activation of clipping planes at higher indices. If a bit is set, the system applies the appropriate cli
d pping plane during scene rendering. The default value is 0.
User-defined clipping planes are enabled when the value set in this render state contains one or more set bits (that is,
is not 0). The value of the render state is not important; the system does not interpret the value as a number. Rather, t
he value enables the clipping plane, whose corresponding bit is set. Bit 0 controls the state of the first clipping plane (
at index 0), bit 1 the second plane, and so on.
The bit patterns that these macros create can be combined by using a logical OR operation to simultaneously enable
multiple clipping planes. Omitting one of these from the combination effectively disables the clipping plane at that ind
ex.
Cull d Same values as CullMode.
Mode w
o
r
d
Multi b true or false. Equivalent to setting MultiSampleAntiAlias.
Samp o
leAnti o
alias l
Multi d Same values as MultiSampleMask.
Samp w
leMa o
sk r
d
Point fl
Size o
a
t
Point fl
Size_ o
Min a
t
Point fl
Size_ o
Max a
t
Point b True or False.
Sprit o
eEna o
ble l
Sampler States
State Type Values
Sampler sampler null, or a sampler state block.
Shader States
There are only two effect shader states: one associated with a vertex shader object and/or associated with a pixel shader object.
Pixel Shader States
State Type Values
PixelShader pixelshader NULL, an assembly block, a compile target, or a pixel shader parameter.
Vertex Shader States
State Type Values
VertexShader vertexshader NULL, an assembly block, a compile target, or a pixel shader parameter.
Texture States
State Type Values
Texture[8] texture NULL, or a texture parameter.
XNA Game Studio 2.0
2D Graphics
This section discusses the basics of 2D rendering and includes examples of how to display sprites.
In This Section
2D Graphics Overview
Presents the basics of using sprites.
How To: Draw a Sprite
This article demonstrates how to draw a sprite by using the SpriteBatch class.
How To: Animate a Sprite
This article demonstrates how to animate a sprite from a texture using a custom class.
How To: Draw a Masked Sprite over a Background
This article demonstrates how to draw a foreground and background sprite using the SpriteBatch class, where only part of
the foreground sprite masks the background. The foreground sprite in this example must include masking information.
How To: Make a Scrolling Background
This article demonstrates how to draw a scrolling background sprite using the SpriteBatch class.
How To: Rotate a Sprite
This article demonstrates how to rotate a sprite around its center.
How To: Rotate a Group of Sprites
This article demonstrates how to rotate a group of sprites around a single point using a rotation Matrix. It uses two methods;
rotating the sprite positions manually during Update, and creating a rotation matrix during Update that SpriteBatch can use
during Draw.
How To: Scale a Sprite
This article demonstrates how to scale a sprite using a uniform scale, nonuniform scale, or a destination rectangle.
How To: Tile a Sprite
This article demonstrates how to draw a sprite repeatedly in the x and y directions in one Draw call.
How To: Tint a Sprite
This article demonstrates how to tint a sprite using a Color value.
How To: Scale Sprites Based On Screen Size
This article demonstrates how to scale sprites using a matrix that is created based on the viewport width. This article applies
only to Windows programming.
How To: Draw Point Sprites
This article demonstrates how to create and draw point sprites.
How To: Apply a Pixel Shader to Sprites
This article demonstrates how to apply a pixel shader to sprites.
How To: Draw a Sprite Over a Model
This article demonstrates how to draw a sprite so that it obscures a model.
How To: Draw Text
This article demonstrates how to import a SpriteFont into a project and draw text using DrawString.
XNA Game Studio 2.0
2D Graphics Overview
Sprites are 2D bitmaps drawn directly on the screen, as opposed to being drawn in 3D space. Sprites are commonly used to
display information such as health bars, number of lives, or text such as scores. Some games, especially older games, are
composed entirely of sprites. This topic discusses sprites in detail, covering the following areas.
Overview
Sprite Origin
Sprite Depth
Sampling Textures
Sprite Scaling
Sprite Transformation Matrices
Sprite Fonts
Sprite Batching
Render States
Point Sprites
Overview
Sprites are positioned on the screen by coordinates. The width and height of the screen is the same as the back buffer. The x-
axis represents the screen width and the y-axis represents the screen height. It is important to note that the y-axis is measured
from the top of the screen and increases as you move down the screen, and the x-axis is measured from left to right. For
example, when the graphics back buffer is 800×600, 0,0 is the upper left of the screen, and 800,600 is the lower right of the
screen (see Figure 1).
Figure 2. The blue dot indicates the center coordinate of the sprite
When rotating a sprite, the method uses the origin as the center of the rotation. In these cases, it is common to use the center
of the sprite as the origin when calculating where to draw the sprite on the screen.
Sprite Depth
Sprites also have a concept of depth. When drawing a sprite, you can specify a depth between 0 and 1 as a floating-point
number. Sprites drawn at a depth of 0 are at the "front" of the screen, and will cover any sprites drawn at a lower depth. Sprites
drawn at a depth of 1 are at the "back" of the screen, and will be covered by any sprites drawn at a depth less than 1.
Sampling Textures
A sprite is based on a Texture2D object—in other words, a bitmap. Draw can draw the entire texture, or a portion of the texture.
To draw a portion of the texture, use the sourceRectangle parameter to specify which texels to draw as a sprite. A texel is a
pixel in the texture. A 32×32 texture has 1024 texels, specified as x and y values similar to how screen coordinates are
specified. Specifying a sourceRectangle of (0, 0, 16, 16) would select the upper-left quadrant of a 32×32 texture.
Sprite Scaling
Draw provides three methods of scaling sprites. Draw accepts either a uniform scaling parameter, a nonuniform scaling
parameter, or a source and destination rectangle. The uniform scaling parameter is a floating-point number that multiplies the
sprite size through both the x- and y-axes. This will shrink or expand the sprite along each axis equally, maintaining the original
ratio between the sprite width and height.
To scale the x- and y-axes independently, Draw accepts a Vector2 value as a scalar. This Vector2 specifies nonuniform scaling:
x- and y-axes are scaled independently according to the X and Y fields of the Vector2.
Draw also accepts a source and destination rectangle. The destination rectangle is specified in screen coordinates, while the
source rectangle is specified in texels. Draw takes the pixels on the texture specified in sourceRectangle and scales them
independently along the x- and y-axes until they fit the screen coordinates specified by destinationRectangle.
Sprite Transformation Matrices
XNA Game Studio includes a feature for sprite batches—the ability to specify a transformation matrix that the batch can apply
to each sprite before drawing. The transformation matrix can be any combination of translation, rotation, or scaling matrices
multiplied together into a single matrix. This matrix is combined with the sprite position, rotation, scaling, and depth
parameters supplied to Draw. Because the matrix also applies to depth, any z-coordinate transformation that makes the sprite
depth greater than 1.0 or less than 0.0 will cause the sprite to disappear.
See How To: Rotate a Group of Sprites for an example of matrix rotation, and How To: Scale Sprites Based On Screen Size for
an example of matrix scaling.
Sprite Fonts
XNA Game Studio enables you to draw text using SpriteBatch. The DrawString method will draw text on screen with position,
color, rotation, origin, and scaling. DrawString also requires a special type of texture encapsulated by the SpriteFont class. A
SpriteFont is created by the Content Pipeline when you add a Sprite Font file to your project. The Sprite Font file has
information such as the name and point size of the font, and which Unicode characters to include in the SpriteFont texture. At
run time, a SpriteFont is loaded with ContentManager.Load just like a Texture2D object.
See How To: Draw Text for an example of how to use SpriteFont to draw text, and Sprite Font XML Schema Reference for a list
of Sprite Font tags. You can use the Content Pipeline to determine your character regions automatically. For more information,
see How To: Extend the Font Description Processor to Support Additional Characters.
Sprite Batching
In normal drawing, the SpriteBatch object does not change any render states or draw any sprites until you call End. This is
known as Deferred mode. In Deferred mode, SpriteBatch saves the information from each Draw call until you call End. When
you then call End, SpriteBatch changes the graphics device settings and draws each sprite in the batch. End then resets the
device settings, if you specified SaveStateMode.SaveState.
If you call Begin, specifying SpriteSortMode.Immediate, it triggers Immediate mode. In Immediate mode, the SpriteBatch
immediately changes the graphics device render states to begin drawing sprites. Thereafter, each call to Draw immediately
draws the sprite using the current device settings. Calling End resets the device settings, if you specified
SaveStateMode.SaveState.
In Immediate mode, once you call Begin on one SpriteBatch instance, do not call it on any other SpriteBatch instance until you
call End for the first SpriteBatch.
Deferred mode is slower than Immediate mode, but it allows multiple instances of SpriteBatch to accept Begin and Draw calls
without interfering with each other.
Render States
The SpriteBatch object sets the following render states on the graphics card when drawing sprites.
Render State Value
GraphicsDevice.RenderState.CullMode CullMode.CullCounterClockwiseFace
GraphicsDevice.RenderState.DepthBufferEnable false
GraphicsDevice.RenderState.AlphaBlendEnable true
GraphicsDevice.RenderState.AlphaBlendOperation BlendFunction.Add
GraphicsDevice.RenderState.SourceBlend Blend.SourceAlpha
GraphicsDevice.RenderState.DestinationBlend Blend.InverseSourceAlpha
GraphicsDevice.RenderState.SeparateAlphaBlendEnabled false
GraphicsDevice.RenderState.AlphaTestEnable true
GraphicsDevice.RenderState.AlphaFunction CompareFunction.Greater
GraphicsDevice.RenderState.ReferenceAlpha 0
GraphicsDevice.SamplerStates[0].AddressU TextureAddressMode.Clamp
GraphicsDevice.SamplerStates[0].AddressV TextureAddressMode.Clamp
GraphicsDevice.SamplerStates[0].MagFilter TextureFilter.Linear
GraphicsDevice.SamplerStates[0].MinFilter TextureFilter.Linear
GraphicsDevice.SamplerStates[0].MipFilter TextureFilter.Linear
GraphicsDevice.SamplerStates[0].MipMapLevelOfDetailBias 0.0f
GraphicsDevice.SamplerStates[0].MaxMipLevel 0
The most important settings changed are DepthBufferEnable (normally true), AlphaBlendEnable (normally false), and
AlphaTestEnable (normally false). You may also want to set TextureAddressMode.Wrap for the AddressU and AddressV
sampler states.
The SpriteBatch object also sets the Vertices, Indices, VertexDeclaration, VertexShader, and PixelShader properties on the
current GraphicsDevice.
In Immediate mode, all of the render states can be changed before Draw is called, and Draw will use the new render states.
How To: Apply a Pixel Shader to Sprites takes advantage of this to apply a custom pixel shader to Draw.
Point Sprites
Point sprites are sprites drawn in 3D space. These sprites are specified by a position and a size. When a point sprite is rendered,
it always appears the same size on screen (no matter where the point lies in 3D space relative to the camera) and faces the
camera. Point sprites are used to render particle systems. How To: Apply a Pixel Shader to Sprites gives an example of how to
render point sprites using a simple pixel and vertex shader.
See Also
Tasks
How To: Draw a Sprite
How To: Draw Text
How To: Animate a Sprite
How To: Draw a Masked Sprite over a Background
How To: Make a Scrolling Background
How To: Rotate a Sprite
How To: Rotate a Group of Sprites
How To: Scale a Sprite
How To: Tint a Sprite
How To: Scale Sprites Based On Screen Size
How To: Draw Point Sprites
How To: Apply a Pixel Shader to Sprites
Reference
SpriteBatch
Draw
Texture2D
XNA Game Studio 2.0
spriteBatch.Begin();
Vector2 pos = new Vector2(TitleSafe.Left, TitleSafe.Top);
spriteBatch.Draw(SpriteTexture, pos, Color.White);
spriteBatch.End();
base.Draw(gameTime);
}
See Also
Concepts
2D Graphics Overview
Xbox 360 Programming Considerations
Reference
SpriteBatch
Draw
Texture2D
XNA Game Studio 2.0
3. Load the texture or textures that provide the image data for the animation. In this example, the AnimatedTexture class
loads a single texture and divides it into frames of animation. It uses the last parameter to determine how many frames
to draw each second. In this case, it draws 4 frames at 2 fps (frames per second).
C#
private Viewport viewport;
private Vector2 shipPos;
private const int Frames = 4;
private const int FramesPerSec = 2;
protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
This is handled by AnimatedTexture's UpdateFrame method, which takes the elapsed seconds between updates as a
parameter.
C#
// class AnimatedTexture
public void UpdateFrame(float elapsed)
{
if (Paused)
return;
TotalElapsed += elapsed;
if (TotalElapsed > TimePerFrame)
{
Frame++;
// Keep the Frame between 0 and the total frames, minus one.
Frame = Frame % framecount;
TotalElapsed -= TimePerFrame;
}
}
base.Draw(gameTime);
}
AnimatedTexture will draw the sprite using the subrectangle of the texture that contains the desired animation.
C#
// class AnimatedTexture
public void DrawFrame(SpriteBatch batch, Vector2 screenPos)
{
DrawFrame(batch, Frame, screenPos);
}
public void DrawFrame(SpriteBatch batch, int frame, Vector2 screenPos)
{
int FrameWidth = myTexture.Width / framecount;
Rectangle sourcerect = new Rectangle(FrameWidth * frame, 0,
FrameWidth, myTexture.Height);
batch.Draw(myTexture, screenPos, sourcerect, Color.White,
Rotation, Origin, Scale, SpriteEffects.None, Depth);
}
See Also
Tasks
How To: Draw a Sprite
Concepts
2D Graphics Overview
Reference
SpriteBatch
Draw
Texture2D
XNA Game Studio 2.0
StarTexture = Content.Load<Texture2D>("starfield");
ShipTexture = Content.Load<Texture2D>("ship");
viewport = graphics.GraphicsDevice.Viewport;
ViperPos.X = viewport.Width / 2;
ViperPos.Y = viewport.Height - 100;
ScrollHeight = StarTexture.Height;
}
3. In Draw, call Begin for the SpriteBatch representing the background. Specify SpriteBlendMode.None; this will tell the
SpriteBatch to ignore alpha color values when drawing sprites. By default the z-order of sprites is the order in which they
are drawn.
4. Draw the background sprites, then call End.
C#
spriteBatch.Begin(SpriteBlendMode.None);
DrawBackground(spriteBatch);
spriteBatch.End();
5. Call Begin for the SpriteBatch representing the foreground. Specify SpriteBlendMode.AlphaBlend; this will cause pixels on
the sprite with an alpha value less than 255 to become transparent based on the magnitude of the alpha value. An alpha
of 0 will make the pixel completely transparent. Calling Begin with no parameters causes SpriteBatch to default to
SpriteBlendMode.AlphaBlend.
6. Draw the foreground sprites, then call End.
C#
spriteBatch.Begin(SpriteBlendMode.AlphaBlend);
DrawForeground(spriteBatch);
spriteBatch.End();
See Also
Tasks
How To: Draw a Sprite
Concepts
2D Graphics Overview
What Is Color Blending?
Reference
SpriteBatch
Draw
Texture2D
XNA Game Studio 2.0
3. Determine the size of the background texture and the size of the screen. The texture size is determined using the Height
and Width properties, and the screen size is determined using the Viewport property on the graphics device. Using the
texture and screen information, set the origin of the texture to the center of the top edge of the texture, and the initial
screen position to the center of the screen.
C#
// class ScrollingBackground
private Vector2 screenpos, origin, texturesize;
private Texture2D mytexture;
private int screenheight;
public void Load( GraphicsDevice device, Texture2D backgroundTexture )
{
mytexture = backgroundTexture;
screenheight = device.Viewport.Height;
int screenwidth = device.Viewport.Width;
// Set the origin so that we're drawing from the
// center of the top edge.
origin = new Vector2( mytexture.Width / 2, 0 );
// Set the screen position to the center of the screen.
screenpos = new Vector2( screenwidth / 2, screenheight / 2 );
// Offset to draw the second texture, when necessary.
texturesize = new Vector2( 0, mytexture.Height );
}
4. To scroll the background, change the screen position of the background texture in your Update method. This example
moves the background down 100 pixels per second by increasing the screen position's Y value.
C#
protected override void Update(GameTime gameTime)
{
...
// The time since Update was called last.
float elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds;
base.Update(gameTime);
}
The Y value is kept no larger than the texture height, making the background scroll from the bottom of the screen back to
the top.
C#
public void Update( float deltaY )
{
screenpos.Y += deltaY;
screenpos.Y = screenpos.Y % mytexture.Height;
}
// ScrollingBackground.Draw
5. Draw the background using the origin and screen position calculated in LoadContent and Update.
C#
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
spriteBatch.Begin();
myBackground.Draw(spriteBatch);
spriteBatch.End();
base.Draw(gameTime);
}
In case the texture doesn't cover the screen, another texture is drawn, subtracting the texture height from the screen
position using the texturesize vector created at load time. This creates the illusion of a loop.
C#
public void Draw( SpriteBatch batch )
{
// Draw the texture, if it is still onscreen.
if (screenpos.Y < screenheight)
{
batch.Draw( mytexture, screenpos, null,
Color.White, 0, origin, 1, SpriteEffects.None, 0f );
}
// Draw the texture a second time, behind the first,
// to create the scrolling illusion.
batch.Draw( mytexture, screenpos - texturesize, null,
Color.White, 0, origin, 1, SpriteEffects.None, 0f );
}
See Also
Tasks
How To: Draw a Sprite
How To: Draw a Masked Sprite over a Background
Concepts
2D Graphics Overview
Reference
SpriteBatch
Draw
Texture2D
XNA Game Studio 2.0
3. In your Update method, determine the rotation angle to use for the sprite. The angle is specified in radians, and it can be
greater than two times pi, but does not need to be.
C#
private float RotationAngle = 0f;
protected override void Update(GameTime gameTime)
{
// Allows the game to exit
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
this.Exit();
base.Update(gameTime);
}
4. In your own Draw method, call SpriteBatch.Draw with the texture, angle, screen position, and origin of the texture.
C#
protected override void Draw(GameTime gameTime)
{
graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
base.Draw(gameTime);
}
5. When all the sprites have been drawn, call End on your SpriteBatch object.
See Also
Tasks
How To: Draw a Sprite
Concepts
2D Graphics Overview
Reference
SpriteBatch
Draw
Texture2D
XNA Game Studio 2.0
base.Initialize();
}
3. After loading the sprite, calculate the positions of the unrotated group of sprites based on the sprite's size.
C#
private Texture2D SpriteTexture;
private Vector2 origin;
private Vector2 screenpos;
protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
SpriteTexture = Content.Load<Texture2D>("ship");
origin.X = SpriteTexture.Width / 2;
origin.Y = SpriteTexture.Height / 2;
Viewport viewport = graphics.GraphicsDevice.Viewport;
screenpos.X = viewport.Width / 2;
screenpos.Y = viewport.Height / 2;
}
4. In your Update method, copy the unrotated vectors and determine the screen position around which all the sprites will
rotate.
C#
private float RotationAngle = 0f;
private bool batchAutoRotate = false;
private Matrix rotationMatrix = Matrix.Identity;
protected override void Update(GameTime gameTime)
{
...
float elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds;
RotationAngle += elapsed;
float circle = MathHelper.Pi * 2;
RotationAngle = RotationAngle % circle;
if (!batchAutoRotate)
RotatePoints(ref screenpos, RotationAngle, ref drawVectors);
else
UpdateMatrix(ref screenpos, RotationAngle);
base.Update(gameTime);
}
5. Transform each vector using a rotation matrix created for the rotation angle. To rotate around the origin, transform each
vector relative to the origin by subtracting the origin vector. Then add the origin vector to the transformed vector to
create the final rotated vector.
C#
private static void RotatePoints(ref Vector2 origin, float radians, ref Vector2[] Vect
ors)
{
Matrix myRotationMatrix = Matrix.CreateRotationZ(radians);
base.Initialize();
}
3. After loading the sprite, calculate the positions of the unrotated group of sprites based on the sprite's size.
C#
private Texture2D SpriteTexture;
private Vector2 origin;
private Vector2 screenpos;
protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
SpriteTexture = Content.Load<Texture2D>("ship");
origin.X = SpriteTexture.Width / 2;
origin.Y = SpriteTexture.Height / 2;
Viewport viewport = graphics.GraphicsDevice.Viewport;
screenpos.X = viewport.Width / 2;
screenpos.Y = viewport.Height / 2;
}
4. In your Update method, copy the unrotated vectors and determine the screen position around which all the sprites will
rotate.
C#
private float RotationAngle = 0f;
private bool batchAutoRotate = false;
private Matrix rotationMatrix = Matrix.Identity;
protected override void Update(GameTime gameTime)
{
...
float elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds;
RotationAngle += elapsed;
float circle = MathHelper.Pi * 2;
RotationAngle = RotationAngle % circle;
if (!batchAutoRotate)
RotatePoints(ref screenpos, RotationAngle, ref drawVectors);
else
UpdateMatrix(ref screenpos, RotationAngle);
base.Update(gameTime);
}
5. Create a rotation matrix for SpriteBatch to use during Draw. To rotate around a point that is not the upper-left corner of
the screen, you must first subtract the origin of your rotation using a translation matrix, then multiply that translation
matrix by the rotation matrix, and multiply the result by a translation matrix adding the origin of your rotation. This is
because a rotation matrix must rotate around (0,0,0).
C#
private void UpdateMatrix(ref Vector2 origin, float radians)
{
// Translate sprites to center around screen (0,0), rotate them, and
// translate them back to their original positions
Vector3 matrixorigin = new Vector3(origin, 0);
rotationMatrix = Matrix.CreateTranslation(-matrixorigin) *
Matrix.CreateRotationZ(radians) *
Matrix.CreateTranslation(matrixorigin);
}
6. In your Draw method, call SpriteBatch.Begin, specifying your rotation matrix as the fourth parameter.
C#
private void DrawMatrix()
{
// Draw using a rotation matrix with SpriteBatch
spriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Deferred,
SaveStateMode.None, rotationMatrix);
for (int j = 0; j < myVectors.Length; j++)
spriteBatch.Draw(SpriteTexture, myVectors[j], null, Color.White, 0,
origin, 1.0f, SpriteEffects.None, 0f);
spriteBatch.End();
}
base.Update(gameTime);
}
3. When drawing the sprite, specify the scale of the sprite as a parameter to draw. Specifying a floating-point scale
parameter scales the sprite evenly in both the x and y directions.
C#
protected virtual void DrawForeground( SpriteBatch Batch )
{
Rectangle safeArea = GetTitleSafeArea( .8f );
Vector2 position = new Vector2( safeArea.X, safeArea.Y );
Batch.Begin();
Batch.Draw( SpriteTexture, position, null,
Color.White, 0f, Vector2.Zero, scale, SpriteEffects.None, 0f );
Batch.End();
}
4. When all the sprites have been drawn, call End on your SpriteBatch object.
To draw a scaled sprite using a nonuniform scale
1. Follow steps 1–5 of How To: Draw a Sprite.
2. In your Update method, determine how your sprite will be scaled along each axis, and store those values in a Vector2
object.
C#
protected Vector2 nonuniformscale = Vector2.One;
protected override void Update(GameTime gameTime)
{
base.Update(gameTime);
float basescale = nonuniformscale.Y;
basescale += (float)gameTime.ElapsedGameTime.TotalSeconds;
basescale = basescale % 6;
nonuniformscale.Y = basescale;
nonuniformscale.X = basescale * .8f;
}
3. When drawing the sprite, specify the scale of the sprite using the Vector2 object that you updated earlier. Specifying a
Vector2 scales the sprite independently in both the x and y directions.
C#
protected override void DrawForeground(SpriteBatch batch)
{
Rectangle safeArea = GetTitleSafeArea(.8f);
Vector2 position = new Vector2(safeArea.X, safeArea.Y);
batch.Begin();
batch.Draw(SpriteTexture, position, null, Color.White, 0, Vector2.Zero,
nonuniformscale, SpriteEffects.None, 0);
batch.End();
}
4. When all of the sprites have been drawn, call End on your SpriteBatch object.
To draw a scaled sprite using a destination rectangle
1. Follow steps 1–5 of How To: Draw a Sprite.
2. In your Update method, construct a rectangle that defines where on screen the sprite will be drawn. This rectangle does
not need to be the same shape or size as the original sprite; each dimension of the sprite is scaled independently to fit the
destination rectangle.
C#
protected Rectangle destrect;
protected override void Update(GameTime gameTime)
{
destrect = new Rectangle();
Rectangle safeArea = GetTitleSafeArea(.8f);
destrect.X = safeArea.X;
destrect.Y = safeArea.Y;
destrect.Width = (int)scale * 100;
destrect.Height = (int)scale * 80;
base.Update(gameTime);
}
3. When drawing the sprite, specify the destination rectangle as a parameter to Draw. The sprite will be drawn, filling the
destination rectangle.
C#
protected override void DrawForeground(SpriteBatch Batch)
{
Batch.Begin();
Batch.Draw(SpriteTexture, destrect, Color.White);
Batch.End();
}
4. When all of the sprites have been drawn, call End on your SpriteBatch object.
See Also
Tasks
How To: Draw a Sprite
Concepts
2D Graphics Overview
Reference
SpriteBatch
Draw
Texture2D
XNA Game Studio 2.0
3. Call SpriteBatch.Begin, choosing SpriteSortMode.Immediate. Then set the TextureAddressMode of the first SamplerState
to TextureAddressMode.Wrap for both the u and v directions.
C#
spriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Immediate, SaveStateMode.
None);
GraphicsDevice.SamplerStates[0].AddressU = TextureAddressMode.Wrap;
GraphicsDevice.SamplerStates[0].AddressV = TextureAddressMode.Wrap;
4. Call SpriteBatch.Draw with the sprite to tile, the starting position of the sprite, the source rectangle you created, and other
relevant parameters.
C#
Vector2 pos = new Vector2(50);
spriteBatch.Draw(xna, pos, source, Color.White, 0, Vector2.Zero, 0.5f, SpriteEffects.N
one, 1.0f);
5. When all of the sprites have been drawn, call End on your SpriteBatch object.
C#
spriteBatch.End();
base.Draw(gameTime);
}
See Also
Tasks
How To: Draw a Sprite
Concepts
2D Graphics Overview
What Is Texture Mapping?
Reference
SpriteBatch
Draw
SpriteSortMode
Texture2D
XNA Game Studio 2.0
base.Update(gameTime);
}
3. In the Draw method, pass the color value created in Update to SpriteBatch.Draw.
C#
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
spriteBatch.Begin();
spriteBatch.Draw(SpriteTexture, position, tint);
spriteBatch.End();
base.Draw(gameTime);
}
4. When all of the sprites have been drawn, call End on your SpriteBatch object.
See Also
Tasks
How To: Draw a Sprite
Concepts
2D Graphics Overview
Reference
SpriteBatch
Draw
Texture2D
Color
XNA Game Studio 2.0
...
3. In your Update method, determine whether the game needs to change screen resolution. This example uses game pad
buttons to switch between two resolutions.
C#
protected override void Update(GameTime gameTime)
{
...
// Change the resolution dynamically based on input
if (GamePad.GetState(PlayerIndex.One).Buttons.A == ButtonState.Pressed)
{
graphics.PreferredBackBufferHeight = 768;
graphics.PreferredBackBufferWidth = 1024;
graphics.ApplyChanges();
}
if (GamePad.GetState(PlayerIndex.One).Buttons.B == ButtonState.Pressed)
{
graphics.PreferredBackBufferHeight = 600;
graphics.PreferredBackBufferWidth = 800;
graphics.ApplyChanges();
}
base.Update(gameTime);
}
4. In your Draw method, call SpriteBatch.Begin, passing the scaling matrix created in LoadContent.
5. Draw your scene normally, then call SpriteBatch.End. All of the sprites you draw will be scaled according to the matrix.
C#
protected override void Draw(GameTime gameTime)
{
...
// Initialize the batch with the scaling matrix
spriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Deferred,
SaveStateMode.None, SpriteScale);
// Draw a sprite at each corner
for (int i = 0; i < spritepos.Length; i++)
{
spriteBatch.Draw(square, spritepos[i], null, Color.White, rotation,
origin, scale, SpriteEffects.None, depth);
}
spriteBatch.End();
base.Draw(gameTime);
}
See Also
Tasks
How To: Draw a Sprite
Concepts
2D Graphics Overview
Reference
SpriteBatch
Draw
Texture2D
Matrix.CreateScale
XNA Game Studio 2.0
};
sampler Sampler = sampler_state
{
Texture = <SpriteTexture>;
};
float4 PixelShader(PS_INPUT input) : COLOR0
{
float2 texCoord;
texCoord = input.TexCoord.xy;
2. A vertex shader for point sprites only needs to return a POSITION0 for the vertex, transformed by the world-view-
projection matrix.
2. In Draw, set the proper render states on the GraphicsDevice. In this case, you want to set PointSpriteEnable to true, and
DepthBufferWriteEnable to false. If your shader does not set the PSIZE semantic itself, you will want to set a PointSize
here. The PointSize is the width of the point sprite on screen, in pixels. Setting the PSIZE semantic in the shader allows the
shader to vary the size of each point. Using the PointSize render state instead will cause each point to be rendered as the
same size.
In this example, we also setup additive blending by setting AlphaBlendEnable to true, and the SourceBlend and
DestinationBlend to Blend.One.
C#
graphics.GraphicsDevice.RenderState.PointSpriteEnable = true;
graphics.GraphicsDevice.RenderState.PointSize = 64.0f;
graphics.GraphicsDevice.RenderState.AlphaBlendEnable = true;
graphics.GraphicsDevice.RenderState.SourceBlend = Blend.SourceAlpha;
graphics.GraphicsDevice.RenderState.DestinationBlend = Blend.One;
graphics.GraphicsDevice.RenderState.DepthBufferWriteEnable = false;
graphics.GraphicsDevice.VertexDeclaration
= vertexPosColDecl;
Matrix WVPMatrix = Matrix.Identity * viewMatrix * projectionMatrix;
pointSpritesEffect.Parameters["WVPMatrix"].SetValue(WVPMatrix);
pointSpritesEffect.Begin();
foreach (EffectPass pass in pointSpritesEffect.CurrentTechnique.Passes)
{
pass.Begin();
graphics.GraphicsDevice.DrawUserPrimitives<VertexPositionColor>(Primit
iveType.PointList,
spriteArray, 0, spriteArray.Length);
pass.End();
}
pointSpritesEffect.End();
graphics.GraphicsDevice.RenderState.PointSpriteEnable = false;
graphics.GraphicsDevice.RenderState.DepthBufferWriteEnable = true;
graphics.GraphicsDevice.RenderState.SourceBlend = Blend.SourceAlpha;
graphics.GraphicsDevice.RenderState.DestinationBlend =
Blend.InverseSourceAlpha;
base.Draw(gameTime);
}
}
}
using System;
namespace PointSprites
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main(string[] args)
{
using (Game1 game = new Game1())
{
game.Run();
}
}
}
}
3. Set the VertexDeclaration on the GraphicsDevice to the type of vertex you will be drawing (in this case,
VertexPositionColor).
C#
graphics.GraphicsDevice.VertexDeclaration
= vertexPosColDecl;
4. Call SetValue for any draw-time parameters to your Effect, such as the world-view-projection matrix.
C#
Matrix WVPMatrix = Matrix.Identity * viewMatrix * projectionMatrix;
pointSpritesEffect.Parameters["WVPMatrix"].SetValue(WVPMatrix);
5. Call Begin on your Effect, and for each pass in the effect, call DrawUserPrimitives for the point sprites.
C#
pointSpritesEffect.Begin();
foreach (EffectPass pass in pointSpritesEffect.CurrentTechnique.Passes)
{
pass.Begin();
graphics.GraphicsDevice.DrawUserPrimitives<VertexPositionColor>(PrimitiveType.Poin
tList,
spriteArray, 0, spriteArray.Length);
pass.End();
}
pointSpritesEffect.End();
2. A pixel shader is only required to return a color for the current pixel. This pixel shader uses the tex2D fuction to pick a
pixel on the sampler to display. Because this is a distortion shader, the pixel chosen is not necessarily the "current" pixel.
return color;
}
...
}
3. In Draw, cache the current render target using GetRenderTarget, then switch to an offscreen render target using
SetRenderTarget.
4. Clear the offscreen render target, and then draw all the sprites that comprise the scene.
5. Resolve the render target with ResolveRenderTarget, and retrieve the scene with GetTexture. Then reset the render target
to the previous render target (normally the back buffer).
C#
// Change to our offscreen render target.
RenderTarget2D temp = (RenderTarget2D)GraphicsDevice.GetRenderTarget(0);
GraphicsDevice.SetRenderTarget(0, ShaderRenderTarget);
GraphicsDevice.Clear(Color.Black);
// Render a simple scene.
spriteBatch.Begin();
TileSprite(spriteBatch, grid);
spriteBatch.End();
6. Using the Texture2D containing the scene to shade, call Begin on your SpriteBatch, specifying SpriteSortMode.Immediate.
7. Call Begin on the Effect, and Begin on the pass containing your pixel shader.
8. Call Draw on the SpriteBatch. The pixel shader you specified will be used to render the sprite.
9. Call End on the SpriteBatch, the EffectPass, and the Effect.
C#
// Use Immediate mode and our effect to draw the scene
// again, using our pixel shader.
spriteBatch.Begin(SpriteBlendMode.None, SpriteSortMode.Immediate, SaveStateMode.None);
ripple.Begin();
ripple.CurrentTechnique.Passes[0].Begin();
spriteBatch.Draw(ShaderTexture, Vector2.Zero, Color.White);
spriteBatch.End();
ripple.CurrentTechnique.Passes[0].End();
ripple.End();
See Also
Concepts
2D Graphics Overview
What Is a Render Target?
Reference
Draw
SpriteSortMode.Immediate
Effect
RenderTarget2D
XNA Game Studio 2.0
2. Use CreateMerged to create a BoundingSphere that contains all the BoundingSphere values for each ModelMesh in the
Model. Then use Viewport.Project to find the centerpoint of that sphere—that is the center of the model in screen
coordinates.
C#
// Create a total bounding sphere for the mesh
BoundingSphere totalbounds = new BoundingSphere();
foreach (ModelMesh mesh in Ring.Meshes)
{
totalbounds = BoundingSphere.CreateMerged(totalbounds, mesh.BoundingSphere);
}
// Project the center of the 3D object to the screen, and center the
// sprite there
Vector3 center = GraphicsDevice.Viewport.Project(totalbounds.Center,
projectionMatrix, Camera1.ViewMatrix, Matrix.Identity);
explosionpos.X = center.X;
explosionpos.Y = center.Y;
3. Take the BoundingSphere for the model and use that to create a BoundingBox with CreateFromSphere. Then find the
corner of the box that is farthest from the center using Project, and use that to scale the sprite appropriately.
C#
// Create a bounding box from the bounding sphere, and find the corner
// that is farthest away from the center using Project
BoundingBox extents = BoundingBox.CreateFromSphere(totalbounds);
float maxdistance = 0;
float distance;
Vector3 screencorner;
foreach (Vector3 corner in extents.GetCorners())
{
screencorner = GraphicsDevice.Viewport.Project(corner,
projectionMatrix, Camera1.ViewMatrix, Matrix.Identity);
distance = Vector3.Distance(screencorner, center);
if (distance > maxdistance)
maxdistance = distance;
}
base.Update(gameTime);
}
4. In your Draw method, draw the Model normally, then draw the animated sprite using the position calculated in Update.
C#
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
base.Draw( gameTime );
}
See Also
Tasks
How To: Animate a Sprite
How To: Render a Model
Concepts
2D Graphics Overview
What Is Color Blending?
Reference
Project
BoundingSphere
BoundingBox
XNA Game Studio 2.0
6. In your Draw method, call Begin on the SpriteBatch object. If you select your own SpriteBlendMode,
SpriteBlendMode.AlphaBlend is recommended.
7. If necessary, determine the origin of your text. If you want to draw your text centered on a point, you can find the center
of the text by calling MeasureString and dividing the returned vector by 2.
8. Call DrawString to draw your output text, specifying the SpriteFont object for the font you want to use. All other
parameters of DrawString produce the same effects as a call to SpriteBatch.Draw.
9. When you have drawn all your text, call SpriteBatch.End.
C#
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
spriteBatch.Begin();
spriteBatch.End();
base.Draw( gameTime );
}
See Also
Tasks
How To: Draw a Sprite
Concepts
2D Graphics Overview
Reference
SpriteBatch
DrawString
SpriteFont
ContentManager.Load
XNA Game Studio 2.0
3D Graphics
This section contains an overview of the 3D Graphics classes as well as tutorials to demonstrate low-level 3D rendering.
In This Section
3D Graphics Overview
The Microsoft.Xna.Framework.Graphics namespace contains classes to utilize the graphics device to load and render
resources and to apply effects to vertices and pixels.
Viewports and Frustums
Overview of viewports and frustums as related to 3D graphics concepts.
Dynamic Vertex Buffers in XNA
Describes several techniques for implementing dynamic vertex buffers in an XNA Framework game.
"What Is" Articles
This section contains brief overviews of some 3D graphics concepts.
"How To" Articles
This section contains step-by-step procedures for certain 3D graphics techniques.
XNA Game Studio 2.0
3D Graphics Overview
The Microsoft.Xna.Framework.Graphics namespace contains classes to utilize the graphics device to load and render resources
and to apply effects to vertices and pixels. This overview covers the following topics as they apply to 3D graphics.
Getting Started with 3D
The Graphics Device
Resources
Shaders and Effects
However, there are cases where render states can change automatically. A common example is the rendering of sprites and 3D
objects on the same graphics device. In this case, the SpriteBatch object changes various render states when End is called. If any
3D rendering is done after this step, the results can be unpredictable.
For this reason, you should restore several key render states to their former settings before attempting any 3D object
rendering. The following code demonstrates this approach.
GraphicsDevice.RenderState.DepthBufferEnable = true;
GraphicsDevice.RenderState.AlphaBlendEnable = false;
GraphicsDevice.RenderState.AlphaTestEnable = false;
In addition, you should set the following render states, depending on the type of 3D content you are rendering.
GraphicsDevice.SamplerStates[0].AddressU = TextureAddressMode.Wrap;
GraphicsDevice.SamplerStates[0].AddressV = TextureAddressMode.Wrap;
It is also possible to save the render state of the graphics device before rendering sprites by passing SaveStateMode.SaveState
your SpriteBatch.Begin method call. However, this is not recommended because it is a time-intensive process and can affect the
speed of your rendering.
Resources
A resource is a collection of data stored in memory that can be accessed by the CPU or GPU. Types of resources that an
application might use include render targets, vertex buffers, index buffers, and textures.
Based on the resource management mode that was used when a resource is created, it should be reloaded when the device is
reset. For more information, see How To: Load Content.
Vertex and Index Buffers
A vertex buffer contains a list of 3D vertices to be streamed to the graphics device. Each vertex in a vertex buffer may contain
data about not only the 3D coordinate of the vertex, but also other information describing the vertex, such as the vertex
normal, color, or texture coordinate. The XNA Framework contains several classes to describe common vertex declaration
types, such as VertexPositionColor, VertexPositionColorTexture, VertexPositionNormalTexture, and VertexPositionTexture. You
may also use the VertexElement class to compose custom vertex types.
For a demonstration of low-level rendering of a 3D object from a vertex buffer, see
How To: Draw Points, Lines, and Other 3D Primitives.
Vertex buffers may contain either indexed or non-indexed vertex data.
If a vertex buffer is not indexed, all of the vertices are placed in the vertex buffer in the order they are to be rendered. Because
3D line lists or triangle lists often reference the same vertices multiple times, this can result in a large amount of redundant
data.
Index buffers allow you to list each vertex only once in the vertex buffer. An index buffer is a list of indices into the vertex
buffer, given in the order that you want the vertices to render.
To render a non-indexed vertex buffer, call the GraphicsDevice.DrawPrimitives Method or
GraphicsDevice.DrawUserPrimitives Generic Method. To render an indexed buffer, call the
GraphicsDevice.DrawIndexedPrimitives Method or GraphicsDevice.DrawUserIndexedPrimitives Method.
Textures
A texture resource is a structured collection of data designed to store texture data. The data in a texture resource is made up of
one or more subresources that are organized into arrays and mipmap chains. Textures can be filtered by texture samplers as
they are read by shaders. The type of texture influences how the texture is filtered.
You can apply textures by using the Texture property of the BasicEffect class, or choose to write your own effect methods to
apply textures. For a demonstration of applying a texture from a user-created effect, see the example
How To: Create Custom Texture Effects.
Shaders and Effects
Shaders are programs that do per-vertex or per-pixel processing of resources at run time. An effect is a combination of vertex
and pixel shader code grouped together to encapsulate a particular rendering effect. Because shaders transform vertices and
pixels at run time, they are used for lighting, materials, and textures. Unless you are using the BasicEffect class, you must first
write shaders in either high-level shader language (HLSL) or assembly shader code (ASM) and then compile your shaders
before your application can use the binary code.
For overviews of HLSL and the effect file format, see the HLSL Shaders and Effects DirectX Programming Guides on MSDN.
Complete reference documentation for HLSL, shader ASM, and the effect file format is available in the Direct3D API Reference.
For a simple demonstration of how to apply a vertex shader from an effect file, see How To: Create and Apply Custom Effects.
XNA Game Studio 2.0
Imagine that you are standing in a dark room and looking through a square window. this is a good representation of a viewing
frustum. In this analogy, the near clipping plane is the window, and the back clipping plane is whatever finally interrupts your
view - the skyscraper across the street, the mountains in the distance, or nothing at all. You can see everything inside the
truncated pyramid that starts at the window and ends with whatever interrupts your view, and nothing else.
The viewing frustum is defined by a field of view (fov) and by the distances of the front and back clipping planes, specified in z-
coordinates. You can create a perspective fov using the CreatePerspectiveFieldOfView method. For more information on
setting up a frustum and perspective transformation, see How To: Make a Third-Person Camera.
Viewport Rectangle
You define a viewport rectangle in XNA by using the Viewport structure. For more information on using this structure in your
game application, see Displays, Client Bounds, Viewports, and Back Buffers.
The Viewport structure contains four members - X, Y, Width, Height - that define the area of the render-target surface in which
a scene is rendered. These values correspond to the destination rectangle, or viewport rectangle.
The specified values for the X, Y, Width, and Height members are screen coordinates relative to the upper-left corner of the
render-target surface. The structure defines two additional members (MinDepth and MaxDepth), indicating the near and far
view planes.
Tip
The depth buffer has a limited resolution which is distributed between the near and far clip planes. If these planes are too far
apart, two objects could have the same depth value even though they lie on different depth planes. In cases like this, the dept
h buffer is unable to distinguish between them because of its limited resolution.
To avoid this situation, set your near clipping plane as high as possible without causing near-plane clipping issues. For instan
ce, avoid settings such as 0.000001, which would certainly cause problems.
The XNA Framework assumes that the viewport clipping volume ranges from -1.0 to 1.0 in X, and from 1.0 to -1.0 in Y. These
were the settings used most often by applications in the past. You can specify the viewport aspect ratio, used for the projection
transform, with a call to CreatePerspectiveFieldOfView.
The XNA Framework uses the viewport location and dimensions to scale the vertices to fit a rendered scene into the
appropriate location on the target surface. An internal matrix is applied to each vertex to scale vertices according to the
viewport dimensions and desired depth range and translate them to the appropriate location on the render-target surface. This
matrix also reverses the y-coordinate to reflect a screen origin at the top-left corner with y increasing downward. After this
matrix is applied, vertices are still homogeneous. That is, they still exist as [x,y,z,w] vertices—and they must be converted to
non-homogeneous coordinates before being sent to the rasterizer.
Note
The viewport scaling matrix incorporates the MinDepth and MaxDepth members of the Viewport structure to scale vertices t
o fit the specified depth range.
Clearing a Viewport
Clearing the viewport resets the contents of the viewport rectangle on the render-target surface. It can also clear the depth and
stencil buffer surfaces.
Use Clear to clear the various components of the viewport. Overloaded versions accept various parameters such as a set of
rectangles, defining the areas on the surface to be cleared, or a ClearOptions enumeration that specifies which buffers or
render target to clear.
Use the Clear method to clear stencil bits within a depth buffer. Set the options parameter to determine which render-target
components are cleared. The color argument sets the color value of the render target after it has been cleared. The depth
parameter clears the depth buffer to the specified depth: 0.0 is the closest distance, and 1.0 is the farthest. Finally, the stencil
paramter resets the stencil bits to the specified value. Use integers ranging from 0 to 2n−1, where n is the stencil buffer bit
depth.
XNA Game Studio 2.0
What Is Antialiasing?
Antialiasing is the process of softening hard edges in an image so that polygons appear less jagged.
Antialiasing is normally accomplished by multisampling: using more than one pixel ("sample") from an image to determine the
color of a pixel in your final image. The more samples per pixel, the smoother the resulting image.
Both PC and Xbox 360 platforms support Full Screen Antialiasing (FSAA) modes, where extra pixels are rendered to a render
target and used as samples to create an antialiased final image. 4x FSAA uses four samples per pixel by rendering the scene to
a render target with twice the height and width of the backbuffer, and using the extra samples in the render target to create an
antialiased final image. 2x FSAA is also common on PCs and supported by the Xbox 360.
The CheckDeviceMultiSampleType method is used to query for antialiasing support on your game machine. The
MultiSampleQuality and MultiSampleType properties of the PresentationParameters are used to select an antialiasing mode
for your backbuffer. For more information see How To: Enable Antialiasing (Multisampling). Setting PreferMultiSampling on
the GraphicsDeviceManager to true can be used to let the GraphicsDeviceManager choose the antialiasing mode.
The RenderState property MultiSampleAntiAlias can be used to enable or disable multisampling at run time.
Concepts
3D Graphics Overview What Is a Render Target?
Tasks
How To: Enable Antialiasing (Multisampling)
Reference
CheckDeviceMultiSampleType PreferMultiSampling MultiSampleQuality MultiSampleType
XNA Game Studio 2.0
The source blend factor is specified by the SourceBlend property, and the destination blend factor is specified by the
DestinationBlend property. The BlendFunction property specifies the blend function to use, normally BlendFunction.Add. In that
case the formula looks like this:
(source × SourceBlend) + (destination × DestinationBlend)
When the AlphaBlendEnable property is false, no blending occurs during rendering. In this case the source pixel overwrites the
destination pixel. When AlphaBlendEnable is true, you can create a lot of special effects using the SourceBlend and
DestinationBlend properties:
Blend Type Blend Settings
Alpha Blending (source × Blend.SourceAlpha) + (destination × Blend.InvSourceAlpha)
Additive Blending (source × Blend.One) + (destination × Blend.One)
Multiplicative Blending (source × Blend.Zero) + (destination × Blend.SouceColor)
2X Multiplicative Blending (source × Blend.DestinationColor) + (destination × Blend.SourceColor)
Figure 1. This picture illustrates four common blend modes. From left to right: Alpha blending, Additive blending,
Multiplicative blending, and 2X Multiplicative blending. The top image in each column is the source image and
below, it's effect when added to the destination.
Alpha blending uses the alpha channel of the source color to create a transparency effect so that the destination color appears
through the source color. For example, if you clear your backbuffer to Color.Gray, it will be colored (0.5,0.5,0.5,1). If you then
take a Color.White color with a partial alpha value (1,1,1,0.4), the result will be 60 percent of the destination color and 40
percent of the source: (0.5 x 0.6) + (1 x 0.4). The resulting color will be (0.7,0.7,0.7, 1). The alpha values are multiplied as well -
(.6 x 1) + .4 gives us an alpha value of 1.
In same cases alpha blending is automatic. When drawing sprites using the SpriteBatch class, choosing
SpriteBlendMode.AlphaBlend configures alpha blending for you.
By default, the alpha channel is blended along with the red, green, and blue channels using the SourceBlend and
DestinationBlend properties. You can choose to customize the blending for just the alpha channel by using the
AlphaSourceBlend and AlphaDestinationBlend properties. When the alpha channel is computed, these properties are used as
blending factors if the SeparateAlphaBlendEnabled property is true.
Concepts
2D Graphics Overview 3D Graphics Overview
Tasks
How To: Draw a Masked Sprite over a Background
Reference
RenderState Blend
XNA Game Studio 2.0
2. Create a method to use as an event handler for the PreparingDeviceSettings event. You will be using the
PreparingDeviceSettingsEventArgs instance to access the PresentationParameters and set your antialiasing preferences.
C#
void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs
e)
{
3. If your game is running on Xbox 360, you can directly set the MultiSampleQuality and MultiSampleType properties and
return from your event handler. The Xbox supports MultiSampleType.TwoSamples and MultiSampleType.FourSamples,
each with a MultiSampleQuality of 1. MultiSampleType.FourSamples is 4x antialiasing; MultiSampleType.TwoSamples is
2x antialiasing.
C#
// Xbox 360 and most PCs support FourSamples/1 (4x) and TwoSamples/1 (2x)
// antialiasing.
#if XBOX
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleQuality = 1;
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleType =
MultiSampleType.FourSamples;
return;
#endif
4. If your game is running on a PC, use CheckDeviceMultiSampleType to query for antialiasing support. Many PCs support
4x antialiasing, and most will support 2x antialiasing. Once you have determined that antialiasing is supported, set the
MultiSampleType and MultiSampleQuality properties appropriately and return from the event handler.
C#
int quality = 0;
GraphicsAdapter adapter = e.GraphicsDeviceInformation.Adapter;
SurfaceFormat format = adapter.CurrentDisplayMode.Format;
// Check for 4xAA
if (adapter.CheckDeviceMultiSampleType(DeviceType.Hardware, format,
false, MultiSampleType.FourSamples, out quality))
{
// even if a greater quality is returned, we only want quality 1
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleQuality = 1;
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleType =
MultiSampleType.FourSamples;
}
// Check for 2xAA
else if (adapter.CheckDeviceMultiSampleType(DeviceType.Hardware, format,
false, MultiSampleType.TwoSamples, out quality))
{
// even if a greater quality is returned, we only want quality 1
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleQuality = 1;
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleType =
MultiSampleType.TwoSamples;
}
return;
}
See Also
Concepts
3D Graphics Overview
What Is Antialiasing?
Tasks
How To: Display a Game in Full-Screen Mode
Reference
GraphicsDeviceManager
PreparingDeviceSettings
CheckDeviceMultiSampleType
PresentationParameters
MultiSampleType
MultiSampleQuality
MultiSampleType
XNA Game Studio 2.0
2. Initialize the world, view, and projection matrices. In this example, a world matrix is created that rotates the geometry
22.5 degrees along the x and y axes. The view matrix is a look-at matrix with a camera position at (0, 0, 5), pointing at the
origin. The projection matrix is a perspective projection matrix based on a field of view, specifying a 45-degree field of
view, an aspect ratio equal to the client window, and a set of near and far planes.
C#
float tilt = MathHelper.ToRadians(22.5f); // 22.5 degree angle
// Use the world matrix to tilt the cube along x and y axes.
worldMatrix = Matrix.CreateRotationX(tilt) *
Matrix.CreateRotationY(tilt);
projectionMatrix = Matrix.CreatePerspectiveFieldOfView(
MathHelper.ToRadians(45), // 45 degree angle
(float)graphics.GraphicsDevice.Viewport.Width / (float)graphics.GraphicsDevice.Vie
wport.Height,
1.0f, 100.0f);
basicEffect.DirectionalLight1.Enabled = true;
basicEffect.DirectionalLight1.DiffuseColor = new Vector3(0.5f, 0.5f, 0.5f);
basicEffect.DirectionalLight1.Direction = Vector3.Normalize(new Vector3(-1.0f, -1.0f,
1.0f));
basicEffect.DirectionalLight1.SpecularColor = new Vector3(0.5f, 0.5f, 0.5f);
basicEffect.LightingEnabled = true;
basicEffect.World = worldMatrix;
basicEffect.View = viewMatrix;
basicEffect.Projection = projectionMatrix;
4. BasicEffect can use the vertex type that is appropriate for the options you will enable for the effect.
If lighting is enabled, the vertex must have a normal.
If vertex colors are enabled, the vertex must have colors.
If texturing is enabled, the vertex must have a texture coordinate.
The following code shows a cube created with vertices of type VertexPositionNormalTexture.
C#
cubeVertices = new VertexPositionNormalTexture[36];
// Front face.
cubeVertices[0] =
new VertexPositionNormalTexture(
topLeftFront, frontNormal, textureTopLeft);
cubeVertices[1] =
new VertexPositionNormalTexture(
bottomLeftFront, frontNormal, textureBottomLeft);
cubeVertices[2] =
new VertexPositionNormalTexture(
topRightFront, frontNormal, textureTopRight);
cubeVertices[3] =
new VertexPositionNormalTexture(
bottomLeftFront, frontNormal, textureBottomLeft);
cubeVertices[4] =
new VertexPositionNormalTexture(
bottomRightFront, frontNormal, textureBottomRight);
cubeVertices[5] =
new VertexPositionNormalTexture(
topRightFront, frontNormal, textureTopRight);
// Back face.
cubeVertices[6] =
new VertexPositionNormalTexture(
topLeftBack, backNormal, textureTopRight);
cubeVertices[7] =
new VertexPositionNormalTexture(
topRightBack, backNormal, textureTopLeft);
cubeVertices[8] =
new VertexPositionNormalTexture(
bottomLeftBack, backNormal, textureBottomRight);
cubeVertices[9] =
new VertexPositionNormalTexture(
bottomLeftBack, backNormal, textureBottomRight);
cubeVertices[10] =
new VertexPositionNormalTexture(
topRightBack, backNormal, textureTopLeft);
cubeVertices[11] =
new VertexPositionNormalTexture(
bottomRightBack, backNormal, textureBottomLeft);
// Top face.
cubeVertices[12] =
new VertexPositionNormalTexture(
topLeftFront, topNormal, textureBottomLeft);
cubeVertices[13] =
new VertexPositionNormalTexture(
topRightBack, topNormal, textureTopRight);
cubeVertices[14] =
new VertexPositionNormalTexture(
topLeftBack, topNormal, textureTopLeft);
cubeVertices[15] =
new VertexPositionNormalTexture(
topLeftFront, topNormal, textureBottomLeft);
cubeVertices[16] =
new VertexPositionNormalTexture(
topRightFront, topNormal, textureBottomRight);
cubeVertices[17] =
new VertexPositionNormalTexture(
topRightBack, topNormal, textureTopRight);
// Bottom face.
cubeVertices[18] =
new VertexPositionNormalTexture(
bottomLeftFront, bottomNormal, textureTopLeft);
cubeVertices[19] =
new VertexPositionNormalTexture(
bottomLeftBack, bottomNormal, textureBottomLeft);
cubeVertices[20] =
new VertexPositionNormalTexture(
bottomRightBack, bottomNormal, textureBottomRight);
cubeVertices[21] =
new VertexPositionNormalTexture(
bottomLeftFront, bottomNormal, textureTopLeft);
cubeVertices[22] =
new VertexPositionNormalTexture(
bottomRightBack, bottomNormal, textureBottomRight);
cubeVertices[23] =
new VertexPositionNormalTexture(
bottomRightFront, bottomNormal, textureTopRight);
// Left face.
cubeVertices[24] =
new VertexPositionNormalTexture(
topLeftFront, leftNormal, textureTopRight);
cubeVertices[25] =
new VertexPositionNormalTexture(
bottomLeftBack, leftNormal, textureBottomLeft);
cubeVertices[26] =
new VertexPositionNormalTexture(
bottomLeftFront, leftNormal, textureBottomRight);
cubeVertices[27] =
new VertexPositionNormalTexture(
topLeftBack, leftNormal, textureTopLeft);
cubeVertices[28] =
new VertexPositionNormalTexture(
bottomLeftBack, leftNormal, textureBottomLeft);
cubeVertices[29] =
new VertexPositionNormalTexture(
topLeftFront, leftNormal, textureTopRight);
// Right face.
cubeVertices[30] =
new VertexPositionNormalTexture(
topRightFront, rightNormal, textureTopLeft);
cubeVertices[31] =
new VertexPositionNormalTexture(
bottomRightFront, rightNormal, textureBottomLeft);
cubeVertices[32] =
new VertexPositionNormalTexture(
bottomRightBack, rightNormal, textureBottomRight);
cubeVertices[33] =
new VertexPositionNormalTexture(
topRightBack, rightNormal, textureTopRight);
cubeVertices[34] =
new VertexPositionNormalTexture(
topRightFront, rightNormal, textureTopLeft);
cubeVertices[35] =
new VertexPositionNormalTexture(
bottomRightBack, rightNormal, textureBottomRight);
5. Create a vertex declaration for the type VertexPositionNormalTexture. This vertex declaration will be used in the render
loop in the next step.
C#
basicEffectVertexDeclaration = new VertexDeclaration(
graphics.GraphicsDevice, VertexPositionNormalTexture.VertexElements);
6. Call the Effect.Begin to begin applying the BasicEffect. Draw the desired geometry between calls to EffectPass.Begin and
EffectPass.End. Call Effect.End to stop application of the technique.
C#
graphics.GraphicsDevice.VertexDeclaration =
basicEffectVertexDeclaration;
graphics.GraphicsDevice.Vertices[0].SetSource(vertexBuffer, 0, VertexPositionNormalTex
ture.SizeInBytes);
graphics.GraphicsDevice.DrawPrimitives(
PrimitiveType.TriangleList,
0,
12
);
pass.End();
}
basicEffect.End();
XNA Game Studio 2.0
5. After the asset is added, open the Properties window and verify that the proper importer and processor are specified.
For this example, the Content Importer is X File - XNA Framework and the Content Processor is Model - XNA
Framework. For ease of reference, the asset name value was manually changed to "ship" using the Properties window.
For more information on the Properties window of a game asset, see Game Asset Properties.
6. Save the solution.
At this point, build the solution.
This completes the design-time portion of the example. The remaining parts render the model using the managed object
(called "ship") and add some user control of the model. All code modifications for this part occur within the game1.cs file of the
game project.
To render the model
1. From Solution Explorer, double-click the game1.cs file.
2. Modify the Game1 class by adding the following code at the beginning of the declaration.
C#
private Model gameShip;
This code loads the model into the gameShip member (using Load).
4. Create a new private method (called DrawModel) in the Game1 class by adding the following code before the existing
Draw method.
C#
private void DrawModel(Model m)
{
Matrix[] transforms = new Matrix[m.Bones.Count];
float aspectRatio = graphics.GraphicsDevice.Viewport.Width / graphics.GraphicsDevi
ce.Viewport.Height;
m.CopyAbsoluteBoneTransformsTo(transforms);
Matrix projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45.0f
),
aspectRatio, 1.0f, 10000.0f);
Matrix view = Matrix.CreateLookAt(new Vector3(0.0f, 50.0f, Zoom), Vector3.Zero, Ve
ctor3.Up);
effect.View = view;
effect.Projection = projection;
effect.World = gameWorldRotation * transforms[mesh.ParentBone.Index] * Mat
rix.CreateTranslation(Position);
}
mesh.Draw();
}
}
This code sets up the lighting effects for each sub-mesh of the model. The gameWorldRotation and Zoom variables are
used for player control. This functionality is added later.
Note
This render code is designed for only those models with a BasicEffect. For custom effects, the inner for-each loop shou
ld be changed to use Effect instead of BasicEffect. In addition, you must manually set the world, view, and projection ma
trices by using EffectParameter objects.
5. Modify the Game1.Draw method by replacing the following code // TODO: Add your drawing code here with the
following code:
C#
DrawModel(gameShip);
This causes the effects initialization of the model before the entire model is rendered.
6. Save the solution.
At this point, the rendering code for the model is complete, but the user control code still needs implementation.
To move the model:
1. Modify the Game1 class by adding the following code after the gameShip declaration.
C#
private Vector3 Position = Vector3.One;
private float Zoom = 2500;
private float RotationY = 0.0f;
private float RotationX = 0.0f;
private Matrix gameWorldRotation;
These members store the current position, zoom, and rotation values. In addition, the gameWorldRotation simplifies the
UpdateGamePad code.
if (state.Buttons.A == ButtonState.Pressed)
{
Exit();
}
This code implements an exit method for the game (pressing the A button) and updates the position members with the
current input of the game controller.
3. Modify the Update method by adding a call to UpdateGamePad, before the call to Update.
C#
UpdateGamePad();
This code updates the state of the position variables with the latest input.
4. Save the solution.
At this point, all development is complete and you can control the ship location with the game pad and exit by pressing the A
button.
See Also Content Pipeline
XNA Game Studio 2.0
//Declares the elements of the custom vertex. Each vertex stores information on th
e current
//position, color, and normal.
public static readonly VertexElement[] VertexElements = new VertexElement[]
{
new VertexElement(0, 0, VertexElementFormat.Vector3,
VertexElementMethod.Default, VertexElementUsage.Position, 0),
new VertexElement(0, sizeof(float) * 3, VertexElementFormat.Color,
VertexElementMethod.Default, VertexElementUsage.Color, 0),
new VertexElement(0, sizeof(float) * 3 + 4, VertexElementFormat.Vector3,
VertexElementMethod.Default, VertexElementUsage.Normal, 0),
};
The custom vertex structure declaration is now complete. Initializing the basic effect is next.
Initializing the Effect and Camera
The next step initializes an effect (of type BasicEffect) and the related camera. These are used for basic coloring and lighting
effects and for viewing the 3D object. Although this step is not strictly necessary for implementing a custom vertex, it is
provided to illustrate a common usage scenario for this custom vertex; the rendering of a simple 3D object with color and light
effects.
To initialize the basic effect and camera
1. Declare variables for the basic effect and various projection matrices.
C#
BasicEffect basicEffect;
Matrix worldMatrix;
Matrix viewMatrix;
Matrix projectionMatrix;
viewMatrix = Matrix.CreateLookAt(
new Vector3(0.0f, 0.0f, 5.0f),
Vector3.Zero,
Vector3.Up
);
projectionMatrix = Matrix.CreatePerspectiveFieldOfView(
MathHelper.ToRadians(45),
(float)graphics.GraphicsDevice.Viewport.Width / (float)graphics.GraphicsDevice.Vie
wport.Height,
1.0f, 100.0f
);
//Enables some basic effect characteristics, such as vertex coloring an ddefault light
ing.
basicEffect = new BasicEffect(graphics.GraphicsDevice, null);
basicEffect.VertexColorEnabled = true;
basicEffect.LightingEnabled = true;
basicEffect.EnableDefaultLighting();
basicEffect.World = worldMatrix;
basicEffect.View = viewMatrix;
basicEffect.Projection = projectionMatrix;
This completes the initialization of the camera and basic effect. The next step sets up a basic triangle strip using the custom
vertex declared earlier in this topic.
Initializing the 3D Primitive
In this step, a vertex array is initialized with custom vertices implemented by VertexPositionColoredNormal. The vertex array,
in addition to an indices array, is used later to render a colored triangle strip with default lighting effects.
To initialize the triangle strip
1. Declare an array (of type VertexPositionColoredNormal), and initialize the various properties of the vertex elements. In
this topic, a triangle strip (from 0,0 to 3,0 and on the plane z = 0) is drawn.
C#
triangleStripVertices = new VertexPositionColoredNormal[8];
2. Create and initialize the indices buffer for the primitive. Because a triangle strip is being used, the buffer is relatively
small.
C#
triangleStripIndices = new short[8];
for (int i = 0; i < 8; i++)
{
triangleStripIndices[i] = (short)i;
}
Initialization of the triangle strip is complete and the final step, rendering the triangle strip, is next.
Drawing the 3D Primitive
In this step, a red triangle strip is rendered with some basic lighting effects. This code is commonly placed inside the Draw
method of your game.
To draw the triangle strip
1. Declare the proper vertex declaration for the graphics device and call the DrawUserIndexedPrimitives method.
C#
graphics.GraphicsDevice.VertexDeclaration = basicEffectVertexDeclaration;
basicEffect.Begin();
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
pass.Begin();
graphics.GraphicsDevice.DrawUserIndexedPrimitives<VertexPositionColoredNormal>(
PrimitiveType.TriangleStrip,
triangleStripVertices,
0, // vertex buffer offset to add to each element of the index buffer
8, // number of vertices to draw
triangleStripIndices,
0, // first index element to read
6 // number of primitives to draw
);
pass.End();
}
basicEffect.End();
These simple lighting effects are the reason the VertexPositionColoredNormal custom vertex type was created. Because each
vertex has a normal, along with a position and color, the basic effect determines where the triangle strip is highlighted and
where any shadows lie. If you had instead used vertices, of type VertexPositionColor, there would be no normals to determine
any lighting effects.
XNA Game Studio 2.0
The vertices used in the sample are of type VertexPositionNormalTexture Structure. Vertices of this type contain position,
normal data, and one set of texture coordinates. For this sample, only the position information is used.
The Complete Sample
The code in this tutorial illustrates the technique described in the text. A complete code sample for this tutorial is available for
you to download, including full source code and any additional supporting files required by the sample.
Download DrawUserPrimitives_Sample.zip.
The major steps for this example are listed below:
The Complete Sample
Drawing Points
Drawing Lines
Drawing a Line Strip
Drawing Triangles
Drawing a Triangle Strip
Drawing Points
To draw a point list
1. Create a list of vertices in 3D space that represent the points to draw.
C#
pointList = new VertexPositionNormalTexture[points];
In this topic, eight points forming a triangle strip consisting of six triangles are drawn along the plane z = 0 and centered
around (0, 0, 0). The camera is positioned at (0, 0, 7) looking at (0, 0, 0). This results in a orthogonal view of all eight
points. The positioning of the points, the camera, and the required transformations are implemented with the following
code:
C#
worldMatrix = Matrix.CreateTranslation(new Vector3(-1.5f, -0.5f, 0.0f));
viewMatrix = Matrix.CreateLookAt(
new Vector3(0.0f, 0.0f, 7.0f),
new Vector3(0.0f, 0.0f, 0.0f),
Vector3.Up
);
projectionMatrix = Matrix.CreatePerspectiveFieldOfView(
MathHelper.ToRadians(45),
(float)graphics.GraphicsDevice.Viewport.Width /
(float)graphics.GraphicsDevice.Viewport.Height,
1.0f, 100.0f
);
The following code initializes these eight points and stores them in an array of type VertexPositionNormalTexture.
This results in an array with the following vertex positions.
2. The size of a point rendered from a point list is controlled by setting the property RenderState.PointSize. Here, the point
size is specified as 10, so at each point in the list a 10-pixel square is drawn.
C#
graphics.GraphicsDevice.RenderState.PointSize = 10;
3. Render the points by calling DrawUserPrimitives, specifying PrimitiveType.PointList to determine how the data in the
vertex array is interpreted.
C#
graphics.GraphicsDevice.DrawUserPrimitives<VertexPositionNormalTexture>(
PrimitiveType.PointList,
pointList,
0, // index of the first vertex to draw
8 // number of primitives
);
Drawing Lines
To draw a line list
1. This example uses the sample vertex list created in step 1 of "To draw a point list". Here, an index array is created that
indexes into that vertex buffer, identifying a series of lines.
C#
// Initialize an array of indices of type short.
lineListIndices = new short[(points * 2) - 2];
This is equivalent to setting lineListIndices to the following array, consisting of a series of lines between pointList[0]
and pointList[1], pointList[1] and pointList[2], and so forth.
C#
lineListIndices = new short[14]{ 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7 };
2. Render the lines by calling DrawUserIndexedPrimitives, specifying PrimitiveType.LineList to determine how to interpret
the data in the vertex array.
C#
graphics.GraphicsDevice.DrawUserIndexedPrimitives<VertexPositionNormalTexture>(
PrimitiveType.LineList,
pointList,
0, // vertex buffer offset to add to each element of the index buffer
8, // number of vertices in pointList
lineListIndices, // the index buffer
0, // first index element to read
7 // number of primitives to draw
);
This is equivalent to setting lineStripIndices to the following array, consisting of a series of connected lines between
pointList[0], pointList[1], and pointList[2], and so forth.
C#
lineStripIndices = new short[8]{ 0, 1, 2, 3, 4, 5, 6, 7 };
2. Render the line strip by calling DrawUserIndexedPrimitives, specifying PrimitiveType.LineStrip to determine how the data
in the vertex array is interpreted. Note that fewer vertices are used to render the same number of primitives rendered
earlier by the line list.
Note
In the example code, the line strip is rendered by a series of red lines, instead of the white lines used for the previous lin
e list. This is used to indicate a different primitive type even though the result is the same.
C#
basicEffect.DiffuseColor = new Vector3(1.0f, 0.0f, 0.0f);
basicEffect.CommitChanges();
graphics.GraphicsDevice.DrawUserIndexedPrimitives<VertexPositionNormalTexture>(
PrimitiveType.LineStrip,
pointList,
0, // vertex buffer offset to add to each element of the index buffer
8, // number of vertices to draw
lineStripIndices,
0, // first index element to read
7 // number of primitives to draw
);
basicEffect.DiffuseColor = new Vector3(1.0f, 1.0f, 1.0f);
basicEffect.CommitChanges();
Drawing Triangles
To draw a triangle list
Like a line list, a triangle list is a primitive type indicating that the vertices in the vertex buffer are to be interpreted as a series of
separately drawn triangles.
1. Create an array to hold the list of indices identifying a series of triangles to draw from the specified point list.
C#
triangleListIndices = new short[(width - 1) * (height - 1) * 6];
This is equivalent to setting triangleListIndices to the following array, consisting of a series of triangles between
pointList[0], pointList[1], and pointList[2], and so forth.
C#
triangleListIndices = new short[18]{ 0, 1, 2, 2, 1, 3, 2, 3, 4, 4, 3, 5, 4, 5, 6, 6, 5
, 7 };
2. Render the lines by calling DrawUserIndexedPrimitives, specifying PrimitiveType.TriangleList to determine how the data
in the vertex array is interpreted.
C#
graphics.GraphicsDevice.DrawUserIndexedPrimitives<VertexPositionNormalTexture>(
PrimitiveType.TriangleList,
pointList,
0, // vertex buffer offset to add to each element of the index buffer
8, // number of vertices to draw
triangleListIndices,
0, // first index element to read
6 // number of primitives to draw
);
This is equivalent to setting triangleStripIndices to the following array, consisting of a series of connected triangles
between pointList[0], pointList[1], and pointList[2], and so forth.
C#
triangleStripIndices = new short[8]{ 0, 1, 2, 3, 4, 5, 6, 7 };
2. Render the lines by calling DrawUserIndexedPrimitives, specifying PrimitiveType.TriangleStrip to determine how the data
in the vertex array is interpreted. Note that fewer vertices are used to render the same number of primitives rendered
earlier by the triangle list.
Note
In the example code, the triangle strip is rendered by a series of red lines, instead of the white lines used for the previou
s triangle list. This is used to indicate a different primitive type even though the result is the same.
C#
basicEffect.DiffuseColor = new Vector3(1.0f, 0.0f, 0.0f);
basicEffect.CommitChanges();
graphics.GraphicsDevice.DrawUserIndexedPrimitives<VertexPositionNormalTexture>(
PrimitiveType.TriangleStrip,
pointList,
0, // vertex buffer offset to add to each element of the index buffer
8, // number of vertices to draw
triangleStripIndices,
0, // first index element to read
6 // number of primitives to draw
);
basicEffect.DiffuseColor = new Vector3(1.0f, 1.0f, 1.0f);
basicEffect.CommitChanges();
XNA Game Studio 2.0
struct VS_OUTPUT
{
float4 position : POSITION;
float4 color : COLOR0;
};
VS_OUTPUT Transform(
float4 Pos : POSITION,
float4 Color : COLOR0 )
{
VS_OUTPUT Out = (VS_OUTPUT)0;
return Out;
}
technique TransformTechnique
{
pass P0
{
vertexShader = compile vs_2_0 Transform();
pixelShader = compile ps_1_1 PixelShader();
}
}
2. Add the effect file to the Content directory of your XNA Framework game. Right-click your Content node and point to
Add, and then click Existing Item. In the Files of type: drop-down list, click All Files. Navigate to your .fx file and click
Add.
Tip
To create a new .fx file, point to Add, and then New Item, and then choose the Text File template. For the name of the
file, use the .fx file extension.
3. Create a new Effect by using the ContentManager.Load<Effect> method to load the asset.
C#
effect = Content.Load<Effect>("ReallySimpleEffect");
4. In the effect file, there is a parameter named WorldViewProj, which is a matrix used by the vertex shader. The following
code looks up the WorldViewProj parameter in Effect.Parameters and calls EffectParameter.SetValue to initialize the
value of the transform matrix.
C#
effect.Parameters["WorldViewProj"].SetValue(worldViewProjection);
5. Set Effect.CurrentTechnique to the technique from the effect file you wish to apply. In this case, we use Effect.Techniques
to look up the technique named TransformTechnique from the effect file.
C#
effect.CurrentTechnique = effect.Techniques["TransformTechnique"];
6. Call the Effect.Begin to begin applying the technique. For each pass in the technique, draw the desired geometry between
calls to EffectPass.Begin and EffectPass.End. Call Effect.End to stop applying the technique.
C#
// The effect is a compiled effect created and compiled elsewhere
// in the application.
effect.Begin();
foreach (EffectPass pass in effect.CurrentTechnique.Passes)
{
pass.Begin();
graphics.GraphicsDevice.DrawIndexedPrimitives(
PrimitiveType.TriangleList,
0,
0,
cubeVertices.Length,
0,
12);
pass.End();
}
effect.End();
XNA Game Studio 2.0
3. Next, iterate through each ModelMeshPart in your model, and assign your Effect to the Effect property of the
ModelMeshPart.
C#
public static void RemapModel(Model model, Effect effect)
{
foreach (ModelMesh mesh in model.Meshes)
{
foreach (ModelMeshPart part in mesh.MeshParts)
{
part.Effect = effect;
}
}
}
4. Lastly, draw the Model normally using the steps outlined in How To: Render a Model, except instead of using BasicEffect,
use the Effect attached to the model.
C#
foreach (ModelMesh mesh in terrain.Meshes)
{
foreach (Effect effect in mesh.Effects)
{
mesh.Draw();
}
}
See Also
Concepts
3D Graphics Overview
Tasks
How To: Render a Model
Reference
Model
ModelMeshPart
Effect
Draw
Effect
XNA Game Studio 2.0
struct VS_OUTPUT
{
float4 position : POSITION;
float4 textureCoordinate : TEXCOORD0;
};
4. Declare an array to hold the list of vertices. This array will be used to assign data to the vertex buffer.
C#
cubeVertices = new VertexPositionTexture[36];
5. Assign the position and texture coordinate data to each element of the vertex array.
C#
// Vertices for the front of the cube.
cubeVertices[0] =
new VertexPositionTexture(
topLeftFront, textureTopLeft); // 0
cubeVertices[1] =
new VertexPositionTexture(
bottomLeftFront, textureBottomLeft); // 1
cubeVertices[2] =
new VertexPositionTexture(
topRightFront, textureTopRight); // 2
cubeVertices[3] =
new VertexPositionTexture(
bottomRightFront, textureBottomRight); // 3
// Vertices for the back of the cube.
cubeVertices[4] =
new VertexPositionTexture(
topLeftBack, textureTopRight); // 4
cubeVertices[5] =
new VertexPositionTexture(
topRightBack, textureTopLeft); // 5
cubeVertices[6] =
new VertexPositionTexture(
bottomLeftBack, textureBottomRight); //6
cubeVertices[7] =
new VertexPositionTexture(
bottomRightBack, textureBottomLeft); // 7
2. Set the device vertex stream, indices, and vertex declaration to correspond to the vertices for which the texture is to be
applied.
C#
graphics.GraphicsDevice.VertexDeclaration = cubeVertexDeclaration;
graphics.GraphicsDevice.Indices = indexBuffer;
graphics.GraphicsDevice.Vertices[0].SetSource(
vertexBuffer,
0,
VertexPositionTexture.SizeInBytes);
3. Apply the technique by placing the drawing calls between EffectPass.Begin and EffectPass.End inside an Effect.Begin ...
Effect.End block.
C#
// This code would go between a device BeginScene-EndScene block.
effect.Begin();
foreach (EffectPass pass in effect.CurrentTechnique.Passes)
{
pass.Begin();
graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList,
0,
0,
cubeVertices.Length,
0,
12
);
pass.End();
}
effect.End();
See Also
Concepts
3D Graphics Overview
Tasks
How To: Use BasicEffect
How To: Use EffectParameters and EffectTechniques
XNA Game Studio 2.0
FillVertices();
}
2. Determine the UV coordinates for the texture you want to apply to the quad. The Quad constructor calls FillVertices,
which assigns UV coordinates ranging from (0,0) to (1,1). This will make the entire texture appear on the quad.
C#
private void FillVertices()
{
// Fill in texture coordinates to display full texture
// on quad
Vector2 textureUpperLeft = new Vector2( 0.0f, 0.0f );
Vector2 textureUpperRight = new Vector2( 1.0f, 0.0f );
Vector2 textureLowerLeft = new Vector2( 0.0f, 1.0f );
Vector2 textureLowerRight = new Vector2( 1.0f, 1.0f );
3. Determine the normals for your vertices. FillVertices copies the normal vector you provide to each vertex.
C#
// Provide a normal for each vertex
for (int i = 0; i < Vertices.Length; i++)
{
Vertices[i].Normal = Normal;
}
4. Copy the position and texture coordinate data to your vertex array.
C#
// Set the position and texture coordinate for each
// vertex
Vertices[0].Position = LowerLeft;
Vertices[0].TextureCoordinate = textureLowerLeft;
Vertices[1].Position = UpperLeft;
Vertices[1].TextureCoordinate = textureUpperLeft;
Vertices[2].Position = LowerRight;
Vertices[2].TextureCoordinate = textureLowerRight;
Vertices[3].Position = UpperRight;
Vertices[3].TextureCoordinate = textureUpperRight;
5. Fill out the index buffer to determine what order your vertices are drawn by the graphics hardware. Drawing two
triangles requires four vertices, but six index entries if you are using PrimitiveType.TriangleList. The indices are specified
in clockwise order. Because XNA is a right-handed system, triangles drawn in counter-clockwise order are assumed to be
facing away from the camera, and are automatically culled by default.
C#
// Set the index buffer for each vertex, using
// clockwise winding
Indexes[0] = 0;
Indexes[1] = 1;
Indexes[2] = 2;
Indexes[3] = 2;
Indexes[4] = 1;
Indexes[5] = 3;
}
To Draw a Quad
1. In your game's Initialize method, create a new Quad object specifying the location, the normal (the direction the Quad
faces), the Up vector, and the width and height of the quad. You can also create a View and Projection matrix to use when
rendering.
C#
Quad quad;
VertexDeclaration quadVertexDecl;
Matrix View, Projection;
protected override void Initialize()
{
quad = new Quad(Vector3.Zero, Vector3.Backward, Vector3.Up, 1, 1);
View = Matrix.CreateLookAt(new Vector3(0, 0, 2), Vector3.Zero, Vector3.Up);
Projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, 4.0f / 3.0f,
1, 500);
base.Initialize();
}
2. In your game's LoadContent method, load the texture you want to apply to the quad using the ContentManager, and
create and initialize a new BasicEffect object. Set TextureEnabled to true and assign the texture to draw to the Texture
property.
C#
Texture2D texture;
BasicEffect quadEffect;
protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
texture = Content.Load<Texture2D>("Glass");
quadEffect = new BasicEffect(graphics.GraphicsDevice, null);
quadEffect.EnableDefaultLighting();
quadEffect.World = Matrix.Identity;
quadEffect.View = View;
quadEffect.Projection = Projection;
quadEffect.TextureEnabled = true;
quadEffect.Texture = texture;
3. Also in LoadContent, create a VertexDeclaration for the vertex type used to define the quad, in this case,
VertexPositionNormalTexture.
C#
quadVertexDecl = new VertexDeclaration(graphics.GraphicsDevice,
VertexPositionNormalTexture.VertexElements);
}
4. In your game's Draw method, set the VertexDeclaration on the GraphicsDevice to the VertexDeclaration object you
created in LoadContent.
C#
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
GraphicsDevice.VertexDeclaration = quadVertexDecl;
5. Call Begin on the effect, then in each EffectPass use DrawUserIndexedPrimitives to draw the quad. Use the Vertices and
Indices properties on the Quad structure to supply the primitive data, and specify two triangles to draw. Then End the
effect.
C#
quadEffect.Begin();
foreach (EffectPass pass in quadEffect.CurrentTechnique.Passes)
{
pass.Begin();
GraphicsDevice.DrawUserIndexedPrimitives<VertexPositionNormalTexture>(
PrimitiveType.TriangleList, quad.Vertices, 0, 4, quad.Indexes, 0, 2);
pass.End();
}
quadEffect.End();
base.Draw(gameTime);
}
See Also
Concepts
3D Graphics Overview
Tasks
How To: Use BasicEffect
Reference
BasicEffect
VertexDeclaration
DrawUserIndexedPrimitives
XNA Game Studio 2.0
defaultViewport = GraphicsDevice.Viewport;
leftViewport = defaultViewport;
rightViewport = defaultViewport;
leftViewport.Width = leftViewport.Width / 2;
rightViewport.Width = rightViewport.Width / 2;
rightViewport.X = leftViewport.Width + 1;
2. Immediately after creating the two new viewports, create a projection matrix to fit each new viewport. In this case,
because the screen is split in half, only one new projection matrix is necessary. It has the same settings as the 4:3 full
screen projection matrix, except the aspect ratio is now 2:3.
C#
projectionMatrix = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, 4.0f /
3.0f, 1.0f, 10000f);
halfprojectionMatrix = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, 2.0
f / 3.0f, 1.0f, 10000f);
}
3. In your Draw method, assign one of the viewports to draw as the GraphicsDevice Viewport. Then draw your scene as
normal, using the camera (or view matrix) associated with this perspective, along with the proper projection matrix.
C#
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Viewport = defaultViewport;
GraphicsDevice.Clear(Color.CornflowerBlue);
GraphicsDevice.Viewport = leftViewport;
DrawScene(gameTime, Camera1.ViewMatrix, halfprojectionMatrix);
4. After drawing the first scene, assign the other viewport to the Viewport property, and draw your scene again with the
associated camera or view matrix, and the proper projection matrix.
C#
GraphicsDevice.Viewport = rightViewport;
DrawScene(gameTime, Camera2.ViewMatrix, halfprojectionMatrix);
base.Draw(gameTime);
See Also
Concepts
Displays, Client Bounds, Viewports, and Back Buffers
Reference
GraphicsDevice.Viewport
Viewport Structure
XNA Game Studio 2.0
SkyCoord = pos;
};
2. The pixel shader for the SkySphere effect uses the texCUBE function to choose a pixel on the cube map. Imagine the
sphere model surrounding the camera viewpoint, and the cube map surrounding the sphere model (as a cube). Then
draw a line from the camera position to a point on the sphere model, and continue that line until it hits the cube map.
This is the pixel returned by texCUBE. This has the effect of transforming the cube into a different shape, which makes a
more realistic sky (the cube often has obvious corners). You do not have to use a sphere for this effect; a flattened or
oblong sphere may look better for some applications.
C#
uniform extern texture SkyboxTexture;
sampler SkyboxS = sampler_state
{
Texture = <SkyboxTexture>;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = LINEAR;
AddressU = WRAP;
AddressV = WRAP;
};
float4 SkyboxPixelShader( float3 SkyCoord : TEXCOORD0 ) : COLOR
{
// grab the pixel color value from the skybox cube map
return texCUBE(SkyboxS, SkyCoord);
};
3. The technique for the SkySphere effect has one pass. The technique has to disable culling, because you want all the
triangles on the sphere to render. Since the camera is inside the sphere, normal culling would result in no vertices to
shade. Depth writes are also disabled, because we want the environment to render behind everything else, without
appearing to clip any objects.
C#
technique SkyboxTechnique
{
pass P0
{
vertexShader = compile vs_2_0 SkyboxVertexShader();
pixelShader = compile ps_2_0 SkyboxPixelShader();
5. Since the Effect and the Model are loaded separately, you need to apply the SkySphere effect to each Effect property on
the ModelMeshPart of the SkySphere model.
C#
// Set the Skysphere Effect to each part of the Skysphere model
foreach (ModelMesh mesh in SkySphere.Meshes)
{
foreach (ModelMeshPart part in mesh.MeshParts)
{
part.Effect = SkySphereEffect;
}
}
7. Then draw the SkySphere by setting parameters to the SkySphere Effect, and then drawing the SkySphere Model. In this
case we set the View and Projection matrices.
C#
// Set the View and Projection matrix for the effect
SkySphereEffect.Parameters["ViewMatrix"].SetValue(myCamera.ViewMatrix);
//SkySphereEffect.Parameters["ViewMatrix"].SetValue(myCamera.View);
SkySphereEffect.Parameters["ProjectionMatrix"].SetValue(projectionMatrix);
// Draw the sphere model that the effect projects onto
foreach (ModelMesh mesh in SkySphere.Meshes)
{
mesh.Draw();
}
8. Because this shader sets some render states before it runs, you must reset the affected render states to the values we
want to use for further rendering.
C#
// Undo the renderstate settings from the shader
graphics.GraphicsDevice.RenderState.CullMode = CullMode.CullCounterClockwi
seFace;
graphics.GraphicsDevice.RenderState.DepthBufferWriteEnable = true;
base.Draw(gameTime);
}
}
}
using System;
namespace SkySphere
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main(string[] args)
{
using (Game1 game = new Game1())
{
game.Run();
}
}
}
}
namespace SkySphere
{
public enum SampleArcBallCameraMode
{
/// <summary>
/// A totally free-look arcball that orbits relative
/// to its orientation
/// </summary>
Free = 0,
/// <summary>
/// A camera constrained by roll so that orbits only
/// occur on latitude and longitude
/// </summary>
RollConstrained = 1
/// <summary>
/// An example arc ball camera
/// </summary>
public class SampleArcBallCamera
{
#region Helper Functions
/// <summary>
/// Uses a pair of keys to simulate a positive or negative axis input.
/// </summary>
public static float ReadKeyboardAxis(KeyboardState keyState, Keys downKey,
Keys upKey)
{
float value = 0;
if (keyState.IsKeyDown(downKey))
value -= 1.0f;
if (keyState.IsKeyDown(upKey))
value += 1.0f;
return value;
}
#endregion
#region Fields
/// <summary>
/// The location of the look-at target
/// </summary>
private Vector3 targetValue;
/// <summary>
/// The distance between the camera and the target
/// </summary>
private float distanceValue;
/// <summary>
/// The orientation of the camera relative to the target
/// </summary>
private Quaternion orientation;
#region Constructors
/// <summary>
/// Create an arcball camera that allows free orbit around a target point.
/// </summary>
public SampleArcBallCamera(SampleArcBallCameraMode controlMode)
{
//orientation quaternion assumes a Pi rotation so you're facing the "front
"
//of the model (looking down the +Z axis)
orientation = Quaternion.CreateFromAxisAngle(Vector3.Up, MathHelper.Pi);
mode = controlMode;
inputDistanceRateValue = 4.0f;
yaw = MathHelper.Pi;
pitch = 0;
}
#endregion
}
}
/// <summary>
/// Get the right direction vector of the camera.
/// </summary>
public Vector3 Right
{
get
{
//R v R' where v = (1,0,0,0)
//The equation can be reduced because we know the following things:
// 1. We're using unit quaternions
// 2. The initial aspect does not change
//The reduced form of the same equation follows
Vector3 right = Vector3.Zero;
right.X =
((orientation.X * orientation.X) + (orientation.W * orientation.W)
) -
((orientation.Z * orientation.Z) + (orientation.Y * orientation.Y)
);
right.Y = 2.0f *
((orientation.X * orientation.Y) + (orientation.Z * orientation.W)
);
right.Z = 2.0f *
((orientation.X * orientation.Z) - (orientation.Y * orientation.W)
);
return right;
}
}
/// <summary>
/// Get the up direction vector of the camera.
/// </summary>
public Vector3 Up
{
get
{
//R v R' where v = (0,1,0,0)
//The equation can be reduced because we know the following things:
// 1. We're using unit quaternions
// 2. The initial aspect does not change
//The reduced form of the same equation follows
Vector3 up = Vector3.Zero;
up.X = 2.0f *
((orientation.X * orientation.Y) - (orientation.Z * orientation.W)
);
up.Y =
((orientation.Y * orientation.Y) + (orientation.W * orientation.W)
) -
((orientation.Z * orientation.Z) + (orientation.X * orientation.X)
);
up.Z = 2.0f *
((orientation.Y * orientation.Z) + (orientation.X * orientation.W)
);
return up;
}
}
/// <summary>
/// Get the View (look at) Matrix defined by the camera
/// </summary>
public Matrix ViewMatrix
{
get
{
return Matrix.CreateLookAt(targetValue -
(Direction * distanceValue), targetValue, Up);
}
}
#endregion
/// <summary>
/// Get or Set the camera's distance to the target.
/// </summary>
public float Distance
{
get
{ return distanceValue; }
set
{ distanceValue = value; }
}
/// <summary>
/// Sets the rate of distance change
/// when automatically handling input
/// </summary>
public float InputDistanceRate
{
get
{ return inputDistanceRateValue; }
set
{ inputDistanceRateValue = value; }
}
/// <summary>
/// Get/Set the camera's current postion.
/// </summary>
public Vector3 Position
{
get
{
return targetValue - (Direction * Distance);
}
set
{
SetCamera(value, targetValue, Vector3.Up);
}
}
#endregion
switch (mode)
{
case SampleArcBallCameraMode.Free:
//rotate the aspect by the angle
orientation = orientation *
Quaternion.CreateFromAxisAngle(Vector3.Right, -angle);
/// <summary>
/// Orbit towards the Right vector in Free camera
/// or on the latitude line when roll constrained
/// </summary>
public void OrbitRight(float angle)
{
switch (mode)
{
case SampleArcBallCameraMode.Free:
//rotate the aspect by the angle
orientation = orientation *
Quaternion.CreateFromAxisAngle(Vector3.Up, angle);
/// <summary>
/// Rotate around the Forward vector
/// in free-look camera only
/// </summary>
public void RotateClockwise(float angle)
{
switch (mode)
{
case SampleArcBallCameraMode.Free:
//rotate the orientation around the direction vector
orientation = orientation *
Quaternion.CreateFromAxisAngle(Vector3.Forward, angle);
Quaternion.Normalize(ref orientation, out orientation);
break;
case SampleArcBallCameraMode.RollConstrained:
//Do nothing, we don't want to roll at all to stay consistent
break;
}
}
/// <summary>
/// Sets up a quaternion & position from vector camera components
/// and oriented the camera up
/// </summary>
/// <param name="eye">The camera position</param>
/// <param name="lookAt">The camera's look-at point</param>
/// <param name="up"></param>
public void SetCamera(Vector3 position, Vector3 target, Vector3 up)
{
//Create a look at matrix, to simplify matters a bit
Matrix temp = Matrix.CreateLookAt(position, target, up);
//Get the pitch from the angle formed by the Up vector and the
//the forward direction, then subtracting Pi / 2, since
//we pitch is zero at Forward, not Up.
pitch = (float)-(Math.Acos(Vector3.Dot(Vector3.Up, Direction))
- MathHelper.PiOver2);
}
}
#endregion
if (dY != 0) OrbitUp(dY);
if (dX != 0) OrbitRight(dX);
if (mode != SampleArcBallCameraMode.Free)
{
float dR = elapsedTime * ReadKeyboardAxis(
kbState, Keys.Q, Keys.E) * InputTurnRate;
if (dR != 0) RotateClockwise(dR);
}
}
/// <summary>
/// Handle default gamepad input for a camera
/// </summary>
public void HandleDefaultGamepadControls(GamePadState gpState, GameTime gameTi
me)
{
if (gameTime == null)
{
throw new ArgumentNullException("gameTime",
"GameTime parameter cannot be null.");
}
if (gpState.IsConnected)
{
float elapsedTime = (float)gameTime.ElapsedGameTime.TotalSeconds;
See Also
Concepts
3D Graphics Overview
Tasks
How To: Create and Apply Custom Effects
Reference
Effect
TextureCube
Effect
XNA Game Studio 2.0
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
graphics.PreferredDepthStencilFormat = SelectStencilMode();
}
private static DepthFormat SelectStencilMode()
{
// Check stencil formats
GraphicsAdapter adapter = GraphicsAdapter.DefaultAdapter;
SurfaceFormat format = adapter.CurrentDisplayMode.Format;
if (adapter.CheckDepthStencilMatch(DeviceType.Hardware, format, format, DepthForma
t.Depth24Stencil8))
return DepthFormat.Depth24Stencil8;
else if (adapter.CheckDepthStencilMatch(DeviceType.Hardware, format, format, Depth
Format.Depth24Stencil8Single))
return DepthFormat.Depth24Stencil8Single;
else if (adapter.CheckDepthStencilMatch(DeviceType.Hardware, format, format, Depth
Format.Depth24Stencil4))
return DepthFormat.Depth24Stencil4;
else if (adapter.CheckDepthStencilMatch(DeviceType.Hardware, format, format, Depth
Format.Depth15Stencil1))
return DepthFormat.Depth15Stencil1;
else
throw new InvalidOperationException("Could Not Find Stencil Buffer for Default
Adapter");
}
2. Create a Plane that represents the surface the shadow falls upon. In this case, the shadow falls upon a textured quad
drawn with the Quad class, so we create a plane using three vertices of the quad.
C#
Quad wall;
Plane wallPlane;
protected override void Initialize()
{
...
// Create a new Textured Quad to represent a wall
wall = new Quad(Vector3.Zero, Vector3.Backward, Vector3.Up, 7, 7);
// Create a Plane using three points on the Quad
wallPlane = new Plane(wall.UpperLeft, wall.UpperRight, wall.LowerLeft);
base.Initialize();
}
3. Use CreateShadow to create a shadow matrix based on the direction of your key light and the plane the shadow falls
upon - in this case, the Plane we created earlier from a textured quad. The shadow matrix also contains a translation to
make sure it doesn't intersect the quad. If the shadow used exactly the same plane as an object, the two objects would
both be displayed intermittently, an effect called z-fighting.
C#
Vector3 shadowLightDir;
Matrix shadow;
protected override void LoadContent()
{
...
shadowLightDir = quadEffect.DirectionalLight0.Direction;
// Use the wall plane to create a shadow matrix, and make the shadow slightly
// higher than the wall. The shadow is based on the strongest light
shadow = Matrix.CreateShadow(shadowLightDir, wallPlane) *
Matrix.CreateTranslation(wall.Normal / 100);
...
}
effect.View = View;
effect.Projection = Projection;
effect.World = modelWorld;
}
mesh.Draw();
}
5. Next, we draw the shadow using a stencil buffer. The stencil buffer ensures that the shadow appears one-dimensional.
Our first step is to set StencilEnable to true and Clear the stencil buffer.
C#
// Draw shadow, using the stencil buffer to prevent drawing overlapping
// polygons
6. Setup the stencil buffer test for the shadow. Setting the StencilFunction to CompareFunction.Equal with a
ReferenceStencil of 0 means we will only draw a pixel when the stencil buffer value is 0. Setting StencilPass to
StencilOperation.Increment means that after a pixel is drawn, the stencil buffer value becomes 1, so no more pixels will
be drawn.
C#
// Draw on screen if 0 is the stencil buffer value
GraphicsDevice.RenderState.ReferenceStencil = 0;
GraphicsDevice.RenderState.StencilFunction = CompareFunction.Equal;
// Increment the stencil buffer if we draw
GraphicsDevice.RenderState.StencilPass = StencilOperation.Increment;
7. Setup alpha blending for the shadow by setting AlphaBlendEnable to true, and setting the SourceBlend and
DestinationBlend modes to use the alpha value.
C#
// Setup alpha blending to make the shadow semi-transparent
GraphicsDevice.RenderState.AlphaBlendEnable = true;
GraphicsDevice.RenderState.SourceBlend = Blend.SourceAlpha;
GraphicsDevice.RenderState.DestinationBlend = Blend.InverseSourceAlpha;
8. Draw the model again, this time as a shadow. To make a shadow, we turn the ambient light color to black, disable other
lights, and set an alpha transparency to make the ground below the shadow show through. The shape of the shadow is
created by multiplying the model's world matrix with the shadow matrix.
C#
// Draw the shadow without lighting
foreach (ModelMesh mesh in model.Meshes)
{
foreach (BasicEffect effect in mesh.Effects)
{
effect.AmbientLightColor = Vector3.Zero;
effect.Alpha = 0.5f;
effect.DirectionalLight0.Enabled = false;
effect.DirectionalLight1.Enabled = false;
effect.DirectionalLight2.Enabled = false;
effect.View = View;
effect.Projection = Projection;
effect.World = modelWorld * shadow;
}
mesh.Draw();
}
9. Reset the render states to normal, disabling stencil testing and alpha blending
C#
// Return render states to normal
// turn stencilling off
GraphicsDevice.RenderState.StencilEnable = false;
// turn alpha blending off
GraphicsDevice.RenderState.AlphaBlendEnable = false;
See Also
Concepts
3D Graphics Overview
Tasks
How To: Use BasicEffect
How To: Draw a Textured Quad
How To: Draw a Reflection with the Stencil Buffer
Reference
CreateShadow
AlphaBlendEnable
StencilEnable
PreferredDepthStencilFormat
XNA Game Studio 2.0
3. Access the effect parameter using the Parameters indexed property on Effect, and assign it to your EffectParameter.
C#
mWorld = effect.Parameters["g_mWorld"];
mCameraView = effect.Parameters["g_mCameraView"];
CameraPos = effect.Parameters["g_CameraPos"];
mCameraProj = effect.Parameters["g_mCameraProj"];
4. Call SetValue on EffectParameter whenever you want to set a new value for the effect parameter. You must call SetValue
before calling Begin on your Effect. If you change the value of an EffectParameter after calling Begin and before calling
End, you must call CommitChanges for the new value to take effect.
C#
MyEffect.CameraPos.SetValue(CameraPos);
MyEffect.mCameraView.SetValue(view);
MyEffect.mCameraProj.SetValue(projection);
MyEffect.LightPos.SetValue(LightPos);
MyEffect.mLightView.SetValue(Matrix.CreateLookAt(LightPos, bounds.Center, Vector3.Up))
;
To Use EffectTechniques
1. In your game's LoadContent method, load your Effect from the Content Manager.
2. Create an EffectTechnique instance for each technique in your Effect that you will use during Update or Draw. Any effect
technique can be accessed using the Techniques indexed property on Effect, but this is slower than using
EffectTechniques. For this reason you should create an EffectTechnique for each effect technique that you use.
C#
public EffectTechnique texture;
public EffectTechnique shadows;
public EffectTechnique shadowMap;
3. Access the effect technique using the Techniques indexed property on Effect, and assign it to your EffectTechnique.
C#
texture = effect.Techniques["TextureRender"];
shadowMap = effect.Techniques["ShadowMapRender"];
shadows = effect.Techniques["ShadowRender"];
4. Set the CurrentTechnique property on your Effect to the technique you wish to use when drawing. You can use your
Effect multiple times per Draw with different techniques.
C#
private void DrawScene(EffectTechnique technique)
{
MyEffect.mWorld.SetValue(terrainWorld);
MyEffect.MeshTexture.SetValue(terrainTex);
foreach (ModelMesh mesh in terrain.Meshes)
{
foreach (Effect effect in mesh.Effects)
{
effect.CurrentTechnique = technique;
mesh.Draw();
}
}
}
See Also
Concepts
3D Graphics Overview
Tasks
How To: Render a Model
Reference
Effect
CurrentTechnique
Techniques
Parameters
EffectTechnique
EffectParameter
XNA Game Studio 2.0
C#
public static RenderTarget2D CreateRenderTarget(GraphicsDevice device, int numberLevel
s,
SurfaceFormat surface)
{
if (!GraphicsAdapter.DefaultAdapter.CheckDeviceFormat(DeviceType.Hardware,
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Format, TextureUsage.None,
QueryUsages.None, ResourceType.RenderTarget, surface))
{
// Fall back to current display format
surface = device.DisplayMode.Format;
}
return new RenderTarget2D(device,
device.PresentationParameters.BackBufferWidth,
device.PresentationParameters.BackBufferHeight,
numberLevels, surface,
device.PresentationParameters.MultiSampleType,
device.PresentationParameters.MultiSampleQuality);
2. Next in your LoadContent method, create a new DepthStencilBuffer for your custom RenderTarget2D. The
DepthStencilBuffer settings for width, height, and multisample quality should be the same as the values chosen for your
render target. You may want to choose a depth format that gives you the most depth information. In this example,
DepthFormat.Depth24Stencil8Single is chosen if the game machine supports it. (Use CheckDepthStencilMatch on
Windows-based computers to see if your chosen DepthFormat is supported, or consult Xbox 360 Surface Formats for
supported DepthFormats on Xbox. DepthFormat.Depth24Stencil8Single creates a 24-bit floating-point value for depth.
This allows more depth precision than the normal 24-bit fixed-point buffer, but care must be taken with floating-point
values to guard against floating-point errors for depth values that are nearly identical.
C#
shadowDepthBuffer = GfxComponent.CreateDepthStencil(shadowRenderTarget,
DepthFormat.Depth24Stencil8Single);
C#
public static DepthStencilBuffer CreateDepthStencil(RenderTarget2D target)
{
return new DepthStencilBuffer(target.GraphicsDevice, target.Width,
target.Height, target.GraphicsDevice.DepthStencilBuffer.Format,
target.MultiSampleType, target.MultiSampleQuality);
}
public static DepthStencilBuffer CreateDepthStencil(RenderTarget2D target, DepthFormat
depth)
{
if (GraphicsAdapter.DefaultAdapter.CheckDepthStencilMatch(DeviceType.Hardware,
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Format, target.Format,
depth))
{
return new DepthStencilBuffer(target.GraphicsDevice, target.Width,
target.Height, depth, target.MultiSampleType, target.MultiSampleQuality);
}
else
return CreateDepthStencil(target);
}
3. In your game's Update method, calculate a projection matrix from the point of view of the light source. Include as many
objects in the scene as possible, if they are visible to the camera. In this example, both objects are always visible to the
camera and do not move, so the bounding sphere used is the bounding sphere of both objects combined. Set the near
and far plane of the projection matrix as close as possible to the objects in the scene - this will result in more accurate
depth values for the depth map. The projection matrix is passed to the effect.
C#
protected override void Update(GameTime gameTime)
{
...
Matrix proj = CalcLightProjection(LightPos, bounds, defaultViewport);
MyEffect.mLightProj.SetValue(proj);
base.Update(gameTime);
}
4. In your Draw method, set the appropriate DepthBufferFunction for your depth texture effect. In this case, we use
CompareFunction.LessEqual. With CompareFunction.LessEqual, when a pixel is depth tested, lower depth values are
preserved while any pixels with a depth value higher than the current lowest value are discarded.
C#
GraphicsDevice.RenderState.DepthBufferFunction = CompareFunction.LessEqual;
5. In your Draw method, call GraphicsDevice.SetRenderTarget to set the current render target (target 0) to the render target
you created in Step 1. Then make a copy of the current DepthStencilBuffer on the GraphicsDevice before assigning the
DepthStencilBuffer you created in Step 2 to the DepthStencilBuffer property on GraphicsDevice.
C#
GraphicsDevice.SetRenderTarget(0, shadowRenderTarget);
// Cache the current depth buffer
DepthStencilBuffer old = GraphicsDevice.DepthStencilBuffer;
// Set our custom depth buffer
GraphicsDevice.DepthStencilBuffer = shadowDepthBuffer;
6. Render your scene using an effect that will draw the depth value of each pixel to your render target. A simple vertex and
pixel shader for such an effect is illustrated below:
C#
// Render the shadow map
GraphicsDevice.Clear(Color.Black);
DrawScene(MyEffect.shadowMap);
7. After you have rendered the depth values to the render target, call SetRenderTarget again, setting the current render
target (target 0) to null. That will reset the current render target to the display buffer. Also set the DepthStencilBuffer on
the GraphicsDevice to its former value.
C#
// Set render target back to the back buffer
GraphicsDevice.SetRenderTarget(0, null);
// Reset the depth buffer
GraphicsDevice.DepthStencilBuffer = old;
8. Lastly, call GetTexture on your RenderTarget2D to get a Texture2D containing the depth values for your scene. This is
your depth texture.
C#
// Return the shadow map as a texture
return shadowRenderTarget.GetTexture();
struct VS_SHADOW_OUTPUT
{
float4 Position : POSITION;
float Depth : TEXCOORD0;
};
float4 GetPositionFromLight(float4 position)
{
float4x4 WorldViewProjection = mul(mul(g_mWorld, g_mLightView), g_mLightProj);
return mul(position, WorldViewProjection);
}
VS_SHADOW_OUTPUT RenderShadowMapVS(float4 vPos: POSITION)
{
VS_SHADOW_OUTPUT Out;
Out.Position = GetPositionFromLight(vPos);
// Depth is Z/W. This is returned by the pixel shader.
// Subtracting from 1 gives us more precision in floating point.
Out.Depth.x = 1-(Out.Position.z/Out.Position.w);
return Out;
}
2. The pixel shader returns one value, the depth of the pixel. This is calculated by the pixel shader and passed in the
TEXCOORD0 semantic.
The depth is returned as the red value by the pixel shader. If you are using SurfaceFormat.Single, this will hold a 32-bit
floating point value. More bits will give us smoother shadows, and floating point will create smoother shadows than fixed
point. However, this shader will create shadows using almost any SurfaceFormat value.
See Also
Concepts
3D Graphics Overview
What Is a Depth Buffer?
What Is a Depth Texture?
What Is a Render Target?
Xbox 360 Surface Formats
Tasks
How To: Draw a Model with a Custom Effect
How To: Use EffectParameters and EffectTechniques
How To: Implement Shadow Mapping
Reference
RenderTarget2D
GetTexture
SurfaceFormat
CheckDeviceFormat
Texture2D
DepthStencilBuffer
DepthFormat
CheckDepthStencilMatch
DepthBufferFunction
CompareFunction
GraphicsDevice.DepthStencilBuffer
XNA Game Studio 2.0
2. In your game's LoadContent method, load the Models and Effect for your scene. Remap the Models to use your custom
Effect according to How To: Draw a Model with a Custom Effect.
3. In LoadContent, create a RenderTarget2D and DepthStencilBuffer for your shadow map using the techniques described
in How To: Create a Depth Texture.
4. In your game's Update method, set the position of your light source and your camera as parameters to the Effect. You
must also set the view and projection matrices for both the shadow map and the camera itself.
C#
MyEffect.CameraPos.SetValue(CameraPos);
MyEffect.mCameraView.SetValue(view);
MyEffect.mCameraProj.SetValue(projection);
MyEffect.LightPos.SetValue(LightPos);
MyEffect.mLightView.SetValue(Matrix.CreateLookAt(LightPos, bounds.Center, Vector3.Up))
;
5. Next, in your game's Draw method, create a shadow map for the scene using the techniques described in
How To: Create a Depth Texture.
C#
map = CreateShadowMap();
6. After creating the depth texture in Draw, set it into an appropriate sampler value in your shadow mapping effect.
C#
// Set our shadow map into our effect
MyEffect.ShadowMapTexture.SetValue(map);
7. Next, draw your scene using a shader that supports shadow mapping. The shader will apply ambient light only where the
light casts a shadow.
C#
// Render our scene
GraphicsDevice.Clear(Color.CornflowerBlue);
DrawScene(MyEffect.shadows);
VS_OUTPUT RenderShadowsVS(
float3 position : POSITION,
float3 normal : NORMAL,
float2 vTexCoord0 : TEXCOORD0 )
{
VS_OUTPUT Output;
2. The first task for the pixel shader is calculating the normal lighting equation for the pixel. In this example, only diffuse
lighting is calculated.
3. Next, the pixel shader gets the position of this pixel on the shadow map. This is necessary because the shadow map is
rendered from the light's perspective, and this pixel is rendered from the camera's perspective. The result of
GetPositionFromLight is a screen coordinate. This is then converted into a UV coordinate so it can be accessed from the
sampler containing the shadow map.
4. Next, the shadow depth of this pixel is accessed using the tex2D function to access the shadow map. Then the depth of
this pixel is determined by dividing the Z value of the position with the W value. This is subtracted from 1.0 before
comparison because the shadow depths are similarly subtracted from 1.0. For more information see CreateDepthTexture.
5. Now the shadow depth and true depth are compared. Floating-point precision errors can cause a banding effect if the
two values are compared directly, so the shadow depth is decreased slightly to ensure that pixels that should be lighted
are lighted. If this pixel is indeed in shadow, the diffuse portion of the lighting is reset to black.
6. Lastly, the total lighting equation is computed by adding the diffuse and ambient components together. This is the output
returned from the pixel shader.
return Output;
See Also
Concepts
3D Graphics Overview
What Is a Depth Buffer?
What Is a Depth Texture?
What Is a Render Target?
Tasks
How To: Draw a Model with a Custom Effect
How To: Use EffectParameters and EffectTechniques
How To: Create a Depth Texture
Reference
Model
Effect
RenderTarget2D
DepthStencilBuffer
XNA Game Studio 2.0
Math
The XNA Framework provides classes and methods for manipulating vectors and matrices. This section discusses math and
includes examples of common math-related game tasks.
In This Section
Math Overview
Overview of the math related functionality provided by the XNA Framework.
Collision Detection Overview
Overview of the collision-detection–related functionality provided by the XNA Framework.
How To: Transform a Point with a Matrix
This example demonstrates how to use the Vector3 and Matrix classes to transform a point.
How To: Rotate and Move a Camera
This sample demonstrates how to rotate and move a first-person camera in a 3D environment.
How To: Make a First-Person Camera
This example demonstrates how to create a first-person camera.
How To: Make a Third-Person Camera
This example demonstrates how to create a third-person camera.
How To: Script the Camera to Follow a Curve
This example demonstrates how to use the Curve and CurveKey classes to script the movement of the camera.
How To: Position the Camera to View All Objects in a Scene
This example demonstrates how to position the camera so that all objects in a scene are within the view frustum while
maintaining the camera's original orientation.
How To: Detect Whether Two Models Collide
This example demonstrates how to use the BoundingSphere class to check whether two models are colliding.
How To: Detect Whether a User Clicked a 3D Object
This example demonstrates how to check whether the mouse is positioned over a 3D object by creating a ray starting at the
camera's near clipping plane and ending at its far clipping plane.
Note
This example applies only to Windows development. The Mouse and MouseState objects are not supported on Xbox 360.
XNA Game Studio 2.0
Math Overview
Overview of the math related functionality provided by the XNA Framework.
The XNA Framework provides classes and methods dealing with these topics.
Vector Manipulation
Matrix Creation and Manipulation
Testing for Intersection and Containment of Geometry
Mathematical Constants and Scalar Manipulation
Vector Manipulation
The XNA Framework provides the Vector2, Vector3, and Vector4 classes for representing and manipulating vectors. Each
vector class has methods for performing standard vector operations such as dot product, cross product, normalization,
transformation, and interpolation.
Matrix Creation and Manipulation
The XNA Framework provides the Matrix class for transformation of vectors. The Matrix class provides methods for performing
standard matrix operations such as addition, subtraction, and multiplication, in addition to helper methods for creating scale,
translation, and rotation matrices.
Testing for Intersection and Containment of Geometry
The XNA Framework provides the BoundingBox, BoundingFrustum, BoundingSphere, Plane, and Ray classes for representing
world geometry. These classes have methods for checking for intersection and containment with each other.
Mathematical Constants and Scalar Manipulation
The XNA Framework provides the MathHelper class for manipulating scalar values and retrieving some common mathematical
constants. The MathHelper class also has utility methods for converting between degrees and radians.
XNA Game Studio 2.0
return rotatedPoint;
}
See Also
Matrix Creation Methods
CreateRotationX
CreateRotationY
CreateRotationZ
CreateScale
CreateTranslation
XNA Game Studio 2.0
3. Create a rotation Matrix determining the current amount of rotation for the camera object. Because the camera is limited
to one axis of rotation, this matrix represents the rotation of the camera around its own y-axis. A rotation Matrix
representing rotation around the y-axis is created with CreateRotationY.
C#
Matrix rotationMatrix = Matrix.CreateRotationY(avatarYaw);
4. Transform a copy of the reference vector using Transform and the rotation Matrix. This represents the direction the
camera is pointing in transformed (or view) space.
C#
// Create a vector pointing the direction the camera is facing.
Vector3 transformedReference = Vector3.Transform(cameraReference, rotationMatrix);
5. Add the camera's current position to the transformed direction vector. The result is the position that the camera is
looking at.
C#
// Calculate the position the camera is looking at.
Vector3 cameraLookat = cameraPosition + transformedReference;
6. Create a new view Matrix using CreateLookAt. Pass CreateLookAt the camera's current position and the transformed
direction vector. The third parameter of CreateLookAt is the up direction of the camera and is usually Vector3.Up (0, 1, 0).
This matrix Matrix controls how world coordinates are transformed to camera coordinates.
C#
// Set up the view matrix and projection matrix.
view = Matrix.CreateLookAt(cameraPosition, cameraLookat, new Vector3(0.0f, 1.0f, 0.0f)
);
7. Create a new projection Matrix with CreatePerspectiveFieldOfView. This Matrix controls how camera coordinate values
are transformed to screen coordinates.
The first parameter is the field of view of the projection Matrix expressed in radians. A typical field of view of 45 degrees
would be expressed as pi/4 radians. The second parameter is the aspect ratio of the projection Matrix and corrects for the
difference in width and height of a viewspace. The third and fourth parameters specify the near and far distances at
which the objects will be visible.
C#
// Set distance from the camera of the near and far clipping planes.
static float nearClip = 1.0f;
static float farClip = 2000.0f;
Viewport viewport = graphics.GraphicsDevice.Viewport;
float aspectRatio = (float)viewport.Width / (float)viewport.Height;
8. Loop through each 3D model to be rendered as described in How To: Render a Model using the projection matrix and
view matrix created above. An identity matrix is used for the world matrix as a means of simplifying the code.
C#
void DrawModel(Model model, Matrix world, Texture2D texture)
{
foreach (ModelMesh mesh in model.Meshes)
{
foreach (BasicEffect be in mesh.Effects)
{
be.Projection = proj;
be.View = view;
be.World = world;
be.Texture = texture;
be.TextureEnabled = true;
}
mesh.Draw();
}
}
See Also How To: Render a Model
XNA Game Studio 2.0
4. Transform a copy of the camera's head offset using the rotation Matrix and Vector3.Transform.
C#
// Transform the head offset so the camera is positioned properly relative to the avat
ar.
Vector3 headOffset = Vector3.Transform(avatarHeadOffset, rotationMatrix);
5. Calculate the current position of the camera. The position of the camera will be the position of the avatar plus the avatar's
transformed head offset.
C#
// Calculate the camera's current position.
Vector3 cameraPosition = avatarPosition + headOffset;
6. Transform a copy of the camera's reference vector using the rotation Matrix and Vector3.Transform.
C#
// Create a vector pointing the direction the camera is facing.
Vector3 transformedReference = Vector3.Transform(cameraReference, rotationMatrix);
7. Calculate the position the camera is looking at. This "look-at" position will be the camera's position plus the camera's
transformed reference vector.
C#
// Calculate the position the camera is looking at.
Vector3 cameraLookat = transformedReference + cameraPosition;
8. Create a new view Matrix. The new Matrix is created by passing the camera position and camera lookat to CreateLookAt.
The view Matrix controls how world coordinate values are transformed to camera coordinates.
C#
view = Matrix.CreateLookAt(cameraPosition, cameraLookat, new Vector3(0.0f, 1.0f, 0.0f)
);
9. Create a new projection Matrix with CreatePerspectiveFieldOfView. The projection Matrix controls how camera
coordinate values are transformed to screen coordinates.
C#
Viewport viewport = graphics.GraphicsDevice.Viewport;
float aspectRatio = (float)viewport.Width / (float)viewport.Height;
10. Loop through each model in the world drawing it as described in How To: Render a Model using the projection matrix
and view matrix created above. For the world matrix, use Matrix.CreateTranslation and the object's current position in the
world.
C#
void DrawBoxes()
{
for (int z = 0; z < 9; z++)
{
for (int x = 0; x < 9; x++)
{
DrawModel(box, Matrix.CreateTranslation(x * 60, 0, z * 60), boxTexture);
}
}
}
/// <summary>
/// Draws the 3D specified model.
/// </summary>
/// <param name="model">The 3D model being drawn.</param>
/// <param name="world">Transformation matrix for world coords.</param>
/// <param name="texture">Texture used for the drawn 3D model.</param>
void DrawModel(Model model, Matrix world, Texture2D texture)
{
foreach (ModelMesh mesh in model.Meshes)
{
foreach (BasicEffect be in mesh.Effects)
{
be.Projection = proj;
be.View = view;
be.World = world;
be.Texture = texture;
be.TextureEnabled = true;
}
mesh.Draw();
}
}
4. Transform a copy of the camera offset vector by using the Transform method and the rotation Matrix.
C#
// Create a vector pointing the direction the camera is facing.
Vector3 transformedReference = Vector3.Transform(thirdPersonReference, rotationMatrix)
;
5. Calculate the camera's position as the avatar's position plus the transformed camera offset.
C#
// Calculate the position the camera is looking from.
Vector3 cameraPosition = transformedReference + avatarPosition;
6. Create a view Matrix with the CreateLookAt method. The avatar's current position will be the cameraTarget parameter.
C#
view = Matrix.CreateLookAt(cameraPosition, avatarPosition, new Vector3(0.0f, 1.0f, 0.0
f));
7. Create a new projection Matrix with CreatePerspectiveFieldOfView. The projection Matrix controls how camera
coordinate values are transformed to screen coordinates.
C#
Viewport viewport = graphics.GraphicsDevice.Viewport;
float aspectRatio = (float)viewport.Width / (float)viewport.Height;
8. Loop through each model in the world drawing it as described in How To: Render a Model using the projection matrix
and view matrix created above. For the world matrix, use Matrix.CreateTranslation and the object's current position in the
world.
C#
void DrawBoxes()
{
for (int z = 0; z < 9; z++)
{
for (int x = 0; x < 9; x++)
{
DrawModel(box, Matrix.CreateTranslation(x * 60, 0, z * 60), boxTexture);
}
}
}
/// <summary>
/// Draws the 3D specified model.
/// </summary>
/// <param name="model">The 3D model being drawn.</param>
/// <param name="world">Transformation matrix for world coords.</param>
/// <param name="texture">Texture used for the drawn 3D model.</param>
void DrawModel(Model model, Matrix world, Texture2D texture)
{
foreach (ModelMesh mesh in model.Meshes)
{
foreach (BasicEffect be in mesh.Effects)
{
be.Projection = proj;
be.View = view;
be.World = world;
be.Texture = texture;
be.TextureEnabled = true;
}
mesh.Draw();
}
}
2. Set the PreLoop and PostLoop type of each Curve. The PreLoop and PostLoop types determine how the curve will
interpret positions before the first key or after the last key. In this case, the values will be set to CurveLoopType.Oscillate.
Values past the ends of the curve will change direction and head toward the opposite side of the curve.
C#
curveX.PostLoop = CurveLoopType.Oscillate;
curveY.PostLoop = CurveLoopType.Oscillate;
curveZ.PostLoop = CurveLoopType.Oscillate;
curveX.PreLoop = CurveLoopType.Oscillate;
curveY.PreLoop = CurveLoopType.Oscillate;
curveZ.PreLoop = CurveLoopType.Oscillate;
3. Add CurveKeys to the Curves. Specify the time each CurveKey should be reached and the camera position when the
CurveKey is reached. In this case, each point in time will have three CurveKeys associated with it, one for each of the x, y,
and z coordinates of the point on the Curve.
C#
public void AddPoint(Vector3 point, float time)
{
curveX.Keys.Add(new CurveKey(time, point.X));
curveY.Keys.Add(new CurveKey(time, point.Y));
curveZ.Keys.Add(new CurveKey(time, point.Z));
}
void InitCurve()
{
float time = 0;
cameraCurvePosition.AddPoint(new Vector3(7.5f, 0, -45), time);
cameraCurveLookat.AddPoint(new Vector3(9, 0, 9), time);
time += 2000;
cameraCurvePosition.AddPoint(new Vector3(3f, 0, -36), time);
time += 2000;
cameraCurvePosition.AddPoint(new Vector3(12f, 0, -30), time);
time += 2000;
cameraCurvePosition.AddPoint(new Vector3(3f, 0, -24), time);
time += 2000;
cameraCurvePosition.AddPoint(new Vector3(12f, 0, -18), time);
time += 2000;
...
cameraCurvePosition.SetTangents();
cameraCurveLookat.SetTangents();
}
4. Loop through each Curve setting the TangentIn and TangentOut of each CurveKey. The tangents of the CurveKeys control
the shape of the Curve. Setting the tangents of the CurveKeys to the slope between the previous and next CurveKey will
give a curve that moves smoothly through each point on the curve.
C#
public void SetTangents()
{
CurveKey prev;
CurveKey current;
CurveKey next;
int prevIndex;
int nextIndex;
for (int i = 0; i < curveX.Keys.Count; i++)
{
prevIndex = i - 1;
if (prevIndex < 0) prevIndex = i;
nextIndex = i + 1;
if (nextIndex == curveX.Keys.Count) nextIndex = i;
prev = curveX.Keys[prevIndex];
next = curveX.Keys[nextIndex];
current = curveX.Keys[i];
SetCurveKeyTangent(ref prev, ref current, ref next);
curveX.Keys[i] = current;
prev = curveY.Keys[prevIndex];
next = curveY.Keys[nextIndex];
current = curveY.Keys[i];
SetCurveKeyTangent(ref prev, ref current, ref next);
curveY.Keys[i] = current;
prev = curveZ.Keys[prevIndex];
next = curveZ.Keys[nextIndex];
current = curveZ.Keys[i];
SetCurveKeyTangent(ref prev, ref current, ref next);
curveZ.Keys[i] = current;
}
}
static void SetCurveKeyTangent(ref CurveKey prev, ref CurveKey cur, ref CurveKey next)
{
float dt = next.Position - prev.Position;
float dv = next.Value - prev.Value;
if (Math.Abs(dv) < float.Epsilon)
{
cur.TangentIn = 0;
cur.TangentOut = 0;
}
else
{
// The in and out tangents should be equal to the slope between the adjacent k
eys.
cur.TangentIn = dv * (cur.Position - prev.Position) / dt;
cur.TangentOut = dv * (next.Position - cur.Position) / dt;
}
}
5. Add code to evaluate the x, y, and z coordinates of the Curves at any given time by passing the elapsed time to the
Evaluate method of each of the Curves.
C#
public Vector3 GetPointOnCurve(float time)
{
Vector3 point = new Vector3();
point.X = curveX.Evaluate(time);
point.Y = curveY.Evaluate(time);
point.Z = curveZ.Evaluate(time);
return point;
}
6. Create a variable to track the amount of time that has passed since the camera started moving.
C#
double time;
7. In Game.Update, set the camera's position and look-at position based on the elapsed time since the camera started
moving. Set the camera's view and projection matrices as in How To: Rotate and Move a Camera.
C#
// Calculate the camera's current position.
Vector3 cameraPosition = cameraCurvePosition.GetPointOnCurve((float)time);
Vector3 cameraLookat = cameraCurveLookat.GetPointOnCurve((float)time);
8. In Game.Update, increment the time since the camera started moving by gameTime.ElapsedGameTime.TotalMilliseconds.
C#
time += gameTime.ElapsedGameTime.TotalMilliseconds;
return sceneSphere;
}
2. Set the position of the camera to the center of the BoundingSphere that contains the scene.
C#
cameraPosition = sceneSphere.Center;
3. Determine the distance from the center of the BoundingSphere that the camera needs to be to view the entire scene. This
distance is equal to the hypotenuse of the triangle formed by the center of the sphere, the desired camera position, and
the point where the sphere touches the view frustum. One angle of the triangle is known to be the field of view of the
camera divided by two. One leg of the triangle is known to be the radius of the sphere. Given these two measurements,
you can calculate the hypotenuse as the radius of the sphere divided by the sine of half the field of view.
C#
float distanceToCenter = sceneSphere.Radius / (float)Math.Sin(FOV / 2);
4. Get the Backward vector of the view Matrix and flip its X component.
C#
Vector3 back = view.Backward;
back.X = -back.X; //flip x's sign
5. To move the camera backward with respect to its orientation, multiply the desired distance by the adjusted back vector
from the previous step. The camera is now facing the center of the sphere containing the scene and is far enough back
that the sphere fits in the camera's view frustum.
C#
cameraPosition += (back * distanceToCenter);
2. Make a nested loop with the first model's meshes as the outer loop and the second model's meshes as the inner loop.
3. Inside the loop, do these steps.
a. Get the bounding sphere for the current mesh of the first model and the current mesh of the second model.
b. Offset the bounding spheres by the current positions of the models.
c. Check the pairs of bounding spheres for collision by calling the BoundingSphere.Intersects method. If the method
returns true, the objects are colliding.
d. If the models are colliding, break out of the loop.
C#
static void CheckForCollisions(ref WorldObject c1, ref WorldObject c2)
{
for (int i = 0; i < c1.model.Meshes.Count; i++)
{
// Check whether the bounding boxes of the two cubes intersect.
BoundingSphere c1BoundingSphere = c1.model.Meshes[i].BoundingSphere;
c1BoundingSphere.Center += c1.position;
if (c1BoundingSphere.Intersects(c2BoundingSphere))
{
c2.ReverseVelocity();
c1.Backup();
c1.ReverseVelocity();
return;
}
}
}
}
Note
For an example of determining a particle's path after it hits a surface, see Vector3.Reflect.
See Also How To: Rotate and Move a Camera
How To: Render a Model
XNA Game Studio 2.0
3. Using Viewport.Unproject, determine points in world space on the near and far clip plane. For the point on the near
plane, pass a source vector with x and y set to the mouse position and z set to 0. For the point on the far plane, pass a
source vector with x and y set to the mouse position and z set to 1. For both points, pass Unproject the current projection
matrix and view matrix and a translation matrix for the point (0,0,0).
C#
Vector3 nearsource = new Vector3((float)mouseX, (float)mouseY, 0f);
Vector3 farsource = new Vector3((float)mouseX, (float)mouseY, 1f);
4. Create a Ray starting at the near point and pointing toward the far point.
C#
// Create a ray from the near clip plane to the far clip plane.
Vector3 direction = farPoint - nearPoint;
direction.Normalize();
Ray pickRay = new Ray(nearPoint, direction);
5. Loop through the objects in the world using Intersects to check whether the Ray intersects each object. If the Ray does
intersect an object, check whether it is the closest object intersected so far. If it is, store the object and the distance at
which it was intersected, replacing any previously stored object. When the objects have been completely looped through,
the last object stored will be the closest object underneath the area the user clicked.
See Also How To: Rotate and Move a Camera
How To: Render a Model
XNA Game Studio 2.0
Input
The XNA Framework Microsoft.Xna.Framework.Input namespace provides classes and methods for retrieving user input for
keyboard, mouse, and Xbox 360 controller devices.
In This Section
Input Overview
This article is an introduction to handling user input in XNA Game Studio.
How To: Detect Whether a Controller Button Is Pressed
This example demonstrates how to detect whether a user has pressed a digital button on a connected Xbox 360 Controller.
How To: Detect Whether a Controller Button Has Been Pressed This Frame
This example demonstrates how to detect whether a user has just pressed a digital button on a connected Xbox 360
Controller. This example ignores held buttons, only activating when a button has been pressed in the current frame.
How To: Detect Whether a Controller Is Disconnected
This example demonstrates how to detect whether an Xbox 360 Controller connected to the system at game start has
become disconnected.
How To: Get the Current Mouse Position (Windows)
This example demonstrates how to get the current horizontal and vertical position of the mouse cursor relative to the upper-
left corner a game window.
How To: Detect Whether a Key Is Pressed
This example demonstrates how to detect whether a user has pressed or released a key on the keyboard.
XNA Game Studio 2.0
Input Overview
Input is a general term referring to the process of receiving actions from the user. In XNA Game Studio, the
Microsoft.Xna.Framework.Input namespace provides support for three different input devices: the Xbox 360 Controller, the
keyboard, and the mouse. This overview discusses the differences between these input devices and offers guidelines for how to
use them with your game.
Digital vs. Analog
Input devices have two types of controls: digital and analog. Digital controls report only two possible states—on and off—and
are represented by Boolean values. Examples of digital controls are the START button on the Xbox 360 Controller and any
button on a keyboard.
Analog controls report a range of values, rather than just off and on. Examples of analog controls are the Xbox 360 Controller
stick and the movements of the mouse. Analog values can be represented in a variety of ways. In XNA Game Studio, an analog
value on the Xbox 360 Controller is represented as a floating-point value between −1.0 and 1.0 for the sticks, and between 0.0
and 1.0 for the triggers. For the mouse, XNA Game Studio reports mouse cursor values in pixels.
Polling and States
For all input devices in XNA Game Studio, input is received from the user by way of polling: each frame, call a function to
receive the current state of an input device, and compare to previous states if necessary. A state is a snapshot of an input
device's interactions from the user. At any given moment, a control may have a variety of buttons pressed, analog sticks or
triggers held in a direction. The current positions of these buttons and analog controls are reported in a state structure. The
following sections describe the methods for retrieving and using state for each input device.
Input Device Types
Each input device has specific advantages and disadvantages. The following table shows a brief comparison.
Input Device Digital Butt Analog Cont Vibration Eff Supported on Win Supported on Xbo Number Allowed on S
ons rols ects dows x 360 ystem
Xbox 360 Contr 14 4 Yes Yes Yes 4
oller
Keyboard > 100 0 No Yes Yes 1
Mouse 5 3 No Yes No 1
Xbox 360 Controller
The Xbox 360 Controller provides a good combination of digital buttons and analog sticks, so that many types of games can be
played with it.
The controller can be used on either Windows or Xbox 360 systems. Up to four controllers are supported.
How to Use
1. Each frame of your game, call the static GetState method from the GamePad class.
2. Pass in the index of the player you wish to query. The player associated with a controller is visible on the Ring of Light on
the controller.
3. Query the GamePadState structure you get back to retrieve information on the state of the controller. For more
information on retrieving state, including how to determine whether the user has pressed or released a button since the
last frame, see How To: Detect Whether a Controller Button Is Pressed.
You may store a previous controller state if you wish to compare states to determine input changes from one frame to
the next.
Note
Controllers may become disconnected during normal gameplay. For information on how to properly detect and handle this s
ituation, see How To: Detect Whether a Controller Is Disconnected.
Keyboard
The keyboard, with a multitude of digital buttons, is best for complicated simulations with many functions, or when typing text
is necessary—but a keyboard has no analog controls for precise movement.
Not all keyboards support the entire range of buttons listed in Keys; for example, older keyboards may not support the
VolumeDown, VolumeUp, and VolumeMute members.
If the user's keyboard is connected via USB, it can be used on a Windows system, or on an Xbox 360.
How to Use
1. Each frame of your game, call the static GetState method from the Keyboard class.
2. Query the KeyboardState structure you get back to retrieve information on the state of the keyboard.
You may store a previous keyboard state if you wish to compare states to determine input changes from one frame to
the next. See How To: Detect Whether a Key Is Pressed for more information.
Mouse
The mouse, with its precise analog control, is best for selecting objects, such as in a strategy game, or for moving a viewport,
such as in a first-person action game—but a mouse has few digital buttons. Modern mouse devices have three extra buttons in
addition to the standard left and right buttons: two digital buttons, usually on the side of the mouse, and a digital button that is
activated by clicking down on the scroll wheel. The scroll wheel itself functions as an extra analog control in two directions, but
does not provide precise input.
Not all mouse devices support all buttons; for example, older mouse devices may not support the MiddleButton, XButton1 and
XButton2 properties.
You can set the Game.IsMouseVisible Property to true to make the mouse cursor visible; use the default (false) if you are
drawing your own cursor or don't want a cursor.
Mouse devices are used on Windows systems only; they are not supported on Xbox 360.
How to Use
1. Each frame of your game, call the static GetState method from the Mouse class.
2. Query the MouseState structure that is returned to retrieve information on the state of the mouse. Mouse coordinates
are relative to the upper-left corner of the game window.
You may store a previous mouse state if you wish to compare states to determine input changes from one frame to the
next.
For more information on mouse state, including an example, see How To: Get the Current Mouse Position (Windows).
XNA Game Studio 2.0
namespace InputDetectSimple
{
public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
public Game1()
{
graphics = new GraphicsDeviceManager(this);
}
UpdateInput();
base.Update(gameTime);
}
float vibrationAmount = 0.0f;
void UpdateInput()
{
// Get the current gamepad state.
GamePadState currentState = GamePad.GetState(PlayerIndex.One);
// Process input only if connected and button A is pressed.
if (currentState.IsConnected && currentState.Buttons.A == ButtonState.Pressed)
{
// Button A is currently being pressed; add vibration.
vibrationAmount = MathHelper.Clamp(vibrationAmount + 0.03f, 0.0f, 1.0f);
GamePad.SetVibration(PlayerIndex.One, vibrationAmount, vibrationAmount);
}
else
{
// Button A is not being pressed; subtract some vibration.
vibrationAmount = MathHelper.Clamp(vibrationAmount - 0.05f, 0.0f, 1.0f);
GamePad.SetVibration(PlayerIndex.One, vibrationAmount, vibrationAmount);
}
}
See Also How To: Detect Whether a Controller Button Has Been Pressed This Frame
How To: Detect Whether a Controller Is Disconnected
XNA Game Studio 2.0
namespace InputDetect
{
public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
public Game1()
{
graphics = new GraphicsDeviceManager(this);
}
protected override void Initialize()
{
base.Initialize();
previousGamePadState = GamePad.GetState(PlayerIndex.One);
}
base.Update(gameTime);
}
GamePadState previousGamePadState;
float vibrationAmount = 0.0f;
void UpdateInput()
{
// Get the current gamepad state.
GamePadState currentState = GamePad.GetState(PlayerIndex.One);
// Process input only if connected.
if (currentState.IsConnected)
{
// Increase vibration if the player is tapping the A button.
// Subtract vibration otherwise, even if the player holds down A.
if (currentState.Buttons.A == ButtonState.Pressed &&
previousGamePadState.Buttons.A == ButtonState.Released)
{
// Button A has just been pressed; add vibration.
vibrationAmount = MathHelper.Clamp(vibrationAmount + 0.3f, 0.0f, 1.0f);
GamePad.SetVibration(PlayerIndex.One, vibrationAmount, vibrationAmount)
;
}
else
{
// Subtract some vibration.
vibrationAmount = MathHelper.Clamp(vibrationAmount - 0.04f, 0.0f, 1.0f)
;
GamePad.SetVibration(PlayerIndex.One, vibrationAmount, vibrationAmount)
;
}
// Update previous gamepad state.
previousGamePadState = currentState;
}
}
namespace InputDisconnect
{
public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
// Game states.
enum GameState
{
InputSetup = 0,
Game,
Disconnected
}
public Game1()
{
graphics = new GraphicsDeviceManager(this);
}
UpdateInput();
switch (gameState)
{
case GameState.InputSetup:
// Allow players to join the game, and determine active controllers.
// In this example, there is only one player.
activeControllers[0] = true;
case GameState.Disconnected:
// If reconnected, continue to the game.
if (!disconnectDetected)
{
backColor = Color.CornflowerBlue;
gameState = GameState.Game;
}
// Otherwise, pause the game and display a message.
break;
}
base.Update(gameTime);
}
void UpdateInput()
{
disconnectDetected = false;
PlayerIndex index = PlayerIndex.One;
for (int i = 0; i < 4; i++, index++)
{
if (activeControllers[i] && !GamePad.GetState(index).IsConnected)
{
disconnectDetected = true;
}
}
}
The example queries the Mouse class to return a MouseState object that holds the button states and the current position of the
mouse relative to the upper-left corner of the game window.
To retrieve the current mouse position
1. Call GetState to get the current state of the mouse in a MouseState object.
2. Access the X and Y properties of the MouseState retrieved in the previous section to get the X (horizontal) and Y (vertical)
mouse position, in pixels, relative to the upper-left corner of the game window.
C#
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;
namespace MousePosition
{
public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
Color backColor = Color.CornflowerBlue;
public Game1()
{
graphics = new GraphicsDeviceManager(this);
}
See Also
XNA Game Studio 2.0
namespace Keypress
{
public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
KeyboardState oldState;
Color backColor = Color.CornflowerBlue;
public Game1()
{
graphics = new GraphicsDeviceManager(this);
}
Audio
The XNA Framework Microsoft.Xna.Framework.Audio namespace provides classes and methods for playing audio files.
In This Section
Audio Overview
The XNA Framework provides audio playback through the Microsoft Cross-Platform Audio Creation Tool (XACT) and its
associated audio engine.
How To: Add a Sound File to Your Game Using XACT
This example demonstrates how to add wave (.WAV) files into an XACT project that can be built and interpreted by an XNA
Game Studio game to play audio.
How To: Play a Sound
This example demonstrates how to initialize the audio engine, load sound and wave banks, and play a sound via a Cue object.
How To: Stop or Pause a Sound
This example demonstrates how to initialize the audio engine, load a sound bank and wave bank, and play, pause, resume, or
stop a sound (called a cue). This example builds off a simpler example, How To: Play a Sound.
How To: Change Sound Volume Levels
This example demonstrates how to initialize the audio engine and change the playback volume of a group of sounds using
categories.
How To: Apply Basic 3D Positional Effects to a Cue
This example demonstrates how to apply 3D positioning effects to cues.
How To: Apply Attenuation and Doppler 3D Audio Effects
This example demonstrates how to use the Microsoft Cross-Platform Audio Creation Tool (XACT) to apply attenuation and
Doppler 3D positioning effects to sounds.
XNA Game Studio 2.0
Audio Overview
The XNA Framework provides audio playback through the Microsoft Cross-Platform Audio Creation Tool (XACT) and its
associated audio engine.
Introducing XACT
The Microsoft Cross-Platform Audio Tool, or XACT, is at the heart of the XNA Framework Audio API. XACT is a combination of a
powerful graphical tool for authoring audio content, and an API that is responsible for interpreting the authored XACT files and
playing audio in response to game events.
Getting Started Quickly
Not all features of XACT are necessary for a game title that uses simple audio playback. However, the XNA Framework
interprets audio only from XACT files, so even games with simple audio must use XACT. To learn how to create a simple XACT
project that contains only a few wave files, see How To: Add a Sound File to Your Game Using XACT. Then, to learn how to load
and play cues from the XACT project you have built, see How To: Play a Sound.
What XACT Does
As a GUI-driven audio content creation system, XACT enables audio designers to load wave files into groups, organize the files
into discrete "cues" that can be activated by in-game events, and create transitions between cues. XACT also enables designers
to define variables that can be changed in-game to modify audio settings. With these advanced tools, an audio designer might,
for example, design a set of car engine sounds for a racing game, and through the use of a variable, cause the car engine
sounds to increase or decrease in pitch and volume as the variable is controlled in-game by the XACT engine.
To get started using XACT, click the Start menu, and then click All Programs. Click the XNA Game Studio folder, then Tools,
and then click Microsoft Cross-Platform Audio Creation Tool (XACT).
For detailed information about how to author audio in the XACT tool, including information on categories, variables, and other
advanced features, see XACT Audio Authoring.
Programming for XACT
Once you have created an XACT project and saved it to a file as an .xap file, add the .xap file and any wave files the XACT project
uses as input to your XNA Game Studio game, and the Content Pipeline will build the needed files for you to access your
content at run time.
An XACT project builds a set of files: a global settings file (.xgs), one or more wave banks (.xwb), and one or more sound banks
(.xsb). These files may be provided to AudioEngine, WaveBank, and SoundBank constructors, respectively.
To initialize the XACT engine, you must create a new AudioEngine and provide the path to the global settings file. Then, load
any wave banks you need by creating new WaveBank objects, and load any sound banks that you need by creating SoundBank
objects. Once you have loaded the necessary files, you can access cues that the audio designer has created by calling GetCue
on the SoundBank that contains the Cue that you want to retrieve. Each Cue instance that you retrieve is unique, even when
retrieving multiple cues with the same name. This allows multiple instances of the same Cue to exist and play simultaneously.
You can play, pause, resume, and stop Cue objects by using, respectively, the Play, Pause, Resume, and Stop methods. See
How To: Play a Sound for information about how to play a cue, and How To: Stop or Pause a Sound for more information
about how to pause, resume, and stop cues.
Periodically, you must call Update to allow the audio engine to process audio data.
For more advanced projects, you can also access AudioCategory objects for controlling the playback of sound categories by
calling AudioEngine.GetCategory. Also, to access variables that the audio designer has tied to playback changes in volume,
pitch, or DSP effects, you can call AudioEngine.GetGlobalVariable. For more information about how to use categories to change
sound volume levels, see How To: Change Sound Volume Levels.
XNA Game Studio 2.0
3. In the empty project, you must first create a wave bank. To do this, click Wave Banks, and then click New Wave Bank. A
new wave bank appears in the tree view under Wave Banks with the default name "Wave Bank." Press ENTER to accept
the default name.
4. Create a new sound bank. To do this, click Sound Banks, and then click New Sound Bank. A new sound bank appears in
the tree view under Sound Banks with the default name "Sound Bank." Press ENTER to accept the default name.
5. At this point, two new windows have appeared: one for the wave bank and one for the sound bank. To arrange these
windows for easier viewing, click Window, and then click Tile Horizontally. The windows should now look similar to
the following:
6. Add your wave files to the wave bank window. Make sure the wave bank window is active by clicking on it, and then click
Wave Banks and click Insert Wave File(s). Insert one or more wave files into the wave bank. If you successfully added
them, they appear in the wave bank window, which will look similar to the following:
7. For each wave listed in the wave bank window, drag the wave from the wave bank window to the sound bank window,
and drop it on top of the Cue Name panel. XACT automatically creates a new cue that is linked to a new sound that plays
this wave file. It should look similar to the following:
8. If the lower-left corner of the sound bank window does not have any entries, you must add entries to it by dragging each
sound from the upper-left panel of the sound bank to the lower left panel of the sound bank. This action creates cues that
correspond to the sounds.
9. Save the project. Click File, and then click Save Project.
You are now ready to load and play sounds from this project in your game. See How To: Play a Sound for information on how
to do this.
See Also
Tasks
How To: Play a Sound
XNA Game Studio 2.0
public Game1()
{
graphics = new GraphicsDeviceManager(this);
}
Remarks
Each Cue instance that you play is unique, even when playing multiple cues with the same name. This allows multiple instances
of the same Cue to be played simultaneously.
See Also
Tasks
How To: Add a Sound File to Your Game Using XACT
XNA Game Studio 2.0
// Audio objects
AudioEngine engine;
SoundBank soundBank;
WaveBank waveBank;
Cue cue;
GamePadState oldState;
public Game1()
{
graphics = new GraphicsDeviceManager(this);
}
if (currentState.DPad == oldState.DPad)
{
return;
}
// DPad right is 'play/pause'.
if (currentState.DPad.Right == ButtonState.Pressed)
{
if (cue.IsPaused)
{
cue.Resume();
}
else if (cue.IsPlaying)
{
cue.Pause();
}
else
{
// If stopped, create a new cue.
cue = soundBank.GetCue(cue.Name);
cue.Play();
}
}
// Check input.
UpdateInput();
namespace ChangeSoundVolume
{
public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
// Audio objects
AudioEngine engine;
SoundBank soundBank;
WaveBank waveBank;
AudioCategory musicCategory;
// Music volume.
float musicVolume = 1.0f;
public Game1()
{
graphics = new GraphicsDeviceManager(this);
}
protected override void Initialize()
{
base.Initialize();
// Initialize audio objects.
engine = new AudioEngine("Content\\Audio\\ChangeSoundVolume.xgs");
soundBank = new SoundBank(engine, "Content\\Audio\\Sound Bank.xsb");
waveBank = new WaveBank(engine, "Content\\Audio\\Wave Bank.xwb");
// Get the category.
musicCategory = engine.GetCategory("Music");
// Play the sound.
soundBank.PlayCue("music");
}
if (currentState.DPad.Up == ButtonState.Pressed)
{
musicVolume = MathHelper.Clamp(musicVolume + 0.01f, 0.0f, 2.0f);
}
if (currentState.DPad.Down == ButtonState.Pressed)
{
musicVolume = MathHelper.Clamp(musicVolume - 0.01f, 0.0f, 2.0f);
}
// Check input.
UpdateInput();
// Update the audio engine.
engine.Update();
base.Update(gameTime);
}
The following example uses a circular rotation around a stationary AudioListener to emphasize the 3D effect.
The Complete Sample
The code in this tutorial illustrates the technique described in the text. A complete code sample for this tutorial is available for
you to download, including full source code and any additional supporting files required by the sample.
Download Basic3DAudio_Sample.zip.
C#
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;
namespace Basic3DAudio
{
public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
// Audio objects
AudioEngine engine;
SoundBank soundBank;
WaveBank waveBank;
public Game1()
{
graphics = new GraphicsDeviceManager(this);
}
// 3D audio objects
AudioEmitter emitter = new AudioEmitter();
AudioListener listener = new AudioListener();
Cue cue;
protected override void Initialize()
{
base.Initialize();
// Initialize audio objects
engine = new AudioEngine("Content\\Audio\\3DAudio.xgs");
soundBank = new SoundBank(engine, "Content\\Audio\\Sound Bank.xsb");
waveBank = new WaveBank(engine, "Content\\Audio\\Wave Bank.xwb");
base.Update(gameTime);
}
protected override void Draw(GameTime gameTime)
{
graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
base.Draw(gameTime);
}
}
}
XNA Game Studio 2.0
namespace Advanced3DAudio
{
public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
// Audio objects
AudioEngine engine;
SoundBank soundBank;
WaveBank waveBank;
// 3D audio objects
AudioEmitter emitter = new AudioEmitter();
AudioListener listener = new AudioListener();
Cue cue;
public Game1()
{
graphics = new GraphicsDeviceManager(this);
}
protected override void Initialize()
{
base.Initialize();
base.Update(gameTime);
}
See Also
Concepts
Audio Overview
How To: Apply Basic 3D Positional Effects to a Cue
Tutorial 3: Making Sounds with XNA Game Studio and XACT
XACT Runtime Parameter Controls [DirectX]
XACT Audio Authoring [DirectX]
Reference
Cue.Apply3D Method
AudioEmitter.Position Property
AudioListener.Position Property
AudioEmitter.Velocity Property
AudioListener.Velocity Property
AudioEmitter.DopplerScale Property
XNA Game Studio 2.0
Storage
The Microsoft.Xna.Framework.Storage namespace provides classes that allow reading and writing of files.
In This Section
Storage Overview
The XNA Framework provides a set of classes in the Microsoft.Xna.Framework.Storage namespace that are used to read and
write files from user storage and title storage, including player saves or title data.
How To: Create a File
This example demonstrates how to use the StorageContainer class to create a save game file in the title storage area on a
device specified by the gamer. This example assumes you have already obtained a StorageDevice. To obtain a StorageDevice,
see How To: Get a StorageDevice Asynchronously.
How To: Open a File
This example demonstrates how to use the StorageContainer class to open a save game file in the title storage area on a
device specified by the gamer.
How To: Copy a File
This example demonstrates how to use the StorageContainer class to copy a save game file in the title storage area on a
device specified by the gamer. This example assumes you have already obtained a StorageDevice - to obtain a
StorageDevice, see How To: Get a StorageDevice Asynchronously.
How To: Rename a File
This example demonstrates how to use the StorageContainer class to rename a save game file in the title storage area on a
device specified by the gamer. This example assumes you have already obtained a StorageDevice. To obtain a StorageDevice,
see How To: Get a StorageDevice Asynchronously.
How To: Enumerate Files
This example demonstrates how to use the StorageContainer class to get a list of save game files in the title storage area on
a device specified by the gamer. This example assumes you have already obtained a StorageDevice. To obtain a
StorageDevice, see How To: Get a StorageDevice Asynchronously.
How To: Delete a File
This example demonstrates how to use the StorageContainer class to delete a save game file in the title storage area on a
device specified by the gamer. This example assumes you have already obtained a StorageDevice. To obtain a StorageDevice,
see How To: Get a StorageDevice Asynchronously.
How To: Load a Game Data File
This example demonstrates how to use the File class to read a file from the game image directory.
How To: Serialize Data
This example demonstrates how to use the XmlSerializer class to write data in a custom class to a saved game, and how to
load the data from the file.
How To: Get a StorageDevice Asynchronously
This example demonstrates how to call BeginShowStorageDeviceSelector and EndShowStorageDeviceSelector to get a
StorageDevice object asynchronously.
XNA Game Studio 2.0
Storage Overview
The XNA Framework provides a set of classes in the Microsoft.Xna.Framework.Storage namespace that are used to read and
write files from user storage and title storage, including player saves or title data.
Storage Devices
Storage Locations
Storage Devices
When programming with the XNA Framework, you read files from two general locations:
Title storage, where the game executable and support files (shaders, meshes, textures, and so on) are located.
User storage, the space a player provides for game data (such as saves) that is either locked to a particular profile or
available to all players.
To access title storage, the XNA Framework provides the StorageContainer class, whose TitleLocation property contains a path
to the location of the title itself. Title support files can be loaded based on this location.
To access user storage, the XNA Framework provides the Guide class, which contains the BeginShowStorageDeviceSelector
method. This method brings up a dialog box on Xbox 360 where the user selects a storage device (memory unit or hard drive).
This method works asynchronously, notifying the caller with an IAsyncResult or a callback method when the user has chosen a
device. For more information, see How To: Get a StorageDevice Asynchronously.
The StorageContainer instance provided by OpenContainer provides access to the selected device. Use System.IO objects,
such as the File object, to open, copy, rename, or delete files, using StorageContainer.Path to determine the location of the files
on the device.
Changes to the files within a StorageContainer on Xbox 360 do not take effect until the StorageContainer is disposed. For this
reason, only one StorageContainer can be open on the same device for the same profile. Before opening a StorageContainer
on a device, make sure that all previous StorageContainer objects opened for that profile have been disposed. To dispose a
StorageContainer, call Dispose.
Storage Locations
Currently, the title location on a PC is the folder where the executable resides when it is run. Use the TitleLocation property to
access the path.
User storage is in the My Documents folder of the user who is currently logged in, in the SavedGames folder. A subfolder is
created for each game according to the titleName passed to the OpenContainer method. When no PlayerIndex is specified,
content is saved in the AllPlayers folder. When a PlayerIndex is specified, the content is saved in the Player1, Player2,
Player3, or Player4 folder, depending on which PlayerIndex was passed to BeginShowStorageDeviceSelector.
See Also
Tasks
How To: Create a File
How To: Open a File
How To: Copy a File
How To: Rename a File
How To: Enumerate Files
How To: Delete a File
How To: Load a Game Data File
How To: Serialize Data
How To: Get a StorageDevice Asynchronously
Reference
StorageDevice
BeginShowStorageDeviceSelector
StorageContainer
TitleLocation
Path
XNA Game Studio 2.0
See Also
Concepts
Storage Overview
Reference
StorageDevice
BeginShowStorageDeviceSelector
StorageContainer
Path
XNA Game Studio 2.0
See Also
Concepts
Storage Overview
Reference
StorageDevice
BeginShowStorageDeviceSelector
StorageContainer
Path
XNA Game Studio 2.0
See Also
Concepts
Storage Overview
Reference
StorageDevice
BeginShowStorageDeviceSelector
StorageContainer
Path
XNA Game Studio 2.0
if (!File.Exists(newfilename))
File.Move(oldfilename, newfilename);
See Also
Concepts
Storage Overview
Reference
StorageDevice
BeginShowStorageDeviceSelector
StorageContainer
Path
XNA Game Studio 2.0
See Also
Concepts
Storage Overview
Reference
StorageDevice
BeginShowStorageDeviceSelector
StorageContainer
Path
XNA Game Studio 2.0
See Also
Concepts
Storage Overview
Reference
StorageDevice
BeginShowStorageDeviceSelector
StorageContainer
Path
XNA Game Studio 2.0
See Also
Concepts
Storage Overview
Reference
StorageContainer
TitleLocation
XNA Game Studio 2.0
this.Components.Add(new GamerServicesComponent(this));
}
IAsyncResult result;
Object stateobj;
bool GameSaveRequested = false;
GamePadState currentState;
See Also
Concepts
Storage Overview
Xbox 360 Programming Considerations
Reference
StorageDevice
Guide.BeginShowStorageDeviceSelector
Guide.EndShowStorageDeviceSelector
AsyncCallback
IAsyncResult
XNA Game Studio 2.0
Networking
Overviews
Getting Started With Networked Games
Introduces the key prerequisites for creating a networked XNA Framework game.
Gamer Services Overview
Describes the functionality provided by the XNA Framework GamerServices namespace, which includes the capability to
query for LIVE accounts, retrieve player preferences for local accounts, and show various LIVE Guide user interface screens
programmatically.
Network Session Management
Defines the network session management capabilities in the XNA Framework, which allow for matchmaking access to profile
data on all the gamers in a potential game.
Reliable Packet Delivery
Provides an overview of the reliable UDP protocol supported by the XNA framework and the packet delivery options that
may be chosen.
Network Topologies And Host Migration
Discusses the relationship between session hosts and peers and the actual network topology used to route gameplay.
Latency Simulation and Bandwidth Usage
Describes the packet loss simulation capabilities available to XNA Framework games.
Voice Support
Introduces the voice support options available in the XNA Framework.
Networking How-Tos
How To: Create a Network Session
Describes the process of creating a new network session.
How To: Find and Join a Network Session
Find and join a network session using the steps outlined in this article.
How To: Manage Players Joining and Leaving the Game
Manage the data associated with a player by subscribing to events which occur when players are joining or leaving a game.
How To: Manage Player Movement Between Lobby and Gameplay Modes
Describes the properties and events associated with a multiplayer session that allow a game to move between lobby and
game play modes and identify which mode the game is currently in.
How To: Join an In-Progress Game
Describes enabling the AllowJoinInProgress property to make an in-progress game available to peers searching for available
sessions.
How To: Use Gamertags and Gamer Pictures
Demonstrates how to retrieve gamertags and pictures using a technique that can be applied to retrieve other gamer profile
information.
How To: Send Data
Describes the options available for sending data to all clients or to a specific player.
How To: Receive Data
Describes how the local players on a gaming machine receive data from the other players in a networked game.
How To: Initialize and Update the Gamer Services Pump
Describes how an application would use the GamerServicesDispatcher instead of the GamerServicesComponent for cases in
which a program may not be using the XNA Framework application model or component infrastructure.
See Also
Reference
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
For more information on the gamer services system, please see Gamer Services Overview .
XNA Creators Club and LIVE Membership Requirements
Developing and testing a networked game requires at least two machines, but you only need only one Xbox 360 console and
one Creators Club membership to test your network code for the Xbox 360. This is because XNA Framework supports cross-
platform system links so developers can run one instance of a game on an Xbox 360 and a second on a Windows-based
computer. This functionality is enabled to help creators debug their titles.
It is also possible for more than one Windows-based computer to connect several machines in a system link session without
any special memberships.
This table lists what memberships are required on the development computer and Xbox 360 console in a network session
depending on the session type that has been created.
Xbox 360 Console Windows-Based Computer
Run an XNA Framework Game LIVE Silver membership + Creators Cl No memberships Required
ub membership
Use System Link LIVE Silver membership + Creators Cl No memberships Required
ub membership
Sign-on to Xbox Live and Games for Windo LIVE Silver membership + Creators Cl LIVE Silver membership + Creators Cl
ws - LIVE Servers ub membership ub membership
Use LIVE Matchmaking LIVE Gold membership + Creators Clu LIVE Gold membership + Creators Clu
b membership b membership
Caution
The XNA framework components that interact with Games for Windows LIVE require an XNA Creators Club membership. If, f
or any reason, a LIVE profile without a Creators Club membership is set to auto sign-in on a Windows-based computer, the g
ame will not be able to connect to the LIVE service and the XNA framework gamer services components, including the Guide,
will not be available. To disable auto sign-in for a LIVE profile on a Windows-based computer, launch an XNA framework ga
me and open the Guide while disconnected from the network.
Hardware Requirements
It is not possible to run multiple simultaneous instances of a networked game on a single development computer.
When launching to multiple machines for network testing, we recommend that you load multiple copies of your solution into
separate Visual Studio instances, one per machine.
For a system link game, any one of the following hardware configurations may be used to test a networked game:
One development computer and one Xbox 360 console (running one instance of the game on a Windows-based
computer and one on Xbox 360). The creator will require one LIVE Silver and one Creators Club membership to run code
on the Xbox 360.
One development computer and one client computer (running one instance of the game on each Windows-based
computer). Creators cannot run two networked XNA Framework games at the same time on the same computer, so
creators will need a second machine to run a second game instance for testing purposes. No LIVE memberships or
Creators Club memberships are required for this scenario.
One development computer and two Xbox 360 consoles (running one instance of the game on each Xbox 360). Here a
creator deploys and debugs the game on two Xbox 360s. The creator will need at least two LIVE Silver memberships and
two Creators Club memberships (one pair for each Xbox 360) for this scenario.
If a game creator wants to use true LIVE matchmaking as opposed to system link over a local subnet, any one of the following
hardware configurations may be used:
One development computer and one Xbox 360 console (running one instance of the game on the development
computer and one on the Xbox 360). The creator will need two LIVE Gold memberships and two Creators Club
memberships (one pair for each machine) for this scenario.
One development computer and one client computer (running one instance of the game on each computer). The creator
will requre two LIVE Gold memberships and two Creators Club memberships (one pair for each machine).
One development computer and two Xbox 360 consoles (running one instance of the game on each Xbox 360 console).
The creator will require two LIVE Gold memberships and two Creators Club memberships (one set for each machine).
XNA Game Studio 2.0
Initializing the gamer services system is a potentially slow operation and has user-visible consequences. For example, the game
may display the "Play Signed-in" notification when the gamer services system is initialized if a local profile is set to
automatically sign in, and as a result might trigger a system update. Because of this, if a game is going to use these services it
is desirable to initialize everything in the game startup code in the constructor.
Programs which do not use the XNA Framework application model or component infrastructure can use
GamerServicesDispatcher. In this case, you must also call the GamerServicesDispatcher.Initialize and
GamerServicesDispatcher.Update methods directly. Under these conditions, the GamerServicesDispatcher should be initialized
once on startup, and GamerServicesDispatcher.Update should be called every frame.
The GamerServicesDispatcher.Update method allows for the XNA Framework to raise events for notifications such as sign-in
status changes and game invites when it is safe to raise the events.
Player Sign-In
For standard game clients with a user interface, the Guide automatically displays the appropriate user interface when a player
presses either the HOME key on the keyboard or the Guide button on the Xbox 360 controlller, allowing players to sign in.
Before a player signs in, you can also choose to manually display the sign-in user interface using the Guide.ShowSignIn
function.
When a SignedInGamer signs in, the SignedInGamer.SignedIn event is fired. You can get the list of signed-in players at any
time using the static property Gamer.SignedInGamers.
Player Profile Information
The player profile information that is accessible using the Gamer.GetProfile method returns information such as the gamer
picture, motto, and gamerzone. Specifically, the gamer profile provides the following information about a gamer:
Gamerscore
Gamerzone
Gamer picture
Region
Motto
Reputation
Number of achievements
Number of titles played
Using SignedInGamer.GameDefaults you may retrieve a local gamer's preferred settings, such as:
Controller sensitivity
Game difficulty
Primary and secondary colors
Action movement preferences such as auto-aim, auto-center, and y-axis inversion
Preferred racing camera angle, accelerator, brake, and transmission.
Using SignedInGamer.Privileges you can see if the player is allowed to:
Communicate using voice, text, or messaging.
Join online multiplayer sessions.
View profiles.
You can also view whether a gamer is LIVE-enabled or a guest.
Privileges will be enforced by the framework, so a player will never be allowed to create an online session if the player's
multiplayer privilege is not enabled. Programmatic access to these settings is provided so that games may check if something
is going to be forbidden, in which case the relevant menu options would be grayed out rather than allowing the user to select a
forbidden option and receive an exception or error when attempting to call the method in question.
Guide User Interface
The XNA Framework exposes a property, IsVisible for querying whether the Guide user interface is active. The Guide runs
independently alongside games. It can be displayed by the player at any time using the HOME key on the keyboard or the
Guide button on the controller.
Many of the Guide calls are blocking. The XNA Framework exposes asynchronous versions of all the Guide methods using the
standard .NET async pattern. Blocking versions of the Guide methods automatically pump the graphics device while the UI is
active, calling Present at regular intervals with an empty (black) backbuffer. Games should use the asynchronous versions of
the methods if they wish to continue rendering behind the Guide. The existing storage device UI has been changed to match
the new design.
XNA Game Studio 2.0
Session Management
One important task in writing a networked game is managing the session, or instance, of the game. The events on the
NetworkSession object allow you to be aware of when:
when a player connects or disconnects using GamerJoined and GamerLeft.
when the game has changed state between lobby, gameplay, and post-gameplay modes using GameStarted,
GameEnded, and SessionEnded
when the network machine hosting the session changes using HostChanged
Lobby Transitions
The XNA Framework keeps track of whether the session is in the lobby or actually playing the game and provides events to
notify titles when the state changes. While in the lobby, each player can use IsReady to signal that they are ready to move from
the lobby and into the game. The host will can check IsEveryoneReady to determine whether all the players are ready to begin
the game.
Each network session can use AllowJoinInProgress to specify whether the game supports join-in-progress. This is used in
conjunction with the lobby versus play state to automatically update the session joinability status on the matchmaking servers.
See Also
Tasks
How To: Create a Network Session
How To: Manage Players Joining and Leaving the Game
How To: Manage Player Movement Between Lobby and Gameplay Modes
XNA Game Studio 2.0
Voice Support
Voice data is automatically transmitted and replayed without any title effort whatsoever. The
GamerPrivileges.AllowCommunication property allows you to see which players are allows to send voice data. The
LocalNetworkGamer.EnableSendVoice method allows a game to programmatically specify which players can talk. Titles can
use this to implement team chat or proximity voice. The XNA Framework does not expose direct program access to the voice
data stream.
There are three boolean properties exposed to query the voice status of another player:
Do they have voice access? NetworkGamer.HasVoice
Are they currently talking? NetworkGamer.IsTalking
Are they muted? NetworkGamer.IsMutedByLocalUser
These properties allow games to display voice related information in the user interface, for instance flashing the name of the
player who is currently talking.
XNA Game Studio 2.0
1. The NetworkSessionProperties supports up to eight integer values that describe the session. Because these values are
integers, in this example we will create a set of enums to describe these integer values and their placement in the
NetworkSessionProperties.
C#
enum SessionProperty{ GameMode, SkillLevel, ScoreToWin }
2. Create a new NetworkSessionProperties, and set the values to the custom session properties.
C#
NetworkSessionProperties sessionProperties = new NetworkSessionProperties();
sessionProperties[(int)SessionProperty.GameMode]
= (int)GameMode.Practice; // Game mode
sessionProperties[(int)SessionProperty.SkillLevel]
= (int)SkillLevel.Beginner; // Score to win
sessionProperties[(int)SessionProperty.ScoreToWin]
= 100;
session.Dispose();
session = null;
}
The end of a game is controlled by the NetworkSession.EndGame method. At the end of a game, you might choose to move
back to the lobby or to end the session. Players in the game can subscribe to the NetworkSession.GameEnded and
NetworkSession.SessionEnded events.
See Also
Concepts
Network Session Management
Tasks
How To: Find and Join a Network Session
XNA Game Studio 2.0
2. Create a NetworkSessionProperties collection and set the values to the desired search parameters.
C#
NetworkSessionProperties searchProperties = new NetworkSessionProperties();
searchProperties[(int)SessionProperty.GameMode] = (int)GameMode.Practice;
searchProperties[(int)SessionProperty.SkillLevel] = (int)SkillLevel.Beginner;
2. Use NetworkSession.Find to retrieve the list of available sessions, specifying the type of session you are interested in, the
number of local players that wish to join, and any session properties that should be matched when searching. Note that
the searchProperties argument is optional, and you may pass in null to match any available session regardless of the
session properties settings for that session.
C#
int maximumLocalPlayers = 1;
availableSessions = NetworkSession.Find(
NetworkSessionType.SystemLink, maximumLocalPlayers, searchProperties);
Note
This search may also be performed asynchronously using NetworkSession.BeginFind and NetworkSession.EndFind.
3. After joining a NetworkSession, subscribe to any session events that the peer might be interested in.
C#
session.GamerJoined += new EventHandler<GamerJoinedEventArgs>(session_GamerJoined);
session.GamerLeft += new EventHandler<GamerLeftEventArgs>(session_GamerLeft);
session.GameStarted += new EventHandler<GameStartedEventArgs>(session_GameStarted);
session.GameEnded += new EventHandler<GameEndedEventArgs>(session_GameEnded);
session.SessionEnded += new EventHandler<NetworkSessionEndedEventArgs>(session_Session
Ended);
See Also
Concepts
Network Session Management
Tasks
How To: Create a Network Session
XNA Game Studio 2.0
2. Create the GamerJoined event handler. Note that the GamerJoinedEventArgs object contains a Gamer property which
can be used to read information about a specific player, or to associate information with a specific player. Here, the
Gamer.Tag property is used to associate player data with the player.
C#
void session_GamerJoined(object sender, GamerJoinedEventArgs e)
{
// Associate a tank object with this gamer.
e.Gamer.Tag = new Tank(Content, graphics.GraphicsDevice.PresentationParameters);
}
tank.LeaveGame();
}
Note
If the host player leaves the session calling Game.Exit, this forces a host re-election and the host is automatically migrated to
another player. If you are using a network topology other than peer-to-peer, such as a client-server or hybrid topology, and y
our host is also a server in the game, it will be necessary to migrate game state to the new game server when the host is mig
rated. Players in the game can respond to host migration using the HostChanged event.
See Also
Concepts
Network Session Management
Tasks
How To: Create a Network Session
How To: Find and Join a Network Session
XNA Game Studio 2.0
2. Use NetworkGamer.IsReady to signal that a player is ready to move from the lobby to the game.
C#
// Signal I'm ready to play!
if (IsButtonPressed(GamePadButton.A))
{
foreach (LocalNetworkGamer gamer in session.LocalGamers)
gamer.IsReady = true;
}
3. On the host gaming machine, check NetworkSession.IsEveryoneReady to see if all players are ready. If this is true, call
NetworkSession.StartGame to change the game state from the lobby to gameplay mode.
C#
// The host checks if everyone is ready, and moves to game play if true.
if (session.IsHost)
{
if (session.IsEveryoneReady)
session.StartGame();
}
4. In the NetworkSession.GameStarted event handler, make preparations for the game to begin. In this example, the game
object states are reset for the new game.
C#
void session_GameStarted(object sender, GameStartedEventArgs e)
{
//// Reset everything when we are starting a new game.
NetworkSession session = (NetworkSession)sender;
tank.Reset(i);
}
}
5. In the NetworkSession.GameEnded event handler, make preparations to return the players to the lobby, such as
recording the high score.
C#
void session_GameEnded(object sender, GameEndedEventArgs e)
{
ReturnToLobby();
}
6. In the NetworkSession.SessionEnded event handler, return to the game Title screen. Note that before the session ends,
the session can move between lobby and gameplay states as many times as the player wishes. To retrieve the session
state at any time, you can check the NetworkSession.SessionState property.
C#
void session_SessionEnded(object sender, NetworkSessionEndedEventArgs e)
{
ReturnToTitleScreen();
}
See Also
Concepts
Network Session Management
Tasks
How To: Create a Network Session
How To: Find and Join a Network Session
How To: Manage Players Joining and Leaving the Game
XNA Game Studio 2.0
session.AllowJoinInProgress = true;
2. In the NetworkSession.GamerJoined event handler, the gamer may be a gamer that has joined an in-progress game.
Associate any data necessary to allow for a gamer to join while the game is in-progress.
C#
void session_GamerJoined(object sender, GamerJoinedEventArgs e)
{
// Associate a tank object with this gamer.
e.Gamer.Tag = new Tank(Content, graphics.GraphicsDevice.PresentationParameters);
}
Note
Network sessions of type NetworkSessionType.Ranked cannot be made join-in-progress, due to the competive nature of ran
ked sessions.
See Also
Concepts
Network Session Management
Tasks
How To: Manage Players Joining and Leaving the Game
How To: Find and Join a Network Session
XNA Game Studio 2.0
2. Each LocalNetworkGamer playing on the same game machine might send data, so here we loop through the
LocalGamers collection. To send a packet, call the various overloads of the PacketWriter.Write method to store data into
the writer, and then pass the PacketWriter to SendData. Note that it is also possible to send data to a specific player by
specifying the player in the call to SendData.
Sending the packet will automatically clear the PacketWriter, so it can then be reused to write different data for another
packet. Although it is not used in this example, the PacketWriter supports offsets through the Position property.
In the call to SendData, be careful to specify a SendDataOptions value for options that is appropriate for the type of data
being sent. Not all game data needs to be sent reliably, and sending excessive data using
SendDataOptions.ReliableInOrder can cause the client to lag as it waits for data to be delivered in order.
C#
foreach (LocalNetworkGamer gamer in session.LocalGamers)
{
// Get the tank associated with this player.
Tank myTank = gamer.Tag as Tank;
// Write the data.
packetWriter.Write(myTank.Position);
packetWriter.Write(myTank.TankRotation);
packetWriter.Write(myTank.TurretRotation);
packetWriter.Write(myTank.IsFiring);
packetWriter.Write(myTank.Health);
// Send it to everyone.
gamer.SendData(packetWriter, SendDataOptions.None);
}
XNA Game Studio 2.0
2. Each LocalNetworkGamer playing on the same game machine might receive data, so here we loop through the
LocalGamers collection. To read a packet, pass the PacketReader to ReceiveData, then use the various PacketReader.Read
methods to extract data from the reader.
C#
foreach (LocalNetworkGamer gamer in session.LocalGamers)
{
// Keep reading while packets are available.
while (gamer.IsDataAvailable)
{
NetworkGamer sender;
if (!sender.IsLocal)
{
// Get the tank associated with this packet.
Tank remoteTank = sender.Tag as Tank;
However, in some cases a program might not use the XNA Framework application model or component infrastructure. For this
application, it is possible to call the GamerServicesDispatcher directly.
To Initialize and Update the Gamer Services System
1. Once, in the startup code for the application, call GamerServicesDispatcher.Initialize to initialize the gamer services
subsystem.
C#
protected override void Initialize()
{
GamerServicesDispatcher.WindowHandle = Window.Handle;
GamerServicesDispatcher.Initialize(Services);
base.Initialize();
}
2. Call GamerServicesDispatcher.Update once every frame to pump the gamer services system.
C#
protected override void Update(GameTime gameTime)
{
GamerServicesDispatcher.Update();
base.Update(gameTime);
}
See Also
Concepts
Gamer Services Overview
XNA Game Studio 2.0
// Check the graphics device used by the game for the necessary shader support.
GraphicsDeviceCapabilities caps = graphics.GraphicsDevice.GraphicsDeviceCapabilities;
if (Environment.ProcessorCount == 1)
{
// Perform tasks specific to single processor systems.
}
else
{
// Perform tasks specific to multi-processor systems.
}
Performance-Specific Degradation
Performance levels can be measured by the number of times the Update method is called each second. Once the update rate
falls below a certain level (the default is 60 times per second) GameTime.IsRunningSlowly will be set to true.
This code sample shows where to place code that should be skipped if the game's performance falls below 60 frames per
second.
C#
// Perform the following only if the game is running at 60 frames per second or faster
if (gameTime.IsRunningSlowly == false)
{
// Perform time consuming update or draw here.
}
If 60 frames per second is not ideal for the game, the default can be changed by altering TargetElapsedTime. To have
IsRunningSlowly become true when the game slows to less than 30 frames per second, include this in the program's
initialization code.
C#
// Alert the program when the frame rate falls below 30 frames per second.
TargetElapsedTime = new TimeSpan((1L / 30L) * 10000000L);
To test for a different frame rate, change the 30 of the 30L to the frames-per-second desired (for example, 45L for 45 frames
per second, or 100L for 100 frames per second).
See Also
Tasks
How To: Check for Shader Model 2.0 Support
Concepts
Threading (C# Programming Guide)
Using Threading (C# Programming Guide)
Reference
IsRunningSlowly
TargetElapsedTime
System.Environment.ProcessorCount Property
ElapsedGameTime
XNA Game Studio 2.0
Predicated Tiling
The Xbox 360 has 10 MB (10×1024×1024) of fast embedded dynamic RAM (EDRAM) that is dedicated for use as the back
buffer, depth stencil buffer, and other render targets. Depending on the size and format of the render targets and the
antialiasing level, it may not be possible to fit all targets in EDRAM at once. For example, 10 MB of EDRAM is enough to hold
two 1280×720 32-bit surfaces with no multisample antialiasing (MSAA) or two 640×480 4× MSAA 32-bit surfaces. However,
a 1280×720 2× MSAA 32-bits-per-pixel render target is 7,372,800 bytes. Combined with a 32-bit Z/stencil buffer of the same
dimensions, it becomes apparent that 10 MB might not be sufficient.
Predicated tiling allows rendering to larger surfaces than can fit into EDRAM at any one time. In predicated tiling, the screen
space is broken up into tiles (rectangles). The following figure shows the screen space broken into two tiles.
In predicated tiling, the commands issued in the Draw method are recorded prior to execution. The recorded commands, such
as DrawPrimitives calls, are then executed for each tile, predicated based on whether the rendered primitives intersect the tile.
In the preceding figure, both the triangle primitives would be rendered in Tile 0. Once the primitives for a tile are fully
rendered, the tile is then resolved into the texture that is used for the front buffer. Each successive tile is handled the same way
and is resolved into the same texture.
Triggering Predicated Tiling
Predicated tiling occurs automatically for Xbox 360 games created with XNA Game Studio when the size and format of the
render targets exceed the console's available EDRAM. In predicated tiling, the size of the render targets and the depth-stencil
are no longer limited by EDRAM memory, although each individual tile has to fit into EDRAM.
Once predicated tiling has been triggered, all rendering commands in Draw are accumulated and played back for each tile in
separate passes. An adjusted window offset and clip rectangle are used to render only those portions that intersect with the
specified screen-space tile rectangle. Drawing is done only when the primitive drawing call is known to be visible on the given
tile. This is determined by using hardware screen–space extent queries, which compute if the geometry lies within the tile. All
rendering is then completed using the render target and depth stencil surface that are currently set.
Restrictions Encountered After Predicated Tiling Has Been Triggered
A few restrictions apply when predicated tiling has been triggered.
Resources that are referenced in the command buffer cannot be modified by the CPU, because the command buffer has to be
played back more than once to accomplish the tiling. It is okay for the GPU to modify resources and then reuse them in the
same pass, because the GPU can appropriately recreate the memory on every pass.
Specifically, in the Draw method of an Xbox 360 game, vertex buffers, index buffers, and textures should not be written to
using SetData during the Draw method. This condition may lead to graphics corruption or crashes. For vertex buffers, this
issue can be avoided by using DrawUserPrimitives or DrawUserIndexedPrimitives as the preferred alternative to
VertexBuffer.SetData for dynamic vertex generation.
Data from an occlusion query (specifically, a call to IsComplete) on Xbox 360 is not available from within the tiling bracket.
Access this data by switching to a different render target or end the frame. This condition does not apply to games targeting
the Windows platform.
XNA Game Studio 2.0
See Also
Tasks
How To: Draw Point Sprites
Concepts
Xbox 360 Programming Considerations
HLSL Attributes (Xbox 360)
Microcode (xvs_3_0, xps_3_0)
XNA Game Studio 2.0
Attribute Categories
High-level shader language (HLSL) attributes for Xbox 360 are compiler hints that influence how microcode is generated from
HLSL. Using the attributes, you can optimize how microcode is emitted and tune shader performance.
The high-level shader language attributes consist of the following categories.
Branching Statement Attributes
Looping Statement Attributes
Function Attributes
Miscellaneous Attributes
Branching Statement Attributes
HLSL supports the following attributes that modify the microcode output of branching statements. These attributes affect only
if statements.
branch
flatten
ifAll
ifAny
predicate
predicateBlock
Looping Statement Attributes
HLSL supports the following attributes that modify the microcode output of looping statements. Use these attributes to affect
for, while, and do-while statements.
unroll
loop
Function Attributes
HLSL supports the following attributes that modify the microcode output related to functions. Use these attributes to affect
either how functions are called or how microcode is generated throughout the scope of a function.
call
maxExports
maxTempReg
reduceTempRegUsage
sampreg
Miscellaneous Attributes
HLSL supports the following attributes to isolate areas of HLSL code for optimization and mark certain input parameters as
unused.
isolate
maxInstructionCount
noExpressionOptimizations
removeUnusedInputs
unused
xps
See Also
Concepts
HLSL Attributes (Xbox 360)
Attribute Syntax
Reference
HLSL Attributes Reference (Xbox 360)
XNA Game Studio 2.0
Attribute Syntax
High level shader language (HLSL) attributes use the following syntax.
[AttributeName[(Parameter)]]
Apply HLSL attributes by specifying the attribute name between opening and closing brackets.
Some attributes accept parameters, while others do not. Parameters are passed between opening and closing parentheses
similar to the way C function parameters are passed. If the attribute does not accept a parameter, you do not have to supply
the parentheses.
Different HLSL attributes modify different statement types. To modify a statement, place the attribute in front of a statement
type that is compatible with the particular attribute you are using. HLSL attributes can modify the following types of
statements.
Branching statements.
Loop statements.
Functions.
Function parameters.
Output parameters.
Arbitrary statements, functions, or scopes delineated by brackets.
Entire shaders.
Applying HLSL Attributes
The following code example demonstrates how to apply an attribute. This example applies the call attribute to an HLSL
function. Using the call attribute, you can specify that a function should not be inlined.
[call]
float4 MyFunction()
{
// ...
}
The HLSL compiler provides warnings that help you properly apply attributes. The HLSL compiler displays a warning in the
following cases.
An attribute is unrecognized.
An attribute is applied to an incompatible statement.
An attribute cannot be respected in the current context.
See Also
Concepts
HLSL Attributes (Xbox 360)
Attribute Categories
Reference
HLSL Attributes Reference (Xbox 360)
XNA Game Studio 2.0
branch (HLSL)
Note
This HLSL attribute is available only when developing for the Xbox 360.
Parameters
None
Scope
Applies to if statements.
Examples
The following HLSL code snippet demonstrates how to apply the branch attribute.
[branch]
if( a )
{
a = sqrt( a );
}
See Also
Concepts
HLSL Attributes (Xbox 360)
Attribute Syntax
Attribute Categories
Reference
HLSL Attributes Reference (Xbox 360)
XNA Game Studio 2.0
call (HLSL)
Note
This HLSL attribute is available only when developing for the Xbox 360.
Parameters
None
Scope
Applies to function definitions and function calls.
Remarks
By default, all user-defined HLSL functions are inlined by the HLSL compiler on Xbox 360. Use the call attribute to turn off
inlining and decrease the amount of microcode emitted by the HLSL compiler.
You can use the call attribute to control inlining either when the function is defined or when a function is called.
If applied to a function definition, the function will not be inlined anywhere.
If applied to a function call, the function will not be inlined during the current call, but might be inlined elsewhere.
Examples
The following HLSL code snippet demonstrates how to apply the call attribute.
// This function will not be inlined.
[call]
float4 ComputePosition1 ()
{
...
}
// This function will be inlined wherever possible.
float4 ComputePosition2 ()
{
...
}
See Also
Concepts
HLSL Attributes (Xbox 360)
Attribute Syntax
Attribute Categories
Reference
HLSL Attributes Reference (Xbox 360)
XNA Game Studio 2.0
flatten (HLSL)
Note
This HLSL attribute is available only when developing for the Xbox 360.
Parameters
None.
Scope
Applies to if statements.
Examples
The following HLSL code snippet shows how to apply the flatten attribute.
[flatten]
if( a )
{
a = sqrt( a );
}
See Also
Concepts
HLSL Attributes (Xbox 360)
Attribute Syntax
Attribute Categories
Reference
HLSL Attributes Reference (Xbox 360)
XNA Game Studio 2.0
ifAll (HLSL)
Note
This HLSL attribute is available only when developing for the Xbox 360.
Executes the conditional part of an if statement when the condition is true for all threads on which the current shader is
running.
Syntax
[ifAll]
Parameters
None.
Scope
Applies to if statements.
Remarks
Apply the ifAll attribute to if statements to make a dynamic branch behave more like a static branch. This causes all threads to
branch together. The ifAll attribute executes conditional statements only if the condition is true on all threads.
On static branches, the ifAll attribute is similar to the branch attribute. However, the ifAll attribute does not permit
optimizations that need to invert the original branch condition.
On dynamic branches, the ifAll attribute differs from the branch attribute. When you apply the branch attribute to a dynamic if
statement, the conditional statements are predicated. They are skipped only if no thread needs to execute the code. The branch
attribute allows each thread to execute different instructions for an if statement. The ifAll attribute forces every thread to
execute the same instructions.
Note that you cannot apply the ifAll attribute to a nested dynamic branch.
Examples
The following HLSL code snippet shows how to apply the ifAll attribute.
float x = tex2D( sampler, coord );
float result = g_value1;
[ifAll]
if (x > 0)
{
result = g_value2;
}
See Also
Concepts
HLSL Attributes (Xbox 360)
Attribute Syntax
Attribute Categories
Reference
ifAny (HLSL)
branch (HLSL)
HLSL Attributes Reference (Xbox 360)
XNA Game Studio 2.0
ifAny (HLSL)
Note
This HLSL attribute is available only when developing for the Xbox 360.
Executes the conditional part of an if statement when the condition is true for any thread on which the current shader is
running.
Syntax
[ifAny]
Parameters
None.
Scope
Applies to if statements.
Remarks
Apply the ifAny attribute to if statements to make a dynamic branch behave more like a static branch. This causes all threads
to branch together. The ifAny attribute executes conditional statements if the condition is true on any thread.
On static branches, the ifAny attribute is similar to the branch attribute. However, the ifAny attribute does not permit
optimizations that need to invert the original branch condition.
On dynamic branches, the ifAny attribute differs from the branch attribute. When you apply the branch attribute to a dynamic
if statement, the conditional statements are predicated. They are skipped only if no thread needs to execute the code. The
branch attribute allows each thread to execute different instructions for an if statement. The ifAny attribute forces every thread
to execute the same instructions.
Note that you cannot apply the ifAny attribute to a nested dynamic branch.
Examples
The following HLSL code snippet shows how to apply the ifAny attribute.
float x = tex2D( sampler, coord );
float result = g_value1;
[ifAny]
if (x > 0)
{
result = g_value2;
}
See Also
Concepts
HLSL Attributes (Xbox 360)
Attribute Syntax
Attribute Categories
Reference
ifAll (HLSL)
branch (HLSL)
HLSL Attributes Reference (Xbox 360)
XNA Game Studio 2.0
isolate (HLSL)
Note
This HLSL attribute is available only when developing for the Xbox 360.
Parameters
None.
Scope
Applies to output parameter declarations, functions, structures, or any scope.
Remarks
You can apply the isolate attribute in the following ways.
When the attribute is applied to an output parameter declaration, any code related to computation of the output is
optimized independently of the rest of the function.
When the attribute is applied to a scope, microcode in the scope is optimized independently of the surrounding code.
Isolated scopes are ordered with respect to each other. Isolated scopes can be nested. The inner scope is optimized
independently of the outer scope.
When the attribute is applied to a function, the function can be inlined, but the inlined code will not be merged with code
at the call site.
When the attribute is applied to a structure that is returned by a shader, the function has the same effect as applying it to
an output parameter.
The isolate attribute is useful for multipass shaders that need a floating-point output of two different shaders to be equivalent
bitwise. The generated microcode of the two shaders might not be identical bit-for-bit, but both shaders should compute bit-
for-bit identical results.
When you work with multipass shaders, the source code affected by the isolate attribute must be identical to guarantee
identical microcode. Subtle differences in the HLSL can cause the isolate attribute to emit different microcode. Sometimes the
emitted microcode has the same instructions, but it might have different swizzle values, or it might have different
combinations of the same vector computations. Differences in HLSL can also affect the order in which optimizations occur.
Example
The following HLSL code snippet shows how to apply the isolate attribute.
// Apply the attribute to a declaration.
void main ([isolate] out float4 pos : POSITION)
{
pos = ComputePosition();
}
// These two fetches are always generated in the order specified in the
// HLSL.
[isolate]
{
tex1 = tex3D( coord1 );
}
[isolate]
{
tex2 = tex3D( coord2 );
}
// The HLSL compiler can swap these two fetches, but the compiler cannot
// insert other instructions between them.
[isolate]
{
tex1 = tex3D( coord1 );
tex2 = tex3D( coord2 );
}
See Also
Concepts
HLSL Attributes (Xbox 360)
Attribute Syntax
Attribute Categories
Reference
HLSL Attributes Reference (Xbox 360)
XNA Game Studio 2.0
loop (HLSL)
Note
This HLSL attribute is available only when developing for the Xbox 360.
Parameters
None.
Scope
Applies to for, while, and do-while statements.
Examples
The following HLSL code snippet shows how to apply the loop attribute.
float value = 0;
[loop]
for( uint i = 0;i < 4; i++ )
{
value ++;
}
See Also
Concepts
HLSL Attributes (Xbox 360)
Attribute Syntax
Attribute Categories
Reference
HLSL Attributes Reference (Xbox 360)
XNA Game Studio 2.0
maxexports (HLSL)
Note
This HLSL attribute is available only when developing for the Xbox 360.
Specifies the maximum number of export instructions that will execute along any path from the entry point to an exit.
Syntax
[maxexports(n)]
Parameters
n
Integer that represents the maximum number of export instructions.
Scope
Applies to functions. The maxexports attribute is ignored on any function except the shader entry point that is currently being
compiled.
Examples
The following HLSL code snippet shows how to apply the maxexports attribute.
row_major float4x4 a;
float4 b;
row_major float4x4 c;
float4 d;
[maxexports(2)]
void main ( out float4 pos : POSITION,
out float4 coord : TEXCOORD ) {
pos = mul( a, b );
coord = mul( c, d );
}
Without the call to the maxexports attribute, each mul HLSL intrinsic yields four microcode instructions.
With the call to the maxexports attribute, the HLSL compiler adds extra mov instructions to reduce the number of export
instructions to two.
See Also
Concepts
HLSL Attributes (Xbox 360)
Attribute Syntax
Attribute Categories
Reference
HLSL Attributes Reference (Xbox 360)
XNA Game Studio 2.0
maxInstructionCount (HLSL)
Note
This HLSL attribute is available only when developing for the Xbox 360.
Parameters
n
Integer that represents the maximum number of instructions. The n parameter must be a value between 256 and 3839.
Scope
Applies to an entire shader.
Remarks
The Xbox 360 GPU contains an instruction store of 4096 microcode instructions that Direct3D allocates between vertex and
pixel shaders. By default, Direct3D allocates 2047 instructions on the GPU to vertex shaders and 2048 instructions on the GPU
to pixel shaders. (One instruction at index 0 is reserved.) By default, the HLSL compiler accommodates these requirements by
emitting shaders that do not exceed 2048 instructions.
Use the maxInstructionCount attribute to increase or decrease the limit to the number of instructions that can be emitted by
the HLSL compiler. Note that this attribute does not change the number of instructions allocated to shaders on the GPU.
The number of instructions that can be emitted by the HLSL compiler should not be greater than the number of instructions
available on the GPU. This situation produces an error.
See Also
Concepts
HLSL Attributes (Xbox 360)
Attribute Syntax
Attribute Categories
Reference
HLSL Attributes Reference (Xbox 360)
XNA Game Studio 2.0
maxtempreg (HLSL)
Note
This HLSL attribute is available only when developing for the Xbox 360.
Restricts temporary register usage to the number of registers specified. Generates a compiler error if unsuccessful.
Syntax
[maxtempreg(n)]
Parameters
n
Integer that represents the maximum number of temporary registers.
Scope
Applies to functions. The maxtempreg attribute is ignored on any function except the shader entry point that is currently
being compiled. The parameter also applies to any function that is compiled for this entry point, whether the function is inlined
or not.
Remarks
If the HLSL compiler is unable to restrict temporary registers to the number specified by the maxtempreg attribute, the
compiler reports an error and fails to compile the shader.
Note that the reduceTempRegUsage attribute also restricts temporary register usage. However, the reduceTempRegUsage
attribute reports a warning and then does compile the shader by using the number of temporary registers as close as possible
to the number specified.
Examples
The following HLSL code snippet shows how to apply the maxtempreg attribute and the reduceTempRegUsage attribute. This
example specifies that the compiler never allocate more than 32 registers for temporary usage. Instead, the compiler should try
to stay as close to 12 registers as possible. If the compiler exceeds an allocation of 12 registers, it displays a warning. However,
if the compiler exceeds 32 registers, it displays an error and fails to compile the shader.
[maxtempreg(32)]
[reduceTempRegUsage(12)]
float4 main ( float4 in )
{
// ...
}
See Also
Concepts
HLSL Attributes (Xbox 360)
Attribute Syntax
Attribute Categories
Reference
reduceTempRegUsage
HLSL Attributes Reference (Xbox 360)
XNA Game Studio 2.0
noExpressionOptimizations (HLSL)
Note
This HLSL attribute is available only when developing for the Xbox 360.
Parameters
None.
Scope
Applies to statements, functions, or any scope.
Remarks
The noExpressionOptimizations attribute instructs the compiler not to optimize expressions. The resulting microcode
assembly is kept as close to the original HLSL as possible.
In general, do not apply the noExpressionOptimizations attribute. Use it only to disable optimizations that are causing
problems in your code.
In some situations, the compiler must perform expression optimization even if you apply the noExpressionOptimizations
attribute. For example, the compiler must optimize expressions during sampler array indexing.
Also, the compiler may need to optimize expressions within the scope of the attribute when neighboring code is optimized. To
avoid this situation, apply the noExpressionOptimizations attribute to the shader entry point.
The noExpressionOptimizations attribute cannot be nested. This attribute implies the isolate attribute.
See Also
Concepts
HLSL Attributes (Xbox 360)
Attribute Syntax
Attribute Categories
Reference
HLSL Attributes Reference (Xbox 360)
XNA Game Studio 2.0
predicate (HLSL)
Note
This HLSL attribute is available only when developing for the Xbox 360.
Parameters
None.
Scope
Applies to if statements.
Remarks
Instructions are individually predicated.
Examples
The following HLSL code snippet shows how to apply the predicate attribute.
[predicate]
if( a )
{
a = sqrt( a );
}
See Also
Concepts
HLSL Attributes (Xbox 360)
Attribute Syntax
Attribute Categories
Reference
HLSL Attributes Reference (Xbox 360)
XNA Game Studio 2.0
predicateBlock (HLSL)
Note
This HLSL attribute is available only when developing for the Xbox 360.
Parameters
None.
Scope
Applies to if statements.
Remarks
Use the predicateBlock attribute with the flatten attribute to specify exactly how to flatten a branch.
Examples
The following HLSL code snippet shows how to apply the predicateBlock attribute.
[predicateBlock]
if( a )
{
a = sqrt( a );
}
See Also
Concepts
HLSL Attributes (Xbox 360)
Attribute Syntax
Attribute Categories
Reference
HLSL Attributes Reference (Xbox 360)
XNA Game Studio 2.0
reduceTempRegUsage (HLSL)
Note
This HLSL attribute is available only when developing for the Xbox 360.
Restricts temporary register usage to the number of registers specified. Generates a compiler warning if unsuccessful.
Syntax
[reduceTempRegUsage(n)]
Parameters
n
Integer that represents the maximum number of temporary registers.
Scope
Applies to functions. The reduceTempRegUsage attribute is ignored on any function except the shader entry point that is
currently being compiled.
Remarks
If the HLSL compiler is unable to restrict temporary registers to the number specified by the reduceTempRegUsage attribute,
the HLSL compiler reports a warning and then compiles by using the number of temporary registers as close as possible to the
number specified.
Note that the maxtempreg attribute also restricts temporary register usage. However, the maxtempreg attribute reports an
error and fails to compile if it is unable to restrict temporary registers to the number specified.
Examples
The following HLSL code snippet demonstrates how to apply the reduceTempRegUsage attribute and the maxtempreg
attribute. This example specifies that the compiler should never allocate more than 32 registers for temporary usage, but
should try to stay as close to 12 registers as possible. If the compiler exceeds an allocation of 12 registers, it displays a warning.
However, if the compiler exceeds 32 registers, it displays an error and fails to compile the shader.
[maxtempreg(32)]
[reduceTempRegUsage(12)]
float4 main ( float4 in )
{
// ...
}
See Also
Concepts
HLSL Attributes (Xbox 360)
Attribute Syntax
Attribute Categories
Reference
maxtempreg
HLSL Attributes Reference (Xbox 360)
XNA Game Studio 2.0
removeUnusedInputs (HLSL)
Removes unused interpolator inputs from pixel shaders.
Syntax
[removeUnusedInputs]
Parameters
None.
Scope
Applies to an entire pixel shader.
Remarks
Apply the removeUnusedInputs attribute to a pixel shader entry point. This automatically removes unused interpolator
inputs.
Without the removeUnusedInputs attribute, the HLSL compiler declares all interpolator inputs in the microcode, whether
they are used or not. If interpolator inputs are not used, and the unused attribute is not applied to them, the compiler displays a
warning.
The removeUnusedInputs attribute can sometimes improve performance for shaders that are interpolant-bound. Removing
unused interpolants allows the shader to spend less time in the interpolant calculation phase.
The removeUnusedInputs attribute is sometimes disadvantageous, because it can cause vertex shader outputs and pixel
shader inputs to be mismatched. If the two are mismatched, the shaders are patched, which can decrease performance.
See Also
Concepts
HLSL Attributes (Xbox 360)
Attribute Syntax
Attribute Categories
Reference
HLSL Attributes Reference (Xbox 360)
XNA Game Studio 2.0
sampreg (HLSL)
Note
This HLSL attribute is available only when developing for the Xbox 360.
Sets the ranges of pixel sampler and vertex sampler registers used by the compiler.
Syntax
[sampreg(n,m)]
Parameters
n
Starting vertex sampler register.
m
Starting pixel sampler register.
Scope
Applies to functions. The sampreg attribute is ignored on any function except the shader entry point that is currently being
compiled. The parameters also apply to any function that is compiled for this entry point, whether the function is inlined or not.
See Also
Concepts
HLSL Attributes (Xbox 360)
Attribute Syntax
Attribute Categories
Reference
HLSL Attributes Reference (Xbox 360)
XNA Game Studio 2.0
Parameters
MaxIterationCount
An integer that represents the iteration count. The MaxIterationCount parameter is optional. If it is omitted, the HLSL
compiler automatically determines the iteration count.
Scope
Applies to for, while, and do-while statements.
Remarks
The iteration count can be any arbitrary expression and is handled much like inline microcode options. For example, the
iteration count can be a function parameter. The HLSL compiler automatically inlines the function to resolve the parameter to a
constant.
Examples
The following HLSL code snippet shows how to apply the unroll attribute.
float value = 0;
[unroll(3)]
while( value <= 5 )
{
value ++;
}
See Also
Concepts
HLSL Attributes (Xbox 360)
Attribute Syntax
Attribute Categories
Reference
HLSL Attributes Reference (Xbox 360)
XNA Game Studio 2.0
unused (HLSL)
Note
This HLSL attribute is available only when developing for the Xbox 360.
Parameters
None.
Scope
Applies to function parameters.
Remarks
The unused attribute is useful for shaders that use preprocessors, where the same vertex shader is used with different pixel
shaders. In this case, a pixel shader may not use some of the inputs.
Examples
The following HLSL code snippet shows how to apply the unused attribute.
float4 main ( float4 coord0 : TEXCOORD0,
[unused] float4 coord1 : TEXCOORD1 ) : COLOR
{
#ifdef SHADER_2
return coord0 + coord1;
#else
return coord0;
#endif
}
See Also
Concepts
HLSL Attributes (Xbox 360)
Attribute Syntax
Attribute Categories
Reference
HLSL Attributes Reference (Xbox 360)
XNA Game Studio 2.0
xps (HLSL)
Note
This HLSL attribute is available only when developing for the Xbox 360.
Specifies that all vertex fetch operations are done after the last vfetch instruction. This instruction is used to reduce the latency
back to the command processor to free the vertex buffer.
Syntax
[xps]
Parameters
None.
Scope
Applies to functions or any scope.
See Also
Concepts
HLSL Attributes (Xbox 360)
Attribute Syntax
Attribute Categories
Reference
HLSL Attributes Reference (Xbox 360)
XNA Game Studio 2.0
System
System.CodeDom.Compiler
System.Collections
System.Collections.Generic
System.Collections.ObjectModel
System.Collections.Specialized
System.ComponentModel
System.Configuration.Assemblies
System.Diagnostics
System.Diagnostics.CodeAnalysis
System.Globalization
System.IO
System.Net
System.Reflection
System.Resources
System.Runtime.CompilerServices
System.Runtime.InteropServices
System.Runtime.Serialization
System.Security
System.Security.Permissions
System.Security.Policy
System.Text
System.Text.RegularExpressions
System.Threading
System.Xml
System.Xml.Schema
System.Xml.Serialization
System.Xml.XPath
System.Xml.Xsl
(These links jump to the corresponding namespace in the list below.)
Namespaces, Types, and Members
The following namespaces, types, and members are supported in the .NET Compact Framework for Xbox 360.
Note
To limit the size of this large list, explicit interface implementations and overloads are not listed.
Note
You can open a link in a new tab within Microsoft Document Explorer by holding down SHIFT while clicking the link.
System namespace
System.Action<T> delegate
System.Activator class
[Activator Methods]
Activator.CreateInstance
System.AppDomain class
[AppDomain Methods]
AppDomain.CreateDomain
AppDomain.ExecuteAssembly
AppDomain.ToString
AppDomain.Unload
[AppDomain Properties]
AppDomain.CurrentDomain
AppDomain.FriendlyName
[AppDomain Events]
AppDomain.UnhandledException
System.AppDomainManager class
AppDomainManager.AppDomainManager
[AppDomainManager Methods]
AppDomainManager.InitializeNewDomain
[AppDomainManager Properties]
AppDomainManager.InitializationFlags
System.AppDomainManagerInitializationOptions enumeration
System.AppDomainSetup class
AppDomainSetup.AppDomainSetup
System.AppDomainUnloadedException class
AppDomainUnloadedException.AppDomainUnloadedException
System.ApplicationException class
ApplicationException.ApplicationException
System.ArgumentException class
ArgumentException.ArgumentException
System.ArgumentNullException class
ArgumentNullException.ArgumentNullException
System.ArgumentOutOfRangeException class
ArgumentOutOfRangeException.ArgumentOutOfRangeException
System.ArithmeticException class
ArithmeticException.ArithmeticException
System.Array class
[Array Methods]
Array.BinarySearch
Array.Clear
Array.Clone
Array.Copy
Array.CopyTo
Array.CreateInstance
Array.GetEnumerator
Array.GetLength
Array.GetLowerBound
Array.GetUpperBound
Array.GetValue
Array.IndexOf
Array.Initialize
Array.LastIndexOf
Array.Resize<T>
Array.Reverse
Array.SetValue
Array.Sort
Array.TrueForAll<T>
[Array Properties]
Array.IsFixedSize
Array.IsReadOnly
Array.IsSynchronized
Array.Length
Array.Rank
Array.SyncRoot
System.ArraySegment<T> structure
ArraySegment<T>.ArraySegment<T>
[ArraySegment<T> Methods]
ArraySegment<T>.Equals
ArraySegment<T>.GetHashCode
ArraySegment<T>.op_Equality
ArraySegment<T>.op_Inequality
[ArraySegment<T> Properties]
ArraySegment<T>.Array
ArraySegment<T>.Count
ArraySegment<T>.Offset
System.ArrayTypeMismatchException class
ArrayTypeMismatchException.ArrayTypeMismatchException
System.AsyncCallback delegate
System.Attribute class
Attribute.Attribute
[Attribute Methods]
Attribute.Equals
Attribute.GetCustomAttribute
Attribute.GetCustomAttributes
Attribute.GetHashCode
Attribute.IsDefined
Attribute.Match
System.AttributeTargets enumeration
System.AttributeUsageAttribute class
AttributeUsageAttribute.AttributeUsageAttribute
[AttributeUsageAttribute Properties]
AttributeUsageAttribute.AllowMultiple
AttributeUsageAttribute.Inherited
AttributeUsageAttribute.ValidOn
System.BadImageFormatException class
BadImageFormatException.BadImageFormatException
System.BitConverter class
[BitConverter Fields]
BitConverter.IsLittleEndian
[BitConverter Methods]
BitConverter.GetBytes
BitConverter.ToBoolean
BitConverter.ToChar
BitConverter.ToDouble
BitConverter.ToInt16
BitConverter.ToInt32
BitConverter.ToInt64
BitConverter.ToSingle
BitConverter.ToString
BitConverter.ToUInt16
BitConverter.ToUInt32
BitConverter.ToUInt64
System.Boolean structure
[Boolean Fields]
Boolean.FalseString
Boolean.TrueString
[Boolean Methods]
Boolean.CompareTo
Boolean.Equals
Boolean.GetHashCode
Boolean.GetTypeCode
Boolean.Parse
Boolean.ToString
System.Buffer class
[Buffer Methods]
Buffer.BlockCopy
Buffer.ByteLength
Buffer.GetByte
Buffer.SetByte
System.Byte structure
[Byte Fields]
Byte.MaxValue
Byte.MinValue
[Byte Methods]
Byte.CompareTo
Byte.Equals
Byte.GetHashCode
Byte.GetTypeCode
Byte.Parse
Byte.ToString
System.CannotUnloadAppDomainException class
CannotUnloadAppDomainException.CannotUnloadAppDomainException
System.Char structure
[Char Fields]
Char.MaxValue
Char.MinValue
[Char Methods]
Char.CompareTo
Char.Equals
Char.GetHashCode
Char.GetNumericValue
Char.GetTypeCode
Char.GetUnicodeCategory
Char.IsControl
Char.IsDigit
Char.IsLetter
Char.IsLetterOrDigit
Char.IsLower
Char.IsNumber
Char.IsPunctuation
Char.IsSeparator
Char.IsSurrogate
Char.IsSurrogatePair
Char.IsSymbol
Char.IsUpper
Char.IsWhiteSpace
Char.ToLower
Char.ToLowerInvariant
Char.ToString
Char.ToUpper
System.CharEnumerator class
[CharEnumerator Methods]
CharEnumerator.Clone
CharEnumerator.MoveNext
CharEnumerator.Reset
[CharEnumerator Properties]
CharEnumerator.Current
System.CLSCompliantAttribute class
CLSCompliantAttribute.CLSCompliantAttribute
[CLSCompliantAttribute Properties]
CLSCompliantAttribute.IsCompliant
System.Comparison<T> delegate
System.Console class
[Console Methods]
Console.ReadLine
Console.SetError
Console.SetIn
Console.SetOut
Console.Write
Console.WriteLine
[Console Properties]
Console.Error
Console.In
Console.Out
System.Convert class
[Convert Fields]
Convert.DBNull
[Convert Methods]
Convert.ChangeType
Convert.FromBase64CharArray
Convert.FromBase64String
Convert.GetTypeCode
Convert.IsDBNull
Convert.ToBase64CharArray
Convert.ToBase64String
Convert.ToBoolean
Convert.ToByte
Convert.ToChar
Convert.ToDateTime
Convert.ToDecimal
Convert.ToDouble
Convert.ToInt16
Convert.ToInt32
Convert.ToInt64
Convert.ToSByte
Convert.ToSingle
Convert.ToString
Convert.ToUInt16
Convert.ToUInt32
Convert.ToUInt64
System.Converter<TInput><TOutput> delegate
System.DateTime structure
DateTime.DateTime
[DateTime Fields]
DateTime.MaxValue
DateTime.MinValue
[DateTime Methods]
DateTime.Add
DateTime.AddDays
DateTime.AddHours
DateTime.AddMilliseconds
DateTime.AddMinutes
DateTime.AddMonths
DateTime.AddSeconds
DateTime.AddTicks
DateTime.AddYears
DateTime.Compare
DateTime.CompareTo
DateTime.DaysInMonth
DateTime.Equals
DateTime.FromFileTime
DateTime.FromFileTimeUtc
DateTime.FromOADate
DateTime.GetDateTimeFormats
DateTime.GetHashCode
DateTime.GetTypeCode
DateTime.IsDaylightSavingTime
DateTime.IsLeapYear
DateTime.op_Addition
DateTime.op_Equality
DateTime.op_GreaterThan
DateTime.op_GreaterThanOrEqual
DateTime.op_Inequality
DateTime.op_LessThan
DateTime.op_LessThanOrEqual
DateTime.op_Subtraction
DateTime.Parse
DateTime.ParseExact
DateTime.SpecifyKind
DateTime.Subtract
DateTime.ToFileTime
DateTime.ToFileTimeUtc
DateTime.ToLocalTime
DateTime.ToLongDateString
DateTime.ToLongTimeString
DateTime.ToOADate
DateTime.ToShortDateString
DateTime.ToShortTimeString
DateTime.ToString
DateTime.ToUniversalTime
[DateTime Properties]
DateTime.Date
DateTime.Day
DateTime.DayOfWeek
DateTime.DayOfYear
DateTime.Hour
DateTime.Kind
DateTime.Millisecond
DateTime.Minute
DateTime.Month
DateTime.Now
DateTime.Second
DateTime.Ticks
DateTime.TimeOfDay
DateTime.Today
DateTime.UtcNow
DateTime.Year
System.DateTimeKind enumeration
System.DayOfWeek enumeration
System.DBNull class
[DBNull Fields]
DBNull.Value
[DBNull Methods]
DBNull.GetTypeCode
DBNull.ToString
System.Decimal structure
Decimal.Decimal
[Decimal Fields]
Decimal.MaxValue
Decimal.MinusOne
Decimal.MinValue
Decimal.One
Decimal.Zero
[Decimal Methods]
Decimal.Add
Decimal.Compare
Decimal.CompareTo
Decimal.Divide
Decimal.Equals
Decimal.Floor
Decimal.GetBits
Decimal.GetHashCode
Decimal.GetTypeCode
Decimal.Multiply
Decimal.Negate
Decimal.op_Addition
Decimal.op_Decrement
Decimal.op_Division
Decimal.op_Equality
Decimal.op_Explicit
Decimal.op_GreaterThan
Decimal.op_GreaterThanOrEqual
Decimal.op_Implicit
Decimal.op_Increment
Decimal.op_Inequality
Decimal.op_LessThan
Decimal.op_LessThanOrEqual
Decimal.op_Modulus
Decimal.op_Multiply
Decimal.op_Subtraction
Decimal.op_UnaryNegation
Decimal.op_UnaryPlus
Decimal.Parse
Decimal.Remainder
Decimal.Round
Decimal.Subtract
Decimal.ToByte
Decimal.ToDouble
Decimal.ToInt16
Decimal.ToInt32
Decimal.ToInt64
Decimal.ToSByte
Decimal.ToSingle
Decimal.ToString
Decimal.ToUInt16
Decimal.ToUInt32
Decimal.ToUInt64
Decimal.Truncate
System.Delegate class
[Delegate Methods]
Delegate.Clone
Delegate.Combine
Delegate.CombineImpl
Delegate.Equals
Delegate.Finalize
Delegate.GetHashCode
Delegate.GetInvocationList
Delegate.op_Equality
Delegate.op_Inequality
Delegate.Remove
Delegate.RemoveImpl
System.DivideByZeroException class
DivideByZeroException.DivideByZeroException
System.Double structure
[Double Fields]
Double.Epsilon
Double.MaxValue
Double.MinValue
Double.NaN
Double.NegativeInfinity
Double.PositiveInfinity
[Double Methods]
Double.CompareTo
Double.Equals
Double.GetHashCode
Double.GetTypeCode
Double.IsInfinity
Double.IsNaN
Double.IsNegativeInfinity
Double.IsPositiveInfinity
Double.Parse
Double.ToString
System.EntryPointNotFoundException class
EntryPointNotFoundException.EntryPointNotFoundException
System.Enum structure
Enum.Enum
[Enum Methods]
Enum.CompareTo
Enum.Equals
Enum.GetHashCode
Enum.GetTypeCode
Enum.GetUnderlyingType
Enum.IsDefined
Enum.Parse
Enum.ToObject
Enum.ToString
System.Environment class
[Environment Methods]
Environment.GetFolderPath
[Environment Properties]
Environment.OSVersion
Environment.ProcessorCount
Environment.TickCount
Environment.Version
System.Environment.SpecialFolder enumeration
System.EventArgs class
EventArgs.EventArgs
[EventArgs Fields]
EventArgs.Empty
System.EventHandler delegate
System.EventHandler<TEventArgs> delegate
System.Exception class
Exception.Exception
[Exception Methods]
Exception.GetBaseException
Exception.ToString
[Exception Properties]
Exception.HResult
Exception.InnerException
Exception.Message
Exception.StackTrace
System.FlagsAttribute class
FlagsAttribute.FlagsAttribute
System.FormatException class
FormatException.FormatException
System.GC class
[GC Methods]
GC.Collect
GC.GetTotalMemory
GC.KeepAlive
GC.ReRegisterForFinalize
GC.SuppressFinalize
GC.WaitForPendingFinalizers
[GC Properties]
GC.MaxGeneration
System.Guid structure
Guid.Guid
[Guid Fields]
Guid.Empty
[Guid Methods]
Guid.CompareTo
Guid.Equals
Guid.GetHashCode
Guid.NewGuid
Guid.op_Equality
Guid.op_Inequality
Guid.ToByteArray
Guid.ToString
System.IAsyncResult interface
[IAsyncResult Properties]
IAsyncResult.AsyncState
IAsyncResult.AsyncWaitHandle
IAsyncResult.CompletedSynchronously
IAsyncResult.IsCompleted
System.ICloneable interface
[ICloneable Methods]
ICloneable.Clone
System.IComparable interface
[IComparable Methods]
IComparable.CompareTo
System.IComparable<T> interface
[IComparable<T> Methods]
IComparable<T>.CompareTo
System.IConvertible interface
[IConvertible Methods]
IConvertible.GetTypeCode
IConvertible.ToBoolean
IConvertible.ToByte
IConvertible.ToChar
IConvertible.ToDateTime
IConvertible.ToDecimal
IConvertible.ToDouble
IConvertible.ToInt16
IConvertible.ToInt32
IConvertible.ToInt64
IConvertible.ToSByte
IConvertible.ToSingle
IConvertible.ToString
IConvertible.ToType
IConvertible.ToUInt16
IConvertible.ToUInt32
IConvertible.ToUInt64
System.ICustomFormatter interface
[ICustomFormatter Methods]
ICustomFormatter.Format
System.IDisposable interface
[IDisposable Methods]
IDisposable.Dispose
System.IEquatable<T> interface
[IEquatable<T> Methods]
IEquatable<T>.Equals
System.IFormatProvider interface
[IFormatProvider Methods]
IFormatProvider.GetFormat
System.IFormattable interface
[IFormattable Methods]
IFormattable.ToString
System.IndexOutOfRangeException class
IndexOutOfRangeException.IndexOutOfRangeException
System.Int16 structure
[Int16 Fields]
Int16.MaxValue
Int16.MinValue
[Int16 Methods]
Int16.CompareTo
Int16.Equals
Int16.GetHashCode
Int16.GetTypeCode
Int16.Parse
Int16.ToString
System.Int32 structure
[Int32 Fields]
Int32.MaxValue
Int32.MinValue
[Int32 Methods]
Int32.CompareTo
Int32.Equals
Int32.GetHashCode
Int32.GetTypeCode
Int32.Parse
Int32.ToString
System.Int64 structure
[Int64 Fields]
Int64.MaxValue
Int64.MinValue
[Int64 Methods]
Int64.CompareTo
Int64.Equals
Int64.GetHashCode
Int64.GetTypeCode
Int64.Parse
Int64.ToString
System.IntPtr structure
IntPtr.IntPtr
[IntPtr Fields]
IntPtr.Zero
[IntPtr Methods]
IntPtr.Equals
IntPtr.GetHashCode
IntPtr.op_Equality
IntPtr.op_Explicit
IntPtr.op_Inequality
IntPtr.ToInt32
IntPtr.ToInt64
IntPtr.ToPointer
IntPtr.ToString
[IntPtr Properties]
IntPtr.Size
System.InvalidCastException class
InvalidCastException.InvalidCastException
System.InvalidOperationException class
InvalidOperationException.InvalidOperationException
System.InvalidProgramException class
InvalidProgramException.InvalidProgramException
System.IServiceProvider interface
[IServiceProvider Methods]
IServiceProvider.GetService
System.LocalDataStoreSlot class
System.MarshalByRefObject class
MarshalByRefObject.MarshalByRefObject
System.Math class
[Math Fields]
Math.E
Math.PI
[Math Methods]
Math.Abs
Math.Acos
Math.Asin
Math.Atan
Math.Atan2
Math.Ceiling
Math.Cos
Math.Cosh
Math.Exp
Math.Floor
Math.IEEERemainder
Math.Log
Math.Log10
Math.Max
Math.Min
Math.Pow
Math.Round
Math.Sign
Math.Sin
Math.Sinh
Math.Sqrt
Math.Tan
Math.Tanh
System.MemberAccessException class
MemberAccessException.MemberAccessException
System.MethodAccessException class
MethodAccessException.MethodAccessException
System.MissingMemberException class
MissingMemberException.MissingMemberException
System.MissingMethodException class
MissingMethodException.MissingMethodException
System.MulticastDelegate class
[MulticastDelegate Methods]
MulticastDelegate.CombineImpl
MulticastDelegate.Equals
MulticastDelegate.GetHashCode
MulticastDelegate.GetInvocationList
MulticastDelegate.op_Equality
MulticastDelegate.op_Inequality
MulticastDelegate.RemoveImpl
System.MulticastNotSupportedException class
MulticastNotSupportedException.MulticastNotSupportedException
System.NotImplementedException class
NotImplementedException.NotImplementedException
System.NotSupportedException class
NotSupportedException.NotSupportedException
System.Nullable class
[Nullable Methods]
Nullable.Compare<T>
Nullable.Equals<T>
Nullable.GetUnderlyingType
System.Nullable<T> structure
Nullable<T>.Nullable<T>
[Nullable<T> Methods]
Nullable<T>.Equals
Nullable<T>.GetHashCode
Nullable<T>.GetValueOrDefault
Nullable<T>.op_Explicit
Nullable<T>.op_Implicit
Nullable<T>.ToString
[Nullable<T> Properties]
Nullable<T>.HasValue
Nullable<T>.Value
System.NullReferenceException class
NullReferenceException.NullReferenceException
System.Object class
Object.Object
[Object Methods]
Object.Equals
Object.Finalize
Object.GetHashCode
Object.GetType
Object.MemberwiseClone
Object.ReferenceEquals
Object.ToString
System.ObjectDisposedException class
ObjectDisposedException.ObjectDisposedException
[ObjectDisposedException Properties]
ObjectDisposedException.ObjectName
System.ObsoleteAttribute class
ObsoleteAttribute.ObsoleteAttribute
[ObsoleteAttribute Properties]
ObsoleteAttribute.IsError
ObsoleteAttribute.Message
System.OperatingSystem class
OperatingSystem.OperatingSystem
[OperatingSystem Methods]
OperatingSystem.Clone
OperatingSystem.ToString
[OperatingSystem Properties]
OperatingSystem.Platform
OperatingSystem.Version
System.OutOfMemoryException class
OutOfMemoryException.OutOfMemoryException
System.OverflowException class
OverflowException.OverflowException
System.ParamArrayAttribute class
ParamArrayAttribute.ParamArrayAttribute
System.PlatformID enumeration
System.PlatformNotSupportedException class
PlatformNotSupportedException.PlatformNotSupportedException
System.Predicate<T> delegate
System.Random class
Random.Random
[Random Methods]
Random.Next
Random.NextBytes
Random.NextDouble
Random.Sample
System.RankException class
RankException.RankException
System.RuntimeFieldHandle structure
[RuntimeFieldHandle Properties]
RuntimeFieldHandle.Value
System.RuntimeMethodHandle structure
[RuntimeMethodHandle Properties]
RuntimeMethodHandle.Value
System.RuntimeTypeHandle structure
System.SByte structure
[SByte Fields]
SByte.MaxValue
SByte.MinValue
[SByte Methods]
SByte.CompareTo
SByte.Equals
SByte.GetHashCode
SByte.GetTypeCode
SByte.Parse
SByte.ToString
System.SerializableAttribute class
SerializableAttribute.SerializableAttribute
System.Single structure
[Single Fields]
Single.Epsilon
Single.MaxValue
Single.MinValue
Single.NaN
Single.NegativeInfinity
Single.PositiveInfinity
[Single Methods]
Single.CompareTo
Single.Equals
Single.GetHashCode
Single.GetTypeCode
Single.IsInfinity
Single.IsNaN
Single.IsNegativeInfinity
Single.IsPositiveInfinity
Single.Parse
Single.ToString
System.StackOverflowException class
StackOverflowException.StackOverflowException
System.String class
String.String
[String Fields]
String.Empty
[String Methods]
String.Clone
String.Compare
String.CompareOrdinal
String.CompareTo
String.Concat
String.Contains
String.Copy
String.CopyTo
String.EndsWith
String.Equals
String.Format
String.GetEnumerator
String.GetHashCode
String.GetTypeCode
String.IndexOf
String.IndexOfAny
String.Insert
String.Intern
String.IsInterned
String.IsNullOrEmpty
String.Join
String.LastIndexOf
String.LastIndexOfAny
String.op_Equality
String.op_Inequality
String.PadLeft
String.PadRight
String.Remove
String.Replace
String.Split
String.StartsWith
String.Substring
String.ToCharArray
String.ToLower
String.ToString
String.ToUpper
String.Trim
String.TrimEnd
String.TrimStart
[String Properties]
String.Chars
String.Length
System.StringComparer class
StringComparer.StringComparer
[StringComparer Methods]
StringComparer.Compare
StringComparer.Create
StringComparer.Equals
StringComparer.GetHashCode
[StringComparer Properties]
StringComparer.CurrentCulture
StringComparer.CurrentCultureIgnoreCase
StringComparer.InvariantCulture
StringComparer.InvariantCultureIgnoreCase
StringComparer.Ordinal
StringComparer.OrdinalIgnoreCase
System.StringComparison enumeration
System.SystemException class
SystemException.SystemException
System.TimeoutException class
TimeoutException.TimeoutException
System.TimeSpan structure
TimeSpan.TimeSpan
[TimeSpan Fields]
TimeSpan.MaxValue
TimeSpan.MinValue
TimeSpan.TicksPerDay
TimeSpan.TicksPerHour
TimeSpan.TicksPerMillisecond
TimeSpan.TicksPerMinute
TimeSpan.TicksPerSecond
TimeSpan.Zero
[TimeSpan Methods]
TimeSpan.Add
TimeSpan.Compare
TimeSpan.CompareTo
TimeSpan.Duration
TimeSpan.Equals
TimeSpan.FromDays
TimeSpan.FromHours
TimeSpan.FromMilliseconds
TimeSpan.FromMinutes
TimeSpan.FromSeconds
TimeSpan.FromTicks
TimeSpan.GetHashCode
TimeSpan.Negate
TimeSpan.op_Addition
TimeSpan.op_Equality
TimeSpan.op_GreaterThan
TimeSpan.op_GreaterThanOrEqual
TimeSpan.op_Inequality
TimeSpan.op_LessThan
TimeSpan.op_LessThanOrEqual
TimeSpan.op_Subtraction
TimeSpan.op_UnaryNegation
TimeSpan.Parse
TimeSpan.Subtract
TimeSpan.ToString
[TimeSpan Properties]
TimeSpan.Days
TimeSpan.Hours
TimeSpan.Milliseconds
TimeSpan.Minutes
TimeSpan.Seconds
TimeSpan.Ticks
TimeSpan.TotalDays
TimeSpan.TotalHours
TimeSpan.TotalMilliseconds
TimeSpan.TotalMinutes
TimeSpan.TotalSeconds
System.TimeZone class
TimeZone.TimeZone
[TimeZone Methods]
TimeZone.GetDaylightChanges
TimeZone.GetUtcOffset
TimeZone.IsDaylightSavingTime
TimeZone.ToLocalTime
TimeZone.ToUniversalTime
[TimeZone Properties]
TimeZone.CurrentTimeZone
TimeZone.DaylightName
TimeZone.StandardName
System.Type class
Type.Type
[Type Fields]
Type.Delimiter
Type.Missing
[Type Methods]
Type.Equals
Type.GetArrayRank
Type.GetAttributeFlagsImpl
Type.GetConstructor
Type.GetConstructorImpl
Type.GetConstructors
Type.GetDefaultMembers
Type.GetElementType
Type.GetEvent
Type.GetEvents
Type.GetField
Type.GetFields
Type.GetGenericArguments
Type.GetGenericTypeDefinition
Type.GetHashCode
Type.GetInterfaces
Type.GetMember
Type.GetMembers
Type.GetMethod
Type.GetMethodImpl
Type.GetMethods
Type.GetNestedType
Type.GetNestedTypes
Type.GetProperties
Type.GetProperty
Type.GetPropertyImpl
Type.GetType
Type.GetTypeCode
Type.GetTypeFromHandle
Type.HasElementTypeImpl
Type.InvokeMember
Type.IsArrayImpl
Type.IsAssignableFrom
Type.IsByRefImpl
Type.IsCOMObjectImpl
Type.IsInstanceOfType
Type.IsPointerImpl
Type.IsPrimitiveImpl
Type.IsSubclassOf
Type.IsValueTypeImpl
Type.MakeGenericType
Type.ToString
[Type Properties]
Type.Assembly
Type.AssemblyQualifiedName
Type.Attributes
Type.BaseType
Type.ContainsGenericParameters
Type.DeclaringType
Type.DefaultBinder
Type.FullName
Type.HasElementType
Type.IsAbstract
Type.IsAnsiClass
Type.IsArray
Type.IsAutoClass
Type.IsAutoLayout
Type.IsByRef
Type.IsClass
Type.IsCOMObject
Type.IsEnum
Type.IsGenericParameter
Type.IsGenericType
Type.IsGenericTypeDefinition
Type.IsImport
Type.IsInterface
Type.IsNestedAssembly
Type.IsNestedFamANDAssem
Type.IsNestedFamily
Type.IsNestedFamORAssem
Type.IsNestedPrivate
Type.IsNestedPublic
Type.IsNotPublic
Type.IsPointer
Type.IsPrimitive
Type.IsPublic
Type.IsSealed
Type.IsSpecialName
Type.IsUnicodeClass
Type.IsValueType
Type.IsVisible
Type.MemberType
Type.Module
Type.Namespace
Type.ReflectedType
Type.TypeHandle
Type.UnderlyingSystemType
System.TypeCode enumeration
System.TypedReference structure
System.TypeLoadException class
TypeLoadException.TypeLoadException
System.UInt16 structure
[UInt16 Fields]
UInt16.MaxValue
UInt16.MinValue
[UInt16 Methods]
UInt16.CompareTo
UInt16.Equals
UInt16.GetHashCode
UInt16.GetTypeCode
UInt16.Parse
UInt16.ToString
System.UInt32 structure
[UInt32 Fields]
UInt32.MaxValue
UInt32.MinValue
[UInt32 Methods]
UInt32.CompareTo
UInt32.Equals
UInt32.GetHashCode
UInt32.GetTypeCode
UInt32.Parse
UInt32.ToString
System.UInt64 structure
[UInt64 Fields]
UInt64.MaxValue
UInt64.MinValue
[UInt64 Methods]
UInt64.CompareTo
UInt64.Equals
UInt64.GetHashCode
UInt64.GetTypeCode
UInt64.Parse
UInt64.ToString
System.UIntPtr structure
UIntPtr.UIntPtr
[UIntPtr Fields]
UIntPtr.Zero
[UIntPtr Methods]
UIntPtr.Equals
UIntPtr.GetHashCode
UIntPtr.op_Equality
UIntPtr.op_Explicit
UIntPtr.op_Inequality
UIntPtr.ToPointer
UIntPtr.ToString
UIntPtr.ToUInt32
UIntPtr.ToUInt64
[UIntPtr Properties]
UIntPtr.Size
System.UnauthorizedAccessException class
UnauthorizedAccessException.UnauthorizedAccessException
System.UnhandledExceptionEventArgs class
UnhandledExceptionEventArgs.UnhandledExceptionEventArgs
[UnhandledExceptionEventArgs Properties]
UnhandledExceptionEventArgs.ExceptionObject
UnhandledExceptionEventArgs.IsTerminating
System.UnhandledExceptionEventHandler delegate
System.Uri class
Uri.Uri
[Uri Fields]
Uri.SchemeDelimiter
Uri.UriSchemeFile
Uri.UriSchemeFtp
Uri.UriSchemeGopher
Uri.UriSchemeHttp
Uri.UriSchemeHttps
Uri.UriSchemeMailto
Uri.UriSchemeNetPipe
Uri.UriSchemeNetTcp
Uri.UriSchemeNews
Uri.UriSchemeNntp
[Uri Methods]
Uri.Canonicalize
Uri.CheckHostName
Uri.CheckSchemeName
Uri.CheckSecurity
Uri.Compare
Uri.Equals
Uri.Escape
Uri.EscapeDataString
Uri.EscapeString
Uri.EscapeUriString
Uri.FromHex
Uri.GetComponents
Uri.GetHashCode
Uri.GetLeftPart
Uri.HexEscape
Uri.HexUnescape
Uri.IsBadFileSystemCharacter
Uri.IsBaseOf
Uri.IsExcludedCharacter
Uri.IsHexDigit
Uri.IsHexEncoding
Uri.IsReservedCharacter
Uri.IsWellFormedOriginalString
Uri.IsWellFormedUriString
Uri.MakeRelative
Uri.MakeRelativeUri
Uri.op_Equality
Uri.op_Inequality
Uri.Parse
Uri.ToString
Uri.TryCreate
Uri.Unescape
Uri.UnescapeDataString
[Uri Properties]
Uri.AbsolutePath
Uri.AbsoluteUri
Uri.Authority
Uri.DnsSafeHost
Uri.Fragment
Uri.Host
Uri.HostNameType
Uri.IsAbsoluteUri
Uri.IsDefaultPort
Uri.IsFile
Uri.IsLoopback
Uri.IsUnc
Uri.LocalPath
Uri.OriginalString
Uri.PathAndQuery
Uri.Port
Uri.Query
Uri.Scheme
Uri.Segments
Uri.UserEscaped
Uri.UserInfo
System.UriComponents enumeration
System.UriFormat enumeration
System.UriFormatException class
UriFormatException.UriFormatException
System.UriHostNameType enumeration
System.UriKind enumeration
System.UriPartial enumeration
System.ValueType class
ValueType.ValueType
[ValueType Methods]
ValueType.Equals
ValueType.GetHashCode
System.Version class
Version.Version
[Version Methods]
Version.Clone
Version.CompareTo
Version.Equals
Version.GetHashCode
Version.op_Equality
Version.op_GreaterThan
Version.op_GreaterThanOrEqual
Version.op_Inequality
Version.op_LessThan
Version.op_LessThanOrEqual
Version.ToString
[Version Properties]
Version.Build
Version.Major
Version.Minor
Version.Revision
System.Void structure
System.WeakReference class
WeakReference.WeakReference
[WeakReference Methods]
WeakReference.Finalize
[WeakReference Properties]
WeakReference.IsAlive
WeakReference.Target
WeakReference.TrackResurrection
System.CodeDom.Compiler namespace
System.CodeDom.Compiler.GeneratedCodeAttribute class
GeneratedCodeAttribute.GeneratedCodeAttribute
[GeneratedCodeAttribute Properties]
GeneratedCodeAttribute.Tool
GeneratedCodeAttribute.Version
System.Collections namespace
System.Collections.ArrayList class
ArrayList.ArrayList
[ArrayList Methods]
ArrayList.Add
ArrayList.AddRange
ArrayList.BinarySearch
ArrayList.Clear
ArrayList.Clone
ArrayList.Contains
ArrayList.CopyTo
ArrayList.GetEnumerator
ArrayList.IndexOf
ArrayList.Insert
ArrayList.InsertRange
ArrayList.Remove
ArrayList.RemoveAt
ArrayList.RemoveRange
ArrayList.Reverse
ArrayList.Sort
ArrayList.Synchronized
ArrayList.ToArray
ArrayList.TrimToSize
[ArrayList Properties]
ArrayList.Capacity
ArrayList.Count
ArrayList.IsFixedSize
ArrayList.IsReadOnly
ArrayList.IsSynchronized
ArrayList.Item
ArrayList.SyncRoot
System.Collections.BitArray class
BitArray.BitArray
[BitArray Methods]
BitArray.And
BitArray.Clone
BitArray.CopyTo
BitArray.Get
BitArray.GetEnumerator
BitArray.Not
BitArray.Or
BitArray.Set
BitArray.SetAll
BitArray.Xor
[BitArray Properties]
BitArray.Count
BitArray.IsReadOnly
BitArray.IsSynchronized
BitArray.Item
BitArray.Length
BitArray.SyncRoot
System.Collections.CaseInsensitiveComparer class
CaseInsensitiveComparer.CaseInsensitiveComparer
[CaseInsensitiveComparer Methods]
CaseInsensitiveComparer.Compare
[CaseInsensitiveComparer Properties]
CaseInsensitiveComparer.Default
CaseInsensitiveComparer.DefaultInvariant
System.Collections.CaseInsensitiveHashCodeProvider class
CaseInsensitiveHashCodeProvider.CaseInsensitiveHashCodeProvider
[CaseInsensitiveHashCodeProvider Methods]
CaseInsensitiveHashCodeProvider.GetHashCode
[CaseInsensitiveHashCodeProvider Properties]
CaseInsensitiveHashCodeProvider.Default
CaseInsensitiveHashCodeProvider.DefaultInvariant
System.Collections.CollectionBase class
CollectionBase.CollectionBase
[CollectionBase Methods]
CollectionBase.Clear
CollectionBase.GetEnumerator
CollectionBase.OnClear
CollectionBase.OnClearComplete
CollectionBase.OnInsert
CollectionBase.OnInsertComplete
CollectionBase.OnRemove
CollectionBase.OnRemoveComplete
CollectionBase.OnSet
CollectionBase.OnSetComplete
CollectionBase.OnValidate
CollectionBase.RemoveAt
[CollectionBase Properties]
CollectionBase.Capacity
CollectionBase.Count
CollectionBase.InnerList
CollectionBase.List
System.Collections.Comparer class
Comparer.Comparer
[Comparer Fields]
Comparer.Default
Comparer.DefaultInvariant
[Comparer Methods]
Comparer.Compare
System.Collections.DictionaryEntry structure
DictionaryEntry.DictionaryEntry
[DictionaryEntry Properties]
DictionaryEntry.Key
DictionaryEntry.Value
System.Collections.Hashtable class
Hashtable.Hashtable
[Hashtable Methods]
Hashtable.Add
Hashtable.Clear
Hashtable.Clone
Hashtable.Contains
Hashtable.ContainsKey
Hashtable.ContainsValue
Hashtable.CopyTo
Hashtable.GetEnumerator
Hashtable.GetHash
Hashtable.KeyEquals
Hashtable.Remove
Hashtable.Synchronized
[Hashtable Properties]
Hashtable.comparer
Hashtable.Count
Hashtable.EqualityComparer
Hashtable.hcp
Hashtable.IsFixedSize
Hashtable.IsReadOnly
Hashtable.IsSynchronized
Hashtable.Item
Hashtable.Keys
Hashtable.SyncRoot
Hashtable.Values
System.Collections.ICollection interface
[ICollection Methods]
ICollection.CopyTo
[ICollection Properties]
ICollection.Count
ICollection.IsSynchronized
ICollection.SyncRoot
System.Collections.IComparer interface
[IComparer Methods]
IComparer.Compare
System.Collections.IDictionary interface
[IDictionary Methods]
IDictionary.Add
IDictionary.Clear
IDictionary.Contains
IDictionary.GetEnumerator
IDictionary.Remove
[IDictionary Properties]
IDictionary.IsFixedSize
IDictionary.IsReadOnly
IDictionary.Item
IDictionary.Keys
IDictionary.Values
System.Collections.IDictionaryEnumerator interface
[IDictionaryEnumerator Properties]
IDictionaryEnumerator.Entry
IDictionaryEnumerator.Key
IDictionaryEnumerator.Value
System.Collections.IEnumerable interface
[IEnumerable Methods]
IEnumerable.GetEnumerator
System.Collections.IEnumerator interface
[IEnumerator Methods]
IEnumerator.MoveNext
IEnumerator.Reset
[IEnumerator Properties]
IEnumerator.Current
System.Collections.IEqualityComparer interface
[IEqualityComparer Methods]
IEqualityComparer.Equals
IEqualityComparer.GetHashCode
System.Collections.IHashCodeProvider interface
[IHashCodeProvider Methods]
IHashCodeProvider.GetHashCode
System.Collections.IList interface
[IList Methods]
IList.Add
IList.Clear
IList.Contains
IList.IndexOf
IList.Insert
IList.Remove
IList.RemoveAt
[IList Properties]
IList.IsFixedSize
IList.IsReadOnly
IList.Item
System.Collections.Queue class
Queue.Queue
[Queue Methods]
Queue.Clear
Queue.Clone
Queue.Contains
Queue.CopyTo
Queue.Dequeue
Queue.Enqueue
Queue.GetEnumerator
Queue.Peek
Queue.ToArray
Queue.TrimToSize
[Queue Properties]
Queue.Count
Queue.IsSynchronized
Queue.SyncRoot
System.Collections.SortedList class
SortedList.SortedList
[SortedList Methods]
SortedList.Add
SortedList.Clear
SortedList.Clone
SortedList.Contains
SortedList.ContainsKey
SortedList.ContainsValue
SortedList.CopyTo
SortedList.GetByIndex
SortedList.GetEnumerator
SortedList.GetKey
SortedList.GetKeyList
SortedList.GetValueList
SortedList.IndexOfKey
SortedList.IndexOfValue
SortedList.Remove
SortedList.RemoveAt
SortedList.SetByIndex
SortedList.Synchronized
SortedList.TrimToSize
[SortedList Properties]
SortedList.Capacity
SortedList.Count
SortedList.IsFixedSize
SortedList.IsReadOnly
SortedList.IsSynchronized
SortedList.Item
SortedList.Keys
SortedList.SyncRoot
SortedList.Values
System.Collections.Stack class
Stack.Stack
[Stack Methods]
Stack.Clear
Stack.Clone
Stack.Contains
Stack.CopyTo
Stack.GetEnumerator
Stack.Peek
Stack.Pop
Stack.Push
Stack.Synchronized
Stack.ToArray
[Stack Properties]
Stack.Count
Stack.IsSynchronized
Stack.SyncRoot
System.Collections.Generic namespace
System.Collections.Generic.Comparer<T> class
Comparer<T>.Comparer<T>
[Comparer<T> Methods]
Comparer<T>.Compare
[Comparer<T> Properties]
Comparer<T>.Default
System.Collections.Generic.Dictionary<TKey><TValue> class
Dictionary<TKey><TValue>.Dictionary<TKey><TValue>
[Dictionary<TKey><TValue> Methods]
Dictionary<TKey><TValue>.Add
Dictionary<TKey><TValue>.Clear
Dictionary<TKey><TValue>.ContainsKey
Dictionary<TKey><TValue>.ContainsValue
Dictionary<TKey><TValue>.GetEnumerator
Dictionary<TKey><TValue>.Remove
Dictionary<TKey><TValue>.TryGetValue
[Dictionary<TKey><TValue> Properties]
Dictionary<TKey><TValue>.Comparer
Dictionary<TKey><TValue>.Count
Dictionary<TKey><TValue>.Item
Dictionary<TKey><TValue>.Keys
Dictionary<TKey><TValue>.Values
System.Collections.Generic.Dictionary<TKey><TValue>.Enumerator structure
[Dictionary<TKey><TValue>.Enumerator Methods]
Dictionary<TKey><TValue>.Enumerator.Dispose
Dictionary<TKey><TValue>.Enumerator.MoveNext
[Dictionary<TKey><TValue>.Enumerator Properties]
Dictionary<TKey><TValue>.Enumerator.Current
System.Collections.Generic.Dictionary<TKey><TValue>.KeyCollection class
Dictionary<TKey><TValue>.KeyCollection.Dictionary<TKey><TValue>.KeyCollection
[Dictionary<TKey><TValue>.KeyCollection Methods]
Dictionary<TKey><TValue>.KeyCollection.CopyTo
Dictionary<TKey><TValue>.KeyCollection.GetEnumerator
[Dictionary<TKey><TValue>.KeyCollection Properties]
Dictionary<TKey><TValue>.KeyCollection.Count
System.Collections.Generic.Dictionary<TKey><TValue>.KeyCollection.Enumerator structure
[Dictionary<TKey><TValue>.KeyCollection.Enumerator Methods]
Dictionary<TKey><TValue>.KeyCollection.Enumerator.Dispose
Dictionary<TKey><TValue>.KeyCollection.Enumerator.MoveNext
[Dictionary<TKey><TValue>.KeyCollection.Enumerator Properties]
Dictionary<TKey><TValue>.KeyCollection.Enumerator.Current
System.Collections.Generic.Dictionary<TKey><TValue>.ValueCollection class
Dictionary<TKey><TValue>.ValueCollection.Dictionary<TKey><TValue>.ValueCollection
[Dictionary<TKey><TValue>.ValueCollection Methods]
Dictionary<TKey><TValue>.ValueCollection.CopyTo
Dictionary<TKey><TValue>.ValueCollection.GetEnumerator
[Dictionary<TKey><TValue>.ValueCollection Properties]
Dictionary<TKey><TValue>.ValueCollection.Count
System.Collections.Generic.Dictionary<TKey><TValue>.ValueCollection.Enumerator structure
[Dictionary<TKey><TValue>.ValueCollection.Enumerator Methods]
Dictionary<TKey><TValue>.ValueCollection.Enumerator.Dispose
Dictionary<TKey><TValue>.ValueCollection.Enumerator.MoveNext
[Dictionary<TKey><TValue>.ValueCollection.Enumerator Properties]
Dictionary<TKey><TValue>.ValueCollection.Enumerator.Current
System.Collections.Generic.EqualityComparer<T> class
EqualityComparer<T>.EqualityComparer<T>
[EqualityComparer<T> Methods]
EqualityComparer<T>.Equals
EqualityComparer<T>.GetHashCode
[EqualityComparer<T> Properties]
EqualityComparer<T>.Default
System.Collections.Generic.ICollection<T> interface
[ICollection<T> Methods]
ICollection<T>.Add
ICollection<T>.Clear
ICollection<T>.Contains
ICollection<T>.CopyTo
ICollection<T>.Remove
[ICollection<T> Properties]
ICollection<T>.Count
ICollection<T>.IsReadOnly
System.Collections.Generic.IComparer<T> interface
[IComparer<T> Methods]
IComparer<T>.Compare
System.Collections.Generic.IDictionary<TKey><TValue> interface
[IDictionary<TKey><TValue> Methods]
IDictionary<TKey><TValue>.Add
IDictionary<TKey><TValue>.ContainsKey
IDictionary<TKey><TValue>.Remove
IDictionary<TKey><TValue>.TryGetValue
[IDictionary<TKey><TValue> Properties]
IDictionary<TKey><TValue>.Item
IDictionary<TKey><TValue>.Keys
IDictionary<TKey><TValue>.Values
System.Collections.Generic.IEnumerable<T> interface
[IEnumerable<T> Methods]
IEnumerable<T>.GetEnumerator
System.Collections.Generic.IEnumerator<T> interface
[IEnumerator<T> Properties]
IEnumerator<T>.Current
System.Collections.Generic.IEqualityComparer<T> interface
[IEqualityComparer<T> Methods]
IEqualityComparer<T>.Equals
IEqualityComparer<T>.GetHashCode
System.Collections.Generic.IList<T> interface
[IList<T> Methods]
IList<T>.IndexOf
IList<T>.Insert
IList<T>.RemoveAt
[IList<T> Properties]
IList<T>.Item
System.Collections.Generic.KeyNotFoundException class
KeyNotFoundException.KeyNotFoundException
System.Collections.Generic.KeyValuePair<TKey><TValue> structure
KeyValuePair<TKey><TValue>.KeyValuePair<TKey><TValue>
[KeyValuePair<TKey><TValue> Methods]
KeyValuePair<TKey><TValue>.ToString
[KeyValuePair<TKey><TValue> Properties]
KeyValuePair<TKey><TValue>.Key
KeyValuePair<TKey><TValue>.Value
System.Collections.Generic.LinkedList<T> class
LinkedList<T>.LinkedList<T>
[LinkedList<T> Methods]
LinkedList<T>.AddAfter
LinkedList<T>.AddBefore
LinkedList<T>.AddFirst
LinkedList<T>.AddLast
LinkedList<T>.Clear
LinkedList<T>.Contains
LinkedList<T>.CopyTo
LinkedList<T>.Find
LinkedList<T>.FindLast
LinkedList<T>.GetEnumerator
LinkedList<T>.Remove
LinkedList<T>.RemoveFirst
LinkedList<T>.RemoveLast
[LinkedList<T> Properties]
LinkedList<T>.Count
LinkedList<T>.First
LinkedList<T>.Last
System.Collections.Generic.LinkedList<T>.Enumerator structure
[LinkedList<T>.Enumerator Methods]
LinkedList<T>.Enumerator.Dispose
LinkedList<T>.Enumerator.MoveNext
[LinkedList<T>.Enumerator Properties]
LinkedList<T>.Enumerator.Current
System.Collections.Generic.LinkedListNode<T> class
LinkedListNode<T>.LinkedListNode<T>
[LinkedListNode<T> Properties]
LinkedListNode<T>.List
LinkedListNode<T>.Next
LinkedListNode<T>.Previous
LinkedListNode<T>.Value
System.Collections.Generic.List<T> class
List<T>.List<T>
[List<T> Methods]
List<T>.Add
List<T>.AddRange
List<T>.AsReadOnly
List<T>.BinarySearch
List<T>.Clear
List<T>.Contains
List<T>.ConvertAll<TOutput>
List<T>.CopyTo
List<T>.Exists
List<T>.Find
List<T>.FindAll
List<T>.FindIndex
List<T>.FindLast
List<T>.FindLastIndex
List<T>.ForEach
List<T>.GetEnumerator
List<T>.GetRange
List<T>.IndexOf
List<T>.Insert
List<T>.InsertRange
List<T>.LastIndexOf
List<T>.Remove
List<T>.RemoveAll
List<T>.RemoveAt
List<T>.RemoveRange
List<T>.Reverse
List<T>.Sort
List<T>.ToArray
List<T>.TrimExcess
List<T>.TrueForAll
[List<T> Properties]
List<T>.Capacity
List<T>.Count
List<T>.Item
System.Collections.Generic.List<T>.Enumerator structure
[List<T>.Enumerator Methods]
List<T>.Enumerator.Dispose
List<T>.Enumerator.MoveNext
[List<T>.Enumerator Properties]
List<T>.Enumerator.Current
System.Collections.Generic.Queue<T> class
Queue<T>.Queue<T>
[Queue<T> Methods]
Queue<T>.Clear
Queue<T>.Contains
Queue<T>.CopyTo
Queue<T>.Dequeue
Queue<T>.Enqueue
Queue<T>.GetEnumerator
Queue<T>.Peek
Queue<T>.ToArray
Queue<T>.TrimExcess
[Queue<T> Properties]
Queue<T>.Count
System.Collections.Generic.Queue<T>.Enumerator structure
[Queue<T>.Enumerator Methods]
Queue<T>.Enumerator.Dispose
Queue<T>.Enumerator.MoveNext
[Queue<T>.Enumerator Properties]
Queue<T>.Enumerator.Current
System.Collections.Generic.SortedList<TKey><TValue> class
SortedList<TKey><TValue>.SortedList<TKey><TValue>
[SortedList<TKey><TValue> Methods]
SortedList<TKey><TValue>.Add
SortedList<TKey><TValue>.Clear
SortedList<TKey><TValue>.ContainsKey
SortedList<TKey><TValue>.ContainsValue
SortedList<TKey><TValue>.GetEnumerator
SortedList<TKey><TValue>.IndexOfKey
SortedList<TKey><TValue>.IndexOfValue
SortedList<TKey><TValue>.Remove
SortedList<TKey><TValue>.RemoveAt
SortedList<TKey><TValue>.TrimExcess
SortedList<TKey><TValue>.TryGetValue
[SortedList<TKey><TValue> Properties]
SortedList<TKey><TValue>.Capacity
SortedList<TKey><TValue>.Comparer
SortedList<TKey><TValue>.Count
SortedList<TKey><TValue>.Item
SortedList<TKey><TValue>.Keys
SortedList<TKey><TValue>.Values
System.Collections.Generic.Stack<T> class
Stack<T>.Stack<T>
[Stack<T> Methods]
Stack<T>.Clear
Stack<T>.Contains
Stack<T>.CopyTo
Stack<T>.GetEnumerator
Stack<T>.Peek
Stack<T>.Pop
Stack<T>.Push
Stack<T>.ToArray
Stack<T>.TrimExcess
[Stack<T> Properties]
Stack<T>.Count
System.Collections.Generic.Stack<T>.Enumerator structure
[Stack<T>.Enumerator Methods]
Stack<T>.Enumerator.Dispose
Stack<T>.Enumerator.MoveNext
[Stack<T>.Enumerator Properties]
Stack<T>.Enumerator.Current
System.Collections.ObjectModel namespace
System.Collections.ObjectModel.Collection<T> class
Collection<T>.Collection<T>
[Collection<T> Methods]
Collection<T>.Add
Collection<T>.Clear
Collection<T>.ClearItems
Collection<T>.Contains
Collection<T>.CopyTo
Collection<T>.GetEnumerator
Collection<T>.IndexOf
Collection<T>.Insert
Collection<T>.InsertItem
Collection<T>.Remove
Collection<T>.RemoveAt
Collection<T>.RemoveItem
Collection<T>.SetItem
[Collection<T> Properties]
Collection<T>.Count
Collection<T>.Item
Collection<T>.Items
System.Collections.ObjectModel.KeyedCollection<TKey><TItem> class
KeyedCollection<TKey><TItem>.KeyedCollection<TKey><TItem>
[KeyedCollection<TKey><TItem> Methods]
KeyedCollection<TKey><TItem>.ChangeItemKey
KeyedCollection<TKey><TItem>.ClearItems
KeyedCollection<TKey><TItem>.Contains
KeyedCollection<TKey><TItem>.GetKeyForItem
KeyedCollection<TKey><TItem>.InsertItem
KeyedCollection<TKey><TItem>.Remove
KeyedCollection<TKey><TItem>.RemoveItem
KeyedCollection<TKey><TItem>.SetItem
[KeyedCollection<TKey><TItem> Properties]
KeyedCollection<TKey><TItem>.Comparer
KeyedCollection<TKey><TItem>.Dictionary
KeyedCollection<TKey><TItem>.Item
System.Collections.ObjectModel.ReadOnlyCollection<T> class
ReadOnlyCollection<T>.ReadOnlyCollection<T>
[ReadOnlyCollection<T> Methods]
ReadOnlyCollection<T>.Contains
ReadOnlyCollection<T>.CopyTo
ReadOnlyCollection<T>.GetEnumerator
ReadOnlyCollection<T>.IndexOf
[ReadOnlyCollection<T> Properties]
ReadOnlyCollection<T>.Count
ReadOnlyCollection<T>.Item
ReadOnlyCollection<T>.Items
System.Collections.Specialized namespace
System.Collections.Specialized.BitVector32 structure
BitVector32.BitVector32
[BitVector32 Methods]
BitVector32.CreateMask
BitVector32.CreateSection
BitVector32.Equals
BitVector32.GetHashCode
BitVector32.ToString
[BitVector32 Properties]
BitVector32.Data
BitVector32.Item
BitVector32.Item
System.Collections.Specialized.BitVector32.Section structure
[BitVector32.Section Methods]
BitVector32.Section.Equals
BitVector32.Section.GetHashCode
BitVector32.Section.op_Equality
BitVector32.Section.op_Inequality
BitVector32.Section.ToString
[BitVector32.Section Properties]
BitVector32.Section.Mask
BitVector32.Section.Offset
System.Collections.Specialized.HybridDictionary class
HybridDictionary.HybridDictionary
[HybridDictionary Methods]
HybridDictionary.Add
HybridDictionary.Clear
HybridDictionary.Contains
HybridDictionary.CopyTo
HybridDictionary.GetEnumerator
HybridDictionary.Remove
[HybridDictionary Properties]
HybridDictionary.Count
HybridDictionary.IsFixedSize
HybridDictionary.IsReadOnly
HybridDictionary.IsSynchronized
HybridDictionary.Item
HybridDictionary.Keys
HybridDictionary.SyncRoot
HybridDictionary.Values
System.Collections.Specialized.ListDictionary class
ListDictionary.ListDictionary
[ListDictionary Methods]
ListDictionary.Add
ListDictionary.Clear
ListDictionary.Contains
ListDictionary.CopyTo
ListDictionary.GetEnumerator
ListDictionary.Remove
[ListDictionary Properties]
ListDictionary.Count
ListDictionary.IsFixedSize
ListDictionary.IsReadOnly
ListDictionary.IsSynchronized
ListDictionary.Item
ListDictionary.Keys
ListDictionary.SyncRoot
ListDictionary.Values
System.Collections.Specialized.NameObjectCollectionBase class
NameObjectCollectionBase.NameObjectCollectionBase
[NameObjectCollectionBase Methods]
NameObjectCollectionBase.BaseAdd
NameObjectCollectionBase.BaseClear
NameObjectCollectionBase.BaseGet
NameObjectCollectionBase.BaseGetAllKeys
NameObjectCollectionBase.BaseGetKey
NameObjectCollectionBase.BaseHasKeys
NameObjectCollectionBase.BaseRemove
NameObjectCollectionBase.BaseRemoveAt
NameObjectCollectionBase.BaseSet
NameObjectCollectionBase.GetEnumerator
[NameObjectCollectionBase Properties]
NameObjectCollectionBase.Count
NameObjectCollectionBase.IsReadOnly
NameObjectCollectionBase.Keys
System.Collections.Specialized.NameObjectCollectionBase.KeysCollection class
[NameObjectCollectionBase.KeysCollection Methods]
NameObjectCollectionBase.KeysCollection.Get
NameObjectCollectionBase.KeysCollection.GetEnumerator
[NameObjectCollectionBase.KeysCollection Properties]
NameObjectCollectionBase.KeysCollection.Count
NameObjectCollectionBase.KeysCollection.Item
System.Collections.Specialized.NameValueCollection class
NameValueCollection.NameValueCollection
[NameValueCollection Methods]
NameValueCollection.Add
NameValueCollection.Clear
NameValueCollection.Get
NameValueCollection.GetKey
NameValueCollection.GetValues
NameValueCollection.HasKeys
NameValueCollection.InvalidateCachedArrays
NameValueCollection.Remove
NameValueCollection.Set
[NameValueCollection Properties]
NameValueCollection.AllKeys
NameValueCollection.Item
NameValueCollection.Item
System.Collections.Specialized.StringDictionary class
StringDictionary.StringDictionary
[StringDictionary Methods]
StringDictionary.Add
StringDictionary.Clear
StringDictionary.ContainsKey
StringDictionary.ContainsValue
StringDictionary.CopyTo
StringDictionary.GetEnumerator
StringDictionary.Remove
[StringDictionary Properties]
StringDictionary.Count
StringDictionary.IsSynchronized
StringDictionary.Item
StringDictionary.Keys
StringDictionary.SyncRoot
StringDictionary.Values
System.ComponentModel namespace
System.ComponentModel.AddingNewEventArgs class
AddingNewEventArgs.AddingNewEventArgs
[AddingNewEventArgs Properties]
AddingNewEventArgs.NewObject
System.ComponentModel.AddingNewEventHandler delegate
System.ComponentModel.AsyncCompletedEventArgs class
AsyncCompletedEventArgs.AsyncCompletedEventArgs
[AsyncCompletedEventArgs Methods]
AsyncCompletedEventArgs.RaiseExceptionIfNecessary
[AsyncCompletedEventArgs Properties]
AsyncCompletedEventArgs.Cancelled
AsyncCompletedEventArgs.Error
AsyncCompletedEventArgs.UserState
System.ComponentModel.AsyncCompletedEventHandler delegate
System.ComponentModel.AttributeCollection class
AttributeCollection.AttributeCollection
[AttributeCollection Fields]
AttributeCollection.Empty
[AttributeCollection Methods]
AttributeCollection.Contains
AttributeCollection.CopyTo
AttributeCollection.GetDefaultAttribute
AttributeCollection.GetEnumerator
AttributeCollection.Matches
[AttributeCollection Properties]
AttributeCollection.Count
AttributeCollection.Item
AttributeCollection.Item
System.ComponentModel.BindingList<T> class
BindingList<T>.BindingList<T>
[BindingList<T> Methods]
BindingList<T>.AddNew
BindingList<T>.AddNewCore
BindingList<T>.ApplySortCore
BindingList<T>.CancelNew
BindingList<T>.ClearItems
BindingList<T>.EndNew
BindingList<T>.FindCore
BindingList<T>.InsertItem
BindingList<T>.OnAddingNew
BindingList<T>.OnListChanged
BindingList<T>.RemoveItem
BindingList<T>.RemoveSortCore
BindingList<T>.ResetBindings
BindingList<T>.ResetItem
BindingList<T>.SetItem
[BindingList<T> Properties]
BindingList<T>.AllowEdit
BindingList<T>.AllowNew
BindingList<T>.AllowRemove
BindingList<T>.IsSortedCore
BindingList<T>.RaiseListChangedEvents
BindingList<T>.SortDirectionCore
BindingList<T>.SortPropertyCore
BindingList<T>.SupportsChangeNotificationCore
BindingList<T>.SupportsSearchingCore
BindingList<T>.SupportsSortingCore
[BindingList<T> Events]
BindingList<T>.AddingNew
BindingList<T>.ListChanged
System.ComponentModel.CancelEventArgs class
CancelEventArgs.CancelEventArgs
[CancelEventArgs Properties]
CancelEventArgs.Cancel
System.ComponentModel.CancelEventHandler delegate
System.ComponentModel.CollectionChangeAction enumeration
System.ComponentModel.CollectionChangeEventArgs class
CollectionChangeEventArgs.CollectionChangeEventArgs
[CollectionChangeEventArgs Properties]
CollectionChangeEventArgs.Action
CollectionChangeEventArgs.Element
System.ComponentModel.CollectionChangeEventHandler delegate
System.ComponentModel.Component class
Component.Component
[Component Methods]
Component.Dispose
Component.Finalize
[Component Properties]
Component.Events
Component.Site
[Component Events]
Component.Disposed
System.ComponentModel.ComponentResourceManager class
ComponentResourceManager.ComponentResourceManager
[ComponentResourceManager Methods]
ComponentResourceManager.ApplyResources
System.ComponentModel.Container class
Container.Container
[Container Methods]
Container.Add
Container.CreateSite
Container.Dispose
Container.GetService
Container.Remove
System.ComponentModel.DataObjectAttribute class
DataObjectAttribute.DataObjectAttribute
[DataObjectAttribute Fields]
DataObjectAttribute.DataObject
DataObjectAttribute.Default
DataObjectAttribute.NonDataObject
[DataObjectAttribute Methods]
DataObjectAttribute.Equals
DataObjectAttribute.GetHashCode
[DataObjectAttribute Properties]
DataObjectAttribute.IsDataObject
System.ComponentModel.DataObjectMethodAttribute class
DataObjectMethodAttribute.DataObjectMethodAttribute
[DataObjectMethodAttribute Methods]
DataObjectMethodAttribute.Equals
DataObjectMethodAttribute.GetHashCode
DataObjectMethodAttribute.Match
[DataObjectMethodAttribute Properties]
DataObjectMethodAttribute.IsDefault
DataObjectMethodAttribute.MethodType
System.ComponentModel.DataObjectMethodType enumeration
System.ComponentModel.DefaultValueAttribute class
DefaultValueAttribute.DefaultValueAttribute
[DefaultValueAttribute Methods]
DefaultValueAttribute.Equals
DefaultValueAttribute.GetHashCode
[DefaultValueAttribute Properties]
DefaultValueAttribute.Value
System.ComponentModel.DesignerCategoryAttribute class
DesignerCategoryAttribute.DesignerCategoryAttribute
[DesignerCategoryAttribute Fields]
DesignerCategoryAttribute.Component
DesignerCategoryAttribute.Default
DesignerCategoryAttribute.Form
DesignerCategoryAttribute.Generic
[DesignerCategoryAttribute Methods]
DesignerCategoryAttribute.Equals
DesignerCategoryAttribute.GetHashCode
[DesignerCategoryAttribute Properties]
DesignerCategoryAttribute.Category
System.ComponentModel.DesignTimeVisibleAttribute class
DesignTimeVisibleAttribute.DesignTimeVisibleAttribute
[DesignTimeVisibleAttribute Fields]
DesignTimeVisibleAttribute.Default
DesignTimeVisibleAttribute.No
DesignTimeVisibleAttribute.Yes
[DesignTimeVisibleAttribute Methods]
DesignTimeVisibleAttribute.Equals
DesignTimeVisibleAttribute.GetHashCode
[DesignTimeVisibleAttribute Properties]
DesignTimeVisibleAttribute.Visible
System.ComponentModel.EditorBrowsableAttribute class
EditorBrowsableAttribute.EditorBrowsableAttribute
[EditorBrowsableAttribute Methods]
EditorBrowsableAttribute.Equals
EditorBrowsableAttribute.GetHashCode
[EditorBrowsableAttribute Properties]
EditorBrowsableAttribute.State
System.ComponentModel.EditorBrowsableState enumeration
System.ComponentModel.EventDescriptor class
EventDescriptor.EventDescriptor
[EventDescriptor Methods]
EventDescriptor.AddEventHandler
EventDescriptor.RemoveEventHandler
[EventDescriptor Properties]
EventDescriptor.ComponentType
EventDescriptor.EventType
EventDescriptor.IsMulticast
System.ComponentModel.EventDescriptorCollection class
EventDescriptorCollection.EventDescriptorCollection
[EventDescriptorCollection Fields]
EventDescriptorCollection.Empty
[EventDescriptorCollection Methods]
EventDescriptorCollection.Add
EventDescriptorCollection.Clear
EventDescriptorCollection.Contains
EventDescriptorCollection.Find
EventDescriptorCollection.GetEnumerator
EventDescriptorCollection.IndexOf
EventDescriptorCollection.Insert
EventDescriptorCollection.Remove
EventDescriptorCollection.RemoveAt
[EventDescriptorCollection Properties]
EventDescriptorCollection.Count
EventDescriptorCollection.Item
EventDescriptorCollection.Item
System.ComponentModel.EventHandlerList class
EventHandlerList.EventHandlerList
[EventHandlerList Methods]
EventHandlerList.AddHandler
EventHandlerList.AddHandlers
EventHandlerList.Dispose
EventHandlerList.RemoveHandler
[EventHandlerList Properties]
EventHandlerList.Item
System.ComponentModel.IBindingList interface
[IBindingList Methods]
IBindingList.AddIndex
IBindingList.AddNew
IBindingList.ApplySort
IBindingList.Find
IBindingList.RemoveIndex
IBindingList.RemoveSort
[IBindingList Properties]
IBindingList.AllowEdit
IBindingList.AllowNew
IBindingList.AllowRemove
IBindingList.IsSorted
IBindingList.SortDirection
IBindingList.SortProperty
IBindingList.SupportsChangeNotification
IBindingList.SupportsSearching
IBindingList.SupportsSorting
[IBindingList Events]
IBindingList.ListChanged
System.ComponentModel.IBindingListView interface
[IBindingListView Methods]
IBindingListView.ApplySort
IBindingListView.RemoveFilter
[IBindingListView Properties]
IBindingListView.Filter
IBindingListView.SortDescriptions
IBindingListView.SupportsAdvancedSorting
IBindingListView.SupportsFiltering
System.ComponentModel.ICancelAddNew interface
[ICancelAddNew Methods]
ICancelAddNew.CancelNew
ICancelAddNew.EndNew
System.ComponentModel.IChangeTracking interface
[IChangeTracking Methods]
IChangeTracking.AcceptChanges
[IChangeTracking Properties]
IChangeTracking.IsChanged
System.ComponentModel.IComponent interface
[IComponent Properties]
IComponent.Site
[IComponent Events]
IComponent.Disposed
System.ComponentModel.IContainer interface
[IContainer Methods]
IContainer.Add
IContainer.Remove
System.ComponentModel.ICustomTypeDescriptor interface
[ICustomTypeDescriptor Methods]
ICustomTypeDescriptor.GetAttributes
ICustomTypeDescriptor.GetClassName
ICustomTypeDescriptor.GetComponentName
ICustomTypeDescriptor.GetConverter
ICustomTypeDescriptor.GetDefaultEvent
ICustomTypeDescriptor.GetDefaultProperty
ICustomTypeDescriptor.GetEditor
ICustomTypeDescriptor.GetEvents
ICustomTypeDescriptor.GetProperties
ICustomTypeDescriptor.GetPropertyOwner
System.ComponentModel.IDataErrorInfo interface
[IDataErrorInfo Properties]
IDataErrorInfo.Error
IDataErrorInfo.Item
System.ComponentModel.IEditableObject interface
[IEditableObject Methods]
IEditableObject.BeginEdit
IEditableObject.CancelEdit
IEditableObject.EndEdit
System.ComponentModel.IListSource interface
[IListSource Methods]
IListSource.GetList
[IListSource Properties]
IListSource.ContainsListCollection
System.ComponentModel.INotifyPropertyChanged interface
[INotifyPropertyChanged Events]
INotifyPropertyChanged.PropertyChanged
System.ComponentModel.IRaiseItemChangedEvents interface
[IRaiseItemChangedEvents Properties]
IRaiseItemChangedEvents.RaisesItemChangedEvents
System.ComponentModel.IRevertibleChangeTracking interface
[IRevertibleChangeTracking Methods]
IRevertibleChangeTracking.RejectChanges
System.ComponentModel.ISite interface
[ISite Properties]
ISite.Component
ISite.Container
ISite.DesignMode
ISite.Name
System.ComponentModel.ISupportInitialize interface
[ISupportInitialize Methods]
ISupportInitialize.BeginInit
ISupportInitialize.EndInit
System.ComponentModel.ISupportInitializeNotification interface
[ISupportInitializeNotification Properties]
ISupportInitializeNotification.IsInitialized
[ISupportInitializeNotification Events]
ISupportInitializeNotification.Initialized
System.ComponentModel.ITypedList interface
[ITypedList Methods]
ITypedList.GetItemProperties
ITypedList.GetListName
System.ComponentModel.ListChangedEventArgs class
ListChangedEventArgs.ListChangedEventArgs
[ListChangedEventArgs Properties]
ListChangedEventArgs.ListChangedType
ListChangedEventArgs.NewIndex
ListChangedEventArgs.OldIndex
System.ComponentModel.ListChangedEventHandler delegate
System.ComponentModel.ListChangedType enumeration
System.ComponentModel.ListSortDescription class
ListSortDescription.ListSortDescription
[ListSortDescription Properties]
ListSortDescription.PropertyDescriptor
ListSortDescription.SortDirection
System.ComponentModel.ListSortDescriptionCollection class
ListSortDescriptionCollection.ListSortDescriptionCollection
[ListSortDescriptionCollection Methods]
ListSortDescriptionCollection.Contains
ListSortDescriptionCollection.CopyTo
ListSortDescriptionCollection.IndexOf
[ListSortDescriptionCollection Properties]
ListSortDescriptionCollection.Count
ListSortDescriptionCollection.Item
System.ComponentModel.ListSortDirection enumeration
System.ComponentModel.MarshalByValueComponent class
MarshalByValueComponent.MarshalByValueComponent
[MarshalByValueComponent Methods]
MarshalByValueComponent.Dispose
MarshalByValueComponent.Finalize
MarshalByValueComponent.GetService
MarshalByValueComponent.ToString
[MarshalByValueComponent Properties]
MarshalByValueComponent.Container
MarshalByValueComponent.DesignMode
MarshalByValueComponent.Events
MarshalByValueComponent.Site
[MarshalByValueComponent Events]
MarshalByValueComponent.Disposed
System.ComponentModel.MemberDescriptor class
MemberDescriptor.MemberDescriptor
[MemberDescriptor Methods]
MemberDescriptor.CreateAttributeCollection
MemberDescriptor.FillAttributes
MemberDescriptor.FindMethod
MemberDescriptor.GetHashCode
[MemberDescriptor Properties]
MemberDescriptor.AttributeArray
MemberDescriptor.DisplayName
MemberDescriptor.Name
MemberDescriptor.NameHashCode
System.ComponentModel.PropertyChangedEventArgs class
PropertyChangedEventArgs.PropertyChangedEventArgs
[PropertyChangedEventArgs Properties]
PropertyChangedEventArgs.PropertyName
System.ComponentModel.PropertyChangedEventHandler delegate
System.ComponentModel.PropertyDescriptor class
PropertyDescriptor.PropertyDescriptor
[PropertyDescriptor Methods]
PropertyDescriptor.AddValueChanged
PropertyDescriptor.CanResetValue
PropertyDescriptor.GetValue
PropertyDescriptor.GetValueChangedHandler
PropertyDescriptor.OnValueChanged
PropertyDescriptor.RemoveValueChanged
PropertyDescriptor.ResetValue
PropertyDescriptor.SetValue
PropertyDescriptor.ShouldSerializeValue
[PropertyDescriptor Properties]
PropertyDescriptor.ComponentType
PropertyDescriptor.IsReadOnly
PropertyDescriptor.PropertyType
PropertyDescriptor.SupportsChangeEvents
System.ComponentModel.PropertyDescriptorCollection class
PropertyDescriptorCollection.PropertyDescriptorCollection
[PropertyDescriptorCollection Fields]
PropertyDescriptorCollection.Empty
[PropertyDescriptorCollection Methods]
PropertyDescriptorCollection.Add
PropertyDescriptorCollection.Clear
PropertyDescriptorCollection.Contains
PropertyDescriptorCollection.CopyTo
PropertyDescriptorCollection.Find
PropertyDescriptorCollection.GetEnumerator
PropertyDescriptorCollection.IndexOf
PropertyDescriptorCollection.Insert
PropertyDescriptorCollection.Remove
PropertyDescriptorCollection.RemoveAt
[PropertyDescriptorCollection Properties]
PropertyDescriptorCollection.Count
PropertyDescriptorCollection.Item
PropertyDescriptorCollection.Item
System.ComponentModel.TypeConverter class
TypeConverter.TypeConverter
System.ComponentModel.TypeDescriptor class
[TypeDescriptor Methods]
TypeDescriptor.GetEvents
TypeDescriptor.GetProperties
System.ComponentModel.Win32Exception class
Win32Exception.Win32Exception
[Win32Exception Properties]
Win32Exception.NativeErrorCode
System.Configuration.Assemblies namespace
System.Configuration.Assemblies.AssemblyHashAlgorithm enumeration
System.Configuration.Assemblies.AssemblyVersionCompatibility enumeration
System.Diagnostics namespace
System.Diagnostics.ConditionalAttribute class
ConditionalAttribute.ConditionalAttribute
[ConditionalAttribute Properties]
ConditionalAttribute.ConditionString
System.Diagnostics.Debug class
[Debug Methods]
Debug.Assert
Debug.Close
Debug.Fail
Debug.Flush
Debug.Write
Debug.WriteIf
Debug.WriteLine
Debug.WriteLineIf
[Debug Properties]
Debug.AutoFlush
Debug.IndentLevel
Debug.IndentSize
Debug.Listeners
System.Diagnostics.DebuggableAttribute class
DebuggableAttribute.DebuggableAttribute
System.Diagnostics.DebuggableAttribute.DebuggingModes enumeration
System.Diagnostics.Debugger class
Debugger.Debugger
[Debugger Methods]
Debugger.Break
Debugger.Launch
[Debugger Properties]
Debugger.IsAttached
System.Diagnostics.DebuggerHiddenAttribute class
DebuggerHiddenAttribute.DebuggerHiddenAttribute
System.Diagnostics.DebuggerNonUserCodeAttribute class
DebuggerNonUserCodeAttribute.DebuggerNonUserCodeAttribute
System.Diagnostics.DebuggerStepThroughAttribute class
DebuggerStepThroughAttribute.DebuggerStepThroughAttribute
System.Diagnostics.DefaultTraceListener class
DefaultTraceListener.DefaultTraceListener
[DefaultTraceListener Methods]
DefaultTraceListener.Fail
DefaultTraceListener.Write
DefaultTraceListener.WriteLine
System.Diagnostics.Stopwatch class
Stopwatch.Stopwatch
[Stopwatch Fields]
Stopwatch.Frequency
Stopwatch.IsHighResolution
[Stopwatch Methods]
Stopwatch.GetTimestamp
Stopwatch.Reset
Stopwatch.Start
Stopwatch.StartNew
Stopwatch.Stop
[Stopwatch Properties]
Stopwatch.Elapsed
Stopwatch.ElapsedMilliseconds
Stopwatch.ElapsedTicks
Stopwatch.IsRunning
System.Diagnostics.TextWriterTraceListener class
TextWriterTraceListener.TextWriterTraceListener
[TextWriterTraceListener Methods]
TextWriterTraceListener.Close
TextWriterTraceListener.Dispose
TextWriterTraceListener.Flush
TextWriterTraceListener.Write
TextWriterTraceListener.WriteLine
[TextWriterTraceListener Properties]
TextWriterTraceListener.Writer
System.Diagnostics.Trace class
[Trace Methods]
Trace.Assert
Trace.Close
Trace.Fail
Trace.Flush
Trace.Write
Trace.WriteIf
Trace.WriteLine
Trace.WriteLineIf
[Trace Properties]
Trace.AutoFlush
Trace.IndentLevel
Trace.IndentSize
Trace.Listeners
System.Diagnostics.TraceListener class
TraceListener.TraceListener
[TraceListener Methods]
TraceListener.Close
TraceListener.Dispose
TraceListener.Fail
TraceListener.Flush
TraceListener.Write
TraceListener.WriteIndent
TraceListener.WriteLine
[TraceListener Properties]
TraceListener.IndentLevel
TraceListener.IndentSize
TraceListener.Name
TraceListener.NeedIndent
System.Diagnostics.TraceListenerCollection class
[TraceListenerCollection Methods]
TraceListenerCollection.Add
TraceListenerCollection.Clear
TraceListenerCollection.Contains
TraceListenerCollection.CopyTo
TraceListenerCollection.GetEnumerator
TraceListenerCollection.IndexOf
TraceListenerCollection.Insert
TraceListenerCollection.Remove
TraceListenerCollection.RemoveAt
[TraceListenerCollection Properties]
TraceListenerCollection.Count
TraceListenerCollection.Item
TraceListenerCollection.Item
System.Diagnostics.CodeAnalysis namespace
System.Diagnostics.CodeAnalysis.SuppressMessageAttribute class
SuppressMessageAttribute.SuppressMessageAttribute
[SuppressMessageAttribute Properties]
SuppressMessageAttribute.Category
SuppressMessageAttribute.CheckId
SuppressMessageAttribute.Justification
SuppressMessageAttribute.MessageId
SuppressMessageAttribute.Scope
SuppressMessageAttribute.Target
System.Globalization namespace
System.Globalization.Calendar class
Calendar.Calendar
[Calendar Fields]
Calendar.CurrentEra
[Calendar Methods]
Calendar.AddDays
Calendar.AddHours
Calendar.AddMilliseconds
Calendar.AddMinutes
Calendar.AddMonths
Calendar.AddSeconds
Calendar.AddWeeks
Calendar.AddYears
Calendar.GetDayOfMonth
Calendar.GetDayOfWeek
Calendar.GetDayOfYear
Calendar.GetDaysInMonth
Calendar.GetDaysInYear
Calendar.GetEra
Calendar.GetHour
Calendar.GetMilliseconds
Calendar.GetMinute
Calendar.GetMonth
Calendar.GetMonthsInYear
Calendar.GetSecond
Calendar.GetWeekOfYear
Calendar.GetYear
Calendar.IsLeapDay
Calendar.IsLeapMonth
Calendar.IsLeapYear
Calendar.ToDateTime
Calendar.ToFourDigitYear
[Calendar Properties]
Calendar.Eras
Calendar.IsReadOnly
Calendar.MaxSupportedDateTime
Calendar.MinSupportedDateTime
Calendar.TwoDigitYearMax
System.Globalization.CalendarWeekRule enumeration
System.Globalization.CharUnicodeInfo class
[CharUnicodeInfo Methods]
CharUnicodeInfo.GetNumericValue
CharUnicodeInfo.GetUnicodeCategory
System.Globalization.CompareInfo class
[CompareInfo Methods]
CompareInfo.Compare
CompareInfo.Equals
CompareInfo.GetCompareInfo
CompareInfo.GetHashCode
CompareInfo.IndexOf
CompareInfo.IsPrefix
CompareInfo.IsSuffix
CompareInfo.LastIndexOf
CompareInfo.ToString
[CompareInfo Properties]
CompareInfo.LCID
CompareInfo.Name
System.Globalization.CompareOptions enumeration
System.Globalization.CultureInfo class
CultureInfo.CultureInfo
[CultureInfo Methods]
CultureInfo.ClearCachedData
CultureInfo.Clone
CultureInfo.CreateSpecificCulture
CultureInfo.Equals
CultureInfo.GetCultureInfo
CultureInfo.GetFormat
CultureInfo.GetHashCode
CultureInfo.ReadOnly
CultureInfo.ToString
[CultureInfo Properties]
CultureInfo.Calendar
CultureInfo.CompareInfo
CultureInfo.CurrentCulture
CultureInfo.CurrentUICulture
CultureInfo.DateTimeFormat
CultureInfo.EnglishName
CultureInfo.InvariantCulture
CultureInfo.IsNeutralCulture
CultureInfo.IsReadOnly
CultureInfo.LCID
CultureInfo.Name
CultureInfo.NativeName
CultureInfo.NumberFormat
CultureInfo.OptionalCalendars
CultureInfo.Parent
CultureInfo.TextInfo
CultureInfo.ThreeLetterISOLanguageName
CultureInfo.ThreeLetterWindowsLanguageName
CultureInfo.TwoLetterISOLanguageName
CultureInfo.UseUserOverride
System.Globalization.CultureTypes enumeration
System.Globalization.DateTimeFormatInfo class
DateTimeFormatInfo.DateTimeFormatInfo
[DateTimeFormatInfo Methods]
DateTimeFormatInfo.Clone
DateTimeFormatInfo.GetAbbreviatedDayName
DateTimeFormatInfo.GetAbbreviatedEraName
DateTimeFormatInfo.GetAbbreviatedMonthName
DateTimeFormatInfo.GetAllDateTimePatterns
DateTimeFormatInfo.GetDayName
DateTimeFormatInfo.GetEra
DateTimeFormatInfo.GetEraName
DateTimeFormatInfo.GetFormat
DateTimeFormatInfo.GetInstance
DateTimeFormatInfo.GetMonthName
DateTimeFormatInfo.ReadOnly
[DateTimeFormatInfo Properties]
DateTimeFormatInfo.AbbreviatedDayNames
DateTimeFormatInfo.AbbreviatedMonthGenitiveNames
DateTimeFormatInfo.AbbreviatedMonthNames
DateTimeFormatInfo.AMDesignator
DateTimeFormatInfo.Calendar
DateTimeFormatInfo.CalendarWeekRule
DateTimeFormatInfo.CurrentInfo
DateTimeFormatInfo.DateSeparator
DateTimeFormatInfo.DayNames
DateTimeFormatInfo.FirstDayOfWeek
DateTimeFormatInfo.FullDateTimePattern
DateTimeFormatInfo.InvariantInfo
DateTimeFormatInfo.IsReadOnly
DateTimeFormatInfo.LongDatePattern
DateTimeFormatInfo.LongTimePattern
DateTimeFormatInfo.MonthDayPattern
DateTimeFormatInfo.MonthGenitiveNames
DateTimeFormatInfo.MonthNames
DateTimeFormatInfo.PMDesignator
DateTimeFormatInfo.RFC1123Pattern
DateTimeFormatInfo.ShortDatePattern
DateTimeFormatInfo.ShortestDayNames
DateTimeFormatInfo.ShortTimePattern
DateTimeFormatInfo.SortableDateTimePattern
DateTimeFormatInfo.TimeSeparator
DateTimeFormatInfo.UniversalSortableDateTimePattern
DateTimeFormatInfo.YearMonthPattern
System.Globalization.DateTimeStyles enumeration
System.Globalization.DaylightTime class
DaylightTime.DaylightTime
[DaylightTime Properties]
DaylightTime.Delta
DaylightTime.End
DaylightTime.Start
System.Globalization.GregorianCalendar class
GregorianCalendar.GregorianCalendar
[GregorianCalendar Fields]
GregorianCalendar.ADEra
[GregorianCalendar Methods]
GregorianCalendar.AddMonths
GregorianCalendar.AddYears
GregorianCalendar.GetDayOfMonth
GregorianCalendar.GetDayOfWeek
GregorianCalendar.GetDayOfYear
GregorianCalendar.GetDaysInMonth
GregorianCalendar.GetDaysInYear
GregorianCalendar.GetEra
GregorianCalendar.GetMonth
GregorianCalendar.GetMonthsInYear
GregorianCalendar.GetWeekOfYear
GregorianCalendar.GetYear
GregorianCalendar.IsLeapDay
GregorianCalendar.IsLeapMonth
GregorianCalendar.IsLeapYear
GregorianCalendar.ToDateTime
GregorianCalendar.ToFourDigitYear
[GregorianCalendar Properties]
GregorianCalendar.CalendarType
GregorianCalendar.Eras
GregorianCalendar.MaxSupportedDateTime
GregorianCalendar.MinSupportedDateTime
GregorianCalendar.TwoDigitYearMax
System.Globalization.GregorianCalendarTypes enumeration
System.Globalization.JapaneseCalendar class
JapaneseCalendar.JapaneseCalendar
[JapaneseCalendar Methods]
JapaneseCalendar.AddMonths
JapaneseCalendar.AddYears
JapaneseCalendar.GetDayOfMonth
JapaneseCalendar.GetDayOfWeek
JapaneseCalendar.GetDayOfYear
JapaneseCalendar.GetDaysInMonth
JapaneseCalendar.GetDaysInYear
JapaneseCalendar.GetEra
JapaneseCalendar.GetMonth
JapaneseCalendar.GetMonthsInYear
JapaneseCalendar.GetWeekOfYear
JapaneseCalendar.GetYear
JapaneseCalendar.IsLeapDay
JapaneseCalendar.IsLeapMonth
JapaneseCalendar.IsLeapYear
JapaneseCalendar.ToDateTime
JapaneseCalendar.ToFourDigitYear
[JapaneseCalendar Properties]
JapaneseCalendar.Eras
JapaneseCalendar.MaxSupportedDateTime
JapaneseCalendar.MinSupportedDateTime
JapaneseCalendar.TwoDigitYearMax
System.Globalization.KoreanCalendar class
KoreanCalendar.KoreanCalendar
[KoreanCalendar Fields]
KoreanCalendar.KoreanEra
[KoreanCalendar Methods]
KoreanCalendar.AddMonths
KoreanCalendar.AddYears
KoreanCalendar.GetDayOfMonth
KoreanCalendar.GetDayOfWeek
KoreanCalendar.GetDayOfYear
KoreanCalendar.GetDaysInMonth
KoreanCalendar.GetDaysInYear
KoreanCalendar.GetEra
KoreanCalendar.GetMonth
KoreanCalendar.GetMonthsInYear
KoreanCalendar.GetWeekOfYear
KoreanCalendar.GetYear
KoreanCalendar.IsLeapDay
KoreanCalendar.IsLeapMonth
KoreanCalendar.IsLeapYear
KoreanCalendar.ToDateTime
KoreanCalendar.ToFourDigitYear
[KoreanCalendar Properties]
KoreanCalendar.Eras
KoreanCalendar.MaxSupportedDateTime
KoreanCalendar.MinSupportedDateTime
KoreanCalendar.TwoDigitYearMax
System.Globalization.NumberFormatInfo class
NumberFormatInfo.NumberFormatInfo
[NumberFormatInfo Methods]
NumberFormatInfo.Clone
NumberFormatInfo.GetFormat
NumberFormatInfo.GetInstance
NumberFormatInfo.ReadOnly
[NumberFormatInfo Properties]
NumberFormatInfo.CurrencyDecimalDigits
NumberFormatInfo.CurrencyDecimalSeparator
NumberFormatInfo.CurrencyGroupSeparator
NumberFormatInfo.CurrencyGroupSizes
NumberFormatInfo.CurrencyNegativePattern
NumberFormatInfo.CurrencyPositivePattern
NumberFormatInfo.CurrencySymbol
NumberFormatInfo.CurrentInfo
NumberFormatInfo.InvariantInfo
NumberFormatInfo.IsReadOnly
NumberFormatInfo.NaNSymbol
NumberFormatInfo.NegativeInfinitySymbol
NumberFormatInfo.NegativeSign
NumberFormatInfo.NumberDecimalDigits
NumberFormatInfo.NumberDecimalSeparator
NumberFormatInfo.NumberGroupSeparator
NumberFormatInfo.NumberGroupSizes
NumberFormatInfo.NumberNegativePattern
NumberFormatInfo.PercentDecimalDigits
NumberFormatInfo.PercentDecimalSeparator
NumberFormatInfo.PercentGroupSeparator
NumberFormatInfo.PercentGroupSizes
NumberFormatInfo.PercentNegativePattern
NumberFormatInfo.PercentPositivePattern
NumberFormatInfo.PercentSymbol
NumberFormatInfo.PerMilleSymbol
NumberFormatInfo.PositiveInfinitySymbol
NumberFormatInfo.PositiveSign
System.Globalization.NumberStyles enumeration
System.Globalization.RegionInfo class
RegionInfo.RegionInfo
[RegionInfo Methods]
RegionInfo.Equals
RegionInfo.GetHashCode
RegionInfo.ToString
[RegionInfo Properties]
RegionInfo.CurrencySymbol
RegionInfo.CurrentRegion
RegionInfo.EnglishName
RegionInfo.IsMetric
RegionInfo.ISOCurrencySymbol
RegionInfo.Name
RegionInfo.ThreeLetterISORegionName
RegionInfo.ThreeLetterWindowsRegionName
RegionInfo.TwoLetterISORegionName
System.Globalization.StringInfo class
StringInfo.StringInfo
[StringInfo Methods]
StringInfo.Equals
StringInfo.GetHashCode
StringInfo.GetNextTextElement
StringInfo.GetTextElementEnumerator
StringInfo.ParseCombiningCharacters
[StringInfo Properties]
StringInfo.LengthInTextElements
StringInfo.String
System.Globalization.TaiwanCalendar class
TaiwanCalendar.TaiwanCalendar
[TaiwanCalendar Methods]
TaiwanCalendar.AddMonths
TaiwanCalendar.AddYears
TaiwanCalendar.GetDayOfMonth
TaiwanCalendar.GetDayOfWeek
TaiwanCalendar.GetDayOfYear
TaiwanCalendar.GetDaysInMonth
TaiwanCalendar.GetDaysInYear
TaiwanCalendar.GetEra
TaiwanCalendar.GetMonth
TaiwanCalendar.GetMonthsInYear
TaiwanCalendar.GetWeekOfYear
TaiwanCalendar.GetYear
TaiwanCalendar.IsLeapDay
TaiwanCalendar.IsLeapMonth
TaiwanCalendar.IsLeapYear
TaiwanCalendar.ToDateTime
TaiwanCalendar.ToFourDigitYear
[TaiwanCalendar Properties]
TaiwanCalendar.Eras
TaiwanCalendar.MaxSupportedDateTime
TaiwanCalendar.MinSupportedDateTime
TaiwanCalendar.TwoDigitYearMax
System.Globalization.TextElementEnumerator class
[TextElementEnumerator Methods]
TextElementEnumerator.GetTextElement
TextElementEnumerator.MoveNext
TextElementEnumerator.Reset
[TextElementEnumerator Properties]
TextElementEnumerator.Current
TextElementEnumerator.ElementIndex
System.Globalization.TextInfo class
[TextInfo Methods]
TextInfo.Equals
TextInfo.GetHashCode
TextInfo.ToLower
TextInfo.ToString
TextInfo.ToTitleCase
TextInfo.ToUpper
[TextInfo Properties]
TextInfo.ANSICodePage
TextInfo.CultureName
TextInfo.IsReadOnly
TextInfo.ListSeparator
System.Globalization.ThaiBuddhistCalendar class
ThaiBuddhistCalendar.ThaiBuddhistCalendar
[ThaiBuddhistCalendar Fields]
ThaiBuddhistCalendar.ThaiBuddhistEra
[ThaiBuddhistCalendar Methods]
ThaiBuddhistCalendar.AddMonths
ThaiBuddhistCalendar.AddYears
ThaiBuddhistCalendar.GetDayOfMonth
ThaiBuddhistCalendar.GetDayOfWeek
ThaiBuddhistCalendar.GetDayOfYear
ThaiBuddhistCalendar.GetDaysInMonth
ThaiBuddhistCalendar.GetDaysInYear
ThaiBuddhistCalendar.GetEra
ThaiBuddhistCalendar.GetMonth
ThaiBuddhistCalendar.GetMonthsInYear
ThaiBuddhistCalendar.GetWeekOfYear
ThaiBuddhistCalendar.GetYear
ThaiBuddhistCalendar.IsLeapDay
ThaiBuddhistCalendar.IsLeapMonth
ThaiBuddhistCalendar.IsLeapYear
ThaiBuddhistCalendar.ToDateTime
ThaiBuddhistCalendar.ToFourDigitYear
[ThaiBuddhistCalendar Properties]
ThaiBuddhistCalendar.Eras
ThaiBuddhistCalendar.MaxSupportedDateTime
ThaiBuddhistCalendar.MinSupportedDateTime
ThaiBuddhistCalendar.TwoDigitYearMax
System.Globalization.UnicodeCategory enumeration
System.IO namespace
System.IO.BinaryReader class
BinaryReader.BinaryReader
[BinaryReader Methods]
BinaryReader.Close
BinaryReader.Dispose
BinaryReader.FillBuffer
BinaryReader.PeekChar
BinaryReader.Read
BinaryReader.Read7BitEncodedInt
BinaryReader.ReadBoolean
BinaryReader.ReadByte
BinaryReader.ReadBytes
BinaryReader.ReadChar
BinaryReader.ReadChars
BinaryReader.ReadDouble
BinaryReader.ReadInt16
BinaryReader.ReadInt32
BinaryReader.ReadInt64
BinaryReader.ReadSByte
BinaryReader.ReadSingle
BinaryReader.ReadString
BinaryReader.ReadUInt16
BinaryReader.ReadUInt32
BinaryReader.ReadUInt64
[BinaryReader Properties]
BinaryReader.BaseStream
System.IO.BinaryWriter class
BinaryWriter.BinaryWriter
[BinaryWriter Fields]
BinaryWriter.Null
BinaryWriter.OutStream
[BinaryWriter Methods]
BinaryWriter.Close
BinaryWriter.Dispose
BinaryWriter.Flush
BinaryWriter.Seek
BinaryWriter.Write
BinaryWriter.Write7BitEncodedInt
[BinaryWriter Properties]
BinaryWriter.BaseStream
System.IO.Directory class
[Directory Methods]
Directory.CreateDirectory
Directory.Delete
Directory.Exists
Directory.GetCreationTime
Directory.GetCurrentDirectory
Directory.GetDirectories
Directory.GetDirectoryRoot
Directory.GetFiles
Directory.GetFileSystemEntries
Directory.GetLastAccessTime
Directory.GetLastWriteTime
Directory.Move
Directory.SetCurrentDirectory
System.IO.DirectoryInfo class
DirectoryInfo.DirectoryInfo
[DirectoryInfo Methods]
DirectoryInfo.Create
DirectoryInfo.CreateSubdirectory
DirectoryInfo.Delete
DirectoryInfo.GetDirectories
DirectoryInfo.GetFiles
DirectoryInfo.GetFileSystemInfos
DirectoryInfo.MoveTo
DirectoryInfo.ToString
[DirectoryInfo Properties]
DirectoryInfo.Exists
DirectoryInfo.Name
DirectoryInfo.Parent
DirectoryInfo.Root
System.IO.DirectoryNotFoundException class
DirectoryNotFoundException.DirectoryNotFoundException
System.IO.EndOfStreamException class
EndOfStreamException.EndOfStreamException
System.IO.File class
[File Methods]
File.AppendText
File.Copy
File.Create
File.CreateText
File.Delete
File.Exists
File.GetCreationTime
File.GetLastAccessTime
File.GetLastWriteTime
File.Move
File.Open
File.OpenRead
File.OpenText
File.OpenWrite
System.IO.FileAccess enumeration
System.IO.FileAttributes enumeration
System.IO.FileInfo class
FileInfo.FileInfo
[FileInfo Methods]
FileInfo.AppendText
FileInfo.CopyTo
FileInfo.Create
FileInfo.CreateText
FileInfo.Delete
FileInfo.MoveTo
FileInfo.Open
FileInfo.OpenRead
FileInfo.OpenText
FileInfo.OpenWrite
FileInfo.ToString
[FileInfo Properties]
FileInfo.Directory
FileInfo.DirectoryName
FileInfo.Exists
FileInfo.Length
FileInfo.Name
System.IO.FileMode enumeration
System.IO.FileNotFoundException class
FileNotFoundException.FileNotFoundException
System.IO.FileShare enumeration
System.IO.FileStream class
FileStream.FileStream
[FileStream Methods]
FileStream.Dispose
FileStream.Finalize
FileStream.Flush
FileStream.Read
FileStream.ReadByte
FileStream.Seek
FileStream.SetLength
FileStream.Write
FileStream.WriteByte
[FileStream Properties]
FileStream.CanRead
FileStream.CanSeek
FileStream.CanWrite
FileStream.IsAsync
FileStream.Length
FileStream.Name
FileStream.Position
System.IO.FileSystemInfo class
FileSystemInfo.FileSystemInfo
[FileSystemInfo Fields]
FileSystemInfo.FullPath
FileSystemInfo.OriginalPath
[FileSystemInfo Methods]
FileSystemInfo.Delete
FileSystemInfo.Refresh
[FileSystemInfo Properties]
FileSystemInfo.Attributes
FileSystemInfo.CreationTime
FileSystemInfo.Exists
FileSystemInfo.Extension
FileSystemInfo.FullName
FileSystemInfo.LastAccessTime
FileSystemInfo.LastWriteTime
FileSystemInfo.Name
System.IO.IOException class
IOException.IOException
System.IO.MemoryStream class
MemoryStream.MemoryStream
[MemoryStream Methods]
MemoryStream.Dispose
MemoryStream.Flush
MemoryStream.GetBuffer
MemoryStream.Read
MemoryStream.ReadByte
MemoryStream.Seek
MemoryStream.SetLength
MemoryStream.ToArray
MemoryStream.Write
MemoryStream.WriteByte
MemoryStream.WriteTo
[MemoryStream Properties]
MemoryStream.CanRead
MemoryStream.CanSeek
MemoryStream.CanWrite
MemoryStream.Capacity
MemoryStream.Length
MemoryStream.Position
System.IO.Path class
[Path Fields]
Path.AltDirectorySeparatorChar
Path.DirectorySeparatorChar
Path.InvalidPathChars
Path.PathSeparator
Path.VolumeSeparatorChar
[Path Methods]
Path.ChangeExtension
Path.Combine
Path.GetDirectoryName
Path.GetExtension
Path.GetFileName
Path.GetFileNameWithoutExtension
Path.GetFullPath
Path.GetInvalidPathChars
Path.GetPathRoot
Path.HasExtension
Path.IsPathRooted
System.IO.PathTooLongException class
PathTooLongException.PathTooLongException
System.IO.SeekOrigin enumeration
System.IO.Stream class
Stream.Stream
[Stream Fields]
Stream.Null
[Stream Methods]
Stream.BeginRead
Stream.BeginWrite
Stream.Close
Stream.CreateWaitHandle
Stream.Dispose
Stream.EndRead
Stream.EndWrite
Stream.Flush
Stream.Read
Stream.ReadByte
Stream.Seek
Stream.SetLength
Stream.Write
Stream.WriteByte
[Stream Properties]
Stream.CanRead
Stream.CanSeek
Stream.CanTimeout
Stream.CanWrite
Stream.Length
Stream.Position
Stream.ReadTimeout
Stream.WriteTimeout
System.IO.StreamReader class
StreamReader.StreamReader
[StreamReader Fields]
StreamReader.Null
[StreamReader Methods]
StreamReader.Close
StreamReader.DiscardBufferedData
StreamReader.Dispose
StreamReader.Peek
StreamReader.Read
StreamReader.ReadLine
StreamReader.ReadToEnd
[StreamReader Properties]
StreamReader.BaseStream
StreamReader.CurrentEncoding
StreamReader.EndOfStream
System.IO.StreamWriter class
StreamWriter.StreamWriter
[StreamWriter Fields]
StreamWriter.Null
[StreamWriter Methods]
StreamWriter.Close
StreamWriter.Dispose
StreamWriter.Flush
StreamWriter.Write
[StreamWriter Properties]
StreamWriter.AutoFlush
StreamWriter.BaseStream
StreamWriter.Encoding
System.IO.StringReader class
StringReader.StringReader
[StringReader Methods]
StringReader.Close
StringReader.Dispose
StringReader.Peek
StringReader.Read
StringReader.ReadLine
StringReader.ReadToEnd
System.IO.StringWriter class
StringWriter.StringWriter
[StringWriter Methods]
StringWriter.Close
StringWriter.Dispose
StringWriter.GetStringBuilder
StringWriter.ToString
StringWriter.Write
[StringWriter Properties]
StringWriter.Encoding
System.IO.TextReader class
TextReader.TextReader
[TextReader Fields]
TextReader.Null
[TextReader Methods]
TextReader.Close
TextReader.Dispose
TextReader.Peek
TextReader.Read
TextReader.ReadBlock
TextReader.ReadLine
TextReader.ReadToEnd
TextReader.Synchronized
System.IO.TextWriter class
TextWriter.TextWriter
[TextWriter Fields]
TextWriter.CoreNewLine
TextWriter.Null
[TextWriter Methods]
TextWriter.Close
TextWriter.Dispose
TextWriter.Flush
TextWriter.Synchronized
TextWriter.Write
TextWriter.WriteLine
[TextWriter Properties]
TextWriter.Encoding
TextWriter.FormatProvider
TextWriter.NewLine
System.Net namespace
System.Net.ICredentials interface
[ICredentials Methods]
ICredentials.GetCredential
System.Net.NetworkCredential class
NetworkCredential.NetworkCredential
[NetworkCredential Methods]
NetworkCredential.GetCredential
[NetworkCredential Properties]
NetworkCredential.Domain
NetworkCredential.Password
NetworkCredential.UserName
System.Reflection namespace
System.Reflection.AmbiguousMatchException class
AmbiguousMatchException.AmbiguousMatchException
System.Reflection.Assembly class
[Assembly Methods]
Assembly.CreateInstance
Assembly.GetCallingAssembly
Assembly.GetCustomAttributes
Assembly.GetExecutingAssembly
Assembly.GetManifestResourceNames
Assembly.GetManifestResourceStream
Assembly.GetModules
Assembly.GetName
Assembly.GetSatelliteAssembly
Assembly.GetType
Assembly.GetTypes
Assembly.IsDefined
Assembly.Load
Assembly.LoadFrom
Assembly.ToString
[Assembly Properties]
Assembly.FullName
Assembly.ManifestModule
System.Reflection.AssemblyAlgorithmIdAttribute class
AssemblyAlgorithmIdAttribute.AssemblyAlgorithmIdAttribute
[AssemblyAlgorithmIdAttribute Properties]
AssemblyAlgorithmIdAttribute.AlgorithmId
System.Reflection.AssemblyCompanyAttribute class
AssemblyCompanyAttribute.AssemblyCompanyAttribute
[AssemblyCompanyAttribute Properties]
AssemblyCompanyAttribute.Company
System.Reflection.AssemblyConfigurationAttribute class
AssemblyConfigurationAttribute.AssemblyConfigurationAttribute
[AssemblyConfigurationAttribute Properties]
AssemblyConfigurationAttribute.Configuration
System.Reflection.AssemblyCopyrightAttribute class
AssemblyCopyrightAttribute.AssemblyCopyrightAttribute
[AssemblyCopyrightAttribute Properties]
AssemblyCopyrightAttribute.Copyright
System.Reflection.AssemblyCultureAttribute class
AssemblyCultureAttribute.AssemblyCultureAttribute
[AssemblyCultureAttribute Properties]
AssemblyCultureAttribute.Culture
System.Reflection.AssemblyDefaultAliasAttribute class
AssemblyDefaultAliasAttribute.AssemblyDefaultAliasAttribute
[AssemblyDefaultAliasAttribute Properties]
AssemblyDefaultAliasAttribute.DefaultAlias
System.Reflection.AssemblyDelaySignAttribute class
AssemblyDelaySignAttribute.AssemblyDelaySignAttribute
[AssemblyDelaySignAttribute Properties]
AssemblyDelaySignAttribute.DelaySign
System.Reflection.AssemblyDescriptionAttribute class
AssemblyDescriptionAttribute.AssemblyDescriptionAttribute
[AssemblyDescriptionAttribute Properties]
AssemblyDescriptionAttribute.Description
System.Reflection.AssemblyFlagsAttribute class
AssemblyFlagsAttribute.AssemblyFlagsAttribute
[AssemblyFlagsAttribute Properties]
AssemblyFlagsAttribute.AssemblyFlags
AssemblyFlagsAttribute.Flags
System.Reflection.AssemblyInformationalVersionAttribute class
AssemblyInformationalVersionAttribute.AssemblyInformationalVersionAttribute
[AssemblyInformationalVersionAttribute Properties]
AssemblyInformationalVersionAttribute.InformationalVersion
System.Reflection.AssemblyKeyFileAttribute class
AssemblyKeyFileAttribute.AssemblyKeyFileAttribute
[AssemblyKeyFileAttribute Properties]
AssemblyKeyFileAttribute.KeyFile
System.Reflection.AssemblyKeyNameAttribute class
AssemblyKeyNameAttribute.AssemblyKeyNameAttribute
[AssemblyKeyNameAttribute Properties]
AssemblyKeyNameAttribute.KeyName
System.Reflection.AssemblyName class
AssemblyName.AssemblyName
[AssemblyName Methods]
AssemblyName.Clone
AssemblyName.GetPublicKey
AssemblyName.GetPublicKeyToken
AssemblyName.SetPublicKey
AssemblyName.SetPublicKeyToken
AssemblyName.ToString
[AssemblyName Properties]
AssemblyName.CodeBase
AssemblyName.CultureInfo
AssemblyName.Flags
AssemblyName.FullName
AssemblyName.HashAlgorithm
AssemblyName.Name
AssemblyName.Version
AssemblyName.VersionCompatibility
System.Reflection.AssemblyNameFlags enumeration
System.Reflection.AssemblyProductAttribute class
AssemblyProductAttribute.AssemblyProductAttribute
[AssemblyProductAttribute Properties]
AssemblyProductAttribute.Product
System.Reflection.AssemblyTitleAttribute class
AssemblyTitleAttribute.AssemblyTitleAttribute
[AssemblyTitleAttribute Properties]
AssemblyTitleAttribute.Title
System.Reflection.AssemblyTrademarkAttribute class
AssemblyTrademarkAttribute.AssemblyTrademarkAttribute
[AssemblyTrademarkAttribute Properties]
AssemblyTrademarkAttribute.Trademark
System.Reflection.AssemblyVersionAttribute class
AssemblyVersionAttribute.AssemblyVersionAttribute
[AssemblyVersionAttribute Properties]
AssemblyVersionAttribute.Version
System.Reflection.Binder class
Binder.Binder
[Binder Methods]
Binder.BindToField
Binder.BindToMethod
Binder.ChangeType
Binder.ReorderArgumentArray
Binder.SelectMethod
Binder.SelectProperty
System.Reflection.BindingFlags enumeration
System.Reflection.CallingConventions enumeration
System.Reflection.ConstructorInfo class
ConstructorInfo.ConstructorInfo
[ConstructorInfo Fields]
ConstructorInfo.ConstructorName
ConstructorInfo.TypeConstructorName
[ConstructorInfo Methods]
ConstructorInfo.Invoke
[ConstructorInfo Properties]
ConstructorInfo.MemberType
System.Reflection.CustomAttributeFormatException class
CustomAttributeFormatException.CustomAttributeFormatException
System.Reflection.DefaultMemberAttribute class
DefaultMemberAttribute.DefaultMemberAttribute
[DefaultMemberAttribute Properties]
DefaultMemberAttribute.MemberName
System.Reflection.EventAttributes enumeration
System.Reflection.EventInfo class
EventInfo.EventInfo
[EventInfo Methods]
EventInfo.AddEventHandler
EventInfo.GetAddMethod
EventInfo.GetRaiseMethod
EventInfo.GetRemoveMethod
EventInfo.RemoveEventHandler
[EventInfo Properties]
EventInfo.Attributes
EventInfo.EventHandlerType
EventInfo.IsMulticast
EventInfo.IsSpecialName
EventInfo.MemberType
System.Reflection.FieldAttributes enumeration
System.Reflection.FieldInfo class
FieldInfo.FieldInfo
[FieldInfo Methods]
FieldInfo.GetFieldFromHandle
FieldInfo.GetValue
FieldInfo.SetValue
[FieldInfo Properties]
FieldInfo.Attributes
FieldInfo.FieldHandle
FieldInfo.FieldType
FieldInfo.IsAssembly
FieldInfo.IsFamily
FieldInfo.IsFamilyAndAssembly
FieldInfo.IsFamilyOrAssembly
FieldInfo.IsInitOnly
FieldInfo.IsLiteral
FieldInfo.IsNotSerialized
FieldInfo.IsPinvokeImpl
FieldInfo.IsPrivate
FieldInfo.IsPublic
FieldInfo.IsSpecialName
FieldInfo.IsStatic
FieldInfo.MemberType
System.Reflection.ICustomAttributeProvider interface
[ICustomAttributeProvider Methods]
ICustomAttributeProvider.GetCustomAttributes
ICustomAttributeProvider.IsDefined
System.Reflection.MemberInfo class
MemberInfo.MemberInfo
[MemberInfo Methods]
MemberInfo.GetCustomAttributes
MemberInfo.IsDefined
[MemberInfo Properties]
MemberInfo.DeclaringType
MemberInfo.MemberType
MemberInfo.Name
MemberInfo.ReflectedType
System.Reflection.MemberTypes enumeration
System.Reflection.MethodAttributes enumeration
System.Reflection.MethodBase class
MethodBase.MethodBase
[MethodBase Methods]
MethodBase.GetGenericArguments
MethodBase.GetMethodFromHandle
MethodBase.GetParameters
MethodBase.Invoke
[MethodBase Properties]
MethodBase.Attributes
MethodBase.CallingConvention
MethodBase.ContainsGenericParameters
MethodBase.IsAbstract
MethodBase.IsAssembly
MethodBase.IsConstructor
MethodBase.IsFamily
MethodBase.IsFamilyAndAssembly
MethodBase.IsFamilyOrAssembly
MethodBase.IsFinal
MethodBase.IsGenericMethod
MethodBase.IsGenericMethodDefinition
MethodBase.IsHideBySig
MethodBase.IsPrivate
MethodBase.IsPublic
MethodBase.IsSpecialName
MethodBase.IsStatic
MethodBase.IsVirtual
MethodBase.MethodHandle
System.Reflection.MethodImplAttributes enumeration
System.Reflection.MethodInfo class
MethodInfo.MethodInfo
[MethodInfo Methods]
MethodInfo.GetBaseDefinition
MethodInfo.GetGenericArguments
MethodInfo.GetGenericMethodDefinition
MethodInfo.MakeGenericMethod
[MethodInfo Properties]
MethodInfo.ContainsGenericParameters
MethodInfo.IsGenericMethod
MethodInfo.IsGenericMethodDefinition
MethodInfo.MemberType
MethodInfo.ReturnType
MethodInfo.ReturnTypeCustomAttributes
System.Reflection.Missing class
[Missing Fields]
Missing.Value
System.Reflection.Module class
[Module Methods]
Module.GetCustomAttributes
Module.GetType
Module.GetTypes
Module.IsDefined
Module.ToString
[Module Properties]
Module.Assembly
Module.FullyQualifiedName
Module.Name
System.Reflection.ParameterAttributes enumeration
System.Reflection.ParameterInfo class
ParameterInfo.ParameterInfo
[ParameterInfo Fields]
ParameterInfo.AttrsImpl
ParameterInfo.ClassImpl
ParameterInfo.DefaultValueImpl
ParameterInfo.MemberImpl
ParameterInfo.NameImpl
ParameterInfo.PositionImpl
[ParameterInfo Methods]
ParameterInfo.Equals
ParameterInfo.GetCustomAttributes
ParameterInfo.GetHashCode
ParameterInfo.IsDefined
[ParameterInfo Properties]
ParameterInfo.Attributes
ParameterInfo.DefaultValue
ParameterInfo.Member
ParameterInfo.Name
ParameterInfo.ParameterType
ParameterInfo.Position
System.Reflection.ParameterModifier structure
ParameterModifier.ParameterModifier
[ParameterModifier Properties]
ParameterModifier.Item
System.Reflection.PropertyAttributes enumeration
System.Reflection.PropertyInfo class
PropertyInfo.PropertyInfo
[PropertyInfo Methods]
PropertyInfo.GetAccessors
PropertyInfo.GetGetMethod
PropertyInfo.GetIndexParameters
PropertyInfo.GetSetMethod
PropertyInfo.GetValue
PropertyInfo.SetValue
[PropertyInfo Properties]
PropertyInfo.Attributes
PropertyInfo.CanRead
PropertyInfo.CanWrite
PropertyInfo.IsSpecialName
PropertyInfo.MemberType
PropertyInfo.PropertyType
System.Reflection.TargetInvocationException class
TargetInvocationException.TargetInvocationException
System.Reflection.TargetParameterCountException class
TargetParameterCountException.TargetParameterCountException
System.Reflection.TypeAttributes enumeration
System.Resources namespace
System.Resources.IResourceReader interface
[IResourceReader Methods]
IResourceReader.Close
IResourceReader.GetEnumerator
System.Resources.MissingManifestResourceException class
MissingManifestResourceException.MissingManifestResourceException
System.Resources.NeutralResourcesLanguageAttribute class
NeutralResourcesLanguageAttribute.NeutralResourcesLanguageAttribute
[NeutralResourcesLanguageAttribute Properties]
NeutralResourcesLanguageAttribute.CultureName
System.Resources.ResourceManager class
ResourceManager.ResourceManager
[ResourceManager Fields]
ResourceManager.BaseNameField
ResourceManager.HeaderVersionNumber
ResourceManager.MagicNumber
ResourceManager.MainAssembly
ResourceManager.ResourceSets
[ResourceManager Methods]
ResourceManager.CreateFileBasedResourceManager
ResourceManager.GetNeutralResourcesLanguage
ResourceManager.GetObject
ResourceManager.GetResourceFileName
ResourceManager.GetResourceSet
ResourceManager.GetSatelliteContractVersion
ResourceManager.GetString
ResourceManager.InternalGetResourceSet
ResourceManager.ReleaseAllResources
[ResourceManager Properties]
ResourceManager.BaseName
ResourceManager.IgnoreCase
ResourceManager.ResourceSetType
System.Resources.ResourceReader class
ResourceReader.ResourceReader
[ResourceReader Methods]
ResourceReader.Close
ResourceReader.GetEnumerator
System.Resources.ResourceSet class
ResourceSet.ResourceSet
[ResourceSet Fields]
ResourceSet.Reader
ResourceSet.Table
[ResourceSet Methods]
ResourceSet.Close
ResourceSet.Dispose
ResourceSet.GetDefaultReader
ResourceSet.GetEnumerator
ResourceSet.GetObject
ResourceSet.GetString
ResourceSet.ReadResources
System.Resources.SatelliteContractVersionAttribute class
SatelliteContractVersionAttribute.SatelliteContractVersionAttribute
[SatelliteContractVersionAttribute Properties]
SatelliteContractVersionAttribute.Version
System.Runtime.CompilerServices namespace
System.Runtime.CompilerServices.AccessedThroughPropertyAttribute class
AccessedThroughPropertyAttribute.AccessedThroughPropertyAttribute
[AccessedThroughPropertyAttribute Properties]
AccessedThroughPropertyAttribute.PropertyName
System.Runtime.CompilerServices.CompilerGeneratedAttribute class
CompilerGeneratedAttribute.CompilerGeneratedAttribute
System.Runtime.CompilerServices.CustomConstantAttribute class
CustomConstantAttribute.CustomConstantAttribute
[CustomConstantAttribute Properties]
CustomConstantAttribute.Value
System.Runtime.CompilerServices.DateTimeConstantAttribute class
DateTimeConstantAttribute.DateTimeConstantAttribute
[DateTimeConstantAttribute Properties]
DateTimeConstantAttribute.Value
System.Runtime.CompilerServices.DecimalConstantAttribute class
DecimalConstantAttribute.DecimalConstantAttribute
[DecimalConstantAttribute Properties]
DecimalConstantAttribute.Value
System.Runtime.CompilerServices.FixedBufferAttribute class
FixedBufferAttribute.FixedBufferAttribute
[FixedBufferAttribute Properties]
FixedBufferAttribute.ElementType
FixedBufferAttribute.Length
System.Runtime.CompilerServices.IndexerNameAttribute class
IndexerNameAttribute.IndexerNameAttribute
System.Runtime.CompilerServices.InternalsVisibleToAttribute class
InternalsVisibleToAttribute.InternalsVisibleToAttribute
[InternalsVisibleToAttribute Properties]
InternalsVisibleToAttribute.AssemblyName
System.Runtime.CompilerServices.IsVolatile class
System.Runtime.CompilerServices.MethodCodeType enumeration
System.Runtime.CompilerServices.MethodImplAttribute class
MethodImplAttribute.MethodImplAttribute
[MethodImplAttribute Fields]
MethodImplAttribute.MethodCodeType
[MethodImplAttribute Properties]
MethodImplAttribute.Value
System.Runtime.CompilerServices.MethodImplOptions enumeration
System.Runtime.CompilerServices.RuntimeHelpers class
[RuntimeHelpers Methods]
RuntimeHelpers.GetObjectValue
RuntimeHelpers.InitializeArray
[RuntimeHelpers Properties]
RuntimeHelpers.OffsetToStringData
System.Runtime.InteropServices namespace
System.Runtime.InteropServices.CallingConvention enumeration
System.Runtime.InteropServices.CharSet enumeration
System.Runtime.InteropServices.ComVisibleAttribute class
ComVisibleAttribute.ComVisibleAttribute
[ComVisibleAttribute Properties]
ComVisibleAttribute.Value
System.Runtime.InteropServices.DllImportAttribute class
DllImportAttribute.DllImportAttribute
[DllImportAttribute Fields]
DllImportAttribute.CallingConvention
DllImportAttribute.CharSet
DllImportAttribute.EntryPoint
DllImportAttribute.PreserveSig
DllImportAttribute.SetLastError
[DllImportAttribute Properties]
DllImportAttribute.Value
System.Runtime.InteropServices.ExternalException class
ExternalException.ExternalException
[ExternalException Properties]
ExternalException.ErrorCode
System.Runtime.InteropServices.FieldOffsetAttribute class
FieldOffsetAttribute.FieldOffsetAttribute
[FieldOffsetAttribute Properties]
FieldOffsetAttribute.Value
System.Runtime.InteropServices.GCHandle structure
[GCHandle Methods]
GCHandle.AddrOfPinnedObject
GCHandle.Alloc
GCHandle.Free
GCHandle.op_Explicit
[GCHandle Properties]
GCHandle.IsAllocated
GCHandle.Target
System.Runtime.InteropServices.GCHandleType enumeration
System.Runtime.InteropServices.GuidAttribute class
GuidAttribute.GuidAttribute
[GuidAttribute Properties]
GuidAttribute.Value
System.Runtime.InteropServices.InAttribute class
InAttribute.InAttribute
System.Runtime.InteropServices.LayoutKind enumeration
System.Runtime.InteropServices.Marshal class
[Marshal Fields]
Marshal.SystemDefaultCharSize
[Marshal Methods]
Marshal.Copy
Marshal.GetLastWin32Error
Marshal.Prelink
Marshal.PrelinkAll
Marshal.PtrToStringUni
Marshal.PtrToStructure
Marshal.ReadByte
Marshal.ReadInt16
Marshal.ReadInt32
Marshal.ReadInt64
Marshal.ReadIntPtr
Marshal.SizeOf
Marshal.StructureToPtr
Marshal.WriteByte
Marshal.WriteInt16
Marshal.WriteInt32
Marshal.WriteInt64
Marshal.WriteIntPtr
System.Runtime.InteropServices.MarshalAsAttribute class
MarshalAsAttribute.MarshalAsAttribute
[MarshalAsAttribute Fields]
MarshalAsAttribute.ArraySubType
MarshalAsAttribute.SizeConst
MarshalAsAttribute.SizeParamIndex
[MarshalAsAttribute Properties]
MarshalAsAttribute.Value
System.Runtime.InteropServices.MarshalDirectiveException class
MarshalDirectiveException.MarshalDirectiveException
System.Runtime.InteropServices.OutAttribute class
OutAttribute.OutAttribute
System.Runtime.InteropServices.PreserveSigAttribute class
PreserveSigAttribute.PreserveSigAttribute
System.Runtime.InteropServices.StructLayoutAttribute class
StructLayoutAttribute.StructLayoutAttribute
[StructLayoutAttribute Fields]
StructLayoutAttribute.CharSet
StructLayoutAttribute.Size
System.Runtime.InteropServices.UnmanagedType enumeration
System.Runtime.Serialization namespace
System.Runtime.Serialization.SerializationException class
SerializationException.SerializationException
System.Security namespace
System.Security.SecurityException class
SecurityException.SecurityException
System.Security.VerificationException class
VerificationException.VerificationException
System.Security.Permissions namespace
System.Security.Permissions.SecurityAction enumeration
System.Security.Policy namespace
System.Security.Policy.Evidence class
Evidence.Evidence
[Evidence Methods]
Evidence.CopyTo
Evidence.GetEnumerator
[Evidence Properties]
Evidence.Count
Evidence.IsSynchronized
Evidence.SyncRoot
System.Text namespace
System.Text.ASCIIEncoding class
ASCIIEncoding.ASCIIEncoding
[ASCIIEncoding Methods]
ASCIIEncoding.GetByteCount
ASCIIEncoding.GetBytes
ASCIIEncoding.GetCharCount
ASCIIEncoding.GetChars
ASCIIEncoding.GetMaxByteCount
ASCIIEncoding.GetMaxCharCount
System.Text.Decoder class
Decoder.Decoder
[Decoder Methods]
Decoder.Convert
Decoder.GetCharCount
Decoder.GetChars
Decoder.Reset
System.Text.Encoder class
Encoder.Encoder
[Encoder Methods]
Encoder.Convert
Encoder.GetByteCount
Encoder.GetBytes
System.Text.Encoding class
Encoding.Encoding
[Encoding Methods]
Encoding.Clone
Encoding.Convert
Encoding.Equals
Encoding.GetByteCount
Encoding.GetBytes
Encoding.GetCharCount
Encoding.GetChars
Encoding.GetDecoder
Encoding.GetEncoder
Encoding.GetEncoding
Encoding.GetHashCode
Encoding.GetMaxByteCount
Encoding.GetMaxCharCount
Encoding.GetPreamble
Encoding.GetString
[Encoding Properties]
Encoding.ASCII
Encoding.BigEndianUnicode
Encoding.CodePage
Encoding.Default
Encoding.Unicode
Encoding.UTF7
Encoding.UTF8
Encoding.WebName
System.Text.StringBuilder class
StringBuilder.StringBuilder
[StringBuilder Methods]
StringBuilder.Append
StringBuilder.AppendFormat
StringBuilder.AppendLine
StringBuilder.EnsureCapacity
StringBuilder.Equals
StringBuilder.Insert
StringBuilder.Remove
StringBuilder.Replace
StringBuilder.ToString
[StringBuilder Properties]
StringBuilder.Capacity
StringBuilder.Chars
StringBuilder.Length
System.Text.UnicodeEncoding class
UnicodeEncoding.UnicodeEncoding
[UnicodeEncoding Fields]
UnicodeEncoding.CharSize
[UnicodeEncoding Methods]
UnicodeEncoding.Equals
UnicodeEncoding.GetByteCount
UnicodeEncoding.GetBytes
UnicodeEncoding.GetCharCount
UnicodeEncoding.GetChars
UnicodeEncoding.GetDecoder
UnicodeEncoding.GetHashCode
UnicodeEncoding.GetMaxByteCount
UnicodeEncoding.GetMaxCharCount
UnicodeEncoding.GetPreamble
System.Text.UTF7Encoding class
UTF7Encoding.UTF7Encoding
[UTF7Encoding Methods]
UTF7Encoding.Equals
UTF7Encoding.GetByteCount
UTF7Encoding.GetBytes
UTF7Encoding.GetCharCount
UTF7Encoding.GetChars
UTF7Encoding.GetDecoder
UTF7Encoding.GetEncoder
UTF7Encoding.GetHashCode
UTF7Encoding.GetMaxByteCount
UTF7Encoding.GetMaxCharCount
System.Text.UTF8Encoding class
UTF8Encoding.UTF8Encoding
[UTF8Encoding Methods]
UTF8Encoding.Equals
UTF8Encoding.GetByteCount
UTF8Encoding.GetBytes
UTF8Encoding.GetCharCount
UTF8Encoding.GetChars
UTF8Encoding.GetDecoder
UTF8Encoding.GetEncoder
UTF8Encoding.GetHashCode
UTF8Encoding.GetMaxByteCount
UTF8Encoding.GetMaxCharCount
UTF8Encoding.GetPreamble
System.Text.RegularExpressions namespace
System.Text.RegularExpressions.Capture class
[Capture Methods]
Capture.ToString
[Capture Properties]
Capture.Index
Capture.Length
Capture.Value
System.Text.RegularExpressions.CaptureCollection class
[CaptureCollection Methods]
CaptureCollection.CopyTo
CaptureCollection.GetEnumerator
[CaptureCollection Properties]
CaptureCollection.Count
CaptureCollection.IsReadOnly
CaptureCollection.IsSynchronized
CaptureCollection.Item
CaptureCollection.SyncRoot
System.Text.RegularExpressions.Group class
[Group Methods]
Group.Synchronized
[Group Properties]
Group.Captures
Group.Success
System.Text.RegularExpressions.GroupCollection class
[GroupCollection Methods]
GroupCollection.CopyTo
GroupCollection.GetEnumerator
[GroupCollection Properties]
GroupCollection.Count
GroupCollection.IsReadOnly
GroupCollection.IsSynchronized
GroupCollection.Item
GroupCollection.Item
GroupCollection.SyncRoot
System.Text.RegularExpressions.Match class
[Match Methods]
Match.NextMatch
Match.Result
Match.Synchronized
[Match Properties]
Match.Empty
Match.Groups
System.Text.RegularExpressions.MatchCollection class
[MatchCollection Methods]
MatchCollection.CopyTo
MatchCollection.GetEnumerator
[MatchCollection Properties]
MatchCollection.Count
MatchCollection.IsReadOnly
MatchCollection.IsSynchronized
MatchCollection.Item
MatchCollection.SyncRoot
System.Text.RegularExpressions.MatchEvaluator delegate
System.Text.RegularExpressions.Regex class
Regex.Regex
[Regex Fields]
Regex.capnames
Regex.caps
Regex.capsize
Regex.capslist
Regex.pattern
Regex.roptions
[Regex Methods]
Regex.Escape
Regex.GetGroupNames
Regex.GetGroupNumbers
Regex.GroupNameFromNumber
Regex.GroupNumberFromName
Regex.IsMatch
Regex.Match
Regex.Matches
Regex.Replace
Regex.Split
Regex.ToString
Regex.Unescape
Regex.UseOptionC
Regex.UseOptionR
[Regex Properties]
Regex.Options
Regex.RightToLeft
System.Text.RegularExpressions.RegexOptions enumeration
System.Text.RegularExpressions.RegexRunner class
RegexRunner.RegexRunner
[RegexRunner Fields]
RegexRunner.runcrawl
RegexRunner.runcrawlpos
RegexRunner.runmatch
RegexRunner.runregex
RegexRunner.runstack
RegexRunner.runstackpos
RegexRunner.runtext
RegexRunner.runtextbeg
RegexRunner.runtextend
RegexRunner.runtextpos
RegexRunner.runtextstart
RegexRunner.runtrack
RegexRunner.runtrackcount
RegexRunner.runtrackpos
[RegexRunner Methods]
RegexRunner.Capture
RegexRunner.CharInClass
RegexRunner.CharInSet
RegexRunner.Crawl
RegexRunner.Crawlpos
RegexRunner.DoubleCrawl
RegexRunner.DoubleStack
RegexRunner.DoubleTrack
RegexRunner.EnsureStorage
RegexRunner.FindFirstChar
RegexRunner.Go
RegexRunner.InitTrackCount
RegexRunner.IsBoundary
RegexRunner.IsECMABoundary
RegexRunner.IsMatched
RegexRunner.MatchIndex
RegexRunner.MatchLength
RegexRunner.Popcrawl
RegexRunner.Scan
RegexRunner.TransferCapture
RegexRunner.Uncapture
System.Text.RegularExpressions.RegexRunnerFactory class
RegexRunnerFactory.RegexRunnerFactory
[RegexRunnerFactory Methods]
RegexRunnerFactory.CreateInstance
System.Threading namespace
System.Threading.AutoResetEvent class
AutoResetEvent.AutoResetEvent
System.Threading.EventResetMode enumeration
System.Threading.EventWaitHandle class
EventWaitHandle.EventWaitHandle
[EventWaitHandle Methods]
EventWaitHandle.Close
EventWaitHandle.Finalize
EventWaitHandle.Reset
EventWaitHandle.Set
EventWaitHandle.WaitOne
System.Threading.Interlocked class
[Interlocked Methods]
Interlocked.CompareExchange
Interlocked.Decrement
Interlocked.Exchange
Interlocked.Increment
System.Threading.ManualResetEvent class
ManualResetEvent.ManualResetEvent
System.Threading.Monitor class
[Monitor Methods]
Monitor.Enter
Monitor.Exit
Monitor.TryEnter
System.Threading.Mutex class
Mutex.Mutex
[Mutex Methods]
Mutex.Close
Mutex.ReleaseMutex
Mutex.WaitOne
System.Threading.Thread class
Thread.Thread
[Thread Methods]
Thread.Abort
Thread.AllocateDataSlot
Thread.AllocateNamedDataSlot
Thread.FreeNamedDataSlot
Thread.GetData
Thread.GetDomain
Thread.GetNamedDataSlot
Thread.Join
Thread.MemoryBarrier
Thread.SetData
Thread.SetProcessorAffinity
Thread.Sleep
Thread.Start
[Thread Properties]
Thread.CurrentThread
Thread.IsBackground
Thread.ManagedThreadId
Thread.Name
Thread.Priority
System.Threading.ThreadAbortException class
[ThreadAbortException Properties]
ThreadAbortException.ExceptionState
System.Threading.ThreadPool class
[ThreadPool Methods]
ThreadPool.GetMaxThreads
ThreadPool.QueueUserWorkItem
ThreadPool.SetMaxThreads
System.Threading.ThreadPriority enumeration
System.Threading.ThreadStart delegate
System.Threading.ThreadStateException class
ThreadStateException.ThreadStateException
System.Threading.Timeout class
[Timeout Fields]
Timeout.Infinite
System.Threading.Timer class
Timer.Timer
[Timer Methods]
Timer.Change
Timer.Dispose
System.Threading.TimerCallback delegate
System.Threading.WaitCallback delegate
System.Threading.WaitHandle class
WaitHandle.WaitHandle
[WaitHandle Fields]
WaitHandle.InvalidHandle
[WaitHandle Methods]
WaitHandle.Close
WaitHandle.Dispose
WaitHandle.WaitOne
[WaitHandle Properties]
WaitHandle.Handle
System.Xml namespace
System.Xml.ConformanceLevel enumeration
System.Xml.EntityHandling enumeration
System.Xml.Formatting enumeration
System.Xml.IHasXmlNode interface
[IHasXmlNode Methods]
IHasXmlNode.GetNode
System.Xml.IXmlLineInfo interface
[IXmlLineInfo Methods]
IXmlLineInfo.HasLineInfo
[IXmlLineInfo Properties]
IXmlLineInfo.LineNumber
IXmlLineInfo.LinePosition
System.Xml.IXmlNamespaceResolver interface
[IXmlNamespaceResolver Methods]
IXmlNamespaceResolver.GetNamespacesInScope
IXmlNamespaceResolver.LookupNamespace
IXmlNamespaceResolver.LookupPrefix
System.Xml.NameTable class
NameTable.NameTable
[NameTable Methods]
NameTable.Add
NameTable.Get
System.Xml.NewLineHandling enumeration
System.Xml.ReadState enumeration
System.Xml.ValidationType enumeration
System.Xml.WhitespaceHandling enumeration
System.Xml.WriteState enumeration
System.Xml.XmlAttribute class
XmlAttribute.XmlAttribute
[XmlAttribute Methods]
XmlAttribute.AppendChild
XmlAttribute.CloneNode
XmlAttribute.InsertAfter
XmlAttribute.InsertBefore
XmlAttribute.PrependChild
XmlAttribute.RemoveChild
XmlAttribute.ReplaceChild
XmlAttribute.WriteContentTo
XmlAttribute.WriteTo
[XmlAttribute Properties]
XmlAttribute.BaseURI
XmlAttribute.InnerText
XmlAttribute.InnerXml
XmlAttribute.LocalName
XmlAttribute.Name
XmlAttribute.NamespaceURI
XmlAttribute.NodeType
XmlAttribute.OwnerDocument
XmlAttribute.OwnerElement
XmlAttribute.ParentNode
XmlAttribute.Prefix
XmlAttribute.SchemaInfo
XmlAttribute.Specified
XmlAttribute.Value
System.Xml.XmlAttributeCollection class
[XmlAttributeCollection Methods]
XmlAttributeCollection.Append
XmlAttributeCollection.CopyTo
XmlAttributeCollection.InsertAfter
XmlAttributeCollection.InsertBefore
XmlAttributeCollection.Prepend
XmlAttributeCollection.Remove
XmlAttributeCollection.RemoveAll
XmlAttributeCollection.RemoveAt
XmlAttributeCollection.SetNamedItem
[XmlAttributeCollection Properties]
XmlAttributeCollection.ItemOf
XmlAttributeCollection.ItemOf
XmlAttributeCollection.ItemOf
System.Xml.XmlCDataSection class
XmlCDataSection.XmlCDataSection
[XmlCDataSection Methods]
XmlCDataSection.CloneNode
XmlCDataSection.WriteContentTo
XmlCDataSection.WriteTo
[XmlCDataSection Properties]
XmlCDataSection.LocalName
XmlCDataSection.Name
XmlCDataSection.NodeType
XmlCDataSection.ParentNode
System.Xml.XmlCharacterData class
XmlCharacterData.XmlCharacterData
[XmlCharacterData Methods]
XmlCharacterData.AppendData
XmlCharacterData.DeleteData
XmlCharacterData.InsertData
XmlCharacterData.ReplaceData
XmlCharacterData.Substring
[XmlCharacterData Properties]
XmlCharacterData.Data
XmlCharacterData.InnerText
XmlCharacterData.Length
XmlCharacterData.Value
System.Xml.XmlComment class
XmlComment.XmlComment
[XmlComment Methods]
XmlComment.CloneNode
XmlComment.WriteContentTo
XmlComment.WriteTo
[XmlComment Properties]
XmlComment.LocalName
XmlComment.Name
XmlComment.NodeType
System.Xml.XmlConvert class
XmlConvert.XmlConvert
[XmlConvert Methods]
XmlConvert.DecodeName
XmlConvert.EncodeLocalName
XmlConvert.EncodeName
XmlConvert.EncodeNmToken
XmlConvert.FromBinHexString
XmlConvert.ToBinHexString
XmlConvert.ToBoolean
XmlConvert.ToByte
XmlConvert.ToChar
XmlConvert.ToDateTime
XmlConvert.ToDecimal
XmlConvert.ToDouble
XmlConvert.ToGuid
XmlConvert.ToInt16
XmlConvert.ToInt32
XmlConvert.ToInt64
XmlConvert.ToSByte
XmlConvert.ToSingle
XmlConvert.ToString
XmlConvert.ToTimeSpan
XmlConvert.ToUInt16
XmlConvert.ToUInt32
XmlConvert.ToUInt64
XmlConvert.VerifyName
XmlConvert.VerifyNCName
XmlConvert.VerifyNMTOKEN
XmlConvert.VerifyTOKEN
System.Xml.XmlDateTimeSerializationMode enumeration
System.Xml.XmlDeclaration class
XmlDeclaration.XmlDeclaration
[XmlDeclaration Methods]
XmlDeclaration.CloneNode
XmlDeclaration.WriteContentTo
XmlDeclaration.WriteTo
[XmlDeclaration Properties]
XmlDeclaration.Encoding
XmlDeclaration.InnerText
XmlDeclaration.LocalName
XmlDeclaration.Name
XmlDeclaration.NodeType
XmlDeclaration.Standalone
XmlDeclaration.Value
XmlDeclaration.Version
System.Xml.XmlDocument class
XmlDocument.XmlDocument
[XmlDocument Methods]
XmlDocument.CloneNode
XmlDocument.CreateAttribute
XmlDocument.CreateCDataSection
XmlDocument.CreateComment
XmlDocument.CreateDefaultAttribute
XmlDocument.CreateDocumentFragment
XmlDocument.CreateElement
XmlDocument.CreateEntityReference
XmlDocument.CreateNode
XmlDocument.CreateProcessingInstruction
XmlDocument.CreateSignificantWhitespace
XmlDocument.CreateTextNode
XmlDocument.CreateWhitespace
XmlDocument.CreateXmlDeclaration
XmlDocument.GetElementsByTagName
XmlDocument.ImportNode
XmlDocument.Load
XmlDocument.LoadXml
XmlDocument.ReadNode
XmlDocument.Save
XmlDocument.Validate
XmlDocument.WriteContentTo
XmlDocument.WriteTo
[XmlDocument Properties]
XmlDocument.BaseURI
XmlDocument.DocumentElement
XmlDocument.Implementation
XmlDocument.InnerXml
XmlDocument.IsReadOnly
XmlDocument.LocalName
XmlDocument.Name
XmlDocument.NameTable
XmlDocument.NodeType
XmlDocument.OwnerDocument
XmlDocument.ParentNode
XmlDocument.PreserveWhitespace
XmlDocument.SchemaInfo
XmlDocument.Schemas
XmlDocument.XmlResolver
[XmlDocument Events]
XmlDocument.NodeChanged
XmlDocument.NodeChanging
XmlDocument.NodeInserted
XmlDocument.NodeInserting
XmlDocument.NodeRemoved
XmlDocument.NodeRemoving
System.Xml.XmlDocumentFragment class
XmlDocumentFragment.XmlDocumentFragment
[XmlDocumentFragment Methods]
XmlDocumentFragment.CloneNode
XmlDocumentFragment.WriteContentTo
XmlDocumentFragment.WriteTo
[XmlDocumentFragment Properties]
XmlDocumentFragment.InnerXml
XmlDocumentFragment.LocalName
XmlDocumentFragment.Name
XmlDocumentFragment.NodeType
XmlDocumentFragment.OwnerDocument
XmlDocumentFragment.ParentNode
System.Xml.XmlElement class
XmlElement.XmlElement
[XmlElement Methods]
XmlElement.CloneNode
XmlElement.GetAttribute
XmlElement.GetAttributeNode
XmlElement.GetElementsByTagName
XmlElement.HasAttribute
XmlElement.RemoveAll
XmlElement.RemoveAllAttributes
XmlElement.RemoveAttribute
XmlElement.RemoveAttributeAt
XmlElement.RemoveAttributeNode
XmlElement.SetAttribute
XmlElement.SetAttributeNode
XmlElement.WriteContentTo
XmlElement.WriteTo
[XmlElement Properties]
XmlElement.Attributes
XmlElement.HasAttributes
XmlElement.InnerText
XmlElement.InnerXml
XmlElement.IsEmpty
XmlElement.LocalName
XmlElement.Name
XmlElement.NamespaceURI
XmlElement.NextSibling
XmlElement.NodeType
XmlElement.OwnerDocument
XmlElement.ParentNode
XmlElement.Prefix
XmlElement.SchemaInfo
System.Xml.XmlEntityReference class
XmlEntityReference.XmlEntityReference
[XmlEntityReference Methods]
XmlEntityReference.CloneNode
XmlEntityReference.WriteContentTo
XmlEntityReference.WriteTo
[XmlEntityReference Properties]
XmlEntityReference.BaseURI
XmlEntityReference.IsReadOnly
XmlEntityReference.LocalName
XmlEntityReference.Name
XmlEntityReference.NodeType
XmlEntityReference.Value
System.Xml.XmlException class
XmlException.XmlException
[XmlException Properties]
XmlException.LineNumber
XmlException.LinePosition
XmlException.Message
XmlException.SourceUri
System.Xml.XmlImplementation class
XmlImplementation.XmlImplementation
[XmlImplementation Methods]
XmlImplementation.CreateDocument
XmlImplementation.HasFeature
System.Xml.XmlLinkedNode class
[XmlLinkedNode Properties]
XmlLinkedNode.NextSibling
XmlLinkedNode.PreviousSibling
System.Xml.XmlNamedNodeMap class
[XmlNamedNodeMap Methods]
XmlNamedNodeMap.GetEnumerator
XmlNamedNodeMap.GetNamedItem
XmlNamedNodeMap.Item
XmlNamedNodeMap.RemoveNamedItem
XmlNamedNodeMap.SetNamedItem
[XmlNamedNodeMap Properties]
XmlNamedNodeMap.Count
System.Xml.XmlNamespaceManager class
XmlNamespaceManager.XmlNamespaceManager
[XmlNamespaceManager Methods]
XmlNamespaceManager.AddNamespace
XmlNamespaceManager.GetEnumerator
XmlNamespaceManager.GetNamespacesInScope
XmlNamespaceManager.HasNamespace
XmlNamespaceManager.LookupNamespace
XmlNamespaceManager.LookupPrefix
XmlNamespaceManager.PopScope
XmlNamespaceManager.PushScope
XmlNamespaceManager.RemoveNamespace
[XmlNamespaceManager Properties]
XmlNamespaceManager.DefaultNamespace
XmlNamespaceManager.NameTable
System.Xml.XmlNamespaceScope enumeration
System.Xml.XmlNameTable class
XmlNameTable.XmlNameTable
[XmlNameTable Methods]
XmlNameTable.Add
XmlNameTable.Get
System.Xml.XmlNode class
[XmlNode Methods]
XmlNode.AppendChild
XmlNode.Clone
XmlNode.CloneNode
XmlNode.GetEnumerator
XmlNode.GetNamespaceOfPrefix
XmlNode.GetPrefixOfNamespace
XmlNode.InsertAfter
XmlNode.InsertBefore
XmlNode.Normalize
XmlNode.PrependChild
XmlNode.RemoveAll
XmlNode.RemoveChild
XmlNode.ReplaceChild
XmlNode.SelectNodes
XmlNode.SelectSingleNode
XmlNode.Supports
XmlNode.WriteContentTo
XmlNode.WriteTo
[XmlNode Properties]
XmlNode.Attributes
XmlNode.BaseURI
XmlNode.ChildNodes
XmlNode.FirstChild
XmlNode.HasChildNodes
XmlNode.InnerText
XmlNode.InnerXml
XmlNode.IsReadOnly
XmlNode.Item
XmlNode.Item
XmlNode.LastChild
XmlNode.LocalName
XmlNode.Name
XmlNode.NamespaceURI
XmlNode.NextSibling
XmlNode.NodeType
XmlNode.OuterXml
XmlNode.OwnerDocument
XmlNode.ParentNode
XmlNode.Prefix
XmlNode.PreviousSibling
XmlNode.SchemaInfo
XmlNode.Value
System.Xml.XmlNodeChangedAction enumeration
System.Xml.XmlNodeChangedEventArgs class
XmlNodeChangedEventArgs.XmlNodeChangedEventArgs
[XmlNodeChangedEventArgs Properties]
XmlNodeChangedEventArgs.Action
XmlNodeChangedEventArgs.NewParent
XmlNodeChangedEventArgs.NewValue
XmlNodeChangedEventArgs.Node
XmlNodeChangedEventArgs.OldParent
XmlNodeChangedEventArgs.OldValue
System.Xml.XmlNodeChangedEventHandler delegate
System.Xml.XmlNodeList class
XmlNodeList.XmlNodeList
[XmlNodeList Methods]
XmlNodeList.GetEnumerator
XmlNodeList.Item
[XmlNodeList Properties]
XmlNodeList.Count
XmlNodeList.ItemOf
System.Xml.XmlNodeOrder enumeration
System.Xml.XmlNodeReader class
XmlNodeReader.XmlNodeReader
[XmlNodeReader Methods]
XmlNodeReader.Close
XmlNodeReader.GetAttribute
XmlNodeReader.LookupNamespace
XmlNodeReader.MoveToAttribute
XmlNodeReader.MoveToElement
XmlNodeReader.MoveToFirstAttribute
XmlNodeReader.MoveToNextAttribute
XmlNodeReader.Read
XmlNodeReader.ReadAttributeValue
XmlNodeReader.ReadContentAsBase64
XmlNodeReader.ReadContentAsBinHex
XmlNodeReader.ReadElementContentAsBase64
XmlNodeReader.ReadElementContentAsBinHex
XmlNodeReader.ReadString
XmlNodeReader.ResolveEntity
XmlNodeReader.Skip
[XmlNodeReader Properties]
XmlNodeReader.AttributeCount
XmlNodeReader.BaseURI
XmlNodeReader.CanReadBinaryContent
XmlNodeReader.Depth
XmlNodeReader.EOF
XmlNodeReader.HasAttributes
XmlNodeReader.HasValue
XmlNodeReader.IsDefault
XmlNodeReader.IsEmptyElement
XmlNodeReader.LocalName
XmlNodeReader.Name
XmlNodeReader.NamespaceURI
XmlNodeReader.NameTable
XmlNodeReader.NodeType
XmlNodeReader.Prefix
XmlNodeReader.ReadState
XmlNodeReader.SchemaInfo
XmlNodeReader.Value
XmlNodeReader.XmlLang
XmlNodeReader.XmlSpace
System.Xml.XmlNodeType enumeration
System.Xml.XmlOutputMethod enumeration
System.Xml.XmlParserContext class
XmlParserContext.XmlParserContext
[XmlParserContext Properties]
XmlParserContext.BaseURI
XmlParserContext.DocTypeName
XmlParserContext.Encoding
XmlParserContext.InternalSubset
XmlParserContext.NamespaceManager
XmlParserContext.NameTable
XmlParserContext.PublicId
XmlParserContext.SystemId
XmlParserContext.XmlLang
XmlParserContext.XmlSpace
System.Xml.XmlProcessingInstruction class
XmlProcessingInstruction.XmlProcessingInstruction
[XmlProcessingInstruction Methods]
XmlProcessingInstruction.CloneNode
XmlProcessingInstruction.WriteContentTo
XmlProcessingInstruction.WriteTo
[XmlProcessingInstruction Properties]
XmlProcessingInstruction.Data
XmlProcessingInstruction.InnerText
XmlProcessingInstruction.LocalName
XmlProcessingInstruction.Name
XmlProcessingInstruction.NodeType
XmlProcessingInstruction.Target
XmlProcessingInstruction.Value
System.Xml.XmlQualifiedName class
XmlQualifiedName.XmlQualifiedName
[XmlQualifiedName Fields]
XmlQualifiedName.Empty
[XmlQualifiedName Methods]
XmlQualifiedName.Equals
XmlQualifiedName.GetHashCode
XmlQualifiedName.op_Equality
XmlQualifiedName.op_Inequality
XmlQualifiedName.ToString
[XmlQualifiedName Properties]
XmlQualifiedName.IsEmpty
XmlQualifiedName.Name
XmlQualifiedName.Namespace
System.Xml.XmlReader class
XmlReader.XmlReader
[XmlReader Methods]
XmlReader.Close
XmlReader.Create
XmlReader.Dispose
XmlReader.GetAttribute
XmlReader.IsName
XmlReader.IsNameToken
XmlReader.IsStartElement
XmlReader.LookupNamespace
XmlReader.MoveToAttribute
XmlReader.MoveToContent
XmlReader.MoveToElement
XmlReader.MoveToFirstAttribute
XmlReader.MoveToNextAttribute
XmlReader.Read
XmlReader.ReadAttributeValue
XmlReader.ReadContentAs
XmlReader.ReadContentAsBase64
XmlReader.ReadContentAsBinHex
XmlReader.ReadContentAsBoolean
XmlReader.ReadContentAsDateTime
XmlReader.ReadContentAsDecimal
XmlReader.ReadContentAsDouble
XmlReader.ReadContentAsFloat
XmlReader.ReadContentAsInt
XmlReader.ReadContentAsLong
XmlReader.ReadContentAsObject
XmlReader.ReadContentAsString
XmlReader.ReadElementContentAs
XmlReader.ReadElementContentAsBase64
XmlReader.ReadElementContentAsBinHex
XmlReader.ReadElementContentAsBoolean
XmlReader.ReadElementContentAsDateTime
XmlReader.ReadElementContentAsDecimal
XmlReader.ReadElementContentAsDouble
XmlReader.ReadElementContentAsFloat
XmlReader.ReadElementContentAsInt
XmlReader.ReadElementContentAsLong
XmlReader.ReadElementContentAsObject
XmlReader.ReadElementContentAsString
XmlReader.ReadElementString
XmlReader.ReadEndElement
XmlReader.ReadInnerXml
XmlReader.ReadOuterXml
XmlReader.ReadStartElement
XmlReader.ReadString
XmlReader.ReadSubtree
XmlReader.ReadToDescendant
XmlReader.ReadToFollowing
XmlReader.ReadToNextSibling
XmlReader.ReadValueChunk
XmlReader.ResolveEntity
XmlReader.Skip
[XmlReader Properties]
XmlReader.AttributeCount
XmlReader.BaseURI
XmlReader.CanReadBinaryContent
XmlReader.CanReadValueChunk
XmlReader.CanResolveEntity
XmlReader.Depth
XmlReader.EOF
XmlReader.HasAttributes
XmlReader.HasValue
XmlReader.IsDefault
XmlReader.IsEmptyElement
XmlReader.Item
XmlReader.Item
XmlReader.Item
XmlReader.LocalName
XmlReader.Name
XmlReader.NamespaceURI
XmlReader.NameTable
XmlReader.NodeType
XmlReader.Prefix
XmlReader.QuoteChar
XmlReader.ReadState
XmlReader.SchemaInfo
XmlReader.Settings
XmlReader.Value
XmlReader.ValueType
XmlReader.XmlLang
XmlReader.XmlSpace
System.Xml.XmlReaderSettings class
XmlReaderSettings.XmlReaderSettings
[XmlReaderSettings Methods]
XmlReaderSettings.Clone
XmlReaderSettings.Reset
[XmlReaderSettings Properties]
XmlReaderSettings.CheckCharacters
XmlReaderSettings.CloseInput
XmlReaderSettings.ConformanceLevel
XmlReaderSettings.IgnoreComments
XmlReaderSettings.IgnoreProcessingInstructions
XmlReaderSettings.IgnoreWhitespace
XmlReaderSettings.LineNumberOffset
XmlReaderSettings.LinePositionOffset
XmlReaderSettings.NameTable
XmlReaderSettings.Schemas
XmlReaderSettings.ValidationFlags
XmlReaderSettings.ValidationType
XmlReaderSettings.XmlResolver
[XmlReaderSettings Events]
XmlReaderSettings.ValidationEventHandler
System.Xml.XmlResolver class
XmlResolver.XmlResolver
[XmlResolver Methods]
XmlResolver.GetEntity
XmlResolver.ResolveUri
[XmlResolver Properties]
XmlResolver.Credentials
XmlResolver.NameTable
System.Xml.XmlSignificantWhitespace class
XmlSignificantWhitespace.XmlSignificantWhitespace
[XmlSignificantWhitespace Methods]
XmlSignificantWhitespace.CloneNode
XmlSignificantWhitespace.WriteContentTo
XmlSignificantWhitespace.WriteTo
[XmlSignificantWhitespace Properties]
XmlSignificantWhitespace.LocalName
XmlSignificantWhitespace.Name
XmlSignificantWhitespace.NodeType
XmlSignificantWhitespace.ParentNode
XmlSignificantWhitespace.Value
System.Xml.XmlSpace enumeration
System.Xml.XmlText class
XmlText.XmlText
[XmlText Methods]
XmlText.CloneNode
XmlText.SplitText
XmlText.WriteContentTo
XmlText.WriteTo
[XmlText Properties]
XmlText.LocalName
XmlText.Name
XmlText.NodeType
XmlText.ParentNode
XmlText.Value
System.Xml.XmlTextReader class
XmlTextReader.XmlTextReader
[XmlTextReader Methods]
XmlTextReader.Close
XmlTextReader.GetAttribute
XmlTextReader.GetNamespacesInScope
XmlTextReader.GetRemainder
XmlTextReader.HasLineInfo
XmlTextReader.LookupNamespace
XmlTextReader.MoveToAttribute
XmlTextReader.MoveToElement
XmlTextReader.MoveToFirstAttribute
XmlTextReader.MoveToNextAttribute
XmlTextReader.Read
XmlTextReader.ReadAttributeValue
XmlTextReader.ReadBase64
XmlTextReader.ReadBinHex
XmlTextReader.ReadChars
XmlTextReader.ReadContentAsBase64
XmlTextReader.ReadContentAsBinHex
XmlTextReader.ReadElementContentAsBase64
XmlTextReader.ReadElementContentAsBinHex
XmlTextReader.ReadString
XmlTextReader.ResetState
XmlTextReader.ResolveEntity
XmlTextReader.Skip
[XmlTextReader Properties]
XmlTextReader.AttributeCount
XmlTextReader.BaseURI
XmlTextReader.CanReadBinaryContent
XmlTextReader.CanReadValueChunk
XmlTextReader.CanResolveEntity
XmlTextReader.Depth
XmlTextReader.Encoding
XmlTextReader.EntityHandling
XmlTextReader.EOF
XmlTextReader.HasValue
XmlTextReader.IsDefault
XmlTextReader.IsEmptyElement
XmlTextReader.LineNumber
XmlTextReader.LinePosition
XmlTextReader.LocalName
XmlTextReader.Name
XmlTextReader.Namespaces
XmlTextReader.NamespaceURI
XmlTextReader.NameTable
XmlTextReader.NodeType
XmlTextReader.Normalization
XmlTextReader.Prefix
XmlTextReader.QuoteChar
XmlTextReader.ReadState
XmlTextReader.Settings
XmlTextReader.Value
XmlTextReader.WhitespaceHandling
XmlTextReader.XmlLang
XmlTextReader.XmlResolver
XmlTextReader.XmlSpace
System.Xml.XmlTextWriter class
XmlTextWriter.XmlTextWriter
[XmlTextWriter Methods]
XmlTextWriter.Close
XmlTextWriter.Flush
XmlTextWriter.LookupPrefix
XmlTextWriter.WriteBase64
XmlTextWriter.WriteBinHex
XmlTextWriter.WriteCData
XmlTextWriter.WriteCharEntity
XmlTextWriter.WriteChars
XmlTextWriter.WriteComment
XmlTextWriter.WriteDocType
XmlTextWriter.WriteEndAttribute
XmlTextWriter.WriteEndDocument
XmlTextWriter.WriteEndElement
XmlTextWriter.WriteEntityRef
XmlTextWriter.WriteFullEndElement
XmlTextWriter.WriteName
XmlTextWriter.WriteNmToken
XmlTextWriter.WriteProcessingInstruction
XmlTextWriter.WriteQualifiedName
XmlTextWriter.WriteRaw
XmlTextWriter.WriteStartAttribute
XmlTextWriter.WriteStartDocument
XmlTextWriter.WriteStartElement
XmlTextWriter.WriteString
XmlTextWriter.WriteSurrogateCharEntity
XmlTextWriter.WriteWhitespace
[XmlTextWriter Properties]
XmlTextWriter.BaseStream
XmlTextWriter.Formatting
XmlTextWriter.Indentation
XmlTextWriter.IndentChar
XmlTextWriter.Namespaces
XmlTextWriter.QuoteChar
XmlTextWriter.WriteState
XmlTextWriter.XmlLang
XmlTextWriter.XmlSpace
System.Xml.XmlTokenizedType enumeration
System.Xml.XmlUrlResolver class
XmlUrlResolver.XmlUrlResolver
[XmlUrlResolver Methods]
XmlUrlResolver.GetEntity
XmlUrlResolver.ResolveUri
[XmlUrlResolver Properties]
XmlUrlResolver.Credentials
System.Xml.XmlWhitespace class
XmlWhitespace.XmlWhitespace
[XmlWhitespace Methods]
XmlWhitespace.CloneNode
XmlWhitespace.WriteContentTo
XmlWhitespace.WriteTo
[XmlWhitespace Properties]
XmlWhitespace.LocalName
XmlWhitespace.Name
XmlWhitespace.NodeType
XmlWhitespace.ParentNode
XmlWhitespace.Value
System.Xml.XmlWriter class
XmlWriter.XmlWriter
[XmlWriter Methods]
XmlWriter.Close
XmlWriter.Create
XmlWriter.Dispose
XmlWriter.Flush
XmlWriter.LookupPrefix
XmlWriter.WriteAttributes
XmlWriter.WriteAttributeString
XmlWriter.WriteBase64
XmlWriter.WriteBinHex
XmlWriter.WriteCData
XmlWriter.WriteCharEntity
XmlWriter.WriteChars
XmlWriter.WriteComment
XmlWriter.WriteDocType
XmlWriter.WriteElementString
XmlWriter.WriteEndAttribute
XmlWriter.WriteEndDocument
XmlWriter.WriteEndElement
XmlWriter.WriteEntityRef
XmlWriter.WriteFullEndElement
XmlWriter.WriteName
XmlWriter.WriteNmToken
XmlWriter.WriteNode
XmlWriter.WriteProcessingInstruction
XmlWriter.WriteQualifiedName
XmlWriter.WriteRaw
XmlWriter.WriteStartAttribute
XmlWriter.WriteStartDocument
XmlWriter.WriteStartElement
XmlWriter.WriteString
XmlWriter.WriteSurrogateCharEntity
XmlWriter.WriteValue
XmlWriter.WriteWhitespace
[XmlWriter Properties]
XmlWriter.Settings
XmlWriter.WriteState
XmlWriter.XmlLang
XmlWriter.XmlSpace
System.Xml.XmlWriterSettings class
XmlWriterSettings.XmlWriterSettings
[XmlWriterSettings Methods]
XmlWriterSettings.Clone
XmlWriterSettings.Reset
[XmlWriterSettings Properties]
XmlWriterSettings.CheckCharacters
XmlWriterSettings.CloseOutput
XmlWriterSettings.ConformanceLevel
XmlWriterSettings.Encoding
XmlWriterSettings.Indent
XmlWriterSettings.IndentChars
XmlWriterSettings.NewLineChars
XmlWriterSettings.NewLineHandling
XmlWriterSettings.NewLineOnAttributes
XmlWriterSettings.OmitXmlDeclaration
XmlWriterSettings.OutputMethod
System.Xml.Schema namespace
System.Xml.Schema.IXmlSchemaInfo interface
[IXmlSchemaInfo Properties]
IXmlSchemaInfo.IsDefault
IXmlSchemaInfo.IsNil
IXmlSchemaInfo.MemberType
IXmlSchemaInfo.SchemaAttribute
IXmlSchemaInfo.SchemaElement
IXmlSchemaInfo.SchemaType
IXmlSchemaInfo.Validity
System.Xml.Schema.ValidationEventArgs class
[ValidationEventArgs Properties]
ValidationEventArgs.Exception
ValidationEventArgs.Message
ValidationEventArgs.Severity
System.Xml.Schema.ValidationEventHandler delegate
System.Xml.Schema.XmlAtomicValue class
[XmlAtomicValue Methods]
XmlAtomicValue.Clone
XmlAtomicValue.ToString
XmlAtomicValue.ValueAs
[XmlAtomicValue Properties]
XmlAtomicValue.IsNode
XmlAtomicValue.TypedValue
XmlAtomicValue.Value
XmlAtomicValue.ValueAsBoolean
XmlAtomicValue.ValueAsDateTime
XmlAtomicValue.ValueAsDouble
XmlAtomicValue.ValueAsInt
XmlAtomicValue.ValueAsLong
XmlAtomicValue.ValueType
XmlAtomicValue.XmlType
System.Xml.Schema.XmlSchema class
XmlSchema.XmlSchema
[XmlSchema Fields]
XmlSchema.InstanceNamespace
XmlSchema.Namespace
[XmlSchema Methods]
XmlSchema.Read
XmlSchema.Write
[XmlSchema Properties]
XmlSchema.AttributeFormDefault
XmlSchema.AttributeGroups
XmlSchema.Attributes
XmlSchema.BlockDefault
XmlSchema.ElementFormDefault
XmlSchema.Elements
XmlSchema.FinalDefault
XmlSchema.Groups
XmlSchema.Id
XmlSchema.Includes
XmlSchema.IsCompiled
XmlSchema.Items
XmlSchema.Notations
XmlSchema.SchemaTypes
XmlSchema.TargetNamespace
XmlSchema.UnhandledAttributes
XmlSchema.Version
System.Xml.Schema.XmlSchemaAll class
XmlSchemaAll.XmlSchemaAll
[XmlSchemaAll Properties]
XmlSchemaAll.Items
System.Xml.Schema.XmlSchemaAnnotated class
XmlSchemaAnnotated.XmlSchemaAnnotated
[XmlSchemaAnnotated Properties]
XmlSchemaAnnotated.Annotation
XmlSchemaAnnotated.Id
XmlSchemaAnnotated.UnhandledAttributes
System.Xml.Schema.XmlSchemaAnnotation class
XmlSchemaAnnotation.XmlSchemaAnnotation
[XmlSchemaAnnotation Properties]
XmlSchemaAnnotation.Id
XmlSchemaAnnotation.Items
XmlSchemaAnnotation.UnhandledAttributes
System.Xml.Schema.XmlSchemaAny class
XmlSchemaAny.XmlSchemaAny
[XmlSchemaAny Properties]
XmlSchemaAny.Namespace
XmlSchemaAny.ProcessContents
System.Xml.Schema.XmlSchemaAnyAttribute class
XmlSchemaAnyAttribute.XmlSchemaAnyAttribute
[XmlSchemaAnyAttribute Properties]
XmlSchemaAnyAttribute.Namespace
XmlSchemaAnyAttribute.ProcessContents
System.Xml.Schema.XmlSchemaAppInfo class
XmlSchemaAppInfo.XmlSchemaAppInfo
[XmlSchemaAppInfo Properties]
XmlSchemaAppInfo.Markup
XmlSchemaAppInfo.Source
System.Xml.Schema.XmlSchemaAttribute class
XmlSchemaAttribute.XmlSchemaAttribute
[XmlSchemaAttribute Properties]
XmlSchemaAttribute.AttributeSchemaType
XmlSchemaAttribute.AttributeType
XmlSchemaAttribute.DefaultValue
XmlSchemaAttribute.FixedValue
XmlSchemaAttribute.Form
XmlSchemaAttribute.Name
XmlSchemaAttribute.QualifiedName
XmlSchemaAttribute.RefName
XmlSchemaAttribute.SchemaType
XmlSchemaAttribute.SchemaTypeName
XmlSchemaAttribute.Use
System.Xml.Schema.XmlSchemaAttributeGroup class
XmlSchemaAttributeGroup.XmlSchemaAttributeGroup
[XmlSchemaAttributeGroup Properties]
XmlSchemaAttributeGroup.AnyAttribute
XmlSchemaAttributeGroup.Attributes
XmlSchemaAttributeGroup.Name
XmlSchemaAttributeGroup.QualifiedName
XmlSchemaAttributeGroup.RedefinedAttributeGroup
System.Xml.Schema.XmlSchemaAttributeGroupRef class
XmlSchemaAttributeGroupRef.XmlSchemaAttributeGroupRef
[XmlSchemaAttributeGroupRef Properties]
XmlSchemaAttributeGroupRef.RefName
System.Xml.Schema.XmlSchemaChoice class
XmlSchemaChoice.XmlSchemaChoice
[XmlSchemaChoice Properties]
XmlSchemaChoice.Items
System.Xml.Schema.XmlSchemaCompilationSettings class
XmlSchemaCompilationSettings.XmlSchemaCompilationSettings
[XmlSchemaCompilationSettings Properties]
XmlSchemaCompilationSettings.EnableUpaCheck
System.Xml.Schema.XmlSchemaComplexContent class
XmlSchemaComplexContent.XmlSchemaComplexContent
[XmlSchemaComplexContent Properties]
XmlSchemaComplexContent.Content
XmlSchemaComplexContent.IsMixed
System.Xml.Schema.XmlSchemaComplexContentExtension class
XmlSchemaComplexContentExtension.XmlSchemaComplexContentExtension
[XmlSchemaComplexContentExtension Properties]
XmlSchemaComplexContentExtension.AnyAttribute
XmlSchemaComplexContentExtension.Attributes
XmlSchemaComplexContentExtension.BaseTypeName
XmlSchemaComplexContentExtension.Particle
System.Xml.Schema.XmlSchemaComplexContentRestriction class
XmlSchemaComplexContentRestriction.XmlSchemaComplexContentRestriction
[XmlSchemaComplexContentRestriction Properties]
XmlSchemaComplexContentRestriction.AnyAttribute
XmlSchemaComplexContentRestriction.Attributes
XmlSchemaComplexContentRestriction.BaseTypeName
XmlSchemaComplexContentRestriction.Particle
System.Xml.Schema.XmlSchemaComplexType class
XmlSchemaComplexType.XmlSchemaComplexType
[XmlSchemaComplexType Properties]
XmlSchemaComplexType.AnyAttribute
XmlSchemaComplexType.Attributes
XmlSchemaComplexType.AttributeUses
XmlSchemaComplexType.AttributeWildcard
XmlSchemaComplexType.Block
XmlSchemaComplexType.BlockResolved
XmlSchemaComplexType.ContentModel
XmlSchemaComplexType.ContentType
XmlSchemaComplexType.ContentTypeParticle
XmlSchemaComplexType.IsAbstract
XmlSchemaComplexType.IsMixed
XmlSchemaComplexType.Particle
System.Xml.Schema.XmlSchemaContent class
XmlSchemaContent.XmlSchemaContent
System.Xml.Schema.XmlSchemaContentModel class
XmlSchemaContentModel.XmlSchemaContentModel
[XmlSchemaContentModel Properties]
XmlSchemaContentModel.Content
System.Xml.Schema.XmlSchemaContentProcessing enumeration
System.Xml.Schema.XmlSchemaContentType enumeration
System.Xml.Schema.XmlSchemaDatatype class
XmlSchemaDatatype.XmlSchemaDatatype
[XmlSchemaDatatype Methods]
XmlSchemaDatatype.ChangeType
XmlSchemaDatatype.IsDerivedFrom
XmlSchemaDatatype.ParseValue
[XmlSchemaDatatype Properties]
XmlSchemaDatatype.TokenizedType
XmlSchemaDatatype.TypeCode
XmlSchemaDatatype.ValueType
XmlSchemaDatatype.Variety
System.Xml.Schema.XmlSchemaDatatypeVariety enumeration
System.Xml.Schema.XmlSchemaDerivationMethod enumeration
System.Xml.Schema.XmlSchemaDocumentation class
XmlSchemaDocumentation.XmlSchemaDocumentation
[XmlSchemaDocumentation Properties]
XmlSchemaDocumentation.Language
XmlSchemaDocumentation.Markup
XmlSchemaDocumentation.Source
System.Xml.Schema.XmlSchemaElement class
XmlSchemaElement.XmlSchemaElement
[XmlSchemaElement Properties]
XmlSchemaElement.Block
XmlSchemaElement.BlockResolved
XmlSchemaElement.Constraints
XmlSchemaElement.DefaultValue
XmlSchemaElement.ElementSchemaType
XmlSchemaElement.ElementType
XmlSchemaElement.Final
XmlSchemaElement.FinalResolved
XmlSchemaElement.FixedValue
XmlSchemaElement.Form
XmlSchemaElement.IsAbstract
XmlSchemaElement.IsNillable
XmlSchemaElement.Name
XmlSchemaElement.QualifiedName
XmlSchemaElement.RefName
XmlSchemaElement.SchemaType
XmlSchemaElement.SchemaTypeName
XmlSchemaElement.SubstitutionGroup
System.Xml.Schema.XmlSchemaEnumerationFacet class
XmlSchemaEnumerationFacet.XmlSchemaEnumerationFacet
System.Xml.Schema.XmlSchemaException class
XmlSchemaException.XmlSchemaException
[XmlSchemaException Properties]
XmlSchemaException.LineNumber
XmlSchemaException.LinePosition
XmlSchemaException.SourceSchemaObject
XmlSchemaException.SourceUri
System.Xml.Schema.XmlSchemaExternal class
XmlSchemaExternal.XmlSchemaExternal
[XmlSchemaExternal Properties]
XmlSchemaExternal.Id
XmlSchemaExternal.Schema
XmlSchemaExternal.SchemaLocation
XmlSchemaExternal.UnhandledAttributes
System.Xml.Schema.XmlSchemaFacet class
XmlSchemaFacet.XmlSchemaFacet
[XmlSchemaFacet Properties]
XmlSchemaFacet.IsFixed
XmlSchemaFacet.Value
System.Xml.Schema.XmlSchemaForm enumeration
System.Xml.Schema.XmlSchemaFractionDigitsFacet class
XmlSchemaFractionDigitsFacet.XmlSchemaFractionDigitsFacet
System.Xml.Schema.XmlSchemaGroup class
XmlSchemaGroup.XmlSchemaGroup
[XmlSchemaGroup Properties]
XmlSchemaGroup.Name
XmlSchemaGroup.Particle
XmlSchemaGroup.QualifiedName
System.Xml.Schema.XmlSchemaGroupBase class
XmlSchemaGroupBase.XmlSchemaGroupBase
[XmlSchemaGroupBase Properties]
XmlSchemaGroupBase.Items
System.Xml.Schema.XmlSchemaGroupRef class
XmlSchemaGroupRef.XmlSchemaGroupRef
[XmlSchemaGroupRef Properties]
XmlSchemaGroupRef.Particle
XmlSchemaGroupRef.RefName
System.Xml.Schema.XmlSchemaIdentityConstraint class
XmlSchemaIdentityConstraint.XmlSchemaIdentityConstraint
[XmlSchemaIdentityConstraint Properties]
XmlSchemaIdentityConstraint.Fields
XmlSchemaIdentityConstraint.Name
XmlSchemaIdentityConstraint.QualifiedName
XmlSchemaIdentityConstraint.Selector
System.Xml.Schema.XmlSchemaImport class
XmlSchemaImport.XmlSchemaImport
[XmlSchemaImport Properties]
XmlSchemaImport.Annotation
XmlSchemaImport.Namespace
System.Xml.Schema.XmlSchemaInclude class
XmlSchemaInclude.XmlSchemaInclude
[XmlSchemaInclude Properties]
XmlSchemaInclude.Annotation
System.Xml.Schema.XmlSchemaInference class
XmlSchemaInference.XmlSchemaInference
[XmlSchemaInference Methods]
XmlSchemaInference.InferSchema
[XmlSchemaInference Properties]
XmlSchemaInference.Occurrence
XmlSchemaInference.TypeInference
System.Xml.Schema.XmlSchemaInference.InferenceOption enumeration
System.Xml.Schema.XmlSchemaInferenceException class
XmlSchemaInferenceException.XmlSchemaInferenceException
System.Xml.Schema.XmlSchemaInfo class
XmlSchemaInfo.XmlSchemaInfo
[XmlSchemaInfo Properties]
XmlSchemaInfo.ContentType
XmlSchemaInfo.IsDefault
XmlSchemaInfo.IsNil
XmlSchemaInfo.MemberType
XmlSchemaInfo.SchemaAttribute
XmlSchemaInfo.SchemaElement
XmlSchemaInfo.SchemaType
XmlSchemaInfo.Validity
System.Xml.Schema.XmlSchemaKey class
XmlSchemaKey.XmlSchemaKey
System.Xml.Schema.XmlSchemaKeyref class
XmlSchemaKeyref.XmlSchemaKeyref
[XmlSchemaKeyref Properties]
XmlSchemaKeyref.Refer
System.Xml.Schema.XmlSchemaLengthFacet class
XmlSchemaLengthFacet.XmlSchemaLengthFacet
System.Xml.Schema.XmlSchemaMaxExclusiveFacet class
XmlSchemaMaxExclusiveFacet.XmlSchemaMaxExclusiveFacet
System.Xml.Schema.XmlSchemaMaxInclusiveFacet class
XmlSchemaMaxInclusiveFacet.XmlSchemaMaxInclusiveFacet
System.Xml.Schema.XmlSchemaMaxLengthFacet class
XmlSchemaMaxLengthFacet.XmlSchemaMaxLengthFacet
System.Xml.Schema.XmlSchemaMinExclusiveFacet class
XmlSchemaMinExclusiveFacet.XmlSchemaMinExclusiveFacet
System.Xml.Schema.XmlSchemaMinInclusiveFacet class
XmlSchemaMinInclusiveFacet.XmlSchemaMinInclusiveFacet
System.Xml.Schema.XmlSchemaMinLengthFacet class
XmlSchemaMinLengthFacet.XmlSchemaMinLengthFacet
System.Xml.Schema.XmlSchemaNotation class
XmlSchemaNotation.XmlSchemaNotation
[XmlSchemaNotation Properties]
XmlSchemaNotation.Name
XmlSchemaNotation.Public
XmlSchemaNotation.System
System.Xml.Schema.XmlSchemaNumericFacet class
XmlSchemaNumericFacet.XmlSchemaNumericFacet
System.Xml.Schema.XmlSchemaObject class
XmlSchemaObject.XmlSchemaObject
[XmlSchemaObject Properties]
XmlSchemaObject.LineNumber
XmlSchemaObject.LinePosition
XmlSchemaObject.Namespaces
XmlSchemaObject.Parent
XmlSchemaObject.SourceUri
System.Xml.Schema.XmlSchemaObjectCollection class
XmlSchemaObjectCollection.XmlSchemaObjectCollection
[XmlSchemaObjectCollection Methods]
XmlSchemaObjectCollection.Add
XmlSchemaObjectCollection.Contains
XmlSchemaObjectCollection.CopyTo
XmlSchemaObjectCollection.GetEnumerator
XmlSchemaObjectCollection.IndexOf
XmlSchemaObjectCollection.Insert
XmlSchemaObjectCollection.OnClear
XmlSchemaObjectCollection.OnInsert
XmlSchemaObjectCollection.OnRemove
XmlSchemaObjectCollection.OnSet
XmlSchemaObjectCollection.Remove
[XmlSchemaObjectCollection Properties]
XmlSchemaObjectCollection.Item
System.Xml.Schema.XmlSchemaObjectEnumerator class
[XmlSchemaObjectEnumerator Methods]
XmlSchemaObjectEnumerator.MoveNext
XmlSchemaObjectEnumerator.Reset
[XmlSchemaObjectEnumerator Properties]
XmlSchemaObjectEnumerator.Current
System.Xml.Schema.XmlSchemaObjectTable class
[XmlSchemaObjectTable Methods]
XmlSchemaObjectTable.Contains
XmlSchemaObjectTable.GetEnumerator
[XmlSchemaObjectTable Properties]
XmlSchemaObjectTable.Count
XmlSchemaObjectTable.Item
XmlSchemaObjectTable.Names
XmlSchemaObjectTable.Values
System.Xml.Schema.XmlSchemaParticle class
XmlSchemaParticle.XmlSchemaParticle
[XmlSchemaParticle Properties]
XmlSchemaParticle.MaxOccurs
XmlSchemaParticle.MaxOccursString
XmlSchemaParticle.MinOccurs
XmlSchemaParticle.MinOccursString
System.Xml.Schema.XmlSchemaPatternFacet class
XmlSchemaPatternFacet.XmlSchemaPatternFacet
System.Xml.Schema.XmlSchemaRedefine class
XmlSchemaRedefine.XmlSchemaRedefine
[XmlSchemaRedefine Properties]
XmlSchemaRedefine.AttributeGroups
XmlSchemaRedefine.Groups
XmlSchemaRedefine.Items
XmlSchemaRedefine.SchemaTypes
System.Xml.Schema.XmlSchemaSequence class
XmlSchemaSequence.XmlSchemaSequence
[XmlSchemaSequence Properties]
XmlSchemaSequence.Items
System.Xml.Schema.XmlSchemaSet class
XmlSchemaSet.XmlSchemaSet
[XmlSchemaSet Methods]
XmlSchemaSet.Add
XmlSchemaSet.Compile
XmlSchemaSet.Contains
XmlSchemaSet.CopyTo
XmlSchemaSet.Remove
XmlSchemaSet.RemoveRecursive
XmlSchemaSet.Reprocess
XmlSchemaSet.Schemas
[XmlSchemaSet Properties]
XmlSchemaSet.CompilationSettings
XmlSchemaSet.Count
XmlSchemaSet.GlobalAttributes
XmlSchemaSet.GlobalElements
XmlSchemaSet.GlobalTypes
XmlSchemaSet.IsCompiled
XmlSchemaSet.NameTable
XmlSchemaSet.XmlResolver
[XmlSchemaSet Events]
XmlSchemaSet.ValidationEventHandler
System.Xml.Schema.XmlSchemaSimpleContent class
XmlSchemaSimpleContent.XmlSchemaSimpleContent
[XmlSchemaSimpleContent Properties]
XmlSchemaSimpleContent.Content
System.Xml.Schema.XmlSchemaSimpleContentExtension class
XmlSchemaSimpleContentExtension.XmlSchemaSimpleContentExtension
[XmlSchemaSimpleContentExtension Properties]
XmlSchemaSimpleContentExtension.AnyAttribute
XmlSchemaSimpleContentExtension.Attributes
XmlSchemaSimpleContentExtension.BaseTypeName
System.Xml.Schema.XmlSchemaSimpleContentRestriction class
XmlSchemaSimpleContentRestriction.XmlSchemaSimpleContentRestriction
[XmlSchemaSimpleContentRestriction Properties]
XmlSchemaSimpleContentRestriction.AnyAttribute
XmlSchemaSimpleContentRestriction.Attributes
XmlSchemaSimpleContentRestriction.BaseType
XmlSchemaSimpleContentRestriction.BaseTypeName
XmlSchemaSimpleContentRestriction.Facets
System.Xml.Schema.XmlSchemaSimpleType class
XmlSchemaSimpleType.XmlSchemaSimpleType
[XmlSchemaSimpleType Properties]
XmlSchemaSimpleType.Content
System.Xml.Schema.XmlSchemaSimpleTypeContent class
XmlSchemaSimpleTypeContent.XmlSchemaSimpleTypeContent
System.Xml.Schema.XmlSchemaSimpleTypeList class
XmlSchemaSimpleTypeList.XmlSchemaSimpleTypeList
[XmlSchemaSimpleTypeList Properties]
XmlSchemaSimpleTypeList.BaseItemType
XmlSchemaSimpleTypeList.ItemType
XmlSchemaSimpleTypeList.ItemTypeName
System.Xml.Schema.XmlSchemaSimpleTypeRestriction class
XmlSchemaSimpleTypeRestriction.XmlSchemaSimpleTypeRestriction
[XmlSchemaSimpleTypeRestriction Properties]
XmlSchemaSimpleTypeRestriction.BaseType
XmlSchemaSimpleTypeRestriction.BaseTypeName
XmlSchemaSimpleTypeRestriction.Facets
System.Xml.Schema.XmlSchemaSimpleTypeUnion class
XmlSchemaSimpleTypeUnion.XmlSchemaSimpleTypeUnion
[XmlSchemaSimpleTypeUnion Properties]
XmlSchemaSimpleTypeUnion.BaseMemberTypes
XmlSchemaSimpleTypeUnion.BaseTypes
XmlSchemaSimpleTypeUnion.MemberTypes
System.Xml.Schema.XmlSchemaTotalDigitsFacet class
XmlSchemaTotalDigitsFacet.XmlSchemaTotalDigitsFacet
System.Xml.Schema.XmlSchemaType class
XmlSchemaType.XmlSchemaType
[XmlSchemaType Methods]
XmlSchemaType.GetBuiltInComplexType
XmlSchemaType.GetBuiltInSimpleType
XmlSchemaType.IsDerivedFrom
[XmlSchemaType Properties]
XmlSchemaType.BaseSchemaType
XmlSchemaType.BaseXmlSchemaType
XmlSchemaType.Datatype
XmlSchemaType.DerivedBy
XmlSchemaType.Final
XmlSchemaType.FinalResolved
XmlSchemaType.IsMixed
XmlSchemaType.Name
XmlSchemaType.QualifiedName
XmlSchemaType.TypeCode
System.Xml.Schema.XmlSchemaUnique class
XmlSchemaUnique.XmlSchemaUnique
System.Xml.Schema.XmlSchemaUse enumeration
System.Xml.Schema.XmlSchemaValidationException class
XmlSchemaValidationException.XmlSchemaValidationException
[XmlSchemaValidationException Methods]
XmlSchemaValidationException.SetSourceObject
[XmlSchemaValidationException Properties]
XmlSchemaValidationException.SourceObject
System.Xml.Schema.XmlSchemaValidationFlags enumeration
System.Xml.Schema.XmlSchemaValidator class
XmlSchemaValidator.XmlSchemaValidator
[XmlSchemaValidator Methods]
XmlSchemaValidator.AddSchema
XmlSchemaValidator.EndValidation
XmlSchemaValidator.GetExpectedAttributes
XmlSchemaValidator.GetExpectedParticles
XmlSchemaValidator.GetUnspecifiedDefaultAttributes
XmlSchemaValidator.Initialize
XmlSchemaValidator.SkipToEndElement
XmlSchemaValidator.ValidateAttribute
XmlSchemaValidator.ValidateElement
XmlSchemaValidator.ValidateEndElement
XmlSchemaValidator.ValidateEndOfAttributes
XmlSchemaValidator.ValidateText
XmlSchemaValidator.ValidateWhitespace
[XmlSchemaValidator Properties]
XmlSchemaValidator.LineInfoProvider
XmlSchemaValidator.SourceUri
XmlSchemaValidator.ValidationEventSender
XmlSchemaValidator.XmlResolver
[XmlSchemaValidator Events]
XmlSchemaValidator.ValidationEventHandler
System.Xml.Schema.XmlSchemaValidity enumeration
System.Xml.Schema.XmlSchemaWhiteSpaceFacet class
XmlSchemaWhiteSpaceFacet.XmlSchemaWhiteSpaceFacet
System.Xml.Schema.XmlSchemaXPath class
XmlSchemaXPath.XmlSchemaXPath
[XmlSchemaXPath Properties]
XmlSchemaXPath.XPath
System.Xml.Schema.XmlSeverityType enumeration
System.Xml.Schema.XmlTypeCode enumeration
System.Xml.Schema.XmlValueGetter delegate
System.Xml.Serialization namespace
System.Xml.Serialization.IXmlSerializable interface
[IXmlSerializable Methods]
IXmlSerializable.GetSchema
IXmlSerializable.ReadXml
IXmlSerializable.WriteXml
System.Xml.Serialization.IXmlTextParser interface
[IXmlTextParser Properties]
IXmlTextParser.Normalized
IXmlTextParser.WhitespaceHandling
System.Xml.Serialization.SoapAttributeAttribute class
SoapAttributeAttribute.SoapAttributeAttribute
[SoapAttributeAttribute Properties]
SoapAttributeAttribute.AttributeName
SoapAttributeAttribute.DataType
SoapAttributeAttribute.Namespace
System.Xml.Serialization.SoapAttributeOverrides class
SoapAttributeOverrides.SoapAttributeOverrides
[SoapAttributeOverrides Methods]
SoapAttributeOverrides.Add
[SoapAttributeOverrides Properties]
SoapAttributeOverrides.Item
SoapAttributeOverrides.Item
System.Xml.Serialization.SoapAttributes class
SoapAttributes.SoapAttributes
[SoapAttributes Properties]
SoapAttributes.SoapAttribute
SoapAttributes.SoapDefaultValue
SoapAttributes.SoapElement
SoapAttributes.SoapEnum
SoapAttributes.SoapIgnore
SoapAttributes.SoapType
System.Xml.Serialization.SoapElementAttribute class
SoapElementAttribute.SoapElementAttribute
[SoapElementAttribute Properties]
SoapElementAttribute.DataType
SoapElementAttribute.ElementName
SoapElementAttribute.IsNullable
System.Xml.Serialization.SoapEnumAttribute class
SoapEnumAttribute.SoapEnumAttribute
[SoapEnumAttribute Properties]
SoapEnumAttribute.Name
System.Xml.Serialization.SoapIgnoreAttribute class
SoapIgnoreAttribute.SoapIgnoreAttribute
System.Xml.Serialization.SoapIncludeAttribute class
SoapIncludeAttribute.SoapIncludeAttribute
[SoapIncludeAttribute Properties]
SoapIncludeAttribute.Type
System.Xml.Serialization.SoapReflectionImporter class
SoapReflectionImporter.SoapReflectionImporter
[SoapReflectionImporter Methods]
SoapReflectionImporter.ImportTypeMapping
SoapReflectionImporter.IncludeType
SoapReflectionImporter.IncludeTypes
System.Xml.Serialization.SoapTypeAttribute class
SoapTypeAttribute.SoapTypeAttribute
[SoapTypeAttribute Properties]
SoapTypeAttribute.Namespace
SoapTypeAttribute.TypeName
System.Xml.Serialization.UnreferencedObjectEventArgs class
UnreferencedObjectEventArgs.UnreferencedObjectEventArgs
[UnreferencedObjectEventArgs Properties]
UnreferencedObjectEventArgs.UnreferencedId
UnreferencedObjectEventArgs.UnreferencedObject
System.Xml.Serialization.UnreferencedObjectEventHandler delegate
System.Xml.Serialization.XmlAnyAttributeAttribute class
XmlAnyAttributeAttribute.XmlAnyAttributeAttribute
System.Xml.Serialization.XmlAnyElementAttribute class
XmlAnyElementAttribute.XmlAnyElementAttribute
[XmlAnyElementAttribute Properties]
XmlAnyElementAttribute.Name
XmlAnyElementAttribute.Namespace
XmlAnyElementAttribute.Order
System.Xml.Serialization.XmlAnyElementAttributes class
XmlAnyElementAttributes.XmlAnyElementAttributes
[XmlAnyElementAttributes Methods]
XmlAnyElementAttributes.Add
XmlAnyElementAttributes.Contains
XmlAnyElementAttributes.CopyTo
XmlAnyElementAttributes.IndexOf
XmlAnyElementAttributes.Insert
XmlAnyElementAttributes.Remove
[XmlAnyElementAttributes Properties]
XmlAnyElementAttributes.Item
System.Xml.Serialization.XmlArrayAttribute class
XmlArrayAttribute.XmlArrayAttribute
[XmlArrayAttribute Properties]
XmlArrayAttribute.ElementName
XmlArrayAttribute.Form
XmlArrayAttribute.IsNullable
XmlArrayAttribute.Namespace
XmlArrayAttribute.Order
System.Xml.Serialization.XmlArrayItemAttribute class
XmlArrayItemAttribute.XmlArrayItemAttribute
[XmlArrayItemAttribute Properties]
XmlArrayItemAttribute.DataType
XmlArrayItemAttribute.ElementName
XmlArrayItemAttribute.Form
XmlArrayItemAttribute.IsNullable
XmlArrayItemAttribute.IsNullableSpecified
XmlArrayItemAttribute.Namespace
XmlArrayItemAttribute.NestingLevel
XmlArrayItemAttribute.Type
System.Xml.Serialization.XmlArrayItemAttributes class
XmlArrayItemAttributes.XmlArrayItemAttributes
[XmlArrayItemAttributes Methods]
XmlArrayItemAttributes.Add
XmlArrayItemAttributes.Contains
XmlArrayItemAttributes.CopyTo
XmlArrayItemAttributes.IndexOf
XmlArrayItemAttributes.Insert
XmlArrayItemAttributes.Remove
[XmlArrayItemAttributes Properties]
XmlArrayItemAttributes.Item
System.Xml.Serialization.XmlAttributeAttribute class
XmlAttributeAttribute.XmlAttributeAttribute
[XmlAttributeAttribute Properties]
XmlAttributeAttribute.AttributeName
XmlAttributeAttribute.DataType
XmlAttributeAttribute.Form
XmlAttributeAttribute.Namespace
XmlAttributeAttribute.Type
System.Xml.Serialization.XmlAttributeEventArgs class
[XmlAttributeEventArgs Properties]
XmlAttributeEventArgs.Attr
XmlAttributeEventArgs.LineNumber
XmlAttributeEventArgs.LinePosition
XmlAttributeEventArgs.ObjectBeingDeserialized
System.Xml.Serialization.XmlAttributeEventHandler delegate
System.Xml.Serialization.XmlAttributeOverrides class
XmlAttributeOverrides.XmlAttributeOverrides
[XmlAttributeOverrides Methods]
XmlAttributeOverrides.Add
[XmlAttributeOverrides Properties]
XmlAttributeOverrides.Item
XmlAttributeOverrides.Item
System.Xml.Serialization.XmlAttributes class
XmlAttributes.XmlAttributes
[XmlAttributes Properties]
XmlAttributes.XmlAnyAttribute
XmlAttributes.XmlAnyElements
XmlAttributes.XmlArray
XmlAttributes.XmlArrayItems
XmlAttributes.XmlAttribute
XmlAttributes.XmlChoiceIdentifier
XmlAttributes.XmlDefaultValue
XmlAttributes.XmlElements
XmlAttributes.XmlEnum
XmlAttributes.XmlIgnore
XmlAttributes.Xmlns
XmlAttributes.XmlRoot
XmlAttributes.XmlText
XmlAttributes.XmlType
System.Xml.Serialization.XmlChoiceIdentifierAttribute class
XmlChoiceIdentifierAttribute.XmlChoiceIdentifierAttribute
[XmlChoiceIdentifierAttribute Properties]
XmlChoiceIdentifierAttribute.MemberName
System.Xml.Serialization.XmlElementAttribute class
XmlElementAttribute.XmlElementAttribute
[XmlElementAttribute Properties]
XmlElementAttribute.DataType
XmlElementAttribute.ElementName
XmlElementAttribute.Form
XmlElementAttribute.IsNullable
XmlElementAttribute.Namespace
XmlElementAttribute.Order
XmlElementAttribute.Type
System.Xml.Serialization.XmlElementAttributes class
XmlElementAttributes.XmlElementAttributes
[XmlElementAttributes Methods]
XmlElementAttributes.Add
XmlElementAttributes.Contains
XmlElementAttributes.CopyTo
XmlElementAttributes.IndexOf
XmlElementAttributes.Insert
XmlElementAttributes.Remove
[XmlElementAttributes Properties]
XmlElementAttributes.Item
System.Xml.Serialization.XmlElementEventArgs class
[XmlElementEventArgs Properties]
XmlElementEventArgs.Element
XmlElementEventArgs.LineNumber
XmlElementEventArgs.LinePosition
XmlElementEventArgs.ObjectBeingDeserialized
System.Xml.Serialization.XmlElementEventHandler delegate
System.Xml.Serialization.XmlEnumAttribute class
XmlEnumAttribute.XmlEnumAttribute
[XmlEnumAttribute Properties]
XmlEnumAttribute.Name
System.Xml.Serialization.XmlIgnoreAttribute class
XmlIgnoreAttribute.XmlIgnoreAttribute
System.Xml.Serialization.XmlIncludeAttribute class
XmlIncludeAttribute.XmlIncludeAttribute
[XmlIncludeAttribute Properties]
XmlIncludeAttribute.Type
System.Xml.Serialization.XmlMapping class
[XmlMapping Properties]
XmlMapping.ElementName
XmlMapping.Namespace
System.Xml.Serialization.XmlNamespaceDeclarationsAttribute class
XmlNamespaceDeclarationsAttribute.XmlNamespaceDeclarationsAttribute
System.Xml.Serialization.XmlNodeEventArgs class
[XmlNodeEventArgs Properties]
XmlNodeEventArgs.LineNumber
XmlNodeEventArgs.LinePosition
XmlNodeEventArgs.LocalName
XmlNodeEventArgs.Name
XmlNodeEventArgs.NamespaceURI
XmlNodeEventArgs.NodeType
XmlNodeEventArgs.ObjectBeingDeserialized
XmlNodeEventArgs.Text
System.Xml.Serialization.XmlNodeEventHandler delegate
System.Xml.Serialization.XmlReflectionImporter class
XmlReflectionImporter.XmlReflectionImporter
[XmlReflectionImporter Methods]
XmlReflectionImporter.ImportTypeMapping
XmlReflectionImporter.IncludeType
XmlReflectionImporter.IncludeTypes
System.Xml.Serialization.XmlRootAttribute class
XmlRootAttribute.XmlRootAttribute
[XmlRootAttribute Properties]
XmlRootAttribute.DataType
XmlRootAttribute.ElementName
XmlRootAttribute.IsNullable
XmlRootAttribute.IsNullableSpecified
XmlRootAttribute.Namespace
System.Xml.Serialization.XmlSchemaProviderAttribute class
XmlSchemaProviderAttribute.XmlSchemaProviderAttribute
[XmlSchemaProviderAttribute Properties]
XmlSchemaProviderAttribute.MethodName
System.Xml.Serialization.XmlSerializer class
XmlSerializer.XmlSerializer
[XmlSerializer Methods]
XmlSerializer.CanDeserialize
XmlSerializer.Deserialize
XmlSerializer.FromTypes
XmlSerializer.Serialize
[XmlSerializer Events]
XmlSerializer.UnknownAttribute
XmlSerializer.UnknownElement
XmlSerializer.UnknownNode
XmlSerializer.UnreferencedObject
System.Xml.Serialization.XmlSerializerNamespaces class
XmlSerializerNamespaces.XmlSerializerNamespaces
[XmlSerializerNamespaces Methods]
XmlSerializerNamespaces.Add
XmlSerializerNamespaces.ToArray
[XmlSerializerNamespaces Properties]
XmlSerializerNamespaces.Count
System.Xml.Serialization.XmlTextAttribute class
XmlTextAttribute.XmlTextAttribute
[XmlTextAttribute Properties]
XmlTextAttribute.DataType
XmlTextAttribute.Type
System.Xml.Serialization.XmlTypeAttribute class
XmlTypeAttribute.XmlTypeAttribute
[XmlTypeAttribute Properties]
XmlTypeAttribute.AnonymousType
XmlTypeAttribute.IncludeInSchema
XmlTypeAttribute.Namespace
XmlTypeAttribute.TypeName
System.Xml.Serialization.XmlTypeMapping class
[XmlTypeMapping Properties]
XmlTypeMapping.TypeFullName
XmlTypeMapping.TypeName
System.Xml.XPath namespace
System.Xml.XPath.XPathException class
XPathException.XPathException
System.Xml.XPath.XPathItem class
XPathItem.XPathItem
[XPathItem Methods]
XPathItem.ValueAs
[XPathItem Properties]
XPathItem.IsNode
XPathItem.TypedValue
XPathItem.Value
XPathItem.ValueAsBoolean
XPathItem.ValueAsDateTime
XPathItem.ValueAsDouble
XPathItem.ValueAsInt
XPathItem.ValueAsLong
XPathItem.ValueType
XPathItem.XmlType
System.Xml.Xsl namespace
System.Xml.Xsl.XsltException class
XsltException.XsltException
[XsltException Properties]
XsltException.LineNumber
XsltException.LinePosition
XsltException.SourceUri
XNA Game Studio 2.0
See Also
Concepts
Threading (C# Programming Guide)
Thread Pools in the .NET Compact Framework for Xbox 360
Reference
System.Threading.Thread Members
System.Threading.Thread.SetProcessorAffinity Method
XNA Game Studio 2.0
Thread.SetProcessorAffinity Method
Note
This method is available only when developing for Xbox 360.
Sets the processor affinity for a managed thread. Processor affinity determines the processors on which a thread runs.
Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)
Syntax
C#
public void SetProcessorAffinity (
params int[] cpus
)
Parameters
cpus
An array of identifiers that specify the hardware threads on which the managed thread is permitted to run.
For Xbox 360, only a single hardware thread can be specified—the cpus array should contain only one element. The
hardware thread number must be in the range 0 through 5.
XNA Game Studio games should not use hardware threads 0 or 2; see Remarks below.
Exceptions
Exception type Condition
InvalidOperationException An invalid value was passed to the method.
Remarks
Each of the three CPU cores on the Xbox 360 has two hardware threads; the hardware thread number selects a specific
hardware thread on a specific core. Hardware threads 0 and 1 are the hardware threads on core 0; 2 and 3 are the hardware
threads on core 1; and 4 and 5 are the hardware threads on core 2.
Hardware Thread Number Core
0 or 1 0
2 or 3 1
4 or 5 2
Xbox 360 software threads are associated with, and run on, only a single hardware thread at a time. The hardware thread on
which a thread runs (the thread's processor affinity) must be set to a single hardware thread, but can be subsequently changed
by calling SetProcessorAffinity with a different hardware thread number. When a thread is created, it is initially assigned to
the current hardware thread (that is, the hardware thread on which the current thread is running).
For Xbox 360 threads, you cannot clear the thread's processor affinity by passing an empty array as the cpus parameter. An
Xbox 360 thread will always be associated with one hardware thread.
XNA Game Studio games should not use hardware threads 0 or 2, which are reserved for the XNA Framework. The following
table identifies Xbox 360 hardware thread usage.
Hardware Thread Available
0 No, reserved for XNA Framework.
1 Yes
2 No, reserved for XNA Framework.
3 Yes
4 Yes
5 Yes
To determine the number of hardware threads supported by the hardware, use System.Environment.ProcessorCount.
This method should not be used with threads created by the ThreadPool or Timer classes.
See Also
Tasks
How To: Create and Terminate Threads (C# Programming Guide)
Concepts
Threading (C# Programming Guide)
Using Threading (C# Programming Guide)
Reference
Thread Class
Thread Members
System.Threading Namespace
System.Environment.ProcessorCount Method
Platforms
Xbox 360
XNA Game Studio 2.0
a 2 bubblecs.exe 763f9d2
t 2 System.RuntimeType
o 7c79f 2 64
t 1 System.NullReferenceException
o 7cb42 2 64
o 1ce004 1 18
t 3 System.OutOfMemoryException
o 1ce056 1d 118 1ce11f 1ce14c 1ce079 1ce113 1ce116 1ce267 1ce26a 1ce26d
r 22c81b 5 0
o 22c81e 1b 24
r 22c81e 5 0
o 22c823 1b 28
r 22c823 5 0
c bubblecs.exe 763fbef
AppDomain Record
An AppDomain record marks the beginning of a file section that pertains to a particular application domain. All the type, object,
and root information for the garbage collector heap for that application domain is included in this section of the file. All
AppDomain records close with a corresponding End AppDomain record.
The AppDomain record has four elements.
Letter "a" – identifies the record as an AppDomain record.
Version number – number used to track the file format of the dump file. For example, in the .NET Compact Framework
version 2.0 Service Pack 2, this number is always "2".
AppDomain name – name of the application domain used to generate the heap dump file. This is typically the name of
the executable that ran in the application domain.
Time stamp – time that the log data was generated. This value shows the number of milliseconds, represented as a hex
value, since the device booted.
The following example shows an AppDomain record.
a 2 HH3.exe 763f9d2
Type Record
Type records identify types in the garbage collector heap. Each Type record contains three elements.
Letter "t" – identifies the record as a Type record.
Type ID – unique numeric identifier for the type. This identifier ties object instances to their types. (See the description of
Object records in the next section.)
Note
The type ID is not guaranteed to be unique across dump files. For example, the identifier for the "CorporateContacts" ty
pe in the following example is not guaranteed to be "a1" in a different dump that is taken from the same application at
a different point in time.
Type name – fully qualified name of the type.
The following example shows a Type record.
t a1 com.PBSG.WATS.HH3.Biz.Entity.CorporateContacts
Object Record
Object records describe specific instances of types in the garbage collector heap. Object records have a variable number of
elements.
The first four elements are required, and are as follows.
Letter "o" – identifies the record as an Object record.
Object ID – unique numeric identifier for the object.
Note
Object identifiers are not guaranteed to be unique across dump files. Because object identifiers can change in different
dumps of the same heap, it is not possible to develop tools that identify trends across dump files.
Type ID – identifier for the type of the object.
Object size – size, in bytes, of the object instance.
In addition to the four required elements, Object records may have a variable number of the following element.
Referenced object IDs – identifies other objects that the object references.
The Type record that corresponds to a particular Object record is not guaranteed to precede the Object record in the dump file.
The following example shows an Object record with three referenced object IDs.
o 1ce056 1d 118 1ce11f 1ce14c 1ce079
Root Record
Root records identify garbage collector roots.
Each Root record contains four required elements.
Letter "r" – identifies the record as a root record.
Object ID – identifier of the root object.
Root descriptor – explains why the object instance is classified as a root.
The following table shows the possible values for the descriptor.
Val Definition
ue
0 The object instance is rooted internally by the .NET Compact Framework. For example, this includes object instances
for application domains, assemblies, exceptions, and so forth.
1 The object instance is a local variable.
2 The object instance is on the finalizer queue waiting for its finalizer to run. After the finalizer runs, the object will be c
ollected during the next garbage collection.
3 A garbage collector handle (that is, a GCHandle) exists that refers to the object instance.
4 The object instance is a static variable.
5 The object instance is a root that is specific to the garbage collection implementation in the .NET Compact Framewor
k. For example, this includes interned strings and class descriptions.
Root flag – flags that provide more information about the root.
The following table shows the possible flags.
Flag Definition
0 Normal root. This value is applied to the root if none of the other flags apply.
1
The root is pinned. A root can be pinned for the following reasons.
It refers to managed objects that are passed to native code through platform invoke.
It is referenced by a GCHandle that is created with a GCHandleType of Pinned.
A pointer in unsafe code points to the object.
A value type field within the object is referenced directly by a method argument.
2 A GCHandle whose GCHandleType is Weak refers to the object.
4 The object is pointed to by a pointer in unsafe code or is referenced by a value type field inside another object.
If the root descriptor is static (4), the root record will have an additional element.
Root container – identifier of the type that contains the static variable.
The following example shows a root record with an additional root container element.
r b2753 4 0 13c
End AppDomain Record
End AppDomain records close the section that is initiated by a corresponding AppDomain record.
End AppDomain records have three elements.
Letter "c" – identifies the record as an End AppDomain record.
Application name – name of the application from which the dump file was generated. This name matches the name in the
AppDomain record at the beginning of the file.
Time stamp – time that the log data was completed. This value shows the number of milliseconds, represented as a hex
value, since the device booted.
The following example shows an End AppDomain record.
c HH3.exe 763fbef
See Also
Tasks
How To: Monitor Performance at Run Time
How To: Generate a Garbage Collector Heap Dump
Reference
GCHandle
GCHandleType
XNA Game Studio 2.0
Microsoft.Xna.Framework Namespace
Provides commonly needed game classes such as timers and game loops.
Classes
Name Description
BoundingFrustum Defines a frustum and helps determine whether forms intersect with it.
Curve Stores an arbitrary collection of 2D CurveKey points, and provides methods for evalu
ating features of the curve they define.
CurveKey Represents a point in a multi-point curve.
CurveKeyCollection Contains the CurveKeys making up a Curve.
DrawableGameComponent A game component that is notified when it needs to draw itself.
Game Provides basic graphics device initialization, game logic, and rendering code.
GameComponent Base class for all XNA Framework game components.
GameComponentCollection A collection of game components.
GameComponentCollectionEventArgs Arguments used with events from the GameComponentCollection.
GameServiceContainer A collection of game services.
GameTime Snapshot of the game timing state expressed in values that can be used by variable-s
tep (real time) or fixed-step (game time) games.
GameWindow The system window associated with a Game.
GraphicsDeviceInformation Holds the settings for creating a graphics device on Windows.
GraphicsDeviceManager Handles the configuration and management of the graphics device.
MathHelper Contains commonly used precalculated values.
NoSuitableGraphicsDeviceException Thrown when no available graphics device fits the given device preferences.
PreparingDeviceSettingsEventArgs Arguments for the GraphicsDeviceManager.PreparingDeviceSettings event.
Interfaces
Name Description
IDrawable Defines the interface for a drawable game component.
IGameComponent Defines an interface for game components.
IGraphicsDeviceManager Defines the interface for an object that manages a GraphicsDevice.
IUpdateable Defines an interface for a game component that should be updated in Game.Update.
Structures
Name Description
BoundingBox Defines an axis-aligned box-shaped 3D volume.
BoundingSphere Defines a sphere.
Matrix Defines a matrix.
Plane Defines a plane.
Point Defines a point in 2D space.
Quaternion Defines a quaternion.
Ray Defines a ray.
Rectangle Defines a rectangle.
Vector2 Defines a vector with two components.
Vector3 Defines a vector with three components.
Vector4 Defines a vector with four components.
Enumerations
Name Description
ContainmentType Indicates the extent to which bounding volumes intersect or contain one another.
CurveContinuity Defines the continuity of CurveKeys on a Curve.
CurveLoopType Defines how the value of a Curve will be determined for positions before the first point on the Curve
or after the last point on the Curve.
CurveTangent Specifies different tangent types to be calculated for CurveKey points in a Curve.
PlaneIntersectionType Describes the intersection between a plane and a bounding volume.
PlayerIndex Specifies the index of a player.
TargetPlatform Defines the target platform to be used when compiling content.
See Also
Tasks
How To: Allow the Player to Resize a Game Window
How To: Pause a Game
How To: Exit a Game
How To: Display a Game in Full-Screen Mode
How To: Restrict Graphics Devices to Widescreen Aspect Ratios in Full-Screen Mode
How To: Make a Game Time Out
How To: Make a Game Use a Variable Time Step
How To: Transform a Point with a Matrix
How To: Rotate and Move a Camera
How To: Make a First-Person Camera
How To: Make a Third-Person Camera
How To: Script the Camera to Follow a Curve
How To: Position the Camera to View All Objects in a Scene
How To: Detect Whether Two Models Collide
How To: Detect Whether a User Clicked a 3D Object
Concepts
Application Model Overview
Math Overview
XNA Game Studio 2.0
BoundingBox Structure
Defines an axis-aligned box-shaped 3D volume.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[TypeConverterAttribute("typeof(Microsoft.Xna.Framework.Design.BoundingBoxConverter)")]
[SerializableAttribute]
public struct BoundingBox : IEquatable<BoundingBox>
Remarks
The BoundingBox Structure represents the space occupied by a box. The bounding box class is axis aligned. Each face of the
bounding box is perpendicular to the x-axis, the y-axis, or the z-axis.
There are several benefits of using the bounding box for collision detection.
The bounding box class fits rectangular shapes aligned with the axis very well. Compared to the bounding sphere class,
the bounding box class provides a much tighter fit for non-rotated rectangular objects.
Because the bounding box class is axis aligned, you can make certain assumptions that result in collision checks between
bounding boxes being quicker than a bounding box that can be rotated.
There are a few drawbacks of using the bounding box for collision detection.
Rotating a bounding box causes it to no longer be axis aligned. Because of this, if you rotate a model being bounded, you
will need to recreate the bounding box. Doing so can be slow, since all the points in an object are iterated through to get
the bounding box. If the model has not changed orientation, you can translate the bounding box instead of recreating it.
If the model being bounded is not aligned to the axis, the bounding box will have some empty space. The amount of
empty space will be greatest when the object is rotated 45 degrees from an axis.
Empty space in the bounding box can result in false positives when checking for collision.
See Also
Concepts
Collision Detection Overview
Math Overview
Tasks
How To: Detect Whether Two Models Collide
How To: Position the Camera to View All Objects in a Scene
Reference
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingBox Members
The following tables list the members exposed by the BoundingBox type.
Public Constructors
Name Description
BoundingBox Creates an instance of BoundingBox.
Public Fields
Name Description
CornerCount Specifies the total number of corners (8) in the BoundingBox.
Max The maximum point the BoundingBox contains.
Min The minimum point the BoundingBox contains.
Public Methods
Name Description
Contains Overloaded. Tests whether the BoundingBox overlaps another bounding volume.
CreateFromPoints Creates the smallest BoundingBox that will contain a group of points.
CreateFromSphere Overloaded. Creates the smallest BoundingBox that will contain the specified BoundingSphere.
CreateMerged Overloaded. Creates the smallest BoundingBox that contains the two specified BoundingBox instance
s.
Equals Overloaded. Determines whether two instances of BoundingBox are equal.
GetCorners Overloaded. Gets an array of points that make up the corners of the BoundingBox.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
Intersects Overloaded. Checks whether the current BoundingBox intersects with another bounding volume.
op_Equality Determines whether two instances of BoundingBox are equal.
op_Inequality Determines whether two instances of BoundingBox are not equal.
ReferenceEquals (Inherited from Object.)
ToString Returns a String that represents the current BoundingBox.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
BoundingBox Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
BoundingBox Fields
Public Fields
Name Description
CornerCount Specifies the total number of corners (8) in the BoundingBox.
Max The maximum point the BoundingBox contains.
Min The minimum point the BoundingBox contains.
See Also
Reference
BoundingBox Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
BoundingBox.CornerCount Field
Specifies the total number of corners (8) in the BoundingBox.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public const int CornerCount
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingBox.Max Field
The maximum point the BoundingBox contains.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Max
Remarks The maximum point is the point with components that are greater than or equal to the components of every other
point within the BoundingBox. Since a BoundingBox is axis aligned the maximum point is the upper-right corner of the front
face of the BoundingBox when looking at it from the positive z direction.
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingBox.Min Field
The minimum point the BoundingBox contains.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Min
Remarks The minimum point is the point with components that are less than or equal to the components of every other point
within the BoundingBox. Since a BoundingBox is axis aligned the minimum point is the lower-left corner of the back face of the
BoundingBox when looking at it from the positive z direction.
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingBox Constructor
Creates an instance of BoundingBox.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public BoundingBox (
Vector3 min,
Vector3 max
)
Parameters
min
The minimum point the BoundingBox includes.
max
The maximum point the BoundingBox includes.
Remarks
The BoundingBox Structure represents the space occupied by a box. The bounding box class is axis aligned. Each face of the
bounding box is perpendicular to the x-axis, the y-axis, or the z-axis.
There are several benefits of using the bounding box for collision detection.
The bounding box class fits rectangular shapes aligned with the axis very well. Compared to the bounding sphere class,
the bounding box class provides a much tighter fit for non-rotated rectangular objects.
Because the bounding box class is axis aligned, you can make certain assumptions that result in collision checks between
bounding boxes being quicker than a bounding box that can be rotated.
There are a few drawbacks of using the bounding box for collision detection.
Rotating a bounding box causes it to no longer be axis aligned. Because of this, if you rotate a model being bounded, you
will need to recreate the bounding box. Doing so can be slow, since all the points in an object are iterated through to get
the bounding box. If the model has not changed orientation, you can translate the bounding box instead of recreating it.
If the model being bounded is not aligned to the axis, the bounding box will have some empty space. The amount of
empty space will be greatest when the object is rotated 45 degrees from an axis.
Empty space in the bounding box can result in false positives when checking for collision.
See Also
Concepts
Collision Detection Overview
Math Overview
Tasks
How To: Detect Whether Two Models Collide
How To: Position the Camera to View All Objects in a Scene
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingBox Methods
Public Methods
Name Description
Contains Overloaded. Tests whether the BoundingBox overlaps another bounding volume.
CreateFromPoints Creates the smallest BoundingBox that will contain a group of points.
CreateFromSphere Overloaded. Creates the smallest BoundingBox that will contain the specified BoundingSphere.
CreateMerged Overloaded. Creates the smallest BoundingBox that contains the two specified BoundingBox instance
s.
Equals Overloaded. Determines whether two instances of BoundingBox are equal.
GetCorners Overloaded. Gets an array of points that make up the corners of the BoundingBox.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
Intersects Overloaded. Checks whether the current BoundingBox intersects with another bounding volume.
op_Equality Determines whether two instances of BoundingBox are equal.
op_Inequality Determines whether two instances of BoundingBox are not equal.
ReferenceEquals (Inherited from Object.)
ToString Returns a String that represents the current BoundingBox.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
BoundingBox Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
BoundingBox.Contains Method
Tests whether the BoundingBox overlaps another bounding volume.
Overload List
Name Description
BoundingBox.Contains (BoundingBox) Tests whether the BoundingBox contains another BoundingBox.
BoundingBox.Contains (BoundingBox, ContainmentType) Tests whether the BoundingBox contains a BoundingBox.
BoundingBox.Contains (BoundingFrustum) Tests whether the BoundingBox contains a BoundingFrustum.
BoundingBox.Contains (BoundingSphere) Tests whether the BoundingBox contains a BoundingSphere.
BoundingBox.Contains (BoundingSphere, ContainmentType) Tests whether the BoundingBox contains a BoundingSphere.
BoundingBox.Contains (Vector3) Tests whether the BoundingBox contains a point.
BoundingBox.Contains (Vector3, ContainmentType) Tests whether the BoundingBox contains a point.
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
box
The BoundingBox to test for overlap.
Return Value
Enumeration indicating the extent of overlap.
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
box
The BoundingBox to test for overlap.
result
[OutAttribute] Enumeration indicating the extent of overlap.
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
frustum
The BoundingFrustum to test for overlap.
Return Value
Enumeration indicating the extent of overlap.
Exceptions
Exception type Condition
ArgumentNullException frustum is null.
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sphere
The BoundingSphere to test for overlap.
Return Value
Enumeration indicating the extent of overlap.
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sphere
The BoundingSphere to test for overlap.
result
[OutAttribute] Enumeration indicating the extent of overlap.
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
point
The point to test for overlap.
Return Value
Enumeration indicating the extent of overlap.
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
point
The point to test for overlap.
result
[OutAttribute] Enumeration indicating the extent of overlap.
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingBox.CreateFromPoints Method
Creates the smallest BoundingBox that will contain a group of points.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static BoundingBox CreateFromPoints (
IEnumerable<Vector3> points
)
Parameters
points
A list of points the BoundingBox should contain.
Return Value
The created BoundingBox.
Exceptions
Exception type Condition
ArgumentException There are no points in points.
ArgumentNullException points is null.
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingBox.CreateFromSphere Method
Creates the smallest BoundingBox that will contain the specified BoundingSphere.
Overload List
Name Description
BoundingBox.CreateFromSphere (BoundingSphere) Creates the smallest BoundingBox that will contain the speci
fied BoundingSphere.
BoundingBox.CreateFromSphere (BoundingSphere, BoundingBox) Creates the smallest BoundingBox that will contain the speci
fied BoundingSphere.
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
sphere
The BoundingSphere to contain.
Return Value
The created BoundingBox.
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sphere
The BoundingSphere to contain.
result
[OutAttribute] The created BoundingBox.
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingBox.CreateMerged Method
Creates the smallest BoundingBox that contains the two specified BoundingBox instances.
Overload List
Name Description
BoundingBox.CreateMerged (BoundingBox, BoundingBox) Creates the smallest BoundingBox that contains the t
wo specified BoundingBox instances.
BoundingBox.CreateMerged (BoundingBox, BoundingBox, BoundingBox) Creates the smallest BoundingBox that contains the t
wo specified BoundingBox instances.
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
original
One of the BoundingBoxs to contain.
additional
One of the BoundingBoxs to contain.
Return Value
The created BoundingBox.
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
original
One of the BoundingBox instances to contain.
additional
One of the BoundingBox instances to contain.
result
[OutAttribute] The created BoundingBox.
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingBox.Equals Method
Determines whether two instances of BoundingBox are equal.
Overload List
Name Description
BoundingBox.Equals (BoundingBox) Determines whether two instances of BoundingBox are equal.
BoundingBox.Equals (Object) Determines whether two instances of BoundingBox are equal.
BoundingBox.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
other
The BoundingBox to compare with the current BoundingBox.
Return Value
true if the specified BoundingBox is equal to the current BoundingBox; false otherwise.
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
obj
The Object to compare with the current BoundingBox.
Return Value
true if the specified Object is equal to the current BoundingBox; false otherwise.
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingBox.GetCorners Method
Gets an array of points that make up the corners of the BoundingBox.
Overload List
Name Description
BoundingBox.GetCorners () Gets an array of points that make up the corners of the BoundingBox.
BoundingBox.GetCorners (Vector3[]) Gets the array of points that make up the corners of the BoundingBox.
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
BoundingBox.GetCorners Method ()
Gets an array of points that make up the corners of the BoundingBox.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3[] GetCorners ()
Return Value
An array of Vector3 points that represent the corners of the BoundingBox.
Exceptions
Exception type Condition
ArgumentOutOfRangeException You have to have at least 8 elements to copy corners.
Remarks
The points returned correspond to the corners of the BoundingBox faces that are perpendicular to the z-axis. The near face is
the face with the larger z value, and the far face is the face with the smaller z value. Points 0 to 3 correspond to the near face in
a clockwise order starting at its upper-left corner when looking toward the origin from the positive z direction. Points 4 to 7
correspond to the far face in a clockwise order starting at its upper-left corner when looking toward the origin from the
positive z direction.
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
corners
An existing array of at least 8 Vector3 points where the corners of the BoundingBox are written.
Exceptions
Exception type Condition
ArgumentNullException corners is null.
ArgumentOutOfRangeException You have to have at least 8 elements to copy corners.
Remarks
The points returned correspond to the corners of the BoundingBox faces that are perpendicular to the z-axis. The near face is
the face with the larger z value, and the far face is the face with the smaller z value. Points 0 to 3 correspond to the near face in
a clockwise order starting at its upper-left corner when looking toward the origin from the positive z direction. Points 4 to 7
correspond to the far face in a clockwise order starting at its upper-left corner when looking toward the origin from the
positive z direction.
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingBox.GetHashCode Method
Gets the hash code for this instance.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
A hash code for the current BoundingBox.
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingBox.Intersects Method
Checks whether the current BoundingBox intersects with another bounding volume.
Overload List
Name Description
BoundingBox.Intersects (BoundingBox) Checks whether the current BoundingBox intersects another
BoundingBox.
BoundingBox.Intersects (BoundingBox, Boolean) Checks whether the current BoundingBox intersects another
BoundingBox.
BoundingBox.Intersects (BoundingFrustum) Checks whether the current BoundingBox intersects a BoundingFrustum
.
BoundingBox.Intersects (BoundingSphere) Checks whether the current BoundingBox intersects a BoundingSphere.
BoundingBox.Intersects (BoundingSphere, Boolean) Checks whether the current BoundingBox intersects a BoundingSphere.
BoundingBox.Intersects (Plane) Checks whether the current BoundingBox intersects a Plane.
BoundingBox.Intersects (Plane, PlaneIntersectionType) Checks whether the current BoundingBox intersects a Plane.
BoundingBox.Intersects (Ray) Checks whether the current BoundingBox intersects a Ray.
BoundingBox.Intersects (Ray, Nullable<Single>) Checks whether the current BoundingBox intersects a Ray.
See Also
Tasks
How To: Detect Whether Two Models Collide
Concepts
Collision Detection Overview
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
box
The BoundingBox to check for intersection with.
Return Value
true if the BoundingBoxs intersect; false otherwise.
See Also
Tasks
How To: Detect Whether Two Models Collide
Concepts
Collision Detection Overview
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
box
The BoundingBox to check for intersection with.
result
[OutAttribute] true if the BoundingBox instances intersect; false otherwise.
See Also
Tasks
How To: Detect Whether Two Models Collide
Concepts
Collision Detection Overview
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
frustum
The BoundingFrustum to check for intersection with.
Return Value
true if the BoundingBox and BoundingFrustum intersect; false otherwise.
Exceptions
Exception type Condition
ArgumentNullException frustum is null.
See Also
Tasks
How To: Detect Whether Two Models Collide
Concepts
Collision Detection Overview
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sphere
The BoundingSphere to check for intersection with.
Return Value
true if the BoundingBox and BoundingSphere intersect; false otherwise.
See Also
Tasks
How To: Detect Whether Two Models Collide
Concepts
Collision Detection Overview
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sphere
The BoundingSphere to check for intersection with.
result
[OutAttribute] true if the BoundingBox and BoundingSphere intersect; false otherwise.
See Also
Tasks
How To: Detect Whether Two Models Collide
Concepts
Collision Detection Overview
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
plane
The Plane to check for intersection with.
Return Value
An enumeration indicating whether the BoundingBox intersects the Plane.
See Also
Tasks
How To: Detect Whether Two Models Collide
Concepts
Collision Detection Overview
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
plane
The Plane to check for intersection with.
result
[OutAttribute] An enumeration indicating whether the BoundingBox intersects the Plane.
See Also
Tasks
How To: Detect Whether Two Models Collide
Concepts
Collision Detection Overview
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
ray
The Ray to check for intersection with.
Return Value
Distance at which the ray intersects the BoundingBox, or null if there is no intersection.
See Also
Tasks
How To: Detect Whether Two Models Collide
Concepts
Collision Detection Overview
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
ray
The Ray to check for intersection with.
result
[OutAttribute] Distance at which the ray intersects the BoundingBox, or null if there is no intersection.
See Also
Tasks
How To: Detect Whether Two Models Collide
Concepts
Collision Detection Overview
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingBox.op_Equality Method
Determines whether two instances of BoundingBox are equal.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
BoundingBox a,
BoundingBox b
)
Parameters
a
BoundingBox to compare.
b
BoundingBox to compare.
Return Value
true if the two BoundingBoxs are equal; false otherwise.
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingBox.op_Inequality Method
Determines whether two instances of BoundingBox are not equal.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
BoundingBox a,
BoundingBox b
)
Parameters
a
The object to the left of the inequality operator.
b
The object to the right of the inequality operator.
Return Value
true if left is not equal to right; false otherwise.
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingBox.ToString Method
Returns a String that represents the current BoundingBox.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of the current BoundingBox.
See Also
Reference
BoundingBox Structure
BoundingBox Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingFrustum Class
Defines a frustum and helps determine whether forms intersect with it.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[TypeConverterAttribute(System.ComponentModel.ExpandableObjectConverter, System, Version=2.
0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)]
[SerializableAttribute]
public class BoundingFrustum : IEquatable<BoundingFrustum>
Remarks
A frustum in computer graphics is generally a volume of 3D space, defined as the part of a rectangular pyramid that lies
between two planes perpendicular to its center line. A frustum is often used to represent what a "camera" sees in your 3D
space—for example:
The BoundingFrustum class allows you to define a bounding frustum using a combined matrix that is generally the product of
a view matrix and a projection matrix.
You can query a BoundingFrustum object for any one of its bounding planes, for its corners, and for whether it intersects with
a given object. Since objects that don't intersect with your view frustrum generally don't need to be rendered, culling them
quickly can save you a lot of rendering time.
See Also
Reference
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Programming Guide
Math Overview
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingFrustum Members
The following tables list the members exposed by the BoundingFrustum type.
Public Constructors
Name Description
BoundingFrustum Creates a new instance of BoundingFrustum.
Public Fields
Name Description
CornerCount Specifies the total number of corners (8) in the BoundingFrustum.
Public Properties
Name Description
Bottom Gets the bottom plane of the BoundingFrustum.
Far Gets the far plane of the BoundingFrustum.
Left Gets the left plane of the BoundingFrustum.
Matrix Gets the Matrix that was used to instantiate this bounding frustum.
Near Gets the near plane of the BoundingFrustum.
Right Gets the right plane of the BoundingFrustum.
Top Gets the top plane of the BoundingFrustum.
Public Methods
Name Description
Contains Overloaded. Checks whether the current BoundingFrustum contains a specified bounding volume.
Equals Overloaded. Determines whether two instances of BoundingFrustum are equal.
GetCorners Overloaded. Gets an array of points that make up the corners of the BoundingFrustum.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
Intersects Overloaded. Checks whether the current BoundingFrustum intersects a specified volume.
op_Equality Determines whether two instances of BoundingFrustum are equal.
op_Inequality Determines whether two instances of BoundingFrustum are not equal.
ReferenceEquals (Inherited from Object.)
ToString Returns a String that represents the current BoundingFrustum.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
BoundingFrustum Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
BoundingFrustum Fields
Public Fields
Name Description
CornerCount Specifies the total number of corners (8) in the BoundingFrustum.
See Also
Reference
BoundingFrustum Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
BoundingFrustum.CornerCount Field
Specifies the total number of corners (8) in the BoundingFrustum.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public const int CornerCount
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingFrustum Constructor
Creates a new instance of BoundingFrustum.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public BoundingFrustum (
Matrix value
)
Parameters
value
Combined matrix that usually takes view × projection matrix.
Remarks
You can use BoundingFrustum Class to create a bounding volume that corresponds to the space visible to the camera. You
create a bounding frustum from the combined view and projection matrix that the camera is using currently. If the camera
moves or rotates, you need to recreate the bounding frustum. The bounding frustum isn’t used to determine when two objects
collide, but rather when an object is in collision with the volume of space viewable by the camera. Objects that do not intersect
and are not contained by the bounding frustum are not visible to the camera and don’t need to be drawn. For complex models,
this can save the graphics card a lot of work.
See Also
Concepts
Collision Detection Overview
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingFrustum Methods
Public Methods
Name Description
Contains Overloaded. Checks whether the current BoundingFrustum contains a specified bounding volume.
Equals Overloaded. Determines whether two instances of BoundingFrustum are equal.
GetCorners Overloaded. Gets an array of points that make up the corners of the BoundingFrustum.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
Intersects Overloaded. Checks whether the current BoundingFrustum intersects a specified volume.
op_Equality Determines whether two instances of BoundingFrustum are equal.
op_Inequality Determines whether two instances of BoundingFrustum are not equal.
ReferenceEquals (Inherited from Object.)
ToString Returns a String that represents the current BoundingFrustum.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
BoundingFrustum Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
BoundingFrustum.Contains Method
Checks whether the current BoundingFrustum contains a specified bounding volume.
Overload List
Name Description
BoundingFrustum.Contains (BoundingBox) Checks whether the current BoundingFrustum contains the s
pecified BoundingBox.
BoundingFrustum.Contains (BoundingBox, ContainmentType) Checks whether the current BoundingFrustum contains the s
pecified BoundingBox.
BoundingFrustum.Contains (BoundingFrustum) Checks whether the current BoundingFrustum contains the s
pecified BoundingFrustum.
BoundingFrustum.Contains (BoundingSphere) Checks whether the current BoundingFrustum contains the s
pecified BoundingSphere.
BoundingFrustum.Contains (BoundingSphere, ContainmentType) Checks whether the current BoundingFrustum contains the s
pecified BoundingSphere.
BoundingFrustum.Contains (Vector3) Checks whether the current BoundingFrustum contains the s
pecified point.
BoundingFrustum.Contains (Vector3, ContainmentType) Checks whether the current BoundingFrustum contains the s
pecified point.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
box
The BoundingBox to check against the current BoundingFrustum.
Return Value
Enumeration indicating the relationship of the current BoundingFrustum to the specified BoundingBox.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
box
The BoundingBox to test for overlap.
result
[OutAttribute] Enumeration indicating the extent of overlap.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
frustum
The BoundingFrustum to check against the current BoundingFrustum.
Return Value
Enumeration indicating the relationship of the current BoundingFrustum to the specified BoundingFrustum.
Exceptions
Exception type Condition
ArgumentNullException frustum is null.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sphere
The BoundingSphere to check against the current BoundingFrustum.
Return Value
Enumeration indicating the relationship of the current BoundingFrustum to the specified BoundingSphere.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sphere
The BoundingSphere to test for overlap.
result
[OutAttribute] Enumeration indicating the extent of overlap.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
point
The point to check against the current BoundingFrustum.
Return Value
Enumeration indicating the relationship of the current BoundingFrustum to the specified point.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
point
The point to test for overlap.
result
[OutAttribute] Enumeration indicating the extent of overlap.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingFrustum.Equals Method
Determines whether two instances of BoundingFrustum are equal.
Overload List
Name Description
BoundingFrustum.Equals (BoundingFrustum) Determines whether the specified BoundingFrustum is equal to the current
BoundingFrustum.
BoundingFrustum.Equals (Object) Determines whether the specified Object is equal to the BoundingFrustum.
BoundingFrustum.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
other
The BoundingFrustum to compare with the current BoundingFrustum.
Return Value
true if the specified BoundingFrustum is equal to the current BoundingFrustum; false otherwise.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
obj
The Object to compare with the current BoundingFrustum.
Return Value
true if the specified Object is equal to the current BoundingFrustum; false otherwise.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingFrustum.GetCorners Method
Gets an array of points that make up the corners of the BoundingFrustum.
Overload List
Name Description
BoundingFrustum.GetCorners () Gets an array of points that make up the corners of the BoundingFrustum.
BoundingFrustum.GetCorners (Vector3[]) Gets an array of points that make up the corners of the BoundingFrustum.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
BoundingFrustum.GetCorners Method ()
Gets an array of points that make up the corners of the BoundingFrustum.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3[] GetCorners ()
Return Value
Array of Vector3 points that make up the corners of the BoundingFrustum.
Remarks
The points returned correspond to the corners of the BoundingFrustum faces that are perpendicular to the z-axis. The near face
is the face with the larger z value, and the far face is the face with the smaller z value. Points 0 to 3 correspond to the near face
in a clockwise order starting at its upper-left corner when looking toward the origin from the positive z direction. Points 4 to 7
correspond to the far face in a clockwise order starting at its upper-left corner when looking toward the origin from the
positive z direction.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
corners
An existing array of at least 8 Vector3 points where the corners of the BoundingFrustum are written.
Exceptions
Exception type Condition
ArgumentNullException corners is null.
ArgumentOutOfRangeException You have to have at least 8 elements to copy corners.
Remarks
The points returned correspond to the corners of the BoundingFrustum faces that are perpendicular to the z-axis. The near face
is the face with the larger z value, and the far face is the face with the smaller z value. Points 0 to 3 correspond to the near face
in a clockwise order starting at its upper-left corner when looking toward the origin from the positive z direction. Points 4 to 7
correspond to the far face in a clockwise order starting at its upper-left corner when looking toward the origin from the
positive z direction.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingFrustum.GetHashCode Method
Gets the hash code for this instance.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
A hash code for the current BoundingFrustum.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingFrustum.Intersects Method
Checks whether the current BoundingFrustum intersects a specified volume.
Overload List
Name Description
BoundingFrustum.Intersects (BoundingBox) Checks whether the current BoundingFrustum intersects the specifi
ed BoundingBox.
BoundingFrustum.Intersects (BoundingBox, Boolean) Checks whether the current BoundingFrustum intersects a
BoundingBox.
BoundingFrustum.Intersects (BoundingFrustum) Checks whether the current BoundingFrustum intersects the specifi
ed BoundingFrustum.
BoundingFrustum.Intersects (BoundingSphere) Checks whether the current BoundingFrustum intersects the specifi
ed BoundingSphere.
BoundingFrustum.Intersects (BoundingSphere, Boolean) Checks whether the current BoundingFrustum intersects a
BoundingSphere.
BoundingFrustum.Intersects (Plane) Checks whether the current BoundingFrustum intersects the specifi
ed Plane.
BoundingFrustum.Intersects (Plane, PlaneIntersectionType) Checks whether the current BoundingFrustum intersects a Plane.
BoundingFrustum.Intersects (Ray) Checks whether the current BoundingFrustum intersects the specifi
ed Ray.
BoundingFrustum.Intersects (Ray, Nullable<Single>) Checks whether the current BoundingFrustum intersects a Ray.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
box
The BoundingBox to check for intersection.
Return Value
true if the BoundingFrustum intersects the BoundingBox; false otherwise.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
box
The BoundingBox to check for intersection with.
result
[OutAttribute] true if the BoundingFrustum and BoundingBox intersect; false otherwise.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
frustum
The BoundingFrustum to check for intersection.
Return Value
true if the current BoundingFrustum intersects the specified BoundingFrustum; false otherwise.
Exceptions
Exception type Condition
ArgumentNullException frustum is null.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sphere
The BoundingSphere to check for intersection.
Return Value
true if the BoundingFrustum intersects the BoundingSphere; false otherwise.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sphere
The BoundingSphere to check for intersection with.
result
[OutAttribute] true if the BoundingFrustum and BoundingSphere intersect; false otherwise.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
plane
The Plane to check for intersection.
Return Value
An enumeration indicating whether BoundingFrustum intersects the specified Plane.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
plane
The Plane to check for intersection with.
result
[OutAttribute] An enumeration indicating whether the BoundingFrustum intersects the Plane.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
ray
The Ray to check for intersection.
Return Value
Distance at which the ray intersects the BoundingFrustum or null if there is no intersection.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
ray
The Ray to check for intersection with.
result
[OutAttribute] Distance at which the ray intersects the BoundingFrustum or null if there is no intersection.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingFrustum.op_Equality Method
Determines whether two instances of BoundingFrustum are equal.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
BoundingFrustum a,
BoundingFrustum b
)
Parameters
a
The BoundingFrustum to the left of the equality operator.
b
The BoundingFrustum to the right of the equality operator.
Return Value
true if left is equal to right; false otherwise.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingFrustum.op_Inequality Method
Determines whether two instances of BoundingFrustum are not equal.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
BoundingFrustum a,
BoundingFrustum b
)
Parameters
a
The BoundingFrustum to the left of the inequality operator.
b
The BoundingFrustum to the right of the inequality operator.
Return Value
true if left is not equal to right; false otherwise.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingFrustum.ToString Method
Returns a String that represents the current BoundingFrustum.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of the current BoundingFrustum.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingFrustum Properties
Public Properties
Name Description
Bottom Gets the bottom plane of the BoundingFrustum.
Far Gets the far plane of the BoundingFrustum.
Left Gets the left plane of the BoundingFrustum.
Matrix Gets the Matrix that was used to instantiate this bounding frustum.
Near Gets the near plane of the BoundingFrustum.
Right Gets the right plane of the BoundingFrustum.
Top Gets the top plane of the BoundingFrustum.
See Also
Reference
BoundingFrustum Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
BoundingFrustum.Bottom Property
Gets the bottom plane of the BoundingFrustum.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Plane Bottom { get; }
Property Value
Returns the bottom plane of the BoundingFrustum.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingFrustum.Far Property
Gets the far plane of the BoundingFrustum.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Plane Far { get; }
Property Value
Returns the far plane of the BoundingFrustum.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingFrustum.Left Property
Gets the left plane of the BoundingFrustum.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Plane Left { get; }
Property Value
Returns the left plane of the BoundingFrustum.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingFrustum.Matrix Property
Gets the Matrix that was used to instantiate this bounding frustum.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Matrix Matrix { get; set; }
Property Value
the Matrix that was used to instantiate this bounding frustum.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingFrustum.Near Property
Gets the near plane of the BoundingFrustum.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Plane Near { get; }
Property Value
Returns the near plane of the BoundingFrustum.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingFrustum.Right Property
Gets the right plane of the BoundingFrustum.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Plane Right { get; }
Property Value
Returns the right plane of the BoundingFrustum.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingFrustum.Top Property
Gets the top plane of the BoundingFrustum.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Plane Top { get; }
Property Value
Returns the top plane of the BoundingFrustum.
See Also
Reference
BoundingFrustum Class
BoundingFrustum Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingSphere Structure
Defines a sphere.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[TypeConverterAttribute("typeof(Microsoft.Xna.Framework.Design.BoundingSphereConverter)")]
[SerializableAttribute]
public struct BoundingSphere : IEquatable<BoundingSphere>
See Also
Reference
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Programming Guide
Math Overview
How To: Position the Camera to View All Objects in a Scene
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingSphere Members
The following tables list the members exposed by the BoundingSphere type.
Public Constructors
Name Description
BoundingSphere Creates a new instance of BoundingSphere.
Public Fields
Name Description
Center The center point of the sphere.
Radius The radius of the sphere.
Public Methods
Name Description
Contains Overloaded. Checks whether the current BoundingSphere contains a specified bounding volum
e.
CreateFromBoundingBox Overloaded. Creates the smallest BoundingSphere that can contain a specified BoundingBox.
CreateFromFrustum Creates the smallest BoundingSphere that can contain a specified BoundingFrustum.
CreateFromPoints Creates a BoundingSphere that can contain a specified list of points.
CreateMerged Overloaded. Creates a BoundingSphere that contains the two specified BoundingSphere instan
ces.
Equals Overloaded. Determines whether two instances of BoundingSphere are equal.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
Intersects Overloaded. Checks whether the current BoundingSphere intersects another bounding volume.
op_Equality Determines whether two instances of BoundingSphere are equal.
op_Inequality Determines whether two instances of BoundingSphere are not equal.
ReferenceEquals (Inherited from Object.)
ToString Returns a String that represents the current BoundingSphere.
Transform Overloaded. Translates and scales the BoundingSphere using a given Matrix.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
BoundingSphere Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
BoundingSphere Fields
Public Fields
Name Description
Center The center point of the sphere.
Radius The radius of the sphere.
See Also
Reference
BoundingSphere Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
BoundingSphere.Center Field
The center point of the sphere.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Center
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingSphere.Radius Field
The radius of the sphere.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float Radius
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingSphere Constructor
Creates a new instance of BoundingSphere.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public BoundingSphere (
Vector3 center,
float radius
)
Parameters
center
Center point of the sphere.
radius
Radius of the sphere.
Exceptions
Exception type Condition
ArgumentException radius is less than zero. radius must be greater than or equal to zero.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingSphere Methods
Public Methods
Name Description
Contains Overloaded. Checks whether the current BoundingSphere contains a specified bounding volum
e.
CreateFromBoundingBox Overloaded. Creates the smallest BoundingSphere that can contain a specified BoundingBox.
CreateFromFrustum Creates the smallest BoundingSphere that can contain a specified BoundingFrustum.
CreateFromPoints Creates a BoundingSphere that can contain a specified list of points.
CreateMerged Overloaded. Creates a BoundingSphere that contains the two specified BoundingSphere instan
ces.
Equals Overloaded. Determines whether two instances of BoundingSphere are equal.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
Intersects Overloaded. Checks whether the current BoundingSphere intersects another bounding volume.
op_Equality Determines whether two instances of BoundingSphere are equal.
op_Inequality Determines whether two instances of BoundingSphere are not equal.
ReferenceEquals (Inherited from Object.)
ToString Returns a String that represents the current BoundingSphere.
Transform Overloaded. Translates and scales the BoundingSphere using a given Matrix.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
BoundingSphere Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
BoundingSphere.Contains Method
Checks whether the current BoundingSphere contains a specified bounding volume.
Overload List
Name Description
BoundingSphere.Contains (BoundingBox) Checks whether the current BoundingSphere contains the spe
cified BoundingBox.
BoundingSphere.Contains (BoundingBox, ContainmentType) Checks whether the current BoundingSphere contains the spe
cified BoundingBox.
BoundingSphere.Contains (BoundingFrustum) Checks whether the current BoundingSphere contains the spe
cified BoundingFrustum.
BoundingSphere.Contains (BoundingSphere) Checks whether the current BoundingSphere contains the spe
cified BoundingSphere.
BoundingSphere.Contains (BoundingSphere, ContainmentType) Checks whether the current BoundingSphere contains the spe
cified BoundingSphere.
BoundingSphere.Contains (Vector3) Checks whether the current BoundingSphere contains the spe
cified point.
BoundingSphere.Contains (Vector3, ContainmentType) Checks whether the current BoundingSphere contains the spe
cified point.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
box
The BoundingBox to check against the current BoundingSphere.
Return Value
An enumeration indicating the relationship of the specified BoundingBox to the current BoundingSphere.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
box
The BoundingBox to test for overlap.
result
[OutAttribute] Enumeration indicating the extent of overlap.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
frustum
The BoundingFrustum to check against the current BoundingSphere.
Return Value
An enumeration indicating the relationship of the specified BoundingFrustum to the current BoundingSphere.
Exceptions
Exception type Condition
ArgumentNullException frustum is null.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sphere
The BoundingSphere to check against the current BoundingSphere.
Return Value
An enumeration indicating the relationship of the BoundingSpheres.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sphere
The BoundingSphere to test for overlap.
result
[OutAttribute] Enumeration indicating the extent of overlap.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
point
The point to check against the current BoundingSphere.
Return Value
An enumeration indicating the relationship of the specified point to the current BoundingSphere.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
point
The point to test for overlap.
result
[OutAttribute] Enumeration indicating the extent of overlap.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingSphere.CreateFromBoundingBox Method
Creates the smallest BoundingSphere that can contain a specified BoundingBox.
Overload List
Name Description
BoundingSphere.CreateFromBoundingBox (BoundingBox) Creates the smallest BoundingSphere that can con
tain a specified BoundingBox.
BoundingSphere.CreateFromBoundingBox (BoundingBox, BoundingSphere) Creates the smallest BoundingSphere that can con
tain a specified BoundingBox.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
BoundingSphere.CreateFromBoundingBox Method
(BoundingBox)
Creates the smallest BoundingSphere that can contain a specified BoundingBox.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static BoundingSphere CreateFromBoundingBox (
BoundingBox box
)
Parameters
box
The BoundingBox to create the BoundingSphere from.
Return Value
The created BoundingSphere.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Position the Camera to View All Objects in a Scene
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingSphere.CreateFromBoundingBox Method
(BoundingBox, BoundingSphere)
Creates the smallest BoundingSphere that can contain a specified BoundingBox.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static void CreateFromBoundingBox (
ref BoundingBox box,
out BoundingSphere result
)
Parameters
box
The BoundingBox to create the BoundingSphere from.
result
[OutAttribute] The created BoundingSphere.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingSphere.CreateFromFrustum Method
Creates the smallest BoundingSphere that can contain a specified BoundingFrustum.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static BoundingSphere CreateFromFrustum (
BoundingFrustum frustum
)
Parameters
frustum
The BoundingFrustum to create the BoundingSphere with.
Return Value
The created BoundingSphere.
Exceptions
Exception type Condition
ArgumentNullException frustum is null.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingSphere.CreateFromPoints Method
Creates a BoundingSphere that can contain a specified list of points.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static BoundingSphere CreateFromPoints (
IEnumerable<Vector3> points
)
Parameters
points
List of points the BoundingSphere must contain.
Return Value
The created BoundingSphere.
Exceptions
Exception type Condition
ArgumentException There are no points in points.
ArgumentNullException points is null.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Tasks
How To: Position the Camera to View All Objects in a Scene
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingSphere.CreateMerged Method
Creates a BoundingSphere that contains the two specified BoundingSphere instances.
Overload List
Name Description
BoundingSphere.CreateMerged (BoundingSphere, BoundingSphere) Creates a BoundingSphere that contain
s the two specified BoundingSphere ins
tances.
BoundingSphere.CreateMerged (BoundingSphere, BoundingSphere, BoundingSphere) Creates a BoundingSphere that contain
s the two specified BoundingSphere ins
tances.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
original
BoundingSphere to be merged.
additional
BoundingSphere to be merged.
Return Value
The created BoundingSphere.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Position the Camera to View All Objects in a Scene
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
original
BoundingSphere to be merged.
additional
BoundingSphere to be merged.
result
[OutAttribute] The created BoundingSphere.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingSphere.Equals Method
Determines whether two instances of BoundingSphere are equal.
Overload List
Name Description
BoundingSphere.Equals (BoundingSphere) Determines whether the specified BoundingSphere is equal to the current
BoundingSphere.
BoundingSphere.Equals (Object) Determines whether the specified Object is equal to the BoundingSphere.
BoundingSphere.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
other
The BoundingSphere to compare with the current BoundingSphere.
Return Value
true if the specified BoundingSphere is equal to the current BoundingSphere; false otherwise.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
obj
The Object to compare with the current BoundingSphere.
Return Value
true if the specified Object is equal to the current BoundingSphere; false otherwise.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingSphere.GetHashCode Method
Gets the hash code for this instance.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
A hash code for the current BoundingSphere.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingSphere.Intersects Method
Checks whether the current BoundingSphere intersects another bounding volume.
Overload List
Name Description
BoundingSphere.Intersects (BoundingBox) Checks whether the current BoundingSphere intersects with a specif
ied BoundingBox.
BoundingSphere.Intersects (BoundingBox, Boolean) Checks whether the current BoundingSphere intersects a
BoundingBox.
BoundingSphere.Intersects (BoundingFrustum) Checks whether the current BoundingSphere intersects with a specif
ied BoundingFrustum.
BoundingSphere.Intersects (BoundingSphere) Checks whether the current BoundingSphere intersects with a specif
ied BoundingSphere.
BoundingSphere.Intersects (BoundingSphere, Boolean) Checks whether the current BoundingSphere intersects another
BoundingSphere.
BoundingSphere.Intersects (Plane) Checks whether the current BoundingSphere intersects with a specif
ied Plane.
BoundingSphere.Intersects (Plane, PlaneIntersectionType) Checks whether the current BoundingSphere intersects a Plane.
BoundingSphere.Intersects (Ray) Checks whether the current BoundingSphere intersects with a specif
ied Ray.
BoundingSphere.Intersects (Ray, Nullable<Single>) Checks whether the current BoundingSphere intersects a Ray.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
box
The BoundingBox to check for intersection with the current BoundingSphere.
Return Value
true if the BoundingBox and BoundingSphere intersect; false otherwise.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
box
The BoundingBox to check for intersection with.
result
[OutAttribute] true if the BoundingSphere and BoundingBox intersect; false otherwise.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
frustum
The BoundingFrustum to check for intersection with the current BoundingSphere.
Return Value
true if the BoundingFrustum and BoundingSphere intersect; false otherwise.
Exceptions
Exception type Condition
ArgumentNullException frustum is null.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sphere
The BoundingSphere to check for intersection with the current BoundingSphere.
Return Value
true if the BoundingSpheres intersect; false otherwise.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sphere
The BoundingSphere to check for intersection with.
result
[OutAttribute] true if the BoundingSphere instances intersect; false otherwise.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
plane
The Plane to check for intersection with the current BoundingSphere.
Return Value
An enumeration indicating the relationship between the BoundingSphere and the Plane.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
plane
The Plane to check for intersection with.
result
[OutAttribute] An enumeration indicating whether the BoundingSphere intersects the Plane.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
ray
The Ray to check for intersection with the current BoundingSphere.
Return Value
Distance at which the ray intersects the BoundingSphere or null if there is no intersection.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
ray
The Ray to check for intersection with.
result
[OutAttribute] Distance at which the ray intersects the BoundingSphere or null if there is no intersection.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingSphere.op_Equality Method
Determines whether two instances of BoundingSphere are equal.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
BoundingSphere a,
BoundingSphere b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if left is equal to right; false otherwise.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingSphere.op_Inequality Method
Determines whether two instances of BoundingSphere are not equal.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
BoundingSphere a,
BoundingSphere b
)
Parameters
a
The BoundingSphere to the left of the inequality operator.
b
The BoundingSphere to the right of the inequality operator.
Return Value
true if left is not equal to right; false otherwise.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingSphere.ToString Method
Returns a String that represents the current BoundingSphere.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of the current BoundingSphere.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingSphere.Transform Method
Translates and scales the BoundingSphere using a given Matrix.
Overload List
Name Description
BoundingSphere.Transform (Matrix) Translates and scales the BoundingSphere using a given Matrix.
BoundingSphere.Transform (Matrix, BoundingSphere) Translates and scales the BoundingSphere using a given Matrix.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
matrix
A translation and scaling matrix.
Return Value
The transformed BoundingSphere.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
CreateScale
CreateTranslation
CreateWorld
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
matrix
A translation and scaling matrix.
result
[OutAttribute] The transformed BoundingSphere.
See Also
Reference
BoundingSphere Structure
BoundingSphere Members
CreateScale
CreateTranslation
CreateWorld
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContainmentType Enumeration
Indicates the extent to which bounding volumes intersect or contain one another.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum ContainmentType
Members
Member name Description
Contains Indicates that one bounding volume completely contains the other.
Disjoint Indicates there is no overlap between the bounding volumes.
Intersects Indicates that the bounding volumes partially overlap.
See Also
Reference
Microsoft.Xna.Framework Namespace
Programming Guide
Math Overview
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Curve Class
Stores an arbitrary collection of 2D CurveKey points, and provides methods for evaluating features of the curve they define.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[TypeConverterAttribute(System.ComponentModel.ExpandableObjectConverter, System, Version=2.
0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)]
[SerializableAttribute]
public class Curve
Remarks
The Curve class describes how two float values vary with respect to each other even when you cannot easily define their
relationship by a formula; instead, the relationship is defined by an ordered set of value pairs that exemplify it.
You specify a Curve by adding a sequence of CurveKey objects to its Keys collection, each of which must contain at minimum a
Position greater than that of the preceding CurveKey, and a corresponding Value. In practice, the Position is almost always
used to represent a point in time, while the Value property generally represents a coordinate value corresponding to that point
in time.
To represent a time path in two or three dimensions, you can define two or three Curve objects, each of which corresponds to a
different spatial axis. Coordinates of a given time's point on the resulting 2D or 3D curve are calculated very efficiently.
The Curve.Evaluate method returns a (coordinate) value corresponding to a (time) position that you specify. The position
doesn't have to be contained in any of the CurveKey points, because Curve interpolates between points depending on the
CurveKey characteristics you have defined.
Not only is Curve useful for controlling animation and spatial motion, it can also be used anywhere you want to define a
response that changes over time. For example, if you are using a button to accelerate a car in your game, you might want to
define a complex velocity curve that varies with how long the button is held down to simulate gear shifts.
A CurveKey point need not always be part of a smoothly varying curve; you can also set a CurveKey to represent a step or
sharp inflection point.
See Also
Reference
CurveKey
Curve Members
Microsoft.Xna.Framework Namespace
Programming Guide
Math Overview
How To: Script the Camera to Follow a Curve
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Curve Members
The following tables list the members exposed by the Curve type.
Public Constructors
Name Description
Curve Initializes a new instance of Curve.
Public Properties
Name Description
IsConstant Gets a value indicating whether the curve is constant.
Keys The points that make up the curve.
PostLoop Specifies how to handle weighting values that are greater than the last control point in the curve.
PreLoop Specifies how to handle weighting values that are less than the first control point in the curve.
Public Methods
Name Description
Clone Creates a copy of the Curve.
ComputeTangent Overloaded. Computes the tangents for a specified CurveKey in this Curve.
ComputeTangents Overloaded. Computes all tangents for all CurveKeys in the Curve.
Equals (Inherited from Object.)
Evaluate Finds the value at a position on the Curve.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Curve Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Curve Constructor
Initializes a new instance of Curve.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Curve ()
See Also
Reference
Curve Class
Curve Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Curve Methods
Public Methods
Name Description
Clone Creates a copy of the Curve.
ComputeTangent Overloaded. Computes the tangents for a specified CurveKey in this Curve.
ComputeTangents Overloaded. Computes all tangents for all CurveKeys in the Curve.
Equals (Inherited from Object.)
Evaluate Finds the value at a position on the Curve.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Curve Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Curve.Clone Method
Creates a copy of the Curve.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Curve Clone ()
Return Value
The copy of the Curve.
See Also
Reference
Curve Class
Curve Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Curve.ComputeTangent Method
Computes the tangents for a specified CurveKey in this Curve.
Overload List
Name Description
Curve.ComputeTangent (Int32, CurveTangent) Computes both the TangentIn and the TangentOut for a
CurveKey specified by its index.
Curve.ComputeTangent (Int32, CurveTangent, CurveTangent) Computes a specified type of TangentIn and a specified type of
TangentOut for a given CurveKey.
See Also
Reference
Curve Class
Curve Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
keyIndex
The index of the CurveKey for which to compute tangents (in the Keys collection of the Curve).
tangentType
The type of tangents to compute (one of the types specified in the CurveTangent enumeration).
Exceptions
Exception type Condition
ArgumentOutOfRangeException keyIndex is not a valid index.
See Also
Reference
Curve Class
Curve Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
keyIndex
The index of the CurveKey for which to compute tangents (in the Keys collection of the Curve).
tangentInType
The type of TangentIn to compute (one of the types specified in the CurveTangent enumeration).
tangentOutType
The type of TangentOut to compute (one of the types specified in the CurveTangent enumeration).
Exceptions
Exception type Condition
ArgumentOutOfRangeException keyIndex is not a valid index.
See Also
Reference
Curve Class
Curve Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Curve.ComputeTangents Method
Computes all tangents for all CurveKeys in the Curve.
Overload List
Name Description
Curve.ComputeTangents (CurveTangent) Computes all tangents for all CurveKeys in this Curve, using a specifie
d tangent type for both TangentIn and TangentOut.
Curve.ComputeTangents (CurveTangent, CurveTangent) Computes all tangents for all CurveKeys in this Curve, using different
tangent types for TangentOut and TangentIn.
See Also
Reference
Curve Class
Curve Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
tangentType
The type of TangentOut and TangentIn to compute (one of the types specified in the CurveTangent enumeration).
See Also
Reference
Curve Class
Curve Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
tangentInType
The type of TangentIn to compute (one of the types specified in the CurveTangent enumeration).
tangentOutType
The type of TangentOut to compute (one of the types specified in the CurveTangent enumeration).
See Also
Reference
Curve Class
Curve Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Curve.Evaluate Method
Finds the value at a position on the Curve.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float Evaluate (
float position
)
Parameters
position
The position on the Curve.
Return Value
Value at the position on the Curve.
See Also
Reference
Curve Class
Curve Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Script the Camera to Follow a Curve
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Curve Properties
Public Properties
Name Description
IsConstant Gets a value indicating whether the curve is constant.
Keys The points that make up the curve.
PostLoop Specifies how to handle weighting values that are greater than the last control point in the curve.
PreLoop Specifies how to handle weighting values that are less than the first control point in the curve.
See Also
Reference
Curve Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Curve.IsConstant Property
Gets a value indicating whether the curve is constant.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsConstant { get; }
Property Value
true is the curve is constant (has one or fewer points); false otherwise.
See Also
Reference
Curve Class
Curve Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Curve.Keys Property
The points that make up the curve.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public CurveKeyCollection Keys { get; }
Property Value
Points that make up the curve.
See Also
Reference
Curve Class
Curve Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Curve.PostLoop Property
Specifies how to handle weighting values that are greater than the last control point in the curve.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public CurveLoopType PostLoop { get; set; }
Property Value
Specifies how to handle weighting values.
See Also
Reference
Curve Class
Curve Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Script the Camera to Follow a Curve
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Curve.PreLoop Property
Specifies how to handle weighting values that are less than the first control point in the curve.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public CurveLoopType PreLoop { get; set; }
Property Value
Specifies how to handle weighting values.
See Also
Reference
Curve Class
Curve Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Script the Camera to Follow a Curve
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveContinuity Enumeration
Defines the continuity of CurveKeys on a Curve.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum CurveContinuity
Members
Member na Description
me
Smooth Interpolation can be used between this CurveKey and the next.
Step Interpolation cannot be used between this CurveKey and the next. Specifying a position between the two points
returns this point.
See Also
Reference
Microsoft.Xna.Framework Namespace
Programming Guide
Math Overview
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveKey Class
Represents a point in a multi-point curve.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[TypeConverterAttribute(System.ComponentModel.ExpandableObjectConverter, System, Version=2.
0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)]
[SerializableAttribute]
public class CurveKey : IEquatable<CurveKey>, IComparable<CurveKey>
See Also
Reference
CurveKey Members
Microsoft.Xna.Framework Namespace
Programming Guide
Math Overview
How To: Script the Camera to Follow a Curve
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveKey Members
The following tables list the members exposed by the CurveKey type.
Public Constructors
Name Description
CurveKey Overloaded. Initializes a new instance of CurveKey.
Public Properties
Name Description
Continuity Describes whether the segment between this point and the next point in the curve is discrete or continuous.
Position Position of the CurveKey in the curve.
TangentIn Describes the tangent when approaching this point from the previous point in the curve.
TangentOut Describes the tangent when leaving this point to the next point in the curve.
Value Describes the value of this point.
Public Methods
Name Description
Clone Creates a copy of the CurveKey.
CompareTo Compares this instance to another CurveKey and returns an indication of their relative values.
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Returns the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Determines whether two CurveKey instances are equal.
op_Inequality Determines whether two CurveKey instances are not equal.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
CurveKey Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
CurveKey Constructor
Initializes a new instance of CurveKey.
Overload List
Name Description
CurveKey (Single, Single) Initializes a new instance of CurveKey.
CurveKey (Single, Single, Single, Single) Initializes a new instance of CurveKey.
CurveKey (Single, Single, Single, Single, CurveContinuity) Initializes a new instance of CurveKey.
See Also
Reference
CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
position
Position in the curve.
value
Value of the control point.
See Also
Reference
CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
position
Position in the curve.
value
Value of the control point.
tangentIn
Tangent approaching point from the previous point in the curve.
tangentOut
Tangent leaving point toward next point in the curve.
See Also
Reference
CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
position
Position in the curve.
value
Value of the control point.
tangentIn
Tangent approaching point from the previous point in the curve.
tangentOut
Tangent leaving point toward next point in the curve.
continuity
Enum indicating whether the curve is discrete or continuous.
See Also
Reference
CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveKey Methods
Public Methods
Name Description
Clone Creates a copy of the CurveKey.
CompareTo Compares this instance to another CurveKey and returns an indication of their relative values.
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Returns the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Determines whether two CurveKey instances are equal.
op_Inequality Determines whether two CurveKey instances are not equal.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
CurveKey Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
CurveKey.Clone Method
Creates a copy of the CurveKey.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public CurveKey Clone ()
Return Value
The copy of the CurveKey.
See Also
Reference
CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveKey.CompareTo Method
Compares this instance to another CurveKey and returns an indication of their relative values.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int CompareTo (
CurveKey other
)
Parameters
other
CurveKey to compare to.
Return Value
Zero if the positions are the same; -1 if this CurveKey comes before other and 1 if this CurveKey comes after other.
See Also
Reference
CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveKey.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
CurveKey.Equals (CurveKey) Determines whether the specified Object is equal to the CurveKey.
CurveKey.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
CurveKey.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
other
The Object to compare with the current CurveKey.
Return Value
true if the specified Object is equal to the current CurveKey; false otherwise.
See Also
Reference
CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
obj
Object with which to make the comparison.
Return Value
Value that is true if the current instance is equal to the specified object, or false if it is not.
See Also
Reference
CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveKey.GetHashCode Method
Returns the hash code for this instance.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hashcode for this object.
See Also
Reference
CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveKey.op_Equality Method
Determines whether two CurveKey instances are equal.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
CurveKey a,
CurveKey b
)
Parameters
a
CurveKey on the left of the equal sign.
b
CurveKey on the right of the equal sign.
Return Value
true if the CurveKeys are equal; false otherwise.
See Also
Reference
CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveKey.op_Inequality Method
Determines whether two CurveKey instances are not equal.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
CurveKey a,
CurveKey b
)
Parameters
a
CurveKey on the left of the equal sign.
b
CurveKey on the right of the equal sign.
Return Value
true /> if the CurveKeys are not equal; false otherwise.
See Also
Reference
CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveKey Properties
Public Properties
Name Description
Continuity Describes whether the segment between this point and the next point in the curve is discrete or continuous.
Position Position of the CurveKey in the curve.
TangentIn Describes the tangent when approaching this point from the previous point in the curve.
TangentOut Describes the tangent when leaving this point to the next point in the curve.
Value Describes the value of this point.
See Also
Reference
CurveKey Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
CurveKey.Continuity Property
Describes whether the segment between this point and the next point in the curve is discrete or continuous.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public CurveContinuity Continuity { get; set; }
Property Value
Describes the continuity between this point and the next.
See Also
Reference
CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveKey.Position Property
Position of the CurveKey in the curve.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float Position { get; }
Property Value
Position of the CurveKey in the curve.
See Also
Reference
CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveKey.TangentIn Property
Describes the tangent when approaching this point from the previous point in the curve.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float TangentIn { get; set; }
Property Value
The tangent when approaching.
See Also
Reference
CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Script the Camera to Follow a Curve
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveKey.TangentOut Property
Describes the tangent when leaving this point to the next point in the curve.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float TangentOut { get; set; }
Property Value
The tangent when leaving.
See Also
Reference
CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Script the Camera to Follow a Curve
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveKey.Value Property
Describes the value of this point.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float Value { get; set; }
Property Value
The value of the point.
See Also
Reference
CurveKey Class
CurveKey Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveKeyCollection Class
Contains the CurveKeys making up a Curve.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[TypeConverterAttribute(System.ComponentModel.ExpandableObjectConverter, System, Version=2.
0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)]
[SerializableAttribute]
public class CurveKeyCollection : ICollection<CurveKey>, IEnumerable<CurveKey>, IEnumerable
See Also
Reference
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace
Programming Guide
Math Overview
How To: Script the Camera to Follow a Curve
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveKeyCollection Members
The following tables list the members exposed by the CurveKeyCollection type.
Public Constructors
Name Description
CurveKeyCollection Initializes a new instance of CurveKeyCollection.
Public Properties
Name Description
Count Gets the number of elements contained in the CurveKeyCollection.
IsReadOnly Returns a value indicating whether the CurveKeyCollection is read-only.
Item Gets or sets the element at the specified index.
Public Methods
Name Description
Add Adds a CurveKey to the CurveKeyCollection.
Clear Removes all CurveKeys from the CurveKeyCollection.
Clone Creates a copy of the CurveKeyCollection.
Contains Determines whether the CurveKeyCollection contains a specific CurveKey.
CopyTo Copies the CurveKeys of the CurveKeyCollection to an array, starting at the array index provided.
Equals (Inherited from Object.)
GetEnumerator Returns an enumerator that iterates through the CurveKeyCollection.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
IndexOf Determines the index of a CurveKey in the CurveKeyCollection.
ReferenceEquals (Inherited from Object.)
Remove Removes the first occurrence of a specific CurveKey from the CurveKeyCollection.
RemoveAt Removes the CurveKey at the specified index.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
System.Collections.IEnumerable.GetEnumerator Returns an enumerator that iterates through the CurveKeyCollection.
See Also
Reference
CurveKeyCollection Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
CurveKeyCollection Constructor
Initializes a new instance of CurveKeyCollection.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public CurveKeyCollection ()
See Also
Reference
CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveKeyCollection Methods
Public Methods
Name Description
Add Adds a CurveKey to the CurveKeyCollection.
Clear Removes all CurveKeys from the CurveKeyCollection.
Clone Creates a copy of the CurveKeyCollection.
Contains Determines whether the CurveKeyCollection contains a specific CurveKey.
CopyTo Copies the CurveKeys of the CurveKeyCollection to an array, starting at the array index provided.
Equals (Inherited from Object.)
GetEnumerator Returns an enumerator that iterates through the CurveKeyCollection.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
IndexOf Determines the index of a CurveKey in the CurveKeyCollection.
ReferenceEquals (Inherited from Object.)
Remove Removes the first occurrence of a specific CurveKey from the CurveKeyCollection.
RemoveAt Removes the CurveKey at the specified index.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
System.Collections.IEnumerable.GetEnumerator Returns an enumerator that iterates through the CurveKeyCollection.
See Also
Reference
CurveKeyCollection Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
CurveKeyCollection.Add Method
Adds a CurveKey to the CurveKeyCollection.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Add (
CurveKey item
)
Parameters
item
The CurveKey to add.
Exceptions
Exception type Condition
ArgumentNullException item is null.
See Also
Reference
CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveKeyCollection.Clear Method
Removes all CurveKeys from the CurveKeyCollection.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Clear ()
See Also
Reference
CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveKeyCollection.Clone Method
Creates a copy of the CurveKeyCollection.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public CurveKeyCollection Clone ()
Return Value
A new object that is a copy of this instance.
See Also
Reference
CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveKeyCollection.Contains Method
Determines whether the CurveKeyCollection contains a specific CurveKey.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool Contains (
CurveKey item
)
Parameters
item
true if the CurveKey is found in the CurveKeyCollection; false otherwise.
Return Value
The CurveKey to locate in the CurveKeyCollection.
See Also
Reference
CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveKeyCollection.CopyTo Method
Copies the CurveKeys of the CurveKeyCollection to an array, starting at the array index provided.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void CopyTo (
CurveKey[] array,
int arrayIndex
)
Parameters
array
The destination of the CurveKeys copied from CurveKeyCollection. The array must have zero-based indexing.
arrayIndex
The zero-based index in the array to start copying from.
See Also
Reference
CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveKeyCollection.GetEnumerator Method
Returns an enumerator that iterates through the CurveKeyCollection.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public IEnumerator<CurveKey> GetEnumerator ()
Return Value
An enumerator for the CurveKeyCollection.
See Also
Reference
CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveKeyCollection.IndexOf Method
Determines the index of a CurveKey in the CurveKeyCollection.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int IndexOf (
CurveKey item
)
Parameters
item
CurveKey to locate in the CurveKeyCollection.
Return Value
The index of the CurveKey if found in the CurveKeyCollection; −1 otherwise.
See Also
Reference
CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveKeyCollection.Remove Method
Removes the first occurrence of a specific CurveKey from the CurveKeyCollection.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool Remove (
CurveKey item
)
Parameters
item
The CurveKey to remove from the CurveKeyCollection.
Return Value
true if CurveKey is successfully removed; false otherwise.
See Also
Reference
CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveKeyCollection.RemoveAt Method
Removes the CurveKey at the specified index.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void RemoveAt (
int index
)
Parameters
index
The zero-based index of the item to remove.
See Also
Reference
CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
System.Collections.IEnumerable.GetEnumerator Method
Returns an enumerator that iterates through the CurveKeyCollection.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private IEnumerator System.Collections.IEnumerable.GetEnumerator ()
Return Value
An enumerator for the CurveKeyCollection.
See Also
Reference
CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveKeyCollection Properties
Public Properties
Name Description
Count Gets the number of elements contained in the CurveKeyCollection.
IsReadOnly Returns a value indicating whether the CurveKeyCollection is read-only.
Item Gets or sets the element at the specified index.
See Also
Reference
CurveKeyCollection Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
CurveKeyCollection.Count Property
Gets the number of elements contained in the CurveKeyCollection.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Count { get; }
Property Value
The number of elements in the CurveKeyCollection.
See Also
Reference
CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveKeyCollection.IsReadOnly Property
Returns a value indicating whether the CurveKeyCollection is read-only.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsReadOnly { get; }
Property Value
true if the CurveKeyCollection is read-only; false otherwise.
See Also
Reference
CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveKeyCollection.Item Property
Gets or sets the element at the specified index.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public CurveKey this [
int index
] { get; set; }
Property Value
The CurveKey at the specified index.
Exceptions
Exception type Condition
ArgumentNullException Item is null.
See Also
Reference
CurveKeyCollection Class
CurveKeyCollection Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveLoopType Enumeration
Defines how the value of a Curve will be determined for positions before the first point on the Curve or after the last point on
the Curve.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum CurveLoopType
Members
Me Description
mb
er n
am
e
Con The Curve will evaluate to its first key for positions before the first point in the Curve and to the last key for positions aft
stan er the last point.
t
Cycl Positions specified past the ends of the curve will wrap around to the opposite side of the Curve.
e
Cycl Positions specified past the ends of the curve will wrap around to the opposite side of the Curve. The value will be offset
eOf by the difference between the values of the first and last CurveKey multiplied by the number of times the position wraps
fset around. If the position is before the first point in the Curve, the difference will be subtracted from its value; otherwise, th
e difference will be added.
Line Linear interpolation will be performed to determine the value.
ar
Osci Positions specified past the ends of the Curve act as an offset from the same side of the Curve toward the opposite side.
llat
e
See Also
Reference
Microsoft.Xna.Framework Namespace
Programming Guide
Math Overview
How To: Script the Camera to Follow a Curve
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CurveTangent Enumeration
Specifies different tangent types to be calculated for CurveKey points in a Curve.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum CurveTangent
Members
Member Description
name
Flat A Flat tangent always has a value equal to zero.
Linear
A Linear tangent at a CurveKey is equal to the difference between its Value and the Value of the preceding or succ
eeding CurveKey.
For example, in Curve MyCurve, where i is greater than zero and (i + 1) is less than the total number of CurveKey
s in MyCurve, the linear TangentIn of MyCurve.Keys[i] is equal to:
DrawableGameComponent Class
A game component that is notified when it needs to draw itself.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public class DrawableGameComponent : GameComponent, IDrawable
See Also
Reference
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DrawableGameComponent Members
The following tables list the members exposed by the DrawableGameComponent type.
Public Constructors
Name Description
DrawableGameComponent Creates a new instance of DrawableGameComponent.
Public Properties
Name Description
DrawOrder Order in which the component should be drawn, relative to other components that are in the same
GameComponentCollection.
Enabled (Inherited from GameComponent.)
Game (Inherited from GameComponent.)
GraphicsDevice The GraphicsDevice the DrawableGameComponent is associated with.
UpdateOrder (Inherited from GameComponent.)
Visible Indicates whether Draw should be called.
Public Methods
Name Description
Dispose Overloaded. Releases the resources used by the DrawableGameComponent class.
Draw Called when the DrawableGameComponent needs to be drawn. Override this method with component-sp
ecific drawing code.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
Initialize Initializes the component. Override this method to load any non-graphics resources and query for any req
uired services.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Update (Inherited from GameComponent.)
Protected Methods
Name Description
LoadContent Called when graphics resources need to be loaded. Override this method to load any component-
specific graphics resources.
LoadGraphicsContent Obsolete. Called when the component needs to load graphics resources. Override this method to l
oad any component-specific graphics resources.
MemberwiseClone (Inherited from Object.)
OnDrawOrderChanged Called when the DrawOrder property changes. Raises the DrawOrderChanged event.
OnEnabledChanged (Inherited from GameComponent.)
OnUpdateOrderChanged (Inherited from GameComponent.)
OnVisibleChanged Called when the Visible property changes. Raises the VisibleChanged event.
UnloadContent Called when graphics resources need to be unloaded. Override this method to unload any compo
nent-specifc graphics resources.
UnloadGraphicsContent Obsolete. Called when graphics resources should be unloaded. Override this method to handle co
mponent-specific graphics resources.
Public Events
Name Description
Disposed (Inherited from GameComponent.)
DrawOrderChanged Raised when the DrawOrder property changes.
EnabledChanged (Inherited from GameComponent.)
UpdateOrderChanged (Inherited from GameComponent.)
VisibleChanged Raised when the Visible property changes.
See Also
Reference
DrawableGameComponent Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
DrawableGameComponent Constructor
Creates a new instance of DrawableGameComponent.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public DrawableGameComponent (
Game game
)
Parameters
game
The Game that the game component should be attached to.
See Also
Reference
DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DrawableGameComponent Methods
Public Methods
Name Description
Dispose Overloaded. Releases the resources used by the DrawableGameComponent class.
Draw Called when the DrawableGameComponent needs to be drawn. Override this method with component-sp
ecific drawing code.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
Initialize Initializes the component. Override this method to load any non-graphics resources and query for any req
uired services.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Update (Inherited from GameComponent.)
Protected Methods
Name Description
LoadContent Called when graphics resources need to be loaded. Override this method to load any component-
specific graphics resources.
LoadGraphicsContent Obsolete. Called when the component needs to load graphics resources. Override this method to l
oad any component-specific graphics resources.
MemberwiseClone (Inherited from Object.)
OnDrawOrderChanged Called when the DrawOrder property changes. Raises the DrawOrderChanged event.
OnEnabledChanged (Inherited from GameComponent.)
OnUpdateOrderChanged (Inherited from GameComponent.)
OnVisibleChanged Called when the Visible property changes. Raises the VisibleChanged event.
UnloadContent Called when graphics resources need to be unloaded. Override this method to unload any compo
nent-specifc graphics resources.
UnloadGraphicsContent Obsolete. Called when graphics resources should be unloaded. Override this method to handle co
mponent-specific graphics resources.
See Also
Reference
DrawableGameComponent Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
DrawableGameComponent.Dispose Method
Releases the resources used by the DrawableGameComponent class.
Overload List
Name Description
DrawableGameComponent.Dispose (Boolean) Releases the unmanaged resources used by the DrawableGameComponent and
optionally releases the managed resources.
DrawableGameComponent.Dispose () (Inherited from GameComponent.)
See Also
Reference
DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
disposing
true to release both managed and unmanaged resources; false to release only unmanaged resources.
See Also
Reference
DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DrawableGameComponent.Draw Method
Called when the DrawableGameComponent needs to be drawn. Override this method with component-specific drawing code.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public virtual void Draw (
GameTime gameTime
)
Parameters
gameTime
Time passed since the last call to Draw.
Remarks
Caution
In the Draw method of an Xbox 360 game, vertex buffers, index buffers, and textures should not be written using SetData w
hen they are intended to be used for rendering. This condition may lead to graphics corruption or crashes. To avoid this pote
ntial issue, use DrawUserPrimitives or DrawUserIndexedPrimitives as the preferred alternative to VertexBuffer.SetData for dy
namic vertex generation.
This is because, in cases where the size of the back buffer and depth stencil buffer exceed the size of the Xbox 360 10 MB of e
mbedded memory (EDRAM), predicated tiling is utilized on this platform to compensate for the additional memory requirem
ents. Predicated tiling is a process by which scene rendering is performed multiple times on subsections of the final render ta
rget dimensions.
When predicated tiling has been triggered, the drawing commands contained in the Draw function are not submitted until
Present is called. (Note that Draw implicitly calls Present at the end of this method.) In this case, these resources are not avail
able for modification until the GPU is finished with presenting the entire frame.
See Also
Concepts
Predicated Tiling
Reference
DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DrawableGameComponent.Initialize Method
Initializes the component. Override this method to load any non-graphics resources and query for any required services.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public override void Initialize ()
Exceptions
Exception type Condition
InvalidOperationException There is no IGraphicsDeviceService available in the GameServiceContainer that this
DrawableGameComponent is associated with. Usually this means there is no
GraphicsDeviceManager associated with the services of a Game.
Remarks
Game services are a mechanism for maintaining loose coupling between objects that need to interact with each other. Services
work through a mediator—in this case, Game.Services. Service providers register with Game.Services, and service consumers
request services from Game.Services. This arrangement allows an object that requires a service to request the service without
knowing the name of the service provider.
Game services are defined by an interface. A class specifies the services it provides by implementing interfaces and registering
the services with Game.Services. A service is registered by calling Game.Services.AddService specifying the type of service
being implemented and a reference to the object providing the service. For example, to register an object that provides a
service represented by the interface IMyService, you would use the following code.
Services.AddService( typeof( IMyService ), myobject );
Once a service is registered, the object providing the service can be retrieved by Game.Services.GetService and specifying the
desired service. For example, to retrieve IGraphicsDeviceService, you would use the following code.
IGraphicsDeviceService graphicsservice = (IGraphicsDeviceService)Services.GetService( t
ypeof(IGraphicsDeviceService) );
See Also
Reference
Game.Services Property
DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DrawableGameComponent.LoadContent Method
Called when graphics resources need to be loaded. Override this method to load any component-specific graphics resources.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected virtual void LoadContent ()
See Also
Reference
DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DrawableGameComponent.LoadGraphicsContent Method
Obsolete. Called when the component needs to load graphics resources. Override this method to load any component-specific
graphics resources.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected virtual void LoadGraphicsContent (
bool loadAllContent
)
Parameters
loadAllContent
true if all graphics resources need to be loaded; false if only manual resources need to be loaded.
Remarks
Note
This method is obsolete in XNA Game Studio 2.0. Override LoadContent to load graphics resources.
See Also
Reference
DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DrawableGameComponent.OnDrawOrderChanged Method
Called when the DrawOrder property changes. Raises the DrawOrderChanged event.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected virtual void OnDrawOrderChanged (
Object sender,
EventArgs args
)
Parameters
sender
The DrawableGameComponent.
args
Arguments to the DrawOrderChanged event.
See Also
Reference
DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DrawableGameComponent.OnVisibleChanged Method
Called when the Visible property changes. Raises the VisibleChanged event.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected virtual void OnVisibleChanged (
Object sender,
EventArgs args
)
Parameters
sender
The DrawableGameComponent.
args
Arguments to the VisibleChanged event.
See Also
Reference
DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DrawableGameComponent.UnloadContent Method
Called when graphics resources need to be unloaded. Override this method to unload any component-specifc graphics
resources.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected virtual void UnloadContent ()
See Also
Reference
DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DrawableGameComponent.UnloadGraphicsContent Method
Obsolete. Called when graphics resources should be unloaded. Override this method to handle component-specific graphics
resources.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected virtual void UnloadGraphicsContent (
bool unloadAllContent
)
Parameters
unloadAllContent
true if all graphics resources should be unloaded; false if only manual resources should be unloaded.
Remarks
Note
This method is obsolete in XNA Game Studio 2.0. Override LoadContent to unload graphics resources.
See Also
Reference
DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DrawableGameComponent Properties
Public Properties
Name Description
DrawOrder Order in which the component should be drawn, relative to other components that are in the same
GameComponentCollection.
Enabled (Inherited from GameComponent.)
Game (Inherited from GameComponent.)
GraphicsDevice The GraphicsDevice the DrawableGameComponent is associated with.
UpdateOrder (Inherited from GameComponent.)
Visible Indicates whether Draw should be called.
See Also
Reference
DrawableGameComponent Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
DrawableGameComponent.DrawOrder Property
Order in which the component should be drawn, relative to other components that are in the same
GameComponentCollection.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public int DrawOrder { get; set; }
Property Value
Order in which the component should be drawn.
Remarks This value can be any integer. Components in the GameComponentCollection are drawn in ascending order based on
their DrawOrder.
Example
In this example, the three components are added to a GameComponentCollection, and the DrawOrder of each component is
explicitly set to control the drawing order of each component regardless of the order it was added to the
GameComponentCollection. MyDrawableGameComponent is a class which derives from DrawableGameComponent, and
game is an instance of Game.
MyDrawableGameComponent thirdGameComponent = new MyDrawableGameComponent(game);
d3.DrawOrder = 3;
game.Components.Add(d3);
MyDrawableGameComponent firstGameComponent = new MyDrawableGameComponent(game);
d1.DrawOrder = 1;
game.Components.Add(d1);
MyDrawableGameComponent secondGameComponent = new MyDrawableGameComponent(game);
d2.DrawOrder = 2;
game.Components.Add(d2);
See Also
Reference
DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DrawableGameComponent.GraphicsDevice Property
The GraphicsDevice the DrawableGameComponent is associated with.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public GraphicsDevice GraphicsDevice { get; }
Property Value
GraphicsDevice the DrawableGameComponent is associated with.
Exceptions
Exception type Condition
InvalidOperationException The GraphicsDevice property cannot be used before Initialize has been called.
See Also
Reference
DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DrawableGameComponent.Visible Property
Indicates whether Draw should be called.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public bool Visible { get; set; }
Property Value
true Draw should be called; false otherwise.
See Also
Reference
DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DrawableGameComponent Events
Public Events
Name Description
Disposed (Inherited from GameComponent.)
DrawOrderChanged Raised when the DrawOrder property changes.
EnabledChanged (Inherited from GameComponent.)
UpdateOrderChanged (Inherited from GameComponent.)
VisibleChanged Raised when the Visible property changes.
See Also
Reference
DrawableGameComponent Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
DrawableGameComponent.DrawOrderChanged Event
Raised when the DrawOrder property changes.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public event EventHandler DrawOrderChanged
See Also
Reference
DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DrawableGameComponent.VisibleChanged Event
Raised when the Visible property changes.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public event EventHandler VisibleChanged
See Also
Reference
DrawableGameComponent Class
DrawableGameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game Class
Provides basic graphics device initialization, game logic, and rendering code.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public class Game : IDisposable
See Also
Reference
Game Members
Microsoft.Xna.Framework Namespace
Programming Guide
Application Model Overview
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game Members
The following tables list the members exposed by the Game type.
Public Constructors
Nam Description
e
Game Initializes a new instance of this class, which provides basic graphics device initialization, game logic, rendering code,
and a game loop.
Public Properties
Name Description
Components Gets the collection of GameComponents owned by the game.
Content Gets the current ContentManager.
GraphicsDevice Gets the current GraphicsDevice.
InactiveSleepTime Gets or sets the time to sleep when the game is inactive.
IsActive Indicates whether the game is currently the active application.
IsFixedTimeStep Gets or sets a value indicating whether to use fixed time steps.
IsMouseVisible Gets or sets a value indicating whether the mouse cursor should be visible.
Services Gets the GameServiceContainer holding all the service providers attached to the Game.
TargetElapsedTime Gets or sets the target time between calls to Update when IsFixedTimeStep is true.
Window Gets the underlying operating system window.
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
Exit Exits the game.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ResetElapsedTime Resets the elapsed time counter.
Run Call this method to initialize the game, begin running the game loop, and start processing events for the
game.
Tick Updates the game's clock and calls Update and Draw.
ToString (Inherited from Object.)
Protected Methods
Name Description
BeginDraw Starts the drawing of a frame. This method is followed by calls to Draw and EndDraw.
BeginRun Called after all components are initialized but before the first update in the game loop.
Draw Called when the game determines it is time to draw a frame. Override this method with game-spec
ific rendering code.
EndDraw Ends the drawing of a frame. This method is preceeded by calls to Draw and BeginDraw.
EndRun Called after the game loop has stopped running before exiting.
Finalize Allows a Game to attempt to free resources and perform other cleanup operations before garbage
collection reclaims the Game.
Initialize Called after the Game and GraphicsDevice are created, but before LoadContent.
LoadContent Called when graphics resources need to be loaded. Override this method to load any game-specific
graphics resources.
LoadGraphicsContent Obsolete. Called when graphics resources need to be loaded. Override this method to load any ga
me-specific graphics resources.
MemberwiseClone (Inherited from Object.)
OnActivated Raises the Activated event. Override this method to add code to handle when the game gains focus
.
OnDeactivated Raises the Deactivated event. Override this method to add code to handle when the game loses foc
us.
OnExiting Raises an Exiting event. Override this method to add code to handle when the game is exiting.
UnloadContent Called when graphics resources need to be unloaded. Override this method to unload any game-sp
ecifc graphics resources.
UnloadGraphicsContent Obsolete. Called when graphics resources need to be unloaded. Override this method to unload an
y game-specifc graphics resources.
Update Called when the game has determined that game logic needs to be processed. Override this metho
d with game-specific logic.
Public Events
Name Description
Activated Raised when the game gains focus.
Deactivated Raised when the game loses focus.
Disposed Raised when the game is being disposed.
Exiting Raised when the game is exiting.
See Also
Reference
Game Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Game Constructor
Initializes a new instance of this class, which provides basic graphics device initialization, game logic, rendering code, and a
game loop.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public Game ()
Remarks
Although the GraphicsDeviceManager constructor requires an instance of Game, if the application does not otherwise require
an instance of Game it is often more desirable to implement the IGraphicsDeviceService interface to provide the same services
that would be provided by the GraphicsDeviceManager.
Similarly, when creating a new ContentManager, if no instance of Game is otherwise required by the application, it is often
more desirable to create a new class that implements the IServiceProvider interface rather than creating an instance of Game
just to create a new instance of GraphicsDeviceManager.
Example
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main(string[] args)
{
using (Game1 game = new Game1())
{
game.Run();
}
}
See Also
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game Methods
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
Exit Exits the game.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ResetElapsedTime Resets the elapsed time counter.
Run Call this method to initialize the game, begin running the game loop, and start processing events for the
game.
Tick Updates the game's clock and calls Update and Draw.
ToString (Inherited from Object.)
Protected Methods
Name Description
BeginDraw Starts the drawing of a frame. This method is followed by calls to Draw and EndDraw.
BeginRun Called after all components are initialized but before the first update in the game loop.
Draw Called when the game determines it is time to draw a frame. Override this method with game-spec
ific rendering code.
EndDraw Ends the drawing of a frame. This method is preceeded by calls to Draw and BeginDraw.
EndRun Called after the game loop has stopped running before exiting.
Finalize Allows a Game to attempt to free resources and perform other cleanup operations before garbage
collection reclaims the Game.
Initialize Called after the Game and GraphicsDevice are created, but before LoadContent.
LoadContent Called when graphics resources need to be loaded. Override this method to load any game-specific
graphics resources.
LoadGraphicsContent Obsolete. Called when graphics resources need to be loaded. Override this method to load any ga
me-specific graphics resources.
MemberwiseClone (Inherited from Object.)
OnActivated Raises the Activated event. Override this method to add code to handle when the game gains focus
.
OnDeactivated Raises the Deactivated event. Override this method to add code to handle when the game loses foc
us.
OnExiting Raises an Exiting event. Override this method to add code to handle when the game is exiting.
UnloadContent Called when graphics resources need to be unloaded. Override this method to unload any game-sp
ecifc graphics resources.
UnloadGraphicsContent Obsolete. Called when graphics resources need to be unloaded. Override this method to unload an
y game-specifc graphics resources.
Update Called when the game has determined that game logic needs to be processed. Override this metho
d with game-specific logic.
See Also
Reference
Game Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Game.BeginDraw Method
Starts the drawing of a frame. This method is followed by calls to Draw and EndDraw.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected virtual bool BeginDraw ()
Return Value
true if the frame should be drawn; false otherwise.
See Also
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.BeginRun Method
Called after all components are initialized but before the first update in the game loop.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected virtual void BeginRun ()
See Also
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
Game.Dispose () Immediately releases the unmanaged resources used by this object.
Game.Dispose (Boolean) Releases all resources used by the Game class.
See Also
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Game.Dispose Method ()
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public void Dispose ()
See Also
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
disposing
true to release both managed and unmanaged resources; false to release only unmanaged resources.
Remarks
This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean)
method with the disposing parameter set to true. Finalize invokes Dispose(Boolean) with disposing set to false.
When the disposing parameter is true, this method releases all resources held by any managed objects that this Game
references. This method invokes the Dispose method of each referenced object.
Note
Notes to Inheritors
Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects
disposed of in an earlier call to Dispose.
See Also
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.Draw Method
Called when the game determines it is time to draw a frame. Override this method with game-specific rendering code.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected virtual void Draw (
GameTime gameTime
)
Parameters
gameTime
Time passed since the last call to Draw.
Remarks
Update and Draw are called at different rates depending on whether IsFixedTimeStep is true or false. If IsFixedTimeStep is
false, Update and Draw will be called sequentially as often as possible. If IsFixedTimeStep is true, Update will be called at the
interval specified in TargetElapsedTime, while Draw will continue to be called as often as possible. For more information on
fixed-step and variable-step game loops, see Application Model Overview.
Caution
In the Draw method of an Xbox 360 game, vertex buffers, index buffers, and textures should not be written using SetData w
hen they are intended to be used for rendering. This condition may lead to graphics corruption or crashes. To avoid this pote
ntial issue, use DrawUserPrimitives or DrawUserIndexedPrimitives as the preferred alternative to VertexBuffer.SetData for dy
namic vertex generation.
This is because, in cases where the size of the back buffer and depth stencil buffer exceed the size of the Xbox 360 10 MB of e
mbedded memory (EDRAM), predicated tiling is utilized on this platform to compensate for the additional memory requirem
ents. Predicated tiling is a process by which scene rendering is performed multiple times on subsections of the final render ta
rget dimensions.
When predicated tiling has been triggered, the drawing commands contained in the Draw function are not submitted until
Present is called. (Note that Draw implicitly calls Present at the end of this method.) In this case, these resources are not avail
able for modification until the GPU is finished with presenting the entire frame.
Example
In classes that derive from Game, it is necessary to call base.Draw in Draw to enumerate through any graphics components
that have been added to Components and call their Initialize methods.
protected override void Draw( GameTime gameTime )
{
base.Draw( gameTime );
}
See Also
Tasks
Application Model Overview
Concepts
Predicated Tiling
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.EndDraw Method
Ends the drawing of a frame. This method is preceeded by calls to Draw and BeginDraw.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected virtual void EndDraw ()
See Also
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.EndRun Method
Called after the game loop has stopped running before exiting.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected virtual void EndRun ()
See Also
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.Exit Method
Exits the game.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public void Exit ()
Exceptions
Exception type Condition
InvalidOperationException The current platform does not allow games to exit.
See Also
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Exit a Game
Application Model Overview
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.Finalize Method
Allows a Game to attempt to free resources and perform other cleanup operations before garbage collection reclaims the
Game.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected override void Finalize ()
Remarks
This method overrides System.Object.Finalize. Application code should not call this method; an object's Finalize method is
automatically invoked during garbage collection.
See Also
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.Initialize Method
Called after the Game and GraphicsDevice are created, but before LoadContent.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected virtual void Initialize ()
Remarks Override this method to query for any required services and load any non-graphics resources. Use LoadContent to
load graphics resources.
Example
In classes which derive from Game, it is necessary to call base.Initialize in Initialize to enumerate through any graphics
components that have been added to Components and call their Initialize methods.
protected override void Initialize()
{
base.Initialize();
}
See Also
Reference
Game Class
LoadContent
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.LoadContent Method
Called when graphics resources need to be loaded. Override this method to load any game-specific graphics resources.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected virtual void LoadContent ()
Remarks This method is called by Initialize, and any time the game content needs to be reloaded, such as when the
DeviceReset event occurs. You should not access the GraphicsDevice until LoadContent is called.
See Also
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.LoadGraphicsContent Method
Obsolete. Called when graphics resources need to be loaded. Override this method to load any game-specific graphics
resources.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected virtual void LoadGraphicsContent (
bool loadAllContent
)
Parameters
loadAllContent
true if all graphics resources need to be loaded; false if only manual resources need to be loaded.
Remarks
Note
This method is obsolete in XNA Game Studio 2.0. Override LoadContent to load graphics resources.
This method is called by Initialize, as well as any time the game content needs to be reloaded, such as when the DeviceReset
event occurs.
See Also
Tasks
How To: Load Content
Reference
Game Class
LoadContent
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.OnActivated Method
Raises the Activated event. Override this method to add code to handle when the game gains focus.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected virtual void OnActivated (
Object sender,
EventArgs args
)
Parameters
sender
The Game.
args
Arguments for the Activated event.
Remarks The OnActivated method allows derived classes to handle the Activated event without attaching a delegate. This is
the preferred technique for handling the event in a derived class.
See Also
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.OnDeactivated Method
Raises the Deactivated event. Override this method to add code to handle when the game loses focus.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected virtual void OnDeactivated (
Object sender,
EventArgs args
)
Parameters
sender
The Game.
args
Arguments for the Deactivated event.
Remarks The OnDeactivated method allows derived classes to handle the Deactivated event without attaching a delegate.
This is the preferred technique for handling the event in a derived class.
See Also
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.OnExiting Method
Raises an Exiting event. Override this method to add code to handle when the game is exiting.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected virtual void OnExiting (
Object sender,
EventArgs args
)
Parameters
sender
The Game.
args
Arguments for the Exiting event.
Remarks The OnExiting method allows derived classes to handle the Exiting event without attaching a delegate. This is the
preferred technique for handling the event in a derived class.
See Also
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.ResetElapsedTime Method
Resets the elapsed time counter.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void ResetElapsedTime ()
Remarks
Use this method if your game is recovering from a slow-running state, and the ElapsedGameTime or ElapsedRealTime is too
large to be useful.
See Also
Reference
Game Class
Game Members
ElapsedGameTime
ElapsedRealTime
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.Run Method
Call this method to initialize the game, begin running the game loop, and start processing events for the game.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public void Run ()
Exceptions
Exception type Condition
InvalidOperationException Run has been called multiple times in the same application.
ArgumentException
Invalid arguments have been requested for the creation of the graphics device.
Invalid back buffer options have been requested:
BackBufferCount is not between 0 and 3.
BackBufferFormat is not valid. Try SurfaceFormat.Bgr565, SurfaceFormat.Bgr555,
SurfaceFormat.Bgra5551, SurfaceFormat.Bgr32, SurfaceFormat.Color,
SurfaceFormat.Bgra1010102.
The selected BackBufferFormat and IsFullScreen values are not valid for the selected adapter f
ormat and device type.
The BackBufferWidth and BackBufferHeight values do not correspond to a valid display mode.
FullScreenRefreshRateInHz does not match a valid display mode for the specified
BackBufferWidth and BackBufferHeight.
Invalid PresentationParameters.PresentationInterval or SwapEffect options have been requested:
On Xbox 360, PresentationParameters.PresentationInterval has been assigned the invalid valu
e PresentInterval.Four.
SwapEffect.Copy has been assigned to the PresentationParameters.SwapEffect property, but
BackBufferCount is not 1. When using SwapEffect.Copy, BackBufferCount must be 1.
SwapEffect is not one of the following: SwapEffect.Copy, SwapEffect.Discard, or
SwapEffect.Flip.
Invalid multisampling options have been requested:
Multisampling has been enabled, but SwapEffect.Discard has not been specified for the
SwapEffect property. SwapEffect.Discard is required when enabling multisampling.
The selected MultiSampleType is not compatible with the current BackBufferFormat and
IsFullScreen value for the selected adapter.
The selected MultiSampleQuality value is invalid for the selected MultiSampleType.
Invalid depth stencil options have been requested:
AutoDepthStencilFormat is not supported as a depth/stencil format when using the selected a
dapter BackBufferFormat.
PresentOptions has been set to PresentOptions.DiscardDepthStencil, but
EnableAutoDepthStencil is not true.
Multiple PresentationParameters have been specified and EnableAutoDepthStencil is true, bu
t EnableAutoDepthStencil, BackBufferFormat, BackBufferWidth, and BackBufferHeight are not
the same for all adapters.
IsFullScreen is true, but:
BackBufferWidth and BackBufferHeight are not nonzero.
PresentationInterval is not one of the following: PresentInterval.Default,
PresentInterval.Immediate, PresentInterval.One, PresentInterval.Two PresentInterval.Three, or
PresentInterval.Four.
FullScreenRefreshRateInHz is not nonzero.
The selected adapter does not support the selected full screen PresentationInterval.
IsFullScreen is false, but:
PresentationInterval is not one of the following: PresentInterval.Default,
PresentInterval.Immediate, or PresentInterval.One.
FullScreenRefreshRateInHz is not zero.
Remarks
This method calls the game Initialize and BeginRun methods before it begins the game loop and starts processing events for
the game.
Example
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main( string[] args )
{
using (Game1 game = new Game1())
{
game.Run();
}
}
}
See Also
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Programming Guide
Application Model Overview
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.Tick Method
Updates the game's clock and calls Update and Draw.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public void Tick ()
Remarks
In a fixed-step game, Tick calls Update only after a target time interval has elapsed.
In a variable-step game, Update is called every time Tick is called.
See Also
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.UnloadContent Method
Called when graphics resources need to be unloaded. Override this method to unload any game-specifc graphics resources.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected virtual void UnloadContent ()
See Also
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.UnloadGraphicsContent Method
Obsolete. Called when graphics resources need to be unloaded. Override this method to unload any game-specifc graphics
resources.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected virtual void UnloadGraphicsContent (
bool unloadAllContent
)
Parameters
unloadAllContent
true if all graphics resources need to be unloaded; false if only manual resources need to be unloaded.
Remarks
Note
This method is obsolete in XNA Game Studio 2.0. Use UnloadContent to unload graphics resources.
See Also
Reference
Game Class
UnloadContent
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.Update Method
Called when the game has determined that game logic needs to be processed. Override this method with game-specific logic.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected virtual void Update (
GameTime gameTime
)
Parameters
gameTime
Time passed since the last call to Update.
Remarks
Update and Draw are called at different rates depending on whether IsFixedTimeStep is true or false. If IsFixedTimeStep is
false, Update and Draw will be called sequentially as often as possible. If IsFixedTimeStep is true, Update will be called at the
interval specified in TargetElapsedTime, while Draw will continue to be called as often as possible. For more information on
fixed-step and variable-step game loops, see Application Model Overview.
See Also
Tasks
How To: Make a Game Use a Variable Time Step
How To: Make a Game Time Out
How To: Script the Camera to Follow a Curve
Concepts
Application Model Overview
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game Properties
Public Properties
Name Description
Components Gets the collection of GameComponents owned by the game.
Content Gets the current ContentManager.
GraphicsDevice Gets the current GraphicsDevice.
InactiveSleepTime Gets or sets the time to sleep when the game is inactive.
IsActive Indicates whether the game is currently the active application.
IsFixedTimeStep Gets or sets a value indicating whether to use fixed time steps.
IsMouseVisible Gets or sets a value indicating whether the mouse cursor should be visible.
Services Gets the GameServiceContainer holding all the service providers attached to the Game.
TargetElapsedTime Gets or sets the target time between calls to Update when IsFixedTimeStep is true.
Window Gets the underlying operating system window.
See Also
Reference
Game Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Game.Components Property
Gets the collection of GameComponents owned by the game.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public GameComponentCollection Components { get; }
Property Value
The collection of game GameComponents.
Remarks
Game components provide a modular way of adding functionality to a game. You create a game component by deriving the
new component either from the GameComponent class, or, if the component loads and draws graphics content, from the
DrawableGameComponent class. You then add game logic and rendering code to the game component by overriding
GameComponent.Update,DrawableGameComponent.Draw and GameComponent.Initialize. A game component is registered
with a game by passing the component to Game.Components.Add. A registered component will have its draw, update, and
initialize methods called from the Game.Initialize, Game.Update, and Game.Draw methods.
See Also
Tasks
Game Component Development
Concepts
Application Model Overview
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.Content Property
Gets the current ContentManager.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ContentManager Content { get; }
Property Value
The current ContentManager.
See Also
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.GraphicsDevice Property
Gets the current GraphicsDevice.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
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 XP SP2, Windows Vista
XNA Game Studio 2.0
Game.InactiveSleepTime Property
Gets or sets the time to sleep when the game is inactive.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public TimeSpan InactiveSleepTime { get; set; }
Property Value
The time to sleep when the game is inactive.
Exceptions
Exception type Condition
ArgumentOutOfRangeException The value specified for InactiveSleepTime is not greater than or equal to zero. Specify zero or
a positive value.
See Also
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.IsActive Property
Indicates whether the game is currently the active application.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public bool IsActive { get; }
Property Value
true if the game is active; false otherwise.
Remarks
On Windows, a game is active if it is not minimized and has the current input focus. On Xbox 360, the game is active if the user
is not interacting with the Dashboard.
See Also
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.IsFixedTimeStep Property
Gets or sets a value indicating whether to use fixed time steps.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public bool IsFixedTimeStep { get; set; }
Property Value
true if using fixed time steps; false otherwise.
Remarks
The default value for IsFixedTimeStep is true.
A fixed-step Game tries to call its Update method on the fixed interval specified in TargetElapsedTime. Setting
Game.IsFixedTimeStep to true causes a Game to use a fixed-step game loop. A new XNA project uses a fixed-step game loop
with a default TargetElapsedTime of 1/60th of a second.
In a fixed-step game loop, Game calls Update once the TargetElapsedTime has elapsed. After Update is called, if it is not time to
call Update again, Game calls Draw. After Draw is called, if it is not time to call Update again, Game idles until it is time to call
Update.
If Update takes too long to process, Game sets IsRunningSlowly to true and calls Update again, without calling Draw in
between. When an update runs longer than the TargetElapsedTime, Game responds by calling Update extra times and
dropping the frames associated with those updates to catch up. This ensures that Update will have been called the expected
number of times when the game loop catches up from a slow down. You can check the value of IsRunningSlowly in your
Update if you want to detect dropped frames and shorten your Update processing to compensate. You can reset the elapsed
times by calling ResetElapsedTime.
When your game pauses in the debugger, Game will not make extra calls to Update when the game resumes.
See Also
Tasks
How To: Make a Game Use a Variable Time Step
Concepts
Application Model Overview
Reference
GameTime.IsRunningSlowly Property
Game.TargetElapsedTime Property
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.IsMouseVisible Property
Gets or sets a value indicating whether the mouse cursor should be visible.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public bool IsMouseVisible { get; set; }
Property Value
true if the mouse cursor should be visible; false otherwise.
Remarks
Note
This property applies only to Windows development. The Mouse and MouseState objects are not supported on Xbox 360.
See Also
Tasks
How To: Detect Whether a User Clicked a 3D Object
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.Services Property
Gets the GameServiceContainer holding all the service providers attached to the Game.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public GameServiceContainer Services { get; }
Property Value
The GameServiceContainer holding all the service providers attached to the Game.
Remarks
Game services are a mechanism for maintaining loose coupling between objects that need to interact with each other. Services
work through a mediator—in this case, Game.Services. Service providers register with Game.Services, and service consumers
request services from Game.Services. This arrangement allows an object that requires a service to request the service without
knowing the name of the service provider.
Game services are defined by an interface. A class specifies the services it provides by implementing interfaces and registering
the services with Game.Services. A service is registered by calling Game.Services.AddService specifying the type of service
being implemented and a reference to the object providing the service. For example, to register an object that provides a
service represented by the interface IMyService, you would use the following code.
Services.AddService( typeof( IMyService ), myobject );
Once a service is registered, the object providing the service can be retrieved by Game.Services.GetService and specifying the
desired service. For example, to retrieve IGraphicsDeviceService, you would use the following code.
IGraphicsDeviceService graphicsservice = (IGraphicsDeviceService)Services.GetService( t
ypeof(IGraphicsDeviceService) );
See Also
Concepts
Application Model Overview
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.TargetElapsedTime Property
Gets or sets the target time between calls to Update when IsFixedTimeStep is true.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public TimeSpan TargetElapsedTime { get; set; }
Property Value
The target time period for the game loop.
Exceptions
Exception type Condition
ArgumentOutOfRangeException The value specified for TargetElapsedTime is not greater than zero. Specify a nonzero positive
value.
Remarks
The default value for TargetElapsedTime is 1/60th of a second.
A fixed-step Game tries to call its Update method on the fixed interval specified in TargetElapsedTime. Setting
Game.IsFixedTimeStep to true causes a Game to use a fixed-step game loop. A new XNA project uses a fixed-step game loop
with a default TargetElapsedTime of 1/60th of a second.
In a fixed-step game loop, Game calls Update once the TargetElapsedTime has elapsed. After Update is called, if it is not time to
call Update again, Game calls Draw. After Draw is called, if it is not time to call Update again, Game idles until it is time to call
Update.
If Update takes too long to process, Game sets IsRunningSlowly to true and calls Update again, without calling Draw in
between. When an update runs longer than the TargetElapsedTime, Game responds by calling Update extra times and
dropping the frames associated with those updates to catch up. This ensures that Update will have been called the expected
number of times when the game loop catches up from a slow down. You can check the value of IsRunningSlowly in your
Update if you want to detect dropped frames and shorten your Update processing to compensate. You can reset the elapsed
times by calling ResetElapsedTime.
When your game pauses in the debugger, Game will not make extra calls to Update when the game resumes.
See Also
Concepts
Application Model Overview
Reference
GameTime.IsRunningSlowly Property
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.Window Property
Gets the underlying operating system window.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public GameWindow Window { get; }
Property Value
The underlying operating system window.
See Also
Concepts
Displays, Client Bounds, Viewports, and Back Buffers
Tasks
How To: Allow the Player to Resize a Game Window
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game Events
Public Events
Name Description
Activated Raised when the game gains focus.
Deactivated Raised when the game loses focus.
Disposed Raised when the game is being disposed.
Exiting Raised when the game is exiting.
See Also
Reference
Game Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Game.Activated Event
Raised when the game gains focus.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public event EventHandler Activated
See Also
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.Deactivated Event
Raised when the game loses focus.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public event EventHandler Deactivated
See Also
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.Disposed Event
Raised when the game is being disposed.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public event EventHandler Disposed
See Also
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Game.Exiting Event
Raised when the game is exiting.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public event EventHandler Exiting
See Also
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Exit a Game
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameComponent Class
Base class for all XNA Framework game components.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public class GameComponent : IGameComponent, IUpdateable, IDisposable
Remarks
Game components provide a modular way of adding functionality to a game. You create a game component by deriving the
new component either from the GameComponent class, or, if the component loads and draws graphics content, from the
DrawableGameComponent class. You then add game logic and rendering code to the game component by overriding
GameComponent.Update,DrawableGameComponent.Draw and GameComponent.Initialize. A game component is registered
with a game by passing the component to Game.Components.Add. A registered component will have its draw, update, and
initialize methods called from the Game.Initialize, Game.Update, and Game.Draw methods.
See Also
Concepts
Application Model Overview
Tasks
Game Component Development
Reference
GameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameComponent Members
The following tables list the members exposed by the GameComponent type.
Public Constructors
Name Description
GameComponent Initializes a new instance of this class.
Public Properties
Name Description
Enabled Indicates whether GameComponent.Update should be called when Game.Update is called.
Game Gets the Game associated with this GameComponent.
UpdateOrder Indicates the order in which the GameComponent should be updated relative to other GameComponent insta
nces. Lower values are updated first.
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
Initialize Called when the GameComponent needs to be initialized. Override this method to query for required servi
ces and load any non-graphics resources.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Update Called when the GameComponent needs to be updated. Override this method with component-specific up
date code.
Protected Methods
Name Description
Finalize Allows a GameComponent to attempt to free resources and perform other cleanup operations bef
ore garbage collection reclaims the GameComponent.
MemberwiseClone (Inherited from Object.)
OnEnabledChanged Called when the Enabled property changes. Raises the EnabledChanged event.
OnUpdateOrderChanged Called when the UpdateOrder property changes. Raises the UpdateOrderChanged event.
Public Events
Name Description
Disposed Raised when the GameComponent is disposed.
EnabledChanged Raised when the Enabled property changes.
UpdateOrderChanged Raised when the UpdateOrder property changes.
See Also
Reference
GameComponent Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GameComponent Constructor
Initializes a new instance of this class.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public GameComponent (
Game game
)
Parameters
game
Game that the game component should be attached to.
Remarks
Game components provide a modular way of adding functionality to a game. You create a game component by deriving the
new component either from the GameComponent class, or, if the component loads and draws graphics content, from the
DrawableGameComponent class. You then add game logic and rendering code to the game component by overriding
GameComponent.Update,DrawableGameComponent.Draw and GameComponent.Initialize. A game component is registered
with a game by passing the component to Game.Components.Add. A registered component will have its draw, update, and
initialize methods called from the Game.Initialize, Game.Update, and Game.Draw methods.
See Also
Tasks
Game Component Development
Concepts
Application Model Overview
Reference
GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameComponent Methods
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
Initialize Called when the GameComponent needs to be initialized. Override this method to query for required servi
ces and load any non-graphics resources.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Update Called when the GameComponent needs to be updated. Override this method with component-specific up
date code.
Protected Methods
Name Description
Finalize Allows a GameComponent to attempt to free resources and perform other cleanup operations bef
ore garbage collection reclaims the GameComponent.
MemberwiseClone (Inherited from Object.)
OnEnabledChanged Called when the Enabled property changes. Raises the EnabledChanged event.
OnUpdateOrderChanged Called when the UpdateOrder property changes. Raises the UpdateOrderChanged event.
See Also
Reference
GameComponent Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GameComponent.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
GameComponent.Dispose () Immediately releases the unmanaged resources used by this object.
GameComponent.Dispose (Boolean) Releases the unmanaged resources used by the GameComponent and optionally releases
the managed resources.
See Also
Reference
GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GameComponent.Dispose Method ()
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public void Dispose ()
See Also
Reference
GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
disposing
true to release both managed and unmanaged resources; false to release only unmanaged resources.
See Also
Reference
GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameComponent.Finalize Method
Allows a GameComponent to attempt to free resources and perform other cleanup operations before garbage collection
reclaims the GameComponent.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected override void Finalize ()
Remarks
This method overrides System.Object.Finalize. Application code should not call this method; an object's Finalize method is
automatically invoked during garbage collection.
See Also
Reference
GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameComponent.Initialize Method
Called when the GameComponent needs to be initialized. Override this method to query for required services and load any
non-graphics resources.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public virtual void Initialize ()
See Also
Reference
GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameComponent.OnEnabledChanged Method
Called when the Enabled property changes. Raises the EnabledChanged event.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected virtual void OnEnabledChanged (
Object sender,
EventArgs args
)
Parameters
sender
The GameComponent.
args
Arguments to the EnabledChanged event.
See Also
Reference
GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameComponent.OnUpdateOrderChanged Method
Called when the UpdateOrder property changes. Raises the UpdateOrderChanged event.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected virtual void OnUpdateOrderChanged (
Object sender,
EventArgs args
)
Parameters
sender
The GameComponent.
args
Arguments to the UpdateOrderChanged event.
See Also
Reference
GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameComponent.Update Method
Called when the GameComponent needs to be updated. Override this method with component-specific update code.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public virtual void Update (
GameTime gameTime
)
Parameters
gameTime
Time elapsed since the last call to Update
See Also
Reference
GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace
Programming Guide
Application Model Overview
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameComponent Properties
Public Properties
Name Description
Enabled Indicates whether GameComponent.Update should be called when Game.Update is called.
Game Gets the Game associated with this GameComponent.
UpdateOrder Indicates the order in which the GameComponent should be updated relative to other GameComponent insta
nces. Lower values are updated first.
See Also
Reference
GameComponent Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GameComponent.Enabled Property
Indicates whether GameComponent.Update should be called when Game.Update is called.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public bool Enabled { get; set; }
Property Value
true if GameComponent.Update should be called; false otherwise.
See Also
Reference
GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameComponent.Game Property
Gets the Game associated with this GameComponent.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public Game Game { get; }
Property Value
The Game associated with this GameComponent.
See Also
Reference
GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace
Programming Guide
Application Model Overview
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameComponent.UpdateOrder Property
Indicates the order in which the GameComponent should be updated relative to other GameComponent instances. Lower
values are updated first.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public int UpdateOrder { get; set; }
Property Value
The order in which the GameComponent should be updated.
See Also
Reference
GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameComponent Events
Public Events
Name Description
Disposed Raised when the GameComponent is disposed.
EnabledChanged Raised when the Enabled property changes.
UpdateOrderChanged Raised when the UpdateOrder property changes.
See Also
Reference
GameComponent Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GameComponent.Disposed Event
Raised when the GameComponent is disposed.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public event EventHandler Disposed
See Also
Reference
GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameComponent.EnabledChanged Event
Raised when the Enabled property changes.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public event EventHandler EnabledChanged
See Also
Reference
GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameComponent.UpdateOrderChanged Event
Raised when the UpdateOrder property changes.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public event EventHandler UpdateOrderChanged
See Also
Reference
GameComponent Class
GameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameComponentCollection Class
A collection of game components.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public sealed class GameComponentCollection : Collection<IGameComponent>
See Also
Reference
GameComponentCollection Members
Microsoft.Xna.Framework Namespace
Programming Guide
Application Model Overview
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameComponentCollection Members
The following tables list the members exposed by the GameComponentCollection type.
Public Constructors
Name Description
GameComponentCollection Initializes a new instance of this class.
Public Properties
Name Description
Count (Inherited from Collection.)
Item (Inherited from Collection.)
Protected Properties
Name Description
Items (Inherited from Collection.)
Public Methods
Name Description
Add (Inherited from Collection.)
Clear (Inherited from Collection.)
Contains (Inherited from Collection.)
CopyTo (Inherited from Collection.)
Equals (Inherited from Object.)
GetEnumerator (Inherited from Collection.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
IndexOf (Inherited from Collection.)
Insert (Inherited from Collection.)
InsertItem Overloaded. Inserts a child object into the collection at the specified location.
ReferenceEquals (Inherited from Object.)
Remove (Inherited from Collection.)
RemoveAt (Inherited from Collection.)
SetItem Overloaded. Modifies the specified child object in the collection.
ToString (Inherited from Object.)
Protected Methods
Name Description
ClearItems Removes all children from the collection.
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
RemoveItem Removes a child object in the collection.
Public Events
Name Description
ComponentAdded Raised when a component is added to the GameComponentCollection.
ComponentRemoved Raised when a component is removed from the GameComponentCollection.
See Also
Reference
GameComponentCollection Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GameComponentCollection Constructor
Initializes a new instance of this class.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GameComponentCollection ()
See Also
Reference
GameComponentCollection Class
GameComponentCollection Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameComponentCollection Methods
Public Methods
Name Description
Add (Inherited from Collection.)
Clear (Inherited from Collection.)
Contains (Inherited from Collection.)
CopyTo (Inherited from Collection.)
Equals (Inherited from Object.)
GetEnumerator (Inherited from Collection.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
IndexOf (Inherited from Collection.)
Insert (Inherited from Collection.)
InsertItem Overloaded. Inserts a child object into the collection at the specified location.
ReferenceEquals (Inherited from Object.)
Remove (Inherited from Collection.)
RemoveAt (Inherited from Collection.)
SetItem Overloaded. Modifies the specified child object in the collection.
ToString (Inherited from Object.)
Protected Methods
Name Description
ClearItems Removes all children from the collection.
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
RemoveItem Removes a child object in the collection.
See Also
Reference
GameComponentCollection Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GameComponentCollection.ClearItems Method
Removes all children from the collection.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void ClearItems ()
See Also
Reference
GameComponentCollection Class
GameComponentCollection Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameComponentCollection.InsertItem Method
Inserts a child object into the collection at the specified location.
Overload List
Name Description
GameComponentCollection.InsertItem (Int32, IGameComponent) Inserts a child object into the collection at the specified locati
on.
GameComponentCollection.InsertItem (Int32, IGameComponent) (Inherited from Collection.)
See Also
Reference
GameComponentCollection Class
GameComponentCollection Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
index
The position in the collection.
item
The child object being inserted.
Exceptions
Exception type Condition
ArgumentException Cannot add the same game component to a game component collection multiple times.
See Also
Reference
GameComponentCollection Class
GameComponentCollection Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameComponentCollection.RemoveItem Method
Removes a child object in the collection.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void RemoveItem (
int index
)
Parameters
index
The index of the item being removed.
See Also
Reference
GameComponentCollection Class
GameComponentCollection Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameComponentCollection.SetItem Method
Modifies the specified child object in the collection.
Overload List
Name Description
GameComponentCollection.SetItem (Int32, IGameComponent) Modifies the specified child object in the collection.
GameComponentCollection.SetItem (Int32, IGameComponent) (Inherited from Collection.)
See Also
Reference
GameComponentCollection Class
GameComponentCollection Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
index
The position in the collection.
item
The child object being modified.
Exceptions
Exception type Condition
NotSupportedException Cannot set a value using SetItem on GameComponentCollection. Use Add or Remove instead.
See Also
Reference
GameComponentCollection Class
GameComponentCollection Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameComponentCollection Properties
Public Properties
Name Description
Count (Inherited from Collection.)
Item (Inherited from Collection.)
Protected Properties
Name Description
Items (Inherited from Collection.)
See Also
Reference
GameComponentCollection Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GameComponentCollection Events
Public Events
Name Description
ComponentAdded Raised when a component is added to the GameComponentCollection.
ComponentRemoved Raised when a component is removed from the GameComponentCollection.
See Also
Reference
GameComponentCollection Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GameComponentCollection.ComponentAdded Event
Raised when a component is added to the GameComponentCollection.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public event EventHandler<GameComponentCollectionEventArgs> ComponentAdded
See Also
Reference
GameComponentCollection Class
GameComponentCollection Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameComponentCollection.ComponentRemoved Event
Raised when a component is removed from the GameComponentCollection.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public event EventHandler<GameComponentCollectionEventArgs> ComponentRemoved
See Also
Reference
GameComponentCollection Class
GameComponentCollection Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameComponentCollectionEventArgs Class
Arguments used with events from the GameComponentCollection.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public class GameComponentCollectionEventArgs : EventArgs
See Also
Reference
GameComponentCollectionEventArgs Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameComponentCollectionEventArgs Members
The following tables list the members exposed by the GameComponentCollectionEventArgs type.
Public Constructors
Name Description
GameComponentCollectionEventArgs Creates a new instance of GameComponentCollectionEventArgs.
Public Properties
Name Description
GameComponent The game component affected by the event.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GameComponentCollectionEventArgs Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GameComponentCollectionEventArgs Constructor
Creates a new instance of GameComponentCollectionEventArgs.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public GameComponentCollectionEventArgs (
IGameComponent gameComponent
)
Parameters
gameComponent
The game component affected by the event.
See Also
Reference
GameComponentCollectionEventArgs Class
GameComponentCollectionEventArgs Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameComponentCollectionEventArgs Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GameComponentCollectionEventArgs Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GameComponentCollectionEventArgs Properties
Public Properties
Name Description
GameComponent The game component affected by the event.
See Also
Reference
GameComponentCollectionEventArgs Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GameComponentCollectionEventArgs.GameComponent
Property
The game component affected by the event.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public IGameComponent GameComponent { get; }
Property Value
The game component affected by the event.
See Also
Reference
GameComponentCollectionEventArgs Class
GameComponentCollectionEventArgs Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameServiceContainer Class
A collection of game services.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public class GameServiceContainer : IServiceProvider
Remarks
Game services are a mechanism for maintaining loose coupling between objects that need to interact with each other. Services
work through a mediator—in this case, Game.Services. Service providers register with Game.Services, and service consumers
request services from Game.Services. This arrangement allows an object that requires a service to request the service without
knowing the name of the service provider.
Game services are defined by an interface. A class specifies the services it provides by implementing interfaces and registering
the services with Game.Services. A service is registered by calling Game.Services.AddService specifying the type of service
being implemented and a reference to the object providing the service. For example, to register an object that provides a
service represented by the interface IMyService, you would use the following code.
Services.AddService( typeof( IMyService ), myobject );
Once a service is registered, the object providing the service can be retrieved by Game.Services.GetService and specifying the
desired service. For example, to retrieve IGraphicsDeviceService, you would use the following code.
IGraphicsDeviceService graphicsservice = (IGraphicsDeviceService)Services.GetService( t
ypeof(IGraphicsDeviceService) );
See Also
Reference
Game.Services Property
GameServiceContainer Members
Microsoft.Xna.Framework Namespace
Programming Guide
Application Model Overview
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameServiceContainer Members
The following tables list the members exposed by the GameServiceContainer type.
Public Constructors
Name Description
GameServiceContainer Initializes a new instance of this class, which represents a collection of game services.
Public Methods
Name Description
AddService Adds a service to the GameServiceContainer.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetService Gets the object providing a specified service.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
RemoveService Removes the object providing a specified service.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GameServiceContainer Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GameServiceContainer Constructor
Initializes a new instance of this class, which represents a collection of game services.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public GameServiceContainer ()
Remarks
Game services are a mechanism for maintaining loose coupling between objects that need to interact with each other. Services
work through a mediator—in this case, Game.Services. Service providers register with Game.Services, and service consumers
request services from Game.Services. This arrangement allows an object that requires a service to request the service without
knowing the name of the service provider.
Game services are defined by an interface. A class specifies the services it provides by implementing interfaces and registering
the services with Game.Services. A service is registered by calling Game.Services.AddService specifying the type of service
being implemented and a reference to the object providing the service. For example, to register an object that provides a
service represented by the interface IMyService, you would use the following code.
Services.AddService( typeof( IMyService ), myobject );
Once a service is registered, the object providing the service can be retrieved by Game.Services.GetService and specifying the
desired service. For example, to retrieve IGraphicsDeviceService, you would use the following code.
IGraphicsDeviceService graphicsservice = (IGraphicsDeviceService)Services.GetService( t
ypeof(IGraphicsDeviceService) );
See Also
Reference
Game.Services Property
GameServiceContainer Class
GameServiceContainer Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameServiceContainer Methods
Public Methods
Name Description
AddService Adds a service to the GameServiceContainer.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetService Gets the object providing a specified service.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
RemoveService Removes the object providing a specified service.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GameServiceContainer Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GameServiceContainer.AddService Method
Adds a service to the GameServiceContainer.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public void AddService (
Type type,
Object provider
)
Parameters
type
The type of service to add.
provider
The service provider to add.
Exceptions
Exception type Condition
ArgumentNullException The type or provider parameter is null.
ArgumentException The container already contains a service of this type, or the service provider object of the type request
ed is not assignable to this service type.
Remarks
Game services are a mechanism for maintaining loose coupling between objects that need to interact with each other. Services
work through a mediator—in this case, Game.Services. Service providers register with Game.Services, and service consumers
request services from Game.Services. This arrangement allows an object that requires a service to request the service without
knowing the name of the service provider.
Game services are defined by an interface. A class specifies the services it provides by implementing interfaces and registering
the services with Game.Services. A service is registered by calling Game.Services.AddService specifying the type of service
being implemented and a reference to the object providing the service. For example, to register an object that provides a
service represented by the interface IMyService, you would use the following code.
Services.AddService( typeof( IMyService ), myobject );
Once a service is registered, the object providing the service can be retrieved by Game.Services.GetService and specifying the
desired service. For example, to retrieve IGraphicsDeviceService, you would use the following code.
IGraphicsDeviceService graphicsservice = (IGraphicsDeviceService)Services.GetService( t
ypeof(IGraphicsDeviceService) );
See Also
Concepts
Application Model Overview
Reference
GameServiceContainer Class
GameServiceContainer Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameServiceContainer.GetService Method
Gets the object providing a specified service.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public Object GetService (
Type type
)
Parameters
type
The type of service.
Return Value
The object providing the service.
Exceptions
Exception type Condition
ArgumentNullException The type parameter is null.
Remarks
Game services are a mechanism for maintaining loose coupling between objects that need to interact with each other. Services
work through a mediator—in this case, Game.Services. Service providers register with Game.Services, and service consumers
request services from Game.Services. This arrangement allows an object that requires a service to request the service without
knowing the name of the service provider.
Game services are defined by an interface. A class specifies the services it provides by implementing interfaces and registering
the services with Game.Services. A service is registered by calling Game.Services.AddService specifying the type of service
being implemented and a reference to the object providing the service. For example, to register an object that provides a
service represented by the interface IMyService, you would use the following code.
Services.AddService( typeof( IMyService ), myobject );
Once a service is registered, the object providing the service can be retrieved by Game.Services.GetService and specifying the
desired service. For example, to retrieve IGraphicsDeviceService, you would use the following code.
IGraphicsDeviceService graphicsservice = (IGraphicsDeviceService)Services.GetService( t
ypeof(IGraphicsDeviceService) );
See Also
Concepts
Application Model Overview
Reference
GameServiceContainer Class
GameServiceContainer Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameServiceContainer.RemoveService Method
Removes the object providing a specified service.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public void RemoveService (
Type type
)
Parameters
type
The type of service.
Exceptions
Exception type Condition
ArgumentNullException The type parameter is null.
See Also
Reference
GameServiceContainer Class
GameServiceContainer Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameTime Class
Snapshot of the game timing state expressed in values that can be used by variable-step (real time) or fixed-step (game time)
games.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public class GameTime
See Also
Tasks
How To: Make a Game Use a Variable Time Step
Concepts
Application Model Overview
Reference
GameTime Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameTime Members
The following tables list the members exposed by the GameTime type.
Public Constructors
Name Description
GameTime Overloaded. Creates a new instance of GameTime.
Public Properties
Name Description
ElapsedGameTime The amount of elapsed game time since the last update.
ElapsedRealTime The amount of elapsed real time (wall clock) since the last frame.
IsRunningSlowly Gets a value indicating that the game loop is taking longer than its TargetElapsedTime. In this case, the g
ame loop can be considered to be running too slowly and should do something to "catch up."
TotalGameTime The amount of game time since the start of the game.
TotalRealTime The amount of real time (wall clock) since the start of the game.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GameTime Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GameTime Constructor
Creates a new instance of GameTime.
Overload List
Name Description
GameTime () Creates a new instance of GameTime.
GameTime (TimeSpan, TimeSpan, TimeSpan, TimeSpan) Creates a new instance of GameTime.
GameTime (TimeSpan, TimeSpan, TimeSpan, TimeSpan, Boolean) Creates a new instance of GameTime.
See Also
Reference
GameTime Class
GameTime Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GameTime Constructor ()
Creates a new instance of GameTime.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public GameTime ()
See Also
Reference
GameTime Class
GameTime Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
totalRealTime
The amount of real time (wall clock) since the start of the game.
elapsedRealTime
The amount of elapsed real time (wall clock) since the last frame.
totalGameTime
The amount of game time since the start of the game.
elapsedGameTime
The amount of elapsed game time since the last update.
See Also
Reference
GameTime Class
GameTime Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
totalRealTime
The amount of real time (wall clock) since the start of the game.
elapsedRealTime
The amount of elapsed real time (wall clock) since the last frame.
totalGameTime
The amount of game time since the start of the game.
elapsedGameTime
The amount of elapsed game time since the last update.
isRunningSlowly
Whether the game is running multiple updates this frame.
See Also
Reference
GameTime Class
GameTime Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameTime Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GameTime Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GameTime Properties
Public Properties
Name Description
ElapsedGameTime The amount of elapsed game time since the last update.
ElapsedRealTime The amount of elapsed real time (wall clock) since the last frame.
IsRunningSlowly Gets a value indicating that the game loop is taking longer than its TargetElapsedTime. In this case, the g
ame loop can be considered to be running too slowly and should do something to "catch up."
TotalGameTime The amount of game time since the start of the game.
TotalRealTime The amount of real time (wall clock) since the start of the game.
See Also
Reference
GameTime Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GameTime.ElapsedGameTime Property
The amount of elapsed game time since the last update.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public TimeSpan ElapsedGameTime { get; set; }
Property Value
Elapsed game time since the last update.
RemarksFixed-step clocks update by a fixed time span upon every clock step. This results in uniform clock steps that may not
actually track the wall clock time. Fixed-step clocks were popular on console systems where one had tight control over code
and a fixed system performance. Fixed-step clocks are also useful when trying to achieve deterministic updates for debugging,
offline rendering, or other such scenarios.
See Also
Tasks
How To: Make a Game Use a Variable Time Step
Concepts
Application Model Overview
Reference
GameTime Class
GameTime Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameTime.ElapsedRealTime Property
The amount of elapsed real time (wall clock) since the last frame.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public TimeSpan ElapsedRealTime { get; set; }
Property Value
Elapsed real time since the last frame.
RemarksVariable-step clocks automatically track the difference in real-time (wall clock) that transpired since the last clock step.
This type of game timing is popular on PC games where the variable PC configurations affect update time.
See Also
Tasks
How To: Make a Game Use a Variable Time Step
Concepts
Application Model Overview
Reference
GameTime Class
GameTime Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameTime.IsRunningSlowly Property
Gets a value indicating that the game loop is taking longer than its TargetElapsedTime. In this case, the game loop can be
considered to be running too slowly and should do something to "catch up."
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public bool IsRunningSlowly { get; set; }
Property Value
true if the game loop is taking too long; false otherwise.
See Also
Reference
GameTime Class
GameTime Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameTime.TotalGameTime Property
The amount of game time since the start of the game.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public TimeSpan TotalGameTime { get; set; }
Property Value
Game time since the start of the game.
RemarksFixed-step clocks update by a fixed time span upon every clock step. This results in uniform clock steps that may not
actually track the wall clock time. Fixed step clocks were popular on console systems where one had tight control over code
and a fixed system performance. Fixed-step clocks are also useful when trying to achieve deterministic updates for debugging,
offline rendering, or other such scenarios.
See Also
Tasks
How To: Make a Game Use a Variable Time Step
Concepts
Application Model Overview
Reference
GameTime Class
GameTime Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameTime.TotalRealTime Property
The amount of real time (wall clock) since the start of the game.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public TimeSpan TotalRealTime { get; set; }
Property Value
Real time since the start of the game.
RemarksVariable-step clocks automatically track the difference in real-time (wall clock) that transpired since the last clock step.
This type of game timing is popular on PC games where the variable PC configurations affect update time.
See Also
Tasks
How To: Make a Game Use a Variable Time Step
Concepts
Application Model Overview
Reference
GameTime Class
GameTime Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameWindow Class
The system window associated with a Game.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public abstract class GameWindow
See Also
Reference
GameWindow Members
Microsoft.Xna.Framework Namespace
Programming Guide
Application Model Overview
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameWindow Members
The following tables list the members exposed by the GameWindow type.
Public Properties
Name Description
AllowUserResizing Specifies whether to allow the user to resize the game window.
ClientBounds The screen dimensions of the game window's client rectangle.
Handle Gets the handle to the system window.
ScreenDeviceName Gets the device name of the screen the window is currently in.
Title Gets and sets the title of the system window.
Public Methods
Name Description
BeginScreenDeviceChange Starts a device transition (windowed to full screen or vice versa).
EndScreenDeviceChange Overloaded. Completes a device transition.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
OnActivated Called when the GameWindow gets focus.
OnClientSizeChanged Called when the size of the client window changes. Raises the ClientSizeChanged event.
OnDeactivated Called when the GameWindow loses focus.
OnPaint Called when the GameWindow needs to be painted.
OnScreenDeviceNameChanged Called when the GameWindow is moved to a different screen. Raises the
ScreenDeviceNameChanged event.
SetTitle Sets the title of the GameWindow.
Public Events
Name Description
ClientSizeChanged Raised when the size of the GameWindow changes.
ScreenDeviceNameChanged Raised when the GameWindow moves to a different display.
See Also
Reference
GameWindow Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GameWindow Methods
Public Methods
Name Description
BeginScreenDeviceChange Starts a device transition (windowed to full screen or vice versa).
EndScreenDeviceChange Overloaded. Completes a device transition.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
OnActivated Called when the GameWindow gets focus.
OnClientSizeChanged Called when the size of the client window changes. Raises the ClientSizeChanged event.
OnDeactivated Called when the GameWindow loses focus.
OnPaint Called when the GameWindow needs to be painted.
OnScreenDeviceNameChanged Called when the GameWindow is moved to a different screen. Raises the
ScreenDeviceNameChanged event.
SetTitle Sets the title of the GameWindow.
See Also
Reference
GameWindow Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GameWindow.BeginScreenDeviceChange Method
Starts a device transition (windowed to full screen or vice versa).
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public abstract void BeginScreenDeviceChange (
bool willBeFullScreen
)
Parameters
willBeFullScreen
Specifies whether the device will be in full-screen mode upon completion of the change.
Remarks This method must be called before any device change occurs (that is, before resetting the graphics device).
EndScreenDeviceChange should be called to complete the transition.
See Also
Reference
GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameWindow.EndScreenDeviceChange Method
Completes a device transition.
Overload List
Name Description
GameWindow.EndScreenDeviceChange (String) Completes a device transition.
GameWindow.EndScreenDeviceChange (String, Int32, Int32) Completes a device transition.
See Also
Reference
BeginScreenDeviceChange
GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
screenDeviceName
The desktop screen to move the window to. This should be the screen device name of the graphics device that has
transitioned to full screen.
RemarksThis method must be called after any device change (that is, after resetting the graphics device).
See Also
Reference
BeginScreenDeviceChange
GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
screenDeviceName
The desktop screen to move the window to. This should be the screen device name of the graphics device that has
transitioned to full screen.
clientWidth
The new width of the game's client window.
clientHeight
The new height of the game's client window.
Remarks This method must be called after any device change (that is, after resetting the graphics device).
See Also
Reference
BeginScreenDeviceChange
GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameWindow.OnActivated Method
Called when the GameWindow gets focus.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected void OnActivated ()
See Also
Reference
GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameWindow.OnClientSizeChanged Method
Called when the size of the client window changes. Raises the ClientSizeChanged event.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected void OnClientSizeChanged ()
See Also
Reference
GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameWindow.OnDeactivated Method
Called when the GameWindow loses focus.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected void OnDeactivated ()
See Also
Reference
GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameWindow.OnPaint Method
Called when the GameWindow needs to be painted.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected void OnPaint ()
See Also
Reference
GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameWindow.OnScreenDeviceNameChanged Method
Called when the GameWindow is moved to a different screen. Raises the ScreenDeviceNameChanged event.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected void OnScreenDeviceNameChanged ()
See Also
Reference
GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameWindow.SetTitle Method
Sets the title of the GameWindow.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected abstract void SetTitle (
string title
)
Parameters
title
The new title of the GameWindow.
Note
This method is ignored on the Xbox 360.
See Also
Reference
GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameWindow Properties
Public Properties
Name Description
AllowUserResizing Specifies whether to allow the user to resize the game window.
ClientBounds The screen dimensions of the game window's client rectangle.
Handle Gets the handle to the system window.
ScreenDeviceName Gets the device name of the screen the window is currently in.
Title Gets and sets the title of the system window.
See Also
Reference
GameWindow Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GameWindow.AllowUserResizing Property
Specifies whether to allow the user to resize the game window.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
[DefaultValueAttribute(false)]
public abstract bool AllowUserResizing { get; set; }
Property Value
true if user resizing is allowed; false otherwise.
Note
On the Xbox 360, this property is always false.
See Also
Reference
Game Class
Game Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Allow the Player to Resize a Game Window
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameWindow.ClientBounds Property
The screen dimensions of the game window's client rectangle.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public abstract Rectangle ClientBounds { get; }
Property Value
Screen dimensions of the game window's client rectangle.
See Also
Concepts
Displays, Client Bounds, Viewports, and Back Buffers
Reference
GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameWindow.Handle Property
Gets the handle to the system window.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public abstract IntPtr Handle { get; }
Property Value
The handle to the system window.
Note
On the Xbox 360 this property is always IntPtr.Zero.
See Also
Reference
GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameWindow.ScreenDeviceName Property
Gets the device name of the screen the window is currently in.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public abstract string ScreenDeviceName { get; }
Property Value
The device name of the screen.
See Also
Reference
GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameWindow.Title Property
Gets and sets the title of the system window.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public string Title { get; set; }
Property Value
The title of the system window.
Exceptions
Exception type Condition
ArgumentNullException Title is null. Use an empty string instead.
Note
This property is ignored on the Xbox 360.
See Also
Reference
GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameWindow Events
Public Events
Name Description
ClientSizeChanged Raised when the size of the GameWindow changes.
ScreenDeviceNameChanged Raised when the GameWindow moves to a different display.
See Also
Reference
GameWindow Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GameWindow.ClientSizeChanged Event
Raised when the size of the GameWindow changes.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public event EventHandler ClientSizeChanged
See Also
Reference
GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Allow the Player to Resize a Game Window
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameWindow.ScreenDeviceNameChanged Event
Raised when the GameWindow moves to a different display.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public event EventHandler ScreenDeviceNameChanged
See Also
Reference
GameWindow Class
GameWindow Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceInformation Class
Holds the settings for creating a graphics device on Windows.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public class GraphicsDeviceInformation
See Also
Reference
GraphicsDeviceInformation Members
Microsoft.Xna.Framework Namespace
Programming Guide
3D Graphics Overview
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceInformation Members
The following tables list the members exposed by the GraphicsDeviceInformation type.
Public Constructors
Name Description
GraphicsDeviceInformation Initializes a new instance of this class.
Public Properties
Name Description
Adapter Specifies which graphics adapter to create the device on.
DeviceType Specifies the type of device to create (hardware, reference, null).
PresentationParameters Specifies the presentation parameters to use when creating a graphics device.
Public Methods
Name Description
Clone Creates a clone of this object.
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceInformation Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GraphicsDeviceInformation Constructor
Initializes a new instance of this class.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public GraphicsDeviceInformation ()
See Also
Reference
GraphicsDeviceInformation Class
GraphicsDeviceInformation Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceInformation Methods
Public Methods
Name Description
Clone Creates a clone of this object.
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceInformation Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GraphicsDeviceInformation.Clone Method
Creates a clone of this object.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public GraphicsDeviceInformation Clone ()
Return Value
The cloned object.
See Also
Reference
GraphicsDeviceInformation Class
GraphicsDeviceInformation Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceInformation.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
GraphicsDeviceInformation.Equals (Object) Returns a value that indicates whether the current instance is equal to a spe
cified object.
GraphicsDeviceInformation.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
GraphicsDeviceInformation Class
GraphicsDeviceInformation Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
obj
The Object to compare with the current GraphicsDeviceInformation.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
GraphicsDeviceInformation Class
GraphicsDeviceInformation Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceInformation.GetHashCode Method
Gets the hash code for this object.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for this object.
See Also
Reference
GraphicsDeviceInformation Class
GraphicsDeviceInformation Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceInformation Properties
Public Properties
Name Description
Adapter Specifies which graphics adapter to create the device on.
DeviceType Specifies the type of device to create (hardware, reference, null).
PresentationParameters Specifies the presentation parameters to use when creating a graphics device.
See Also
Reference
GraphicsDeviceInformation Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GraphicsDeviceInformation.Adapter Property
Specifies which graphics adapter to create the device on.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public GraphicsAdapter Adapter { get; set; }
Property Value
The graphics adapter to create the device on.
Exceptions
Exception type Condition
ArgumentNullException Adapter is null. Try using DefaultAdapter instead.
See Also
Reference
GraphicsDeviceInformation Class
GraphicsDeviceInformation Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceInformation.DeviceType Property
Specifies the type of device to create (hardware, reference, null).
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public DeviceType DeviceType { get; set; }
Property Value
The type of device to create.
See Also
Reference
GraphicsDeviceInformation Class
GraphicsDeviceInformation Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceInformation.PresentationParameters Property
Specifies the presentation parameters to use when creating a graphics device.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public PresentationParameters PresentationParameters { get; set; }
Property Value
The presentation parameters to use when creating a graphics device.
See Also
Reference
GraphicsDeviceInformation Class
GraphicsDeviceInformation Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager Class
Handles the configuration and management of the graphics device.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public class GraphicsDeviceManager : IGraphicsDeviceService, IDisposable, IGraphicsDeviceMa
nager
Remarks
Custom behavior of the GraphicsDeviceManager can be achieved by deriving a class from GraphicsDeviceManager. For
example, to allow only widescreen devices in full-screen mode the RankDevices method could be overridden to drop non-
widescreen devices (see How To: Restrict Graphics Devices to Widescreen Aspect Ratios in Full-Screen Mode).
Or, if you are creating a 2D game, you might want to create a graphics device without a depth buffer. By adding an event
handler for the PreparingDeviceSettings event to the GraphicsDeviceManager, you can control the PresentationParameters
properties associated with the graphics device. In the example below, the event handler is named
graphics_Settings_NoDepthBuffer.
C#
graphics = new GraphicsDeviceManager(this);
graphics.PreparingDeviceSettings +=
new EventHandler<PreparingDeviceSettingsEventArgs>(
graphics_Settings_NoDepthBuffer);
To ensure that no depth buffer is created, your event handler can set the EnableAutoDepthStencil property of the graphic
device's PresentationParameters to false, as shown below.
C#
void graphics_Settings_NoDepthBuffer(object sender, PreparingDeviceSettingsEventArgs e)
{
e.GraphicsDeviceInformation.PresentationParameters.EnableAutoDepthStencil = false;
}
See Also
Reference
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Programming Guide
Application Model Overview
3D Graphics Overview
How To: Restrict Graphics Devices to Widescreen Aspect Ratios in Full-Screen Mode
How To: Display a Game in Full-Screen Mode
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager Members
The following tables list the members exposed by the GraphicsDeviceManager type.
Public Constructors
Name Description
GraphicsDeviceManager Creates a new GraphicsDeviceManager and registers it to handle the configuration and manageme
nt of the graphics device for the specified Game.
Public Fields
Name Description
DefaultBackBufferHeight Specifies the default minimum back-buffer height.
DefaultBackBufferWidth Specifies the default minimum back-buffer width.
ValidAdapterFormats Specifies the set of adapter formats supported by the GraphicsDeviceManager.
ValidBackBufferFormats Specifies the set of back-buffer formats supported by the GraphicsDeviceManager.
ValidDeviceTypes Specifies the set of valid device types supported by the GraphicsDeviceManager.
Public Properties
Name Description
GraphicsDevice Gets the GraphicsDevice associated with the GraphicsDeviceManager.
IsFullScreen Gets or sets a value that indicates whether the device should start in full-screen mode.
MinimumPixelShaderProfile Gets or sets the minimum pixel shader version required by the GraphicsDeviceManager.
MinimumVertexShaderProfile Gets or sets the minimum vertex shader version required by the GraphicsDeviceManager.
PreferMultiSampling Gets or sets a value that indicates whether to enable a multisampled back buffer.
PreferredBackBufferFormat Gets or sets the format of the back buffer.
PreferredBackBufferHeight Gets or sets the preferred back-buffer height.
PreferredBackBufferWidth Gets or sets the preferred back-buffer width.
PreferredDepthStencilFormat Gets or sets the format of the depth stencil.
SynchronizeWithVerticalRetrace Gets or sets a value that indicates whether to sync to the vertical trace (vsync) when presen
ting the back buffer.
Public Methods
Name Description
ApplyChanges Applies any changes to device-related properties, changing the graphics device as necessary.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToggleFullScreen Toggles between full screen and windowed mode.
ToString (Inherited from Object.)
Protected Methods
Name Description
CanResetDevice Determines whether the given GraphicsDeviceInformation is compatible with the existing grap
hics device.
Dispose Releases the unmanaged resources used by the GraphicsDeviceManager and optionally release
s the managed resources.
Finalize (Inherited from Object.)
FindBestDevice Finds the best device configuration that is compatible with the current device preferences.
MemberwiseClone (Inherited from Object.)
OnDeviceCreated Called when a device is created. Raises the DeviceCreated event.
OnDeviceDisposing Called when a device is being disposed. Raises the DeviceDisposing event.
OnDeviceReset Called when the device has been reset. Raises the DeviceReset event.
OnDeviceResetting Called when the device is about to be reset. Raises the DeviceResetting event.
OnPreparingDeviceSettings Called when the GraphicsDeviceManager is changing the GraphicsDevice settings (during reset
or recreation of the GraphicsDevice). Raises the PreparingDeviceSettings event.
RankDevices Ranks the given list of devices that satisfy the given preferences.
Public Events
Name Description
DeviceCreated Raised when a new graphics device is created.
DeviceDisposing Raised when the GraphicsDeviceManager is being disposed.
DeviceReset Raised when the GraphicsDeviceManager is reset.
DeviceResetting Raised when the GraphicsDeviceManager is about to be reset.
Disposed Raised when the GraphicsDeviceManager is disposed.
PreparingDeviceSettings Raised when the GraphicsDeviceManager is changing the GraphicsDevice settings (during reset or
recreation of the GraphicsDevice).
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.IGraphicsDeviceManager.BeginDraw Prepares the GraphicsDevice to draw.
Microsoft.Xna.Framework.IGraphicsDeviceManager.CreateDevice Called to ensure that the device manager has created a
valid device.
System.IDisposable.Dispose Releases all resources used by the
GraphicsDeviceManager class.
Microsoft.Xna.Framework.IGraphicsDeviceManager.EndDraw Called by the game at the end of drawing and presents t
he final rendering.
See Also
Reference
GraphicsDeviceManager Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GraphicsDeviceManager Fields
Public Fields
Name Description
DefaultBackBufferHeight Specifies the default minimum back-buffer height.
DefaultBackBufferWidth Specifies the default minimum back-buffer width.
ValidAdapterFormats Specifies the set of adapter formats supported by the GraphicsDeviceManager.
ValidBackBufferFormats Specifies the set of back-buffer formats supported by the GraphicsDeviceManager.
ValidDeviceTypes Specifies the set of valid device types supported by the GraphicsDeviceManager.
See Also
Reference
GraphicsDeviceManager Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GraphicsDeviceManager.DefaultBackBufferHeight Field
Specifies the default minimum back-buffer height.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public static readonly int DefaultBackBufferHeight
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.DefaultBackBufferWidth Field
Specifies the default minimum back-buffer width.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public static readonly int DefaultBackBufferWidth
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.ValidAdapterFormats Field
Specifies the set of adapter formats supported by the GraphicsDeviceManager.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public static readonly SurfaceFormat[] ValidAdapterFormats
RemarksThe order of the list determines the preference of any given format.
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.ValidBackBufferFormats Field
Specifies the set of back-buffer formats supported by the GraphicsDeviceManager.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public static readonly SurfaceFormat[] ValidBackBufferFormats
RemarksThe order of the list determines the preference of any given format.
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.ValidDeviceTypes Field
Specifies the set of valid device types supported by the GraphicsDeviceManager.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public static readonly DeviceType[] ValidDeviceTypes
RemarksThe order of the list determines the preference of any given device type.
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager Constructor
Creates a new GraphicsDeviceManager and registers it to handle the configuration and management of the graphics device for
the specified Game.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public GraphicsDeviceManager (
Game game
)
Parameters
game
Game the GraphicsDeviceManager should be associated with.
Exceptions
Exception type Condition
ArgumentNullException The game parameter is null.
ArgumentException A graphics device manager has already been added to Services and registered as the graphics device
manager for the application. The graphics device manager cannot be changed once it is set.
Remarks
This constructor adds this GraphicsDeviceManager to the collection of game services that have been implicitly registered by
adding them to the Game.Services property.
Caution
Although this constructor requires an instance of Game, if the application does not otherwise require an instance of Game it i
s often better to implement a the IGraphicsDeviceService and IGraphicsDeviceManager interfaces to provide the same servic
es that would be provided by the GraphicsDeviceManager.
Custom behavior of the GraphicsDeviceManager can be achieved by deriving a class from GraphicsDeviceManager. For
example, to allow only widescreen devices in full-screen mode the RankDevices method could be overridden to drop non-
widescreen devices (see How To: Restrict Graphics Devices to Widescreen Aspect Ratios in Full-Screen Mode).
Or, if you are creating a 2D game, you might want to create a graphics device without a depth buffer. By adding an event
handler for the PreparingDeviceSettings event to the GraphicsDeviceManager, you can control the PresentationParameters
properties associated with the graphics device. In the example below, the event handler is named
graphics_Settings_NoDepthBuffer.
C#
graphics = new GraphicsDeviceManager(this);
graphics.PreparingDeviceSettings +=
new EventHandler<PreparingDeviceSettingsEventArgs>(
graphics_Settings_NoDepthBuffer);
To ensure that no depth buffer is created, your event handler can set the EnableAutoDepthStencil property of the graphic
device's PresentationParameters to false, as shown below.
C#
void graphics_Settings_NoDepthBuffer(object sender, PreparingDeviceSettingsEventArgs e)
{
e.GraphicsDeviceInformation.PresentationParameters.EnableAutoDepthStencil = false;
}
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager Methods
Public Methods
Name Description
ApplyChanges Applies any changes to device-related properties, changing the graphics device as necessary.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToggleFullScreen Toggles between full screen and windowed mode.
ToString (Inherited from Object.)
Protected Methods
Name Description
CanResetDevice Determines whether the given GraphicsDeviceInformation is compatible with the existing grap
hics device.
Dispose Releases the unmanaged resources used by the GraphicsDeviceManager and optionally release
s the managed resources.
Finalize (Inherited from Object.)
FindBestDevice Finds the best device configuration that is compatible with the current device preferences.
MemberwiseClone (Inherited from Object.)
OnDeviceCreated Called when a device is created. Raises the DeviceCreated event.
OnDeviceDisposing Called when a device is being disposed. Raises the DeviceDisposing event.
OnDeviceReset Called when the device has been reset. Raises the DeviceReset event.
OnDeviceResetting Called when the device is about to be reset. Raises the DeviceResetting event.
OnPreparingDeviceSettings Called when the GraphicsDeviceManager is changing the GraphicsDevice settings (during reset
or recreation of the GraphicsDevice). Raises the PreparingDeviceSettings event.
RankDevices Ranks the given list of devices that satisfy the given preferences.
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.IGraphicsDeviceManager.BeginDraw Prepares the GraphicsDevice to draw.
Microsoft.Xna.Framework.IGraphicsDeviceManager.CreateDevice Called to ensure that the device manager has created a
valid device.
System.IDisposable.Dispose Releases all resources used by the
GraphicsDeviceManager class.
Microsoft.Xna.Framework.IGraphicsDeviceManager.EndDraw Called by the game at the end of drawing and presents t
he final rendering.
See Also
Reference
GraphicsDeviceManager Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GraphicsDeviceManager.ApplyChanges Method
Applies any changes to device-related properties, changing the graphics device as necessary.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public void ApplyChanges ()
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 m
inimum 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 D
irect3D-enabled graphics device is installed, and check the display properties to veri
fy that Hardware acceleration is set to Full.
Remote Desktop is in use. Direct3D is not available when you are using Remote Des
ktop.
InvalidOperationException
This graphics device manager has not been added to Services and registered as the graph
ics device manager for the application. Device settings cannot be changed or committed u
nless 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:
BackBufferCount is not between 0 and 3.
BackBufferFormat is not valid. Try SurfaceFormat.Bgr565, SurfaceFormat.Bgr555,
SurfaceFormat.Bgra5551, SurfaceFormat.Bgr32, SurfaceFormat.Color,
SurfaceFormat.Bgra1010102.
The selected BackBufferFormat and IsFullScreen values are not valid for the selected
adapter format and device type.
The BackBufferWidth and BackBufferHeight values do not correspond to a valid disp
lay mode.
FullScreenRefreshRateInHz does not match a valid display mode for the specified
BackBufferWidth and BackBufferHeight.
Invalid PresentationParameters.PresentationInterval or SwapEffect options have been req
uested:
On Xbox 360, PresentationParameters.PresentationInterval has been assigned the in
valid value PresentInterval.Four.
SwapEffect.Copy has been assigned to the PresentationParameters.SwapEffect prop
erty, but BackBufferCount is not 1. When using SwapEffect.Copy, BackBufferCount
must be 1.
SwapEffect is not one of the following: SwapEffect.Copy, SwapEffect.Discard, or
SwapEffect.Flip.
Invalid multisampling options have been requested:
Multisampling has been enabled, but SwapEffect.Discard has not been specified for
the SwapEffect property. SwapEffect.Discard is required when enabling multisampli
ng.
The selected MultiSampleType is not compatible with the current BackBufferFormat
and the IsFullScreen value for the selected adapter.
The selected MultiSampleQuality value is invalid for the selected MultiSampleType.
Invalid depth stencil options have been requested:
AutoDepthStencilFormat is not supported as a depth/stencil format when using the
selected adapter BackBufferFormat.
PresentOptions has been set to PresentOptions.DiscardDepthStencil, but
EnableAutoDepthStencil is not true.
Multiple PresentationParameters have been specified and EnableAutoDepthStencil i
s true, but EnableAutoDepthStencil, BackBufferFormat, BackBufferWidth, and
BackBufferHeight are not the same for all adapters.
IsFullScreen is true, but:
BackBufferWidth and BackBufferHeight are not nonzero.
PresentationInterval is not one of the following: PresentInterval.Default,
PresentInterval.Immediate, PresentInterval.One, PresentInterval.Two
PresentInterval.Three, or PresentInterval.Four.
FullScreenRefreshRateInHz is not nonzero.
The selected adapter does not support the selected full screen PresentationInterval.
IsFullScreen is false, but:
PresentationInterval is not one of the following: PresentInterval.Default,
PresentInterval.Immediate, or PresentInterval.One.
FullScreenRefreshRateInHz is not zero.
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.CanResetDevice Method
Determines whether the given GraphicsDeviceInformation is compatible with the existing graphics device.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected virtual bool CanResetDevice (
GraphicsDeviceInformation newDeviceInfo
)
Parameters
newDeviceInfo
Information describing the desired device configuration.
Return Value
true if a device reset can be used to get a device compatible with the GraphicsDeviceInformation; false otherwise.
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.Dispose Method
Releases the unmanaged resources used by the GraphicsDeviceManager and optionally releases the managed resources.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected virtual void Dispose (
bool disposing
)
Parameters
disposing
true to release both automatic and manual resources; false to release only manual resources.
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.FindBestDevice Method
Finds the best device configuration that is compatible with the current device preferences.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected virtual GraphicsDeviceInformation FindBestDevice (
bool anySuitableDevice
)
Parameters
anySuitableDevice
true if the FindBestDevice can select devices from any available adapter; false if only the current adapter should be
considered.
Return Value
The best device configuration found.
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.IGraphicsDeviceManager.BeginDraw
Method
Prepares the GraphicsDevice to draw.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
private bool Microsoft.Xna.Framework.IGraphicsDeviceManager.BeginDraw ()
Return Value
true if the GraphicsDevice is ready to draw; false otherwise.
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
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
C#
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 mini
mum 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 Dire
ct3D-enabled graphics device is installed, and check the display properties to verify tha
t Hardware acceleration is set to Full.
Remote Desktop is in use. Direct3D is not available when you are using Remote Deskt
op.
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:
BackBufferCount is not between 0 and 3.
BackBufferFormat is not valid. Try SurfaceFormat.Bgr565, SurfaceFormat.Bgr555,
SurfaceFormat.Bgra5551, SurfaceFormat.Bgr32, SurfaceFormat.Color,
SurfaceFormat.Bgra1010102.
The selected BackBufferFormat and IsFullScreen values are not valid for the selected ad
apter format and device type.
The BackBufferWidth and BackBufferHeight values do not correspond to a valid display
mode.
FullScreenRefreshRateInHz does not match a valid display mode for the specified
BackBufferWidth and BackBufferHeight.
Invalid PresentationParameters.PresentationInterval or SwapEffect options have been reques
ted:
On Xbox 360, PresentationParameters.PresentationInterval has been assigned the inval
id value PresentInterval.Four.
SwapEffect.Copy has been assigned to the PresentationParameters.SwapEffect propert
y, but BackBufferCount is not 1. When using SwapEffect.Copy, BackBufferCount must b
e 1.
SwapEffect is not one of the following: SwapEffect.Copy, SwapEffect.Discard, or
SwapEffect.Flip.
Invalid multisampling options have been requested:
Multisampling has been enabled, but SwapEffect.Discard has not been specified for the
SwapEffect property. SwapEffect.Discard is required when enabling multisampling.
The selected MultiSampleType is not compatible with the current BackBufferFormat an
d the IsFullScreen value for the selected adapter.
The selected MultiSampleQuality value is invalid for the selected MultiSampleType.
Invalid depth stencil options have been requested:
AutoDepthStencilFormat is not supported as a depth/stencil format when using the sel
ected adapter BackBufferFormat.
PresentOptions has been set to PresentOptions.DiscardDepthStencil, but
EnableAutoDepthStencil is not true.
Multiple PresentationParameters have been specified and EnableAutoDepthStencil is tr
ue, but EnableAutoDepthStencil, BackBufferFormat, BackBufferWidth, and
BackBufferHeight are not the same for all adapters.
IsFullScreen is true, but:
BackBufferWidth and BackBufferHeight are not nonzero.
PresentationInterval is not one of the following: PresentInterval.Default,
PresentInterval.Immediate, PresentInterval.One, PresentInterval.Two
PresentInterval.Three, or PresentInterval.Four.
FullScreenRefreshRateInHz is not nonzero.
The selected adapter does not support the selected full screen PresentationInterval.
IsFullScreen is false, but:
PresentationInterval is not one of the following: PresentInterval.Default,
PresentInterval.Immediate, or PresentInterval.One.
FullScreenRefreshRateInHz is not zero.
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.IGraphicsDeviceManager.EndDraw
Method
Called by the game at the end of drawing and presents the final rendering.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
private void Microsoft.Xna.Framework.IGraphicsDeviceManager.EndDraw ()
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.OnDeviceCreated Method
Called when a device is created. Raises the DeviceCreated event.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected virtual void OnDeviceCreated (
Object sender,
EventArgs args
)
Parameters
sender
The GraphicsDeviceManager.
args
Arguments for the DeviceCreated event.
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.OnDeviceDisposing Method
Called when a device is being disposed. Raises the DeviceDisposing event.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected virtual void OnDeviceDisposing (
Object sender,
EventArgs args
)
Parameters
sender
The GraphicsDeviceManager.
args
Arguments for the DeviceDisposing event.
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.OnDeviceReset Method
Called when the device has been reset. Raises the DeviceReset event.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected virtual void OnDeviceReset (
Object sender,
EventArgs args
)
Parameters
sender
The GraphicsDeviceManager.
args
Arguments for the DeviceReset event.
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.OnDeviceResetting Method
Called when the device is about to be reset. Raises the DeviceResetting event.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected virtual void OnDeviceResetting (
Object sender,
EventArgs args
)
Parameters
sender
The GraphicsDeviceManager.
args
Arguments for the DeviceResetting event.
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.OnPreparingDeviceSettings Method
Called when the GraphicsDeviceManager is changing the GraphicsDevice settings (during reset or recreation of the
GraphicsDevice). Raises the PreparingDeviceSettings event.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected virtual void OnPreparingDeviceSettings (
Object sender,
PreparingDeviceSettingsEventArgs args
)
Parameters
sender
The GraphicsDeviceManager.
args
The graphics device information to modify.
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.RankDevices Method
Ranks the given list of devices that satisfy the given preferences.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
protected virtual void RankDevices (
List<GraphicsDeviceInformation> foundDevices
)
Parameters
foundDevices
The list of devices to rank.
Remarks RankDevices orders the provided list so that devices earlier in the list are preferred over devices later in the list. This
method can remove devices from the list if they do not satisfy some custom criteria.
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Restrict Graphics Devices to Widescreen Aspect Ratios in Full-Screen Mode
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
System.IDisposable.Dispose Method
Releases all resources used by the GraphicsDeviceManager class.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
private void System.IDisposable.Dispose ()
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.ToggleFullScreen Method
Toggles between full screen and windowed mode.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public void ToggleFullScreen ()
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 m
inimum 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 D
irect3D-enabled graphics device is installed, and check the display properties to veri
fy that Hardware acceleration is set to Full.
Remote Desktop is in use. Direct3D is not available when you are using Remote Des
ktop.
InvalidOperationException
This graphics device manager has not been added to Services and registered as the graph
ics device manager for the application. Device settings cannot be changed or committed u
nless the device has been registered.
ArgumentException
Full-screen mode is not compatible with the current back buffer settings:
The selected BackBufferFormat and IsFullScreen values are not valid for the selected
adapter format and device type.
FullScreenRefreshRateInHz does not match a valid display mode for the specified
BackBufferWidth and BackBufferHeight.
The selected MultiSampleType is not compatible with the current BackBufferFormat
and the IsFullScreen value for the selected adapter.
IsFullScreen is true, but:
BackBufferWidth and BackBufferHeight are not nonzero.
PresentationInterval is not one of the following: PresentInterval.Default,
PresentInterval.Immediate, PresentInterval.One, PresentInterval.Two
PresentInterval.Three, or PresentInterval.Four.
FullScreenRefreshRateInHz is not nonzero.
The selected adapter does not support the selected full screen PresentationInterval.
IsFullScreen is false, but:
PresentationInterval is not one of the following: PresentInterval.Default,
PresentInterval.Immediate, or PresentInterval.One.
FullScreenRefreshRateInHz is not zero.
RemarksThis method has no effect on the Xbox 360.
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Display a Game in Full-Screen Mode
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager Properties
Public Properties
Name Description
GraphicsDevice Gets the GraphicsDevice associated with the GraphicsDeviceManager.
IsFullScreen Gets or sets a value that indicates whether the device should start in full-screen mode.
MinimumPixelShaderProfile Gets or sets the minimum pixel shader version required by the GraphicsDeviceManager.
MinimumVertexShaderProfile Gets or sets the minimum vertex shader version required by the GraphicsDeviceManager.
PreferMultiSampling Gets or sets a value that indicates whether to enable a multisampled back buffer.
PreferredBackBufferFormat Gets or sets the format of the back buffer.
PreferredBackBufferHeight Gets or sets the preferred back-buffer height.
PreferredBackBufferWidth Gets or sets the preferred back-buffer width.
PreferredDepthStencilFormat Gets or sets the format of the depth stencil.
SynchronizeWithVerticalRetrace Gets or sets a value that indicates whether to sync to the vertical trace (vsync) when presen
ting the back buffer.
See Also
Reference
GraphicsDeviceManager Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GraphicsDeviceManager.GraphicsDevice Property
Gets the GraphicsDevice associated with the GraphicsDeviceManager.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public GraphicsDevice GraphicsDevice { get; }
Property Value
The GraphicsDevice associated with the GraphicsDeviceManager.
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.IsFullScreen Property
Gets or sets a value that indicates whether the device should start in full-screen mode.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public bool IsFullScreen { get; set; }
Property Value
Value that indicates whether the device should start in full-screen mode.
Remarks If no devices are present that support full screen, or the underlying host supports only full screen, this value may be
ignored. This value has no effect on Xbox 360.
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Restrict Graphics Devices to Widescreen Aspect Ratios in Full-Screen Mode
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.MinimumPixelShaderProfile Property
Gets or sets the minimum pixel shader version required by the GraphicsDeviceManager.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public ShaderProfile MinimumPixelShaderProfile { get; set; }
Property Value
The minimum pixel shader version required by the GraphicsDeviceManager.
Exceptions
Exception type Condition
ArgumentOutOfRangeException
MinimumPixelShaderProfile is not a valid pixel shader profile. Use one of the following:
ShaderProfile.PS_1_1
ShaderProfile.PS_1_2
ShaderProfile.PS_1_3
ShaderProfile.PS_1_4
ShaderProfile.PS_2_0
ShaderProfile.PS_2_A
ShaderProfile.PS_2_B
ShaderProfile.PS_2_SW
ShaderProfile.PS_3_0
ShaderProfile.XPS_3_0
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.MinimumVertexShaderProfile
Property
Gets or sets the minimum vertex shader version required by the GraphicsDeviceManager.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public ShaderProfile MinimumVertexShaderProfile { get; set; }
Property Value
The minimum vertex shader version required by the GraphicsDeviceManager.
Exceptions
Exception type Condition
ArgumentOutOfRangeException
MinimumVertexShaderProfile is not a valid vertex shader profile. Use one of the following:
ShaderProfile.VS_1_1
ShaderProfile.VS_2_0
ShaderProfile.VS_2_A
ShaderProfile.VS_2_SW
ShaderProfile.VS_3_0
ShaderProfile.XVS_3_0
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.PreferMultiSampling Property
Gets or sets a value that indicates whether to enable a multisampled back buffer. For more information about multisampling,
see MultiSampleType Enumeration.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public bool PreferMultiSampling { get; set; }
Property Value
Value indicating whether multisampling is enabled on the back buffer.
Remarks PreferMultiSampling is ignored if no hardware is available that supports multisampling.
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.PreferredBackBufferFormat Property
Gets or sets the format of the back buffer.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public SurfaceFormat PreferredBackBufferFormat { get; set; }
Property Value
The format of the back buffer.
Exceptions
Exception type Condition
ArgumentOutOfRangeException
The BackBufferFormat requested is not valid. Use one of the following:
SurfaceFormat.Bgr565
SurfaceFormat.Bgr555
SurfaceFormat.Bgra5551
SurfaceFormat.Bgr32
SurfaceFormat.Color
SurfaceFormat.Bgra1010102
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.PreferredBackBufferHeight Property
Gets or sets the preferred back-buffer height.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public int PreferredBackBufferHeight { get; set; }
Property Value
The preferred back-buffer height.
Exceptions
Exception type Condition
ArgumentOutOfRangeException BackBufferHeight is not greater than zero.
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Display a Game in Full-Screen Mode
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.PreferredBackBufferWidth Property
Gets or sets the preferred back-buffer width.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public int PreferredBackBufferWidth { get; set; }
Property Value
The preferred back-buffer width.
Exceptions
Exception type Condition
ArgumentOutOfRangeException BackBufferWidth is not greater than zero.
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Display a Game in Full-Screen Mode
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.PreferredDepthStencilFormat Property
Gets or sets the format of the depth stencil.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public DepthFormat PreferredDepthStencilFormat { get; set; }
Property Value
The format of the depth stencil.
Exceptions
Exception type Condition
ArgumentOutOfRangeException
The DepthStencilFormat requested is an invalid format. Use one of the following:
DepthFormat.Depth32
DepthFormat.Depth15Stencil1
DepthFormat.Depth24Stencil8
DepthFormat.Depth24
DepthFormat.Depth24Stencil4
DepthFormat.Depth16
DepthFormat.Depth24Stencil8Single
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.SynchronizeWithVerticalRetrace
Property
Gets or sets a value that indicates whether to sync to the vertical trace (vsync) when presenting the back buffer.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public bool SynchronizeWithVerticalRetrace { get; set; }
Property Value
Value that indicates whether to sync to the vertical trace (vsync) when presenting the back buffer.
Remarks This value is honored (when possible) in full screen and windowed modes.
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager Events
Public Events
Name Description
DeviceCreated Raised when a new graphics device is created.
DeviceDisposing Raised when the GraphicsDeviceManager is being disposed.
DeviceReset Raised when the GraphicsDeviceManager is reset.
DeviceResetting Raised when the GraphicsDeviceManager is about to be reset.
Disposed Raised when the GraphicsDeviceManager is disposed.
PreparingDeviceSettings Raised when the GraphicsDeviceManager is changing the GraphicsDevice settings (during reset or
recreation of the GraphicsDevice).
See Also
Reference
GraphicsDeviceManager Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
GraphicsDeviceManager.DeviceCreated Event
Raised when a new graphics device is created.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public event EventHandler DeviceCreated
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.DeviceDisposing Event
Raised when the GraphicsDeviceManager is being disposed.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public event EventHandler DeviceDisposing
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.DeviceReset Event
Raised when the GraphicsDeviceManager is reset.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public event EventHandler DeviceReset
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.DeviceResetting Event
Raised when the GraphicsDeviceManager is about to be reset.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public event EventHandler DeviceResetting
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.Disposed Event
Raised when the GraphicsDeviceManager is disposed.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public event EventHandler Disposed
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceManager.PreparingDeviceSettings Event
Raised when the GraphicsDeviceManager is changing the GraphicsDevice settings (during reset or recreation of the
GraphicsDevice).
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public event EventHandler<PreparingDeviceSettingsEventArgs> PreparingDeviceSettings
Example
Handle PreparingDeviceSettings events to set graphics options for your device - such as antialiasing.
C#
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
graphics.PreferMultiSampling = true;
graphics.PreparingDeviceSettings +=
new EventHandler<PreparingDeviceSettingsEventArgs>(graphics_PreparingDeviceSettings);
}
C#
void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventAr
gs e)
{
// Xbox 360 and most PCs support FourSamples/1 (4x) and TwoSamples/1 (2x)
// antialiasing.
#if XBOX
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleQuality = 1;
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleType =
MultiSampleType.FourSamples;
return;
#endif
int quality = 0;
GraphicsAdapter adapter = e.GraphicsDeviceInformation.Adapter;
SurfaceFormat format = adapter.CurrentDisplayMode.Format;
// Check for 4xAA
if (adapter.CheckDeviceMultiSampleType(DeviceType.Hardware, format,
false, MultiSampleType.FourSamples, out quality))
{
// even if a greater quality is returned, we only want quality 1
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleQuality = 1;
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleType =
MultiSampleType.FourSamples;
}
// Check for 2xAA
else if (adapter.CheckDeviceMultiSampleType(DeviceType.Hardware, format,
false, MultiSampleType.TwoSamples, out quality))
{
// even if a greater quality is returned, we only want quality 1
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleQuality = 1;
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleType =
MultiSampleType.TwoSamples;
}
return;
}
See Also
Reference
GraphicsDeviceManager Class
GraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IDrawable Interface
Defines the interface for a drawable game component.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public interface IDrawable
See Also
Reference
IDrawable Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IDrawable Members
The following tables list the members exposed by the IDrawable type.
Public Properties
Name Description
DrawOrder The order in which to draw this object relative to other objects. Objects with a lower value are drawn first.
Visible Indicates whether IDrawable.Draw should be called in Game.Draw for this game component.
Public Methods
Name Description
Draw Draws the IDrawable.
Public Events
Name Description
DrawOrderChanged Raised when the DrawOrder property changes.
VisibleChanged Raised when the Visible property changes.
See Also
Reference
IDrawable Interface
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
IDrawable Methods
Public Methods
Name Description
Draw Draws the IDrawable.
See Also
Reference
IDrawable Interface
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
IDrawable.Draw Method
Draws the IDrawable.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public void Draw (
GameTime gameTime
)
Parameters
gameTime
Snapshot of the game's timing state.
Remarks
Caution
In the Draw method of an Xbox 360 game, vertex buffers, index buffers, and textures should not be written using SetData w
hen they are intended to be used for rendering. This condition may lead to graphics corruption or crashes. To avoid this pote
ntial issue, use DrawUserPrimitives or DrawUserIndexedPrimitives as the preferred alternative to VertexBuffer.SetData for dy
namic vertex generation.
This is because, in cases where the size of the back buffer and depth stencil buffer exceed the size of the Xbox 360 10 MB of e
mbedded memory (EDRAM), predicated tiling is utilized on this platform to compensate for the additional memory requirem
ents. Predicated tiling is a process by which scene rendering is performed multiple times on subsections of the final render ta
rget dimensions.
When predicated tiling has been triggered, the drawing commands contained in the Draw function are not submitted until
Present is called. (Note that Draw implicitly calls Present at the end of this method.) In this case, these resources are not avail
able for modification until the GPU is finished with presenting the entire frame.
See Also
Concepts
Predicated Tiling
Reference
IDrawable Interface
IDrawable Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IDrawable Properties
Public Properties
Name Description
DrawOrder The order in which to draw this object relative to other objects. Objects with a lower value are drawn first.
Visible Indicates whether IDrawable.Draw should be called in Game.Draw for this game component.
See Also
Reference
IDrawable Interface
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
IDrawable.DrawOrder Property
The order in which to draw this object relative to other objects. Objects with a lower value are drawn first.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public abstract int DrawOrder { get; }
Property Value
Order in which to draw this object relative to other objects.
See Also
Reference
IDrawable Interface
IDrawable Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IDrawable.Visible Property
Indicates whether IDrawable.Draw should be called in Game.Draw for this game component.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public abstract bool Visible { get; }
Property Value
true if Draw should be called; false otherwise.
See Also
Reference
IDrawable Interface
IDrawable Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IDrawable Events
Public Events
Name Description
DrawOrderChanged Raised when the DrawOrder property changes.
VisibleChanged Raised when the Visible property changes.
See Also
Reference
IDrawable Interface
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
IDrawable.DrawOrderChanged Event
Raised when the DrawOrder property changes.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public abstract event EventHandler DrawOrderChanged
See Also
Reference
IDrawable Interface
IDrawable Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IDrawable.VisibleChanged Event
Raised when the Visible property changes.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public abstract event EventHandler VisibleChanged
See Also
Reference
IDrawable Interface
IDrawable Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IGameComponent Interface
Defines an interface for game components.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public interface IGameComponent
See Also
Reference
IGameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IGameComponent Members
The following tables list the members exposed by the IGameComponent type.
Public Methods
Name Description
Initialize Called when the component should be initialized. This method can be used for tasks like querying for services the c
omponent needs and setting up non-graphics resources.
See Also
Reference
IGameComponent Interface
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
IGameComponent Methods
Public Methods
Name Description
Initialize Called when the component should be initialized. This method can be used for tasks like querying for services the c
omponent needs and setting up non-graphics resources.
See Also
Reference
IGameComponent Interface
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
IGameComponent.Initialize Method
Called when the component should be initialized. This method can be used for tasks like querying for services the component
needs and setting up non-graphics resources.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public void Initialize ()
See Also
Reference
IGameComponent Interface
IGameComponent Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IGraphicsDeviceManager Interface
Defines the interface for an object that manages a GraphicsDevice.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public interface IGraphicsDeviceManager
See Also
Reference
IGraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IGraphicsDeviceManager Members
The following tables list the members exposed by the IGraphicsDeviceManager type.
Public Methods
Name Description
BeginDraw Starts the drawing of a frame.
CreateDevice Called to ensure that the device manager has created a valid device.
EndDraw Called by the game at the end of drawing; presents the final rendering.
See Also
Reference
IGraphicsDeviceManager Interface
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
IGraphicsDeviceManager Methods
Public Methods
Name Description
BeginDraw Starts the drawing of a frame.
CreateDevice Called to ensure that the device manager has created a valid device.
EndDraw Called by the game at the end of drawing; presents the final rendering.
See Also
Reference
IGraphicsDeviceManager Interface
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
IGraphicsDeviceManager.BeginDraw Method
Starts the drawing of a frame.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public bool BeginDraw ()
Return Value
true if the frame should be drawn; false otherwise.
See Also
Reference
IGraphicsDeviceManager Interface
IGraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
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
C#
public void CreateDevice ()
See Also
Reference
IGraphicsDeviceManager Interface
IGraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IGraphicsDeviceManager.EndDraw Method
Called by the game at the end of drawing; presents the final rendering.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public void EndDraw ()
See Also
Reference
IGraphicsDeviceManager Interface
IGraphicsDeviceManager Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IUpdateable Interface
Defines an interface for a game component that should be updated in Game.Update.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public interface IUpdateable
See Also
Reference
IUpdateable Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IUpdateable Members
The following tables list the members exposed by the IUpdateable type.
Public Properties
Name Description
Enabled Indicates whether the game component's Update method should be called in Game.Update.
UpdateOrder Indicates when the game component should be updated relative to other game components. Lower values are
updated first.
Public Methods
Name Description
Update Called when the game component should be updated.
Public Events
Name Description
EnabledChanged Raised when the Enabled property changes.
UpdateOrderChanged Raised when the UpdateOrder property changes.
See Also
Reference
IUpdateable Interface
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
IUpdateable Methods
Public Methods
Name Description
Update Called when the game component should be updated.
See Also
Reference
IUpdateable Interface
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
IUpdateable.Update Method
Called when the game component should be updated.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public void Update (
GameTime gameTime
)
Parameters
gameTime
Snapshot of the game's timing state.
See Also
Reference
IUpdateable Interface
IUpdateable Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IUpdateable Properties
Public Properties
Name Description
Enabled Indicates whether the game component's Update method should be called in Game.Update.
UpdateOrder Indicates when the game component should be updated relative to other game components. Lower values are
updated first.
See Also
Reference
IUpdateable Interface
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
IUpdateable.Enabled Property
Indicates whether the game component's Update method should be called in Game.Update.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public abstract bool Enabled { get; }
Property Value
true if Update should be called; false otherwise.
See Also
Reference
IUpdateable Interface
IUpdateable Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IUpdateable.UpdateOrder Property
Indicates when the game component should be updated relative to other game components. Lower values are updated first.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public abstract int UpdateOrder { get; }
Property Value
When the game component should be updated.
See Also
Reference
IUpdateable Interface
IUpdateable Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IUpdateable Events
Public Events
Name Description
EnabledChanged Raised when the Enabled property changes.
UpdateOrderChanged Raised when the UpdateOrder property changes.
See Also
Reference
IUpdateable Interface
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
IUpdateable.EnabledChanged Event
Raised when the Enabled property changes.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public abstract event EventHandler EnabledChanged
See Also
Reference
IUpdateable Interface
IUpdateable Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IUpdateable.UpdateOrderChanged Event
Raised when the UpdateOrder property changes.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public abstract event EventHandler UpdateOrderChanged
See Also
Reference
IUpdateable Interface
IUpdateable Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathHelper Class
Contains commonly used precalculated values.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static class MathHelper
See Also
Reference
MathHelper Members
Microsoft.Xna.Framework Namespace
Programming Guide
Math Overview
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathHelper Members
The following tables list the members exposed by the MathHelper type.
Public Fields
Name Description
E Represents the mathematical constant e.
Log10E Represents the log base ten of e.
Log2E Represents the log base two of e.
Pi Represents the value of pi.
PiOver2 Represents the value of pi divided by two.
PiOver4 Represents the value of pi divided by four.
TwoPi Represents the value of pi times two.
Public Methods
Name Description
Barycentric Returns the Cartesian coordinate for one axis of a point that is defined by a given triangle and two norma
lized barycentric (areal) coordinates.
CatmullRom Performs a Catmull-Rom interpolation using the specified positions.
Clamp Restricts a value to be within a specified range.
Distance Calculates the absolute value of the difference of two values.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
Hermite Performs a Hermite spline interpolation.
Lerp Linearly interpolates between two values.
Max Returns the greater of two values.
Min Returns the lesser of two values.
ReferenceEquals (Inherited from Object.)
SmoothStep Interpolates between two values using a cubic equation.
ToDegrees Converts radians to degrees.
ToRadians Converts degrees to radians.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
MathHelper Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
MathHelper Fields
Public Fields
Name Description
E Represents the mathematical constant e.
Log10E Represents the log base ten of e.
Log2E Represents the log base two of e.
Pi Represents the value of pi.
PiOver2 Represents the value of pi divided by two.
PiOver4 Represents the value of pi divided by four.
TwoPi Represents the value of pi times two.
See Also
Reference
MathHelper Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
MathHelper.E Field
Represents the mathematical constant e.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public const float E
See Also
Reference
MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathHelper.Log10E Field
Represents the log base ten of e.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public const float Log10E
See Also
Reference
MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathHelper.Log2E Field
Represents the log base two of e.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public const float Log2E
See Also
Reference
MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathHelper.Pi Field
Represents the value of pi.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public const float Pi
See Also
Reference
MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathHelper.PiOver2 Field
Represents the value of pi divided by two.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public const float PiOver2
See Also
Reference
MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathHelper.PiOver4 Field
Represents the value of pi divided by four.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public const float PiOver4
See Also
Reference
MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathHelper.TwoPi Field
Represents the value of pi times two.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public const float TwoPi
See Also
Reference
MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathHelper Methods
Public Methods
Name Description
Barycentric Returns the Cartesian coordinate for one axis of a point that is defined by a given triangle and two norma
lized barycentric (areal) coordinates.
CatmullRom Performs a Catmull-Rom interpolation using the specified positions.
Clamp Restricts a value to be within a specified range.
Distance Calculates the absolute value of the difference of two values.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
Hermite Performs a Hermite spline interpolation.
Lerp Linearly interpolates between two values.
Max Returns the greater of two values.
Min Returns the lesser of two values.
ReferenceEquals (Inherited from Object.)
SmoothStep Interpolates between two values using a cubic equation.
ToDegrees Converts radians to degrees.
ToRadians Converts degrees to radians.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
MathHelper Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
MathHelper.Barycentric Method
Returns the Cartesian coordinate for one axis of a point that is defined by a given triangle and two normalized barycentric
(areal) coordinates.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static float Barycentric (
float value1,
float value2,
float value3,
float amount1,
float amount2
)
Parameters
value1
The coordinate on one axis of vertex 1 of the defining triangle.
value2
The coordinate on the same axis of vertex 2 of the defining triangle.
value3
The coordinate on the same axis of vertex 3 of the defining triangle.
amount1
The normalized barycentric (areal) coordinate b2, equal to the weighting factor for vertex 2, the coordinate of which is
specified in value2.
amount2
The normalized barycentric (areal) coordinate b3, equal to the weighting factor for vertex 3, the coordinate of which is
specified in value3.
Return Value
Cartesian coordinate of the specified point with respect to the axis being used.
Remarks
About Barycentric Coordinates
Given a triangle with vertices V1, V2, and V3, any point P on the plane of that triangle can be specified by three weighting
factors b1, b2, and b3, each of which indicates how much relative influence the corresponding triangle vertex contributes to
the location of the point, as specified in the following formulas.
Px = (b1 * V1x) + (b2 * V2x) + (b3 * V3x);
Py = (b1 * V1y) + (b2 * V2y) + (b3 * V3y);
Pz = (b1 * V1z) + (b2 * V2z) + (b3 * V3z);
Such triple-weighting factors b1, b2, and b3 are called barycentric coordinates.
Barycentric coordinates express relative weights, meaning that (k * b1), (k * b2), and (k * b3) are also coordinates of the same
point as b1, b2, and b3 for any positive value of k.
If a set of barycentric coordinates is normalized so that: b1 + b2 + b3 = 1, the resulting coordinates are unique for the point in
question, and are known as areal coordinates. When normalized in this way, only two coordinates are needed, say b2 and b3,
since b1 is known to equal (1 − b2 − b3).
What MathHelper Barycentric Does
On an axis a (a being the x-, y-, or z-axis), the MathHelper.Barycentric method takes three triangle vertex coordinates on that
axis (V1a, V2a, and V3a), and two areal coordinates b2 and b3 of some point P (b2 is the amount1 argument, and b3 is the
amount2 argument). The b2 coordinate relates to vertex V2, and the b3 coordinate relates to V3.
Barycentric then calculates the Cartesian coordinate of Pa as follows:
Pa = ( (1 - b2 - b3) * V1a ) + (b2 * V2a) + (b3 * V3a);
Thus, to calculate the x-axis Cartesian coordinate of P, you would pass the x-coordinates of the triangle vertices to Barycentric
together with the approproiate areal coordinates of P.
See Also
Reference
MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathHelper.CatmullRom Method
Performs a Catmull-Rom interpolation using the specified positions.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static float CatmullRom (
float value1,
float value2,
float value3,
float value4,
float amount
)
Parameters
value1
The first position in the interpolation.
value2
The second position in the interpolation.
value3
The third position in the interpolation.
value4
The fourth position in the interpolation.
amount
Weighting factor.
Return Value
A position that is the result of the Catmull-Rom interpolation.
See Also
Reference
MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathHelper.Clamp Method
Restricts a value to be within a specified range.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static float Clamp (
float value,
float min,
float max
)
Parameters
value
The value to clamp.
min
The minimum value.
max
The maximum value.
Return Value
The clamped value.
See Also
Reference
MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathHelper.Distance Method
Calculates the absolute value of the difference of two values.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static float Distance (
float value1,
float value2
)
Parameters
value1
Source value.
value2
Source value.
Return Value
Distance between the two values.
See Also
Reference
MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathHelper.Hermite Method
Performs a Hermite spline interpolation.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static float Hermite (
float value1,
float tangent1,
float value2,
float tangent2,
float amount
)
Parameters
value1
Source position.
tangent1
Source tangent.
value2
Source position.
tangent2
Source tangent.
amount
Weighting factor.
Return Value
The result of the Hermite spline interpolation.
See Also
Reference
MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathHelper.Lerp Method
Linearly interpolates between two values.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static float Lerp (
float value1,
float value2,
float amount
)
Parameters
value1
Source value.
value2
Source value.
amount
Value between 0 and 1 indicating the weight of value2.
Return Value
Interpolated value.
Remarks
This method performs the linear interpolation based on the following formula.
value1 + (value2 - value1) * amount
Passing amount a value of 0 will cause value1 to be returned, a value of 1 will cause value2 to be returned.
See Also
Reference
MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathHelper.Max Method
Returns the greater of two values.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static float Max (
float value1,
float value2
)
Parameters
value1
Source value.
value2
Source value.
Return Value
The greater value.
See Also
Reference
MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathHelper.Min Method
Returns the lesser of two values.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static float Min (
float value1,
float value2
)
Parameters
value1
Source value.
value2
Source value.
Return Value
The lesser value.
See Also
Reference
MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathHelper.SmoothStep Method
Interpolates between two values using a cubic equation.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static float SmoothStep (
float value1,
float value2,
float amount
)
Parameters
value1
Source value.
value2
Source value.
amount
Weighting value.
Return Value
Interpolated value.
See Also
Reference
MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathHelper.ToDegrees Method
Converts radians to degrees.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static float ToDegrees (
float radians
)
Parameters
radians
The angle in radians.
Return Value
The angle in degrees.
See Also
Reference
MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathHelper.ToRadians Method
Converts degrees to radians.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static float ToRadians (
float degrees
)
Parameters
degrees
The angle in degrees.
Return Value
The angle in radians.
See Also
Reference
MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix Structure
Defines a matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[TypeConverterAttribute("typeof(Microsoft.Xna.Framework.Design.MatrixConverter)")]
[SerializableAttribute]
public struct Matrix : IEquatable<Matrix>
Remarks Matrices use a row vector layout in the XNA Framework. Matrices can be either row vector or column vector. Row
vector matrices view vectors as a row from left to right, while column vector matrices view vectors as a column from top to
bottom. For example, the x, y, and z of a matrix's translation vector in the XNA Framework would correspond to the fields M41,
M42, M43.
See Also
Reference
Matrix Members
Microsoft.Xna.Framework Namespace
Programming Guide
Math Overview
How To: Transform a Point with a Matrix
How To: Rotate and Move a Camera
How To: Make a First-Person Camera
How To: Make a Third-Person Camera
How To: Position the Camera to View All Objects in a Scene
How To: Detect Whether a User Clicked a 3D Object
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix Members
The following tables list the members exposed by the Matrix type.
Public Constructors
Name Description
Matrix Initializes a new instance of Matrix.
Public Fields
Name Description
M11 Value at row 1 column 1 of the matrix.
M12 Value at row 1 column 2 of the matrix.
M13 Value at row 1 column 3 of the matrix.
M14 Value at row 1 column 4 of the matrix.
M21 Value at row 2 column 1 of the matrix.
M22 Value at row 2 column 2 of the matrix.
M23 Value at row 2 column 3 of the matrix.
M24 Value at row 2 column 4 of the matrix.
M31 Value at row 3 column 1 of the matrix.
M32 Value at row 3 column 2 of the matrix.
M33 Value at row 3 column 3 of the matrix.
M34 Value at row 3 column 4 of the matrix.
M41 Value at row 4 column 1 of the matrix.
M42 Value at row 4 column 2 of the matrix.
M43 Value at row 4 column 3 of the matrix.
M44 Value at row 4 column 4 of the matrix.
Public Properties
Name Description
Backward Gets and sets the backward vector of the Matrix.
Down Gets and sets the down vector of the Matrix.
Forward Gets and sets the forward vector of the Matrix.
Identity Returns an instance of the identity matrix.
Left Gets and sets the left vector of the Matrix.
Right Gets and sets the right vector of the Matrix.
Translation Gets and sets the translation vector of the Matrix.
Up Gets and sets the up vector of the Matrix.
Public Methods
Name Description
Add Overloaded. Adds a matrix to another matrix.
CreateBillboard Overloaded. Creates a spherical billboard that rotates around a specified object position.
CreateConstrainedBillboard Overloaded. Creates a cylindrical billboard that rotates around a specified axis.
CreateFromAxisAngle Overloaded. Creates a new Matrix that rotates around an arbitrary vector.
CreateFromQuaternion Overloaded. Creates a rotation Matrix from a Quaternion.
CreateFromYawPitchRoll Overloaded. Creates a new rotation matrix from a specified yaw, pitch, and roll.
CreateLookAt Overloaded. Creates a view matrix.
CreateOrthographic Overloaded. Builds an orthogonal projection matrix.
CreateOrthographicOffCenter Overloaded. Builds a customized, orthogonal projection matrix.
CreatePerspective Overloaded. Builds a perspective projection matrix.
CreatePerspectiveFieldOfView Overloaded. Builds a perspective projection matrix based on a field of view.
CreatePerspectiveOffCenter Overloaded. Builds a customized, perspective projection matrix.
CreateReflection Overloaded. Creates a Matrix that reflects the coordinate system about a specified Plane.
CreateRotationX Overloaded. Returns an x-axis rotation matrix.
CreateRotationY Overloaded. Returns a y-axis rotation matrix.
CreateRotationZ Overloaded. Returns an z-axis rotation matrix.
CreateScale Overloaded. Creates a scaling Matrix.
CreateShadow Overloaded. Creates a Matrix that flattens geometry into a specified Plane as if casting a sh
adow from a specified light source.
CreateTranslation Overloaded. Creates a translation Matrix.
CreateWorld Overloaded. Creates a world matrix.
Decompose Extracts the scalar, translation, and rotation components from a 3D scale/rotate/translate (S
RT) Matrix.
Determinant Calculates the determinant of the matrix.
Divide Overloaded. Divides a matrix by a scalar value or the components of another matrix.
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specifi
ed object.
GetHashCode Gets the hash code of this object.
GetType (Inherited from Object.)
Invert Overloaded. Calculates the inverse of a matrix.
Lerp Overloaded. Linearly interpolates between the corresponding values of two matrices.
Multiply Overloaded. Multiplies a matrix by a scalar value or another matrix.
Negate Overloaded. Negates individual elements of a matrix.
op_Addition Adds a matrix to another matrix.
op_Division Overloaded. Divides a matrix by a scalar value or the components of another matrix.
op_Equality Compares a matrix for equality with another matrix.
op_Inequality Tests a matrix for inequality with another matrix.
op_Multiply Overloaded. Multiplies a matrix by a scalar value or another matrix.
op_Subtraction Subtracts matrices.
op_UnaryNegation Negates individual elements of a matrix.
ReferenceEquals (Inherited from Object.)
Subtract Overloaded. Subtracts matrices.
ToString Retrieves a string representation of the current object.
Transform Overloaded. Transforms a Matrix by applying a Quaternion rotation.
Transpose Overloaded. Transposes the rows and columns of a matrix.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Matrix Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Matrix Fields
Public Fields
Name Description
M11 Value at row 1 column 1 of the matrix.
M12 Value at row 1 column 2 of the matrix.
M13 Value at row 1 column 3 of the matrix.
M14 Value at row 1 column 4 of the matrix.
M21 Value at row 2 column 1 of the matrix.
M22 Value at row 2 column 2 of the matrix.
M23 Value at row 2 column 3 of the matrix.
M24 Value at row 2 column 4 of the matrix.
M31 Value at row 3 column 1 of the matrix.
M32 Value at row 3 column 2 of the matrix.
M33 Value at row 3 column 3 of the matrix.
M34 Value at row 3 column 4 of the matrix.
M41 Value at row 4 column 1 of the matrix.
M42 Value at row 4 column 2 of the matrix.
M43 Value at row 4 column 3 of the matrix.
M44 Value at row 4 column 4 of the matrix.
See Also
Reference
Matrix Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Matrix.M11 Field
Value at row 1 column 1 of the matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float M11
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.M12 Field
Value at row 1 column 2 of the matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float M12
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.M13 Field
Value at row 1 column 3 of the matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float M13
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.M14 Field
Value at row 1 column 4 of the matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float M14
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.M21 Field
Value at row 2 column 1 of the matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float M21
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.M22 Field
Value at row 2 column 2 of the matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float M22
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.M23 Field
Value at row 2 column 3 of the matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float M23
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.M24 Field
Value at row 2 column 4 of the matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float M24
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.M31 Field
Value at row 3 column 1 of the matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float M31
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.M32 Field
Value at row 3 column 2 of the matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float M32
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.M33 Field
Value at row 3 column 3 of the matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float M33
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.M34 Field
Value at row 3 column 4 of the matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float M34
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.M41 Field
Value at row 4 column 1 of the matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float M41
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.M42 Field
Value at row 4 column 2 of the matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float M42
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.M43 Field
Value at row 4 column 3 of the matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float M43
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.M44 Field
Value at row 4 column 4 of the matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float M44
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix Constructor
Initializes a new instance of Matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Matrix (
float m11,
float m12,
float m13,
float m14,
float m21,
float m22,
float m23,
float m24,
float m31,
float m32,
float m33,
float m34,
float m41,
float m42,
float m43,
float m44
)
Parameters
m11
Value to initialize m11 to.
m12
Value to initialize m12 to.
m13
Value to initialize m13 to.
m14
Value to initialize m14 to.
m21
Value to initialize m21 to.
m22
Value to initialize m22 to.
m23
Value to initialize m23 to.
m24
Value to initialize m24 to.
m31
Value to initialize m31 to.
m32
Value to initialize m32 to.
m33
Value to initialize m33 to.
m34
Value to initialize m34 to.
m41
Value to initialize m41 to.
m42
Value to initialize m42 to.
m43
Value to initialize m43 to.
m44
Value to initialize m44 to.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix Methods
Public Methods
Name Description
Add Overloaded. Adds a matrix to another matrix.
CreateBillboard Overloaded. Creates a spherical billboard that rotates around a specified object position.
CreateConstrainedBillboard Overloaded. Creates a cylindrical billboard that rotates around a specified axis.
CreateFromAxisAngle Overloaded. Creates a new Matrix that rotates around an arbitrary vector.
CreateFromQuaternion Overloaded. Creates a rotation Matrix from a Quaternion.
CreateFromYawPitchRoll Overloaded. Creates a new rotation matrix from a specified yaw, pitch, and roll.
CreateLookAt Overloaded. Creates a view matrix.
CreateOrthographic Overloaded. Builds an orthogonal projection matrix.
CreateOrthographicOffCenter Overloaded. Builds a customized, orthogonal projection matrix.
CreatePerspective Overloaded. Builds a perspective projection matrix.
CreatePerspectiveFieldOfView Overloaded. Builds a perspective projection matrix based on a field of view.
CreatePerspectiveOffCenter Overloaded. Builds a customized, perspective projection matrix.
CreateReflection Overloaded. Creates a Matrix that reflects the coordinate system about a specified Plane.
CreateRotationX Overloaded. Returns an x-axis rotation matrix.
CreateRotationY Overloaded. Returns a y-axis rotation matrix.
CreateRotationZ Overloaded. Returns an z-axis rotation matrix.
CreateScale Overloaded. Creates a scaling Matrix.
CreateShadow Overloaded. Creates a Matrix that flattens geometry into a specified Plane as if casting a sh
adow from a specified light source.
CreateTranslation Overloaded. Creates a translation Matrix.
CreateWorld Overloaded. Creates a world matrix.
Decompose Extracts the scalar, translation, and rotation components from a 3D scale/rotate/translate (S
RT) Matrix.
Determinant Calculates the determinant of the matrix.
Divide Overloaded. Divides a matrix by a scalar value or the components of another matrix.
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specifi
ed object.
GetHashCode Gets the hash code of this object.
GetType (Inherited from Object.)
Invert Overloaded. Calculates the inverse of a matrix.
Lerp Overloaded. Linearly interpolates between the corresponding values of two matrices.
Multiply Overloaded. Multiplies a matrix by a scalar value or another matrix.
Negate Overloaded. Negates individual elements of a matrix.
op_Addition Adds a matrix to another matrix.
op_Division Overloaded. Divides a matrix by a scalar value or the components of another matrix.
op_Equality Compares a matrix for equality with another matrix.
op_Inequality Tests a matrix for inequality with another matrix.
op_Multiply Overloaded. Multiplies a matrix by a scalar value or another matrix.
op_Subtraction Subtracts matrices.
op_UnaryNegation Negates individual elements of a matrix.
ReferenceEquals (Inherited from Object.)
Subtract Overloaded. Subtracts matrices.
ToString Retrieves a string representation of the current object.
Transform Overloaded. Transforms a Matrix by applying a Quaternion rotation.
Transpose Overloaded. Transposes the rows and columns of a matrix.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Matrix Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Matrix.Add Method
Adds a matrix to another matrix.
Overload List
Name Description
Matrix.Add (Matrix, Matrix) Adds a matrix to another matrix.
Matrix.Add (Matrix, Matrix, Matrix) Adds a matrix to another matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
matrix1
Source matrix.
matrix2
Source matrix.
Return Value
Resulting matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
matrix1
Source matrix.
matrix2
Source matrix.
result
[OutAttribute] Resulting matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.CreateBillboard Method
Creates a spherical billboard that rotates around a specified object position.
Overload List
Name Description
Matrix.CreateBillboard (Vector3, Vector3, Vector3, Nullable<Vector3>) Creates a spherical billboard that rotates around
a specified object position.
Matrix.CreateBillboard (Vector3, Vector3, Vector3, Nullable<Vector3>, Matrix) Creates a spherical billboard that rotates around
a specified object position.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
objectPosition
Position of the object the billboard will rotate around.
cameraPosition
Position of the camera.
cameraUpVector
The up vector of the camera.
cameraForwardVector
Optional forward vector of the camera.
Return Value
The created billboard matrix.
Remarks
This method computes the facing direction of the billboard from the object position and camera position. When the object and
camera positions are too close, the matrix will not be accurate. To avoid this problem, the method uses the optional camera
forward vector if the positions are too close.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
objectPosition
Position of the object the billboard will rotate around.
cameraPosition
Position of the camera.
cameraUpVector
The up vector of the camera.
cameraForwardVector
Optional forward vector of the camera.
result
[OutAttribute] The created billboard matrix.
Remarks
This method computes the facing direction of the billboard from the object position and camera position. When the object and
camera positions are too close, the matrix will not be accurate. To avoid this problem, the method uses the optional camera
forward vector if the positions are too close.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.CreateConstrainedBillboard Method
Creates a cylindrical billboard that rotates around a specified axis.
Overload List
Name Description
Matrix.CreateConstrainedBillboard (Vector3, Vector3, Vector3, Nullable<Vector3>, Nullable<Vector3>) Creates a cylin
drical billboard
that rotates aro
und a specified
axis.
Matrix.CreateConstrainedBillboard (Vector3, Vector3, Vector3, Nullable<Vector3>, Nullable<Vector3>, Matrix) Creates a cylin
drical billboard
that rotates aro
und a specified
axis.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
objectPosition
Position of the object the billboard will rotate around.
cameraPosition
Position of the camera.
rotateAxis
Axis to rotate the billboard around.
cameraForwardVector
Optional forward vector of the camera.
objectForwardVector
Optional forward vector of the object.
Return Value
The created billboard matrix.
Remarks
This method computes the facing direction of the billboard from the object position and camera position. When the object and
camera positions are too close, the matrix will not be accurate. To avoid this problem, the method uses the optional camera
forward vector if the positions are too close.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
objectPosition
Position of the object the billboard will rotate around.
cameraPosition
Position of the camera.
rotateAxis
Axis to rotate the billboard around.
cameraForwardVector
Optional forward vector of the camera.
objectForwardVector
Optional forward vector of the object.
result
[OutAttribute] The created billboard matrix.
Remarks
This method computes the facing direction of the billboard from the object position and camera position. When the object and
camera positions are too close, the matrix will not be accurate. To avoid this problem, the method uses the optional camera
forward vector if the positions are too close.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.CreateFromAxisAngle Method
Creates a new Matrix that rotates around an arbitrary vector.
Overload List
Name Description
Matrix.CreateFromAxisAngle (Vector3, Single) Creates a new Matrix that rotates around an arbitrary vector.
Matrix.CreateFromAxisAngle (Vector3, Single, Matrix) Creates a new Matrix that rotates around an arbitrary vector.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
axis
The axis to rotate around.
angle
The angle to rotate around the vector.
Return Value
The created Matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Transform a Point with a Matrix
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
axis
The axis to rotate around.
angle
The angle to rotate around the vector.
result
[OutAttribute] The created Matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Transform a Point with a Matrix
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.CreateFromQuaternion Method
Creates a rotation Matrix from a Quaternion.
Overload List
Name Description
Matrix.CreateFromQuaternion (Quaternion) Creates a rotation Matrix from a Quaternion.
Matrix.CreateFromQuaternion (Quaternion, Matrix) Creates a rotation Matrix from a Quaternion.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
quaternion
Quaternion to create the Matrix from.
Return Value
The created Matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
quaternion
Quaternion to create the Matrix from.
result
[OutAttribute] The created Matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.CreateFromYawPitchRoll Method
Creates a new rotation matrix from a specified yaw, pitch, and roll.
Overload List
Name Description
Matrix.CreateFromYawPitchRoll (Single, Single, Single) Creates a new rotation matrix from a specified yaw, pitch, and r
oll.
Matrix.CreateFromYawPitchRoll (Single, Single, Single, Matrix) Fills in a rotation matrix from a specified yaw, pitch, and roll.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
yaw
Angle of rotation, in radians, around the y-axis.
pitch
Angle of rotation, in radians, around the x-axis.
roll
Angle of rotation, in radians, around the z-axis.
Return Value
A new rotation matrix with the specified yaw, pitch, and roll.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
yaw
Angle of rotation, in radians, around the y-axis.
pitch
Angle of rotation, in radians, around the x-axis.
roll
Angle of rotation, in radians, around the z-axis.
result
[OutAttribute] An existing matrix filled in to represent the specified yaw, pitch, and roll.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.CreateLookAt Method
Creates a view matrix.
Overload List
Name Description
Matrix.CreateLookAt (Vector3, Vector3, Vector3) Creates a view matrix.
Matrix.CreateLookAt (Vector3, Vector3, Vector3, Matrix) Creates a view matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
cameraPosition
The position of the camera.
cameraTarget
The direction that the camera is pointing.
cameraUpVector
The direction that is "up" from the camera's point of view.
Return Value
The created view matrix.
Remarks
View space, sometimes called camera space, is similar to world space in that it is typically used for the entire scene. However, in
view space, the origin is at the viewer or camera.
See Also
Tasks
How To: Rotate and Move a Camera
How To: Make a First-Person Camera
How To: Make a Third-Person Camera
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
cameraPosition
The position of the camera.
cameraTarget
The direction that the camera is pointing.
cameraUpVector
The direction that is "up" from the camera's point of view.
result
[OutAttribute] The created view matrix.
Remarks
View space, sometimes called camera space, is similar to world space in that it is typically used for the entire scene. However, in
view space, the origin is at the viewer or camera.
See Also
Tasks
How To: Rotate and Move a Camera
How To: Make a First-Person Camera
How To: Make a Third-Person Camera
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.CreateOrthographic Method
Builds an orthogonal projection matrix.
Overload List
Name Description
Matrix.CreateOrthographic (Single, Single, Single, Single) Builds an orthogonal projection matrix.
Matrix.CreateOrthographic (Single, Single, Single, Single, Matrix) Builds an orthogonal projection matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
width
Width of the view volume.
height
Height of the view volume.
zNearPlane
Minimum z-value of the view volume.
zFarPlane
Maximum z-value of the view volume.
Return Value
The projection matrix.
Remarks
Projection space refers to the space after applying projection transformation from view space. After the projection
transformation, visible content has x and y coordinates ranging from -1 to 1, and z coordinates ranging from 0 to 1.
Unlike perspective projection, in orthographic projection there is no perspective foreshortening.
The viewable area of this orthographic projection is centered on 0,0,0. The x-axis of the area ranges from -width/2 to width/2.
The y-axis of the area ranges from -height/2 to height/2. The z-axis of the area ranges from zNearPlane to zFarPlane. These
values are relative to the position and x, y, and z-axes of the view.
To obtain the viewable area (in world space) of a scene, create a BoundingFrustum and pass the combined view and projection
matrix to the constructor.
See Also
Tasks
How To: Rotate and Move a Camera
How To: Make a First-Person Camera
How To: Make a Third-Person Camera
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
width
Width of the view volume.
height
Height of the view volume.
zNearPlane
Minimum z-value of the view volume.
zFarPlane
Maximum z-value of the view volume.
result
[OutAttribute] The projection matrix.
Remarks
Projection space refers to the space after applying projection transformation from view space. After the projection
transformation, visible content has x and y coordinates ranging from -1 to 1, and z coordinates ranging from 0 to 1.
Unlike perspective projection, in orthographic projection there is no perspective foreshortening.
The viewable area of this orthographic projection is centered on 0,0,0. The x-axis of the area ranges from -width/2 to width/2.
The y-axis of the area ranges from -height/2 to height/2. The z-axis of the area ranges from zNearPlane to zFarPlane. These
values are relative to the position and x, y, and z-axes of the view.
To obtain the viewable area (in world space) of a scene, create a BoundingFrustum and pass the combined view and projection
matrix to the constructor.
See Also
Tasks
How To: Rotate and Move a Camera
How To: Make a First-Person Camera
How To: Make a Third-Person Camera
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.CreateOrthographicOffCenter Method
Builds a customized, orthogonal projection matrix.
Overload List
Name Description
Matrix.CreateOrthographicOffCenter (Single, Single, Single, Single, Single, Single) Builds a customized, orthogonal proj
ection matrix.
Matrix.CreateOrthographicOffCenter (Single, Single, Single, Single, Single, Single, Matrix) Builds a customized, orthogonal proj
ection matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
left
Minimum x-value of the view volume.
right
Maximum x-value of the view volume.
bottom
Minimum y-value of the view volume.
top
Maximum y-value of the view volume.
zNearPlane
Minimum z-value of the view volume.
zFarPlane
Maximum z-value of the view volume.
Return Value
The projection matrix.
Remarks
Projection space refers to the space after applying projection transformation from view space. After the projection
transformation, visible content has x and y coordinates ranging from -1 to 1, and z coordinates ranging from 0 to 1.
Unlike perspective projection, in orthographic projection there is no perspective foreshortening.
The viewable area of this orthographic projection extends from left to right on the x-axis, bottom to top on the y-axis, and
zNearPlane to zFarPlane on the z-axis. These values are relative to the position and x, y, and z-axes of the view.
To obtain the viewable area (in world space) of a scene, create a BoundingFrustum and pass the combined view and projection
matrix to the constructor.
See Also
Tasks
How To: Rotate and Move a Camera
How To: Make a First-Person Camera
How To: Make a Third-Person Camera
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
left
Minimum x-value of the view volume.
right
Maximum x-value of the view volume.
bottom
Minimum y-value of the view volume.
top
Maximum y-value of the view volume.
zNearPlane
Minimum z-value of the view volume.
zFarPlane
Maximum z-value of the view volume.
result
[OutAttribute] The projection matrix.
Remarks
Projection space refers to the space after applying projection transformation from view space. After the projection
transformation, visible content has x and y coordinates ranging from -1 to 1, and z coordinates ranging from 0 to 1.
Unlike perspective projection, in orthographic projection there is no perspective foreshortening.
The viewable area of this orthographic projection extends from left to right on the x-axis, bottom to top on the y-axis, and
zNearPlane to zFarPlane on the z-axis. These values are relative to the position and x, y, and z-axes of the view.
To obtain the viewable area (in world space) of a scene, create a BoundingFrustum and pass the combined view and projection
matrix to the constructor.
See Also
Tasks
How To: Rotate and Move a Camera
How To: Make a First-Person Camera
How To: Make a Third-Person Camera
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.CreatePerspective Method
Builds a perspective projection matrix.
Overload List
Name Description
Matrix.CreatePerspective (Single, Single, Single, Single) Builds a perspective projection matrix.
Matrix.CreatePerspective (Single, Single, Single, Single, Matrix) Builds a perspective projection matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
width
Width of the view volume at the near view plane.
height
Height of the view volume at the near view plane.
nearPlaneDistance
Distance to the near view plane.
farPlaneDistance
Distance to the far view plane.
Return Value
The projection matrix.
Exceptions
Exception type Condition
ArgumentOutOfRangeException
One of the following conditions is true:
nearPlaneDistance or farPlaneDistance is a negative value. Specify a positive value for
nearPlaneDistance or farPlaneDistance.
nearPlaneDistance larger than farPlaneDistance. nearPlaneDistance must be smaller th
an farPlaneDistance.
Remarks
Projection space refers to the space after applying projection transformation from view space. After the projection
transformation, visible content has x and y-coordinates ranging from −1 to 1, and a z-coordinate ranging from 0 to 1.
To obtain the viewable area (in world space) of a scene, create a BoundingFrustum and pass the combined view and projection
matrix to the constructor.
See Also
Tasks
How To: Rotate and Move a Camera
How To: Make a First-Person Camera
How To: Make a Third-Person Camera
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
width
Width of the view volume at the near view plane.
height
Height of the view volume at the near view plane.
nearPlaneDistance
Distance to the near view plane.
farPlaneDistance
Distance to the far view plane.
result
[OutAttribute] The projection matrix.
Exceptions
Exception type Condition
ArgumentOutOfRangeException
One of the following conditions is true:
nearPlaneDistance or farPlaneDistance is a negative value. Specify a positive value for
nearPlaneDistance or farPlaneDistance.
nearPlaneDistance larger than farPlaneDistance. nearPlaneDistance must be smaller th
an farPlaneDistance.
Remarks
Projection space refers to the space after applying projection transformation from view space. After the projection
transformation, visible content has x and y-coordinates ranging from −1 to 1, and a z-coordinate ranging from 0 to 1.
To obtain the viewable area (in world space) of a scene, create a BoundingFrustum and pass the combined view and projection
matrix to the constructor.
See Also
Tasks
How To: Rotate and Move a Camera
How To: Make a First-Person Camera
How To: Make a Third-Person Camera
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.CreatePerspectiveFieldOfView Method
Builds a perspective projection matrix based on a field of view.
Overload List
Name Description
Matrix.CreatePerspectiveFieldOfView (Single, Single, Single, Single) Builds a perspective projection matrix based on a fi
eld of view.
Matrix.CreatePerspectiveFieldOfView (Single, Single, Single, Single, Matrix) Builds a perspective projection matrix based on a fi
eld of view.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
fieldOfView
Field of view in radians.
aspectRatio
Aspect ratio, defined as view space width divided by height.
nearPlaneDistance
Distance to the near view plane.
farPlaneDistance
Distance to the far view plane.
Return Value
The perspective projection matrix.
Exceptions
Exception type Condition
ArgumentOutOfRangeException
One of the following conditions is true:
fieldOfView is not between 0 and pi (180 degrees). Note that fieldOfView should be spe
cified in radians.
nearPlaneDistance or farPlaneDistance is a negative value. Specify a positive value for
nearPlaneDistance or farPlaneDistance.
nearPlaneDistance larger than farPlaneDistance. nearPlaneDistance must be smaller th
an farPlaneDistance.
Remarks
Projection space refers to the space after applying projection transformation from view space. After the projection
transformation, visible content has x and y-coordinates ranging from −1 to 1, and a z-coordinate ranging from 0 to 1.
To obtain the viewable area (in world space) of a scene, create a BoundingFrustum and pass the combined view and projection
matrix to the constructor.
See Also
Tasks
How To: Rotate and Move a Camera
How To: Make a First-Person Camera
How To: Make a Third-Person Camera
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
fieldOfView
Field of view in radians.
aspectRatio
Aspect ratio, defined as view space width divided by height.
nearPlaneDistance
Distance to the near view plane.
farPlaneDistance
Distance to the far view plane.
result
[OutAttribute] The perspective projection matrix.
Exceptions
Exception type Condition
ArgumentOutOfRangeException
One of the following conditions is true:
fieldOfView is not between 0 and pi (180 degrees). Note that fieldOfView should be spe
cified in radians.
nearPlaneDistance or farPlaneDistance is a negative value. Specify a positive value for
nearPlaneDistance or farPlaneDistance.
nearPlaneDistance larger than farPlaneDistance. nearPlaneDistance must be smaller th
an farPlaneDistance.
Remarks
Projection space refers to the space after applying projection transformation from view space. After the projection
transformation, visible content has x and y-coordinates ranging from −1 to 1, and a z-coordinate ranging from 0 to 1.
To obtain the viewable area (in world space) of a scene, create a BoundingFrustum and pass the combined view and projection
matrix to the constructor.
See Also
Tasks
How To: Rotate and Move a Camera
How To: Make a First-Person Camera
How To: Make a Third-Person Camera
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.CreatePerspectiveOffCenter Method
Builds a customized, perspective projection matrix.
Overload List
Name Description
Matrix.CreatePerspectiveOffCenter (Single, Single, Single, Single, Single, Single) Builds a customized, perspective projec
tion matrix.
Matrix.CreatePerspectiveOffCenter (Single, Single, Single, Single, Single, Single, Matrix) Builds a customized, perspective projec
tion matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
left
Minimum x-value of the view volume at the near view plane.
right
Maximum x-value of the view volume at the near view plane.
bottom
Minimum y-value of the view volume at the near view plane.
top
Maximum y-value of the view volume at the near view plane.
nearPlaneDistance
Distance to the near view plane.
farPlaneDistance
Distance to of the far view plane.
Return Value
The created projection matrix.
Remarks
Projection space refers to the space after applying projection transformation from view space. After the projection
transformation, visible content has x and y-coordinates ranging from −1 to 1, and a z-coordinate ranging from 0 to 1.
To obtain the viewable area (in world space) of a scene, create a BoundingFrustum and pass the combined view and projection
matrix to the constructor.
Exceptions
Exception type Condition
ArgumentOutOfRangeException
One of the following conditions is true:
nearPlaneDistance or farPlaneDistance is a negative value. Specify a positive value for
nearPlaneDistance or farPlaneDistance.
nearPlaneDistance larger than farPlaneDistance. nearPlaneDistance must be smaller th
an farPlaneDistance.
See Also
Tasks
How To: Rotate and Move a Camera
How To: Make a First-Person Camera
How To: Make a Third-Person Camera
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
left
Minimum x-value of the view volume at the near view plane.
right
Maximum x-value of the view volume at the near view plane.
bottom
Minimum y-value of the view volume at the near view plane.
top
Maximum y-value of the view volume at the near view plane.
nearPlaneDistance
Distance to the near view plane.
farPlaneDistance
Distance to of the far view plane.
result
[OutAttribute] The created projection matrix.
Exceptions
Exception type Condition
ArgumentOutOfRangeException
One of the following conditions is true:
nearPlaneDistance or farPlaneDistance is a negative value. Specify a positive value for
nearPlaneDistance or farPlaneDistance.
nearPlaneDistance larger than farPlaneDistance. nearPlaneDistance must be smaller th
an farPlaneDistance.
Remarks
Projection space refers to the space after applying projection transformation from view space. After the projection
transformation, visible content has x and y-coordinates ranging from −1 to 1, and a z-coordinate ranging from 0 to 1.
To obtain the viewable area (in world space) of a scene, create a BoundingFrustum and pass the combined view and projection
matrix to the constructor.
See Also
Tasks
How To: Rotate and Move a Camera
How To: Make a First-Person Camera
How To: Make a Third-Person Camera
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.CreateReflection Method
Creates a Matrix that reflects the coordinate system about a specified Plane.
Overload List
Name Description
Matrix.CreateReflection (Plane) Creates a Matrix that reflects the coordinate system about a specified Plane.
Matrix.CreateReflection (Plane, Matrix) Fills in an existing Matrix so that it reflects the coordinate system about a specified
Plane.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value
The Plane about which to create a reflection.
Return Value
A new Matrix expressing the reflection.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The Plane about which to create a reflection.
result
[OutAttribute] A Matrix that creates the reflection.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.CreateRotationX Method
Returns an x-axis rotation matrix.
Overload List
Name Description
Matrix.CreateRotationX (Single) Returns an x-axis rotation matrix.
Matrix.CreateRotationX (Single, Matrix) Returns an x-axis rotation matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
radians
The rotation in radians.
Return Value
The rotation matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Transform a Point with a Matrix
How To: Rotate and Move a Camera
How To: Make a First-Person Camera
How To: Make a Third-Person Camera
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
radians
The rotation in radians.
result
[OutAttribute] The rotation matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Transform a Point with a Matrix
How To: Rotate and Move a Camera
How To: Make a First-Person Camera
How To: Make a Third-Person Camera
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.CreateRotationY Method
Returns a y-axis rotation matrix.
Overload List
Name Description
Matrix.CreateRotationY (Single) Returns a y-axis rotation matrix.
Matrix.CreateRotationY (Single, Matrix) Returns a y-axis rotation matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
radians
The rotation in radians.
Return Value
The rotation matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Transform a Point with a Matrix
How To: Rotate and Move a Camera
How To: Make a First-Person Camera
How To: Make a Third-Person Camera
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
radians
The rotation in radians.
result
[OutAttribute] The rotation matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Transform a Point with a Matrix
How To: Rotate and Move a Camera
How To: Make a First-Person Camera
How To: Make a Third-Person Camera
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.CreateRotationZ Method
Returns an z-axis rotation matrix.
Overload List
Name Description
Matrix.CreateRotationZ (Single) Returns a z-axis rotation matrix.
Matrix.CreateRotationZ (Single, Matrix) Returns an z-axis rotation matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
radians
The rotation in radians.
Return Value
The rotation matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Transform a Point with a Matrix
How To: Rotate and Move a Camera
How To: Make a First-Person Camera
How To: Make a Third-Person Camera
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
radians
The rotation in radians.
result
[OutAttribute] The rotation matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Transform a Point with a Matrix
How To: Rotate and Move a Camera
How To: Make a First-Person Camera
How To: Make a Third-Person Camera
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.CreateScale Method
Creates a scaling Matrix.
Overload List
Name Description
Matrix.CreateScale (Single) Creates a scaling Matrix.
Matrix.CreateScale (Single, Matrix) Creates a scaling Matrix.
Matrix.CreateScale (Single, Single, Single) Creates a scaling Matrix.
Matrix.CreateScale (Single, Single, Single, Matrix) Creates a scaling Matrix.
Matrix.CreateScale (Vector3) Creates a scaling Matrix.
Matrix.CreateScale (Vector3, Matrix) Creates a scaling Matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Transform a Point with a Matrix
XNA Game Studio 2.0
Parameters
scale
Amount to scale by.
Return Value
The created scaling Matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Transform a Point with a Matrix
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
scale
Value to scale by.
result
[OutAttribute] The created scaling Matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
xScale
Value to scale by on the x-axis.
yScale
Value to scale by on the y-axis.
zScale
Value to scale by on the z-axis.
Return Value
The created scaling Matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Transform a Point with a Matrix
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
xScale
Value to scale by on the x-axis.
yScale
Value to scale by on the y-axis.
zScale
Value to scale by on the z-axis.
result
[OutAttribute] The created scaling Matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
scales
Amounts to scale by on the x, y, and z axes.
Return Value
The created scaling Matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Transform a Point with a Matrix
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
scales
Amounts to scale by on the x, y, and z axes.
result
[OutAttribute] The created scaling Matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.CreateShadow Method
Creates a Matrix that flattens geometry into a specified Plane as if casting a shadow from a specified light source.
Overload List
Name Description
Matrix.CreateShadow (Vector3, Plane) Creates a Matrix that flattens geometry into a specified Plane as if casting a shad
ow from a specified light source.
Matrix.CreateShadow (Vector3, Plane, Matrix) Fills in a Matrix to flatten geometry into a specified Plane as if casting a shadow f
rom a specified light source.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
lightDirection
A Vector3 specifying the direction from which the light that will cast the shadow is coming.
plane
The Plane onto which the new matrix should flatten geometry so as to cast a shadow.
Return Value
A new Matrix that can be used to flatten geometry onto the specified plane from the specified direction.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
lightDirection
A Vector3 specifying the direction from which the light that will cast the shadow is coming.
plane
The Plane onto which the new matrix should flatten geometry so as to cast a shadow.
result
[OutAttribute] A Matrix that can be used to flatten geometry onto the specified plane from the specified direction.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.CreateTranslation Method
Creates a translation Matrix.
Overload List
Name Description
Matrix.CreateTranslation (Single, Single, Single) Creates a translation Matrix.
Matrix.CreateTranslation (Single, Single, Single, Matrix) Creates a translation Matrix.
Matrix.CreateTranslation (Vector3) Creates a translation Matrix.
Matrix.CreateTranslation (Vector3, Matrix) Creates a translation Matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Transform a Point with a Matrix
How To: Rotate and Move a Camera
How To: Make a First-Person Camera
How To: Make a Third-Person Camera
XNA Game Studio 2.0
Parameters
xPosition
Value to translate by on the x-axis.
yPosition
Value to translate by on the y-axis.
zPosition
Value to translate by on the z-axis.
Return Value
The created translation Matrix.
See Also
Tasks
How To: Transform a Point with a Matrix
How To: Rotate and Move a Camera
How To: Make a First-Person Camera
How To: Make a Third-Person Camera
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
xPosition
Value to translate by on the x-axis.
yPosition
Value to translate by on the y-axis.
zPosition
Value to translate by on the z-axis.
result
[OutAttribute] The created translation Matrix.
See Also
Tasks
How To: Transform a Point with a Matrix
How To: Rotate and Move a Camera
How To: Make a First-Person Camera
How To: Make a Third-Person Camera
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
position
Amounts to translate by on the x, y, and z axes.
Return Value
The created translation Matrix.
See Also
Tasks
How To: Transform a Point with a Matrix
How To: Rotate and Move a Camera
How To: Make a First-Person Camera
How To: Make a Third-Person Camera
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
position
Amounts to translate by on the x, y, and z axes.
result
[OutAttribute] The created translation Matrix.
See Also
Tasks
How To: Transform a Point with a Matrix
How To: Rotate and Move a Camera
How To: Make a First-Person Camera
How To: Make a Third-Person Camera
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.CreateWorld Method
Creates a world matrix.
Overload List
Name Description
Matrix.CreateWorld (Vector3, Vector3, Vector3) Creates a world matrix with the specified parameters.
Matrix.CreateWorld (Vector3, Vector3, Vector3, Matrix) Creates a world matrix with the specified parameters.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
position
Position of the object. This value is used in translation operations.
forward
Forward direction of the object.
up
Upward direction of the object; usually [0, 1, 0].
Return Value
The created world matrix.
Remarks
This matrix includes rotation and translation, but not scaling.
See Also
Reference
Matrix Structure
CreateScale
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
position
Position of the object. This value is used in translation operations.
forward
Forward direction of the object.
up
Upward direction of the object; usually [0, 1, 0].
result
[OutAttribute] The created world matrix.
Remarks
This matrix includes rotation and translation, but not scaling.
See Also
Reference
Matrix Structure
CreateScale
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.Decompose Method
Extracts the scalar, translation, and rotation components from a 3D scale/rotate/translate (SRT) Matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool Decompose (
out Vector3 scale,
out Quaternion rotation,
out Vector3 translation
)
Parameters
scale
[OutAttribute] The scalar component of the transform matrix, expressed as a Vector3.
rotation
[OutAttribute] The rotation component of the transform matrix, expressed as a Quaternion.
translation
[OutAttribute] The translation component of the transform matrix, expressed as a Vector3.
Return Value
true if the Matrix can be decomposed; false otherwise.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.Determinant Method
Calculates the determinant of the matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float Determinant ()
Return Value
The determinant of the matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.Divide Method
Divides a matrix by a scalar value or the components of another matrix.
Overload List
Name Description
Matrix.Divide (Matrix, Matrix) Divides the components of a matrix by the corresponding components of another matrix.
Matrix.Divide (Matrix, Matrix, Matrix) Divides the components of a matrix by the corresponding components of another matrix.
Matrix.Divide (Matrix, Single) Divides the components of a matrix by a scalar.
Matrix.Divide (Matrix, Single, Matrix) Divides the components of a matrix by a scalar.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
matrix1
Source matrix.
matrix2
The divisor.
Return Value
Result of the division.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
matrix1
Source matrix.
matrix2
The divisor.
result
[OutAttribute] Result of the division.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
matrix1
Source matrix.
divider
The divisor.
Return Value
Resulting matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
matrix1
Source matrix.
divider
The divisor.
result
[OutAttribute] Result of the division.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
Matrix.Equals (Matrix) Determines whether the specified Object is equal to the Matrix.
Matrix.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
Matrix.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
other
The Object to compare with the current Matrix.
Return Value
true if the specified Object is equal to the current Matrix; false otherwise.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
obj
Object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.GetHashCode Method
Gets the hash code of this object.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code of this object.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.Invert Method
Calculates the inverse of a matrix.
Overload List
Name Description
Matrix.Invert (Matrix) Calculates the inverse of a matrix.
Matrix.Invert (Matrix, Matrix) Calculates the inverse of a matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
matrix
Source matrix.
Return Value
The inverse of the matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Detect Whether a User Clicked a 3D Object
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
matrix
Source matrix.
result
[OutAttribute] The inverse of the matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Detect Whether a User Clicked a 3D Object
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.Lerp Method
Linearly interpolates between the corresponding values of two matrices.
Overload List
Name Description
Matrix.Lerp (Matrix, Matrix, Single) Linearly interpolates between the corresponding values of two matrices.
Matrix.Lerp (Matrix, Matrix, Single, Matrix) Linearly interpolates between the corresponding values of two matrices.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
matrix1
Source matrix.
matrix2
Source matrix.
amount
Interpolation value.
Return Value
Resulting matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
matrix1
Source matrix.
matrix2
Source matrix.
amount
Interpolation value.
result
[OutAttribute] Resulting matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.Multiply Method
Multiplies a matrix by a scalar value or another matrix.
Overload List
Name Description
Matrix.Multiply (Matrix, Matrix) Multiplies a matrix by another matrix.
Matrix.Multiply (Matrix, Matrix, Matrix) Multiplies a matrix by another matrix.
Matrix.Multiply (Matrix, Single) Multiplies a matrix by a scalar value.
Matrix.Multiply (Matrix, Single, Matrix) Multiplies a matrix by a scalar value.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
matrix1
Source matrix.
matrix2
Source matrix.
Return Value
Result of the multiplication.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
matrix1
Source matrix.
matrix2
Source matrix.
result
[OutAttribute] Result of the multiplication.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
matrix1
Source matrix.
scaleFactor
Scalar value.
Return Value
Result of the multiplication.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
matrix1
Source matrix.
scaleFactor
Scalar value.
result
[OutAttribute] The result of the multiplication.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.Negate Method
Negates individual elements of a matrix.
Overload List
Name Description
Matrix.Negate (Matrix) Negates individual elements of a matrix.
Matrix.Negate (Matrix, Matrix) Negates individual elements of a matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
matrix
Source matrix.
Return Value
Negated matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
matrix
Source matrix.
result
[OutAttribute] Negated matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.op_Addition Method
Adds a matrix to another matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Matrix op_Addition (
Matrix matrix1,
Matrix matrix2
)
Parameters
matrix1
Source matrix.
matrix2
Source matrix.
Return Value
Resulting matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.op_Division Method
Divides a matrix by a scalar value or the components of another matrix.
Overload List
Name Description
Matrix.op_Division (Matrix, Matrix) Divides the components of a matrix by the corresponding components of another matrix.
Matrix.op_Division (Matrix, Single) Divides the components of a matrix by a scalar.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
matrix1
Source matrix.
matrix2
The divisor.
Return Value
Resulting matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
matrix1
Source matrix.
divider
The divisor.
Return Value
The result of the division.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.op_Equality Method
Compares a matrix for equality with another matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
Matrix matrix1,
Matrix matrix2
)
Parameters
matrix1
Source matrix.
matrix2
Source matrix.
Return Value
true if the matrices are equal; false otherwise.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.op_Inequality Method
Tests a matrix for inequality with another matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
Matrix matrix1,
Matrix matrix2
)
Parameters
matrix1
The matrix on the left of the equal sign.
matrix2
The matrix on the right of the equal sign.
Return Value
true if the matrices are not equal; false otherwise.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.op_Multiply Method
Multiplies a matrix by a scalar value or another matrix.
Overload List
Name Description
Matrix.op_Multiply (Matrix, Matrix) Multiplies a matrix by another matrix.
Matrix.op_Multiply (Matrix, Single) Multiplies a matrix by a scalar value.
Matrix.op_Multiply (Single, Matrix) Multiplies a matrix by a scalar value.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
matrix1
Source matrix.
matrix2
Source matrix.
Return Value
Result of the multiplication.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
matrix
Source matrix.
scaleFactor
Scalar value.
Return Value
Result of the multiplication.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
scaleFactor
Scalar value.
matrix
Source matrix.
Return Value
Result of the multiplication.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.op_Subtraction Method
Subtracts matrices.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Matrix op_Subtraction (
Matrix matrix1,
Matrix matrix2
)
Parameters
matrix1
Source matrix.
matrix2
Source matrix.
Return Value
Result of the subtraction.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.op_UnaryNegation Method
Negates individual elements of a matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Matrix op_UnaryNegation (
Matrix matrix1
)
Parameters
matrix1
Source matrix.
Return Value
Negated matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.Subtract Method
Subtracts matrices.
Overload List
Name Description
Matrix.Subtract (Matrix, Matrix) Subtracts matrices.
Matrix.Subtract (Matrix, Matrix, Matrix) Subtracts matrices.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
matrix1
Source matrix.
matrix2
Source matrix.
Return Value
Result of the subtraction.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
matrix1
Source matrix.
matrix2
Source matrix.
result
[OutAttribute] Result of the subtraction.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.ToString Method
Retrieves a string representation of the current object.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String that represents the object.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.Transform Method
Transforms a Matrix by applying a Quaternion rotation.
Overload List
Name Description
Matrix.Transform (Matrix, Quaternion) Transforms a Matrix by applying a Quaternion rotation.
Matrix.Transform (Matrix, Quaternion, Matrix) Transforms a Matrix by applying a Quaternion rotation.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value
The Matrix to transform.
rotation
The rotation to apply, expressed as a Quaternion.
Return Value
A new Matrix that is the result of the transform.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The Matrix to transform.
rotation
The rotation to apply, expressed as a Quaternion.
result
[OutAttribute] An existing Matrix filled in with the result of the transform.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.Transpose Method
Transposes the rows and columns of a matrix.
Overload List
Name Description
Matrix.Transpose (Matrix) Transposes the rows and columns of a matrix.
Matrix.Transpose (Matrix, Matrix) Transposes the rows and columns of a matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
matrix
Source matrix.
Return Value
Transposed matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
matrix
Source matrix.
result
[OutAttribute] Transposed matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix Properties
Public Properties
Name Description
Backward Gets and sets the backward vector of the Matrix.
Down Gets and sets the down vector of the Matrix.
Forward Gets and sets the forward vector of the Matrix.
Identity Returns an instance of the identity matrix.
Left Gets and sets the left vector of the Matrix.
Right Gets and sets the right vector of the Matrix.
Translation Gets and sets the translation vector of the Matrix.
Up Gets and sets the up vector of the Matrix.
See Also
Reference
Matrix Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Matrix.Backward Property
Gets and sets the backward vector of the Matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Backward { get; set; }
Property Value
The backward vector of the Matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Position the Camera to View All Objects in a Scene
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.Down Property
Gets and sets the down vector of the Matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Down { get; set; }
Property Value
The down vector of the Matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.Forward Property
Gets and sets the forward vector of the Matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Forward { get; set; }
Property Value
The forward vector of the Matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.Identity Property
Returns an instance of the identity matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Matrix Identity { get; }
Property Value
The identity matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.Left Property
Gets and sets the left vector of the Matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Left { get; set; }
Property Value
The left vector of the Matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.Right Property
Gets and sets the right vector of the Matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Right { get; set; }
Property Value
The right vector of the Matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.Translation Property
Gets and sets the translation vector of the Matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Translation { get; set; }
Property Value
The translation vector of the Matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Matrix.Up Property
Gets and sets the up vector of the Matrix.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Up { get; set; }
Property Value
The up vector of the Matrix.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NoSuitableGraphicsDeviceException Class
Thrown when no available graphics device fits the given device preferences.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public class NoSuitableGraphicsDeviceException : ApplicationException
See Also
Reference
NoSuitableGraphicsDeviceException Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NoSuitableGraphicsDeviceException Members
The following tables list the members exposed by the NoSuitableGraphicsDeviceException type.
Public Constructors
Name Description
NoSuitableGraphicsDeviceException Overloaded. Initializes a new instance of this class.
Public Properties
Name Description
Data (Inherited from Exception.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
NoSuitableGraphicsDeviceException Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
NoSuitableGraphicsDeviceException Constructor
Initializes a new instance of this class.
Overload List
Name Description
NoSuitableGraphicsDeviceException (String) Initializes a new instance of this class with a specified error message.
NoSuitableGraphicsDeviceException (String, Exception) Initializes a new instance of this class with a specified error message an
d a reference to the inner exception that is the cause of this exception.
See Also
Reference
NoSuitableGraphicsDeviceException Class
NoSuitableGraphicsDeviceException Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
message
A message that describes the error.
See Also
Reference
NoSuitableGraphicsDeviceException Class
NoSuitableGraphicsDeviceException Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
message
A message that describes the error.
inner
The exception that is the cause of the current exception. If the inner parameter is not a null reference, the current exception is
raised in a catch block that handles the inner exception.
See Also
Reference
NoSuitableGraphicsDeviceException Class
NoSuitableGraphicsDeviceException Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NoSuitableGraphicsDeviceException Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
NoSuitableGraphicsDeviceException Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
NoSuitableGraphicsDeviceException Properties
Public Properties
Name Description
Data (Inherited from Exception.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
See Also
Reference
NoSuitableGraphicsDeviceException Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Plane Structure
Defines a plane.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[TypeConverterAttribute("typeof(Microsoft.Xna.Framework.Design.PlaneConverter)")]
[SerializableAttribute]
public struct Plane : IEquatable<Plane>
Remarks
The Plane structure represents a plane using a 3D vector normal and a distance value, as the following figure shows.
See Also
Reference
Plane Members
Microsoft.Xna.Framework Namespace
Programming Guide
Math Overview
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Plane Members
The following tables list the members exposed by the Plane type.
Public Constructors
Name Description
Plane Overloaded. Creates an instance of Plane.
Public Fields
Name Description
D The distance of the Plane along its normal from the origin.
Normal The normal vector of the Plane.
Public Methods
Name Description
Dot Overloaded. Calculates the dot product of a specified Vector4 and this Plane.
DotCoordinate Overloaded. Returns the dot product of a specified Vector3 and the Normal vector of this Plane plus the
D constant value of the
Plane
.
DotNormal Overloaded. Returns the dot product of a specified Vector3 and the Normal vector of this Plane.
Equals Overloaded. Determines whether two instances of Plane are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
Intersects Overloaded. Checks whether a Plane intersects a bounding volume.
Normalize Overloaded. Changes the coefficients of the Normal vector of a Plane to make it of unit length.
op_Equality Determines whether two instances of Plane are equal.
op_Inequality Determines whether two instances of Plane are not equal.
ReferenceEquals (Inherited from Object.)
ToString Returns a String that represents the current Plane.
Transform Overloaded. Transforms a normalized Plane by a Matrix or Quaternion.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Plane Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Plane Fields
Public Fields
Name Description
D The distance of the Plane along its normal from the origin.
Normal The normal vector of the Plane.
See Also
Reference
Plane Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Plane.D Field
The distance of the Plane along its normal from the origin.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float D
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Plane.Normal Field
The normal vector of the Plane.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Normal
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Plane Constructor
Creates an instance of Plane.
Overload List
Name Description
Plane (Single, Single, Single, Single) Creates a new instance of Plane.
Plane (Vector3, Single) Creates a new instance of Plane.
Plane (Vector3, Vector3, Vector3) Creates a new instance of Plane.
Plane (Vector4) Creates a new instance of Plane.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
a
X component of the normal defining the Plane.
b
Y component of the normal defining the Plane.
c
Z component of the normal defining the Plane.
d
Distance of the Plane along its normal from the origin.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
normal
The normal vector to the Plane.
d
The Plane's distance along its normal from the origin.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
point1
One point of a triangle defining the Plane.
point2
One point of a triangle defining the Plane.
point3
One point of a triangle defining the Plane.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
Vector4 with X, Y, and Z components defining the normal of the Plane. The W component defines the distance of the Plane
along the normal from the origin.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Plane Methods
Public Methods
Name Description
Dot Overloaded. Calculates the dot product of a specified Vector4 and this Plane.
DotCoordinate Overloaded. Returns the dot product of a specified Vector3 and the Normal vector of this Plane plus the
D constant value of the
Plane
.
DotNormal Overloaded. Returns the dot product of a specified Vector3 and the Normal vector of this Plane.
Equals Overloaded. Determines whether two instances of Plane are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
Intersects Overloaded. Checks whether a Plane intersects a bounding volume.
Normalize Overloaded. Changes the coefficients of the Normal vector of a Plane to make it of unit length.
op_Equality Determines whether two instances of Plane are equal.
op_Inequality Determines whether two instances of Plane are not equal.
ReferenceEquals (Inherited from Object.)
ToString Returns a String that represents the current Plane.
Transform Overloaded. Transforms a normalized Plane by a Matrix or Quaternion.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Plane Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Plane.Dot Method
Calculates the dot product of a specified Vector4 and this Plane.
Overload List
Name Description
Plane.Dot (Vector4) Calculates the dot product of a specified Vector4 and this Plane.
Plane.Dot (Vector4, Single) Calculates the dot product of a specified Vector4 and this Plane.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value
The Vector4 to multiply this Plane by.
Return Value
The dot product of the specified Vector4 and this Plane.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The Vector4 to multiply this Plane by.
result
[OutAttribute] The dot product of the specified Vector4 and this Plane.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Plane.DotCoordinate Method
Returns the dot product of a specified Vector3 and the Normal vector of this Plane plus the D constant value of the Plane.
Overload List
Name Description
Plane.DotCoordinate (Vector3) Returns the dot product of a specified Vector3 and the Normal vector of this Plane plus
the distance (D) value of the Plane.
Plane.DotCoordinate (Vector3, Single) Returns the dot product of a specified Vector3 and the Normal vector of this Plane plus
the distance (D) value of the Plane.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value
The Vector3 to multiply by.
Return Value
The resulting value.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The Vector3 to multiply by.
result
[OutAttribute] The resulting value.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Plane.DotNormal Method
Returns the dot product of a specified Vector3 and the Normal vector of this Plane.
Overload List
Name Description
Plane.DotNormal (Vector3) Returns the dot product of a specified Vector3 and the Normal vector of this Plane.
Plane.DotNormal (Vector3, Single) Returns the dot product of a specified Vector3 and the Normal vector of this Plane.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value
The Vector3 to multiply by.
Return Value
The resulting dot product.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The Vector3 to multiply by.
result
[OutAttribute] The resulting dot product.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Plane.Equals Method
Determines whether two instances of Plane are equal.
Overload List
Name Description
Plane.Equals (Object) Determines whether the specified Object is equal to the Plane.
Plane.Equals (Plane) Determines whether the specified Plane is equal to the Plane.
Plane.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
obj
The Object to compare with the current Plane.
Return Value
true if the specified Object is equal to the current Plane; false otherwise.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
other
The Plane to compare with the current Plane.
Return Value
true if the specified Plane is equal to the current Plane; false otherwise.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Plane.GetHashCode Method
Gets the hash code for this object.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
A hash code for the current Plane.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Plane.Intersects Method
Checks whether a Plane intersects a bounding volume.
Overload List
Name Description
Plane.Intersects (BoundingBox) Checks whether the current Plane intersects a specified
BoundingBox.
Plane.Intersects (BoundingBox, PlaneIntersectionType) Checks whether the current Plane intersects a BoundingBox.
Plane.Intersects (BoundingFrustum) Checks whether the current Plane intersects a specified
BoundingFrustum.
Plane.Intersects (BoundingSphere) Checks whether the current Plane intersects a specified
BoundingSphere.
Plane.Intersects (BoundingSphere, PlaneIntersectionType) Checks whether the current Plane intersects a BoundingSphere.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
box
The BoundingBox to test for intersection with.
Return Value
An enumeration indicating the relationship between the Plane and the BoundingBox.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
box
The BoundingBox to check for intersection with.
result
[OutAttribute] An enumeration indicating whether the Plane intersects the BoundingBox.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
frustum
The BoundingFrustum to check for intersection with.
Return Value
An enumeration indicating the relationship between the Plane and the BoundingFrustum.
Exceptions
Exception type Condition
ArgumentNullException frustum is null.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sphere
The BoundingSphere to check for intersection with.
Return Value
An enumeration indicating the relationship between the Plane and the BoundingSphere.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sphere
The BoundingSphere to check for intersection with.
result
[OutAttribute] An enumeration indicating whether the Plane intersects the BoundingSphere.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Plane.Normalize Method
Changes the coefficients of the Normal vector of a Plane to make it of unit length.
Overload List
Name Description
Plane.Normalize () Changes the coefficients of the Normal vector of this Plane to make it of unit length.
Plane.Normalize (Plane) Changes the coefficients of the Normal vector of a Plane to make it of unit length.
Plane.Normalize (Plane, Plane) Changes the coefficients of the Normal vector of a Plane to make it of unit length.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Plane.Normalize Method ()
Changes the coefficients of the Normal vector of this Plane to make it of unit length.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Normalize ()
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The Plane to normalize.
Return Value
A new Plane with a normal having unit length.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The Plane to normalize.
result
[OutAttribute] An existing plane Plane filled in with a normalized version of the specified plane.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Plane.op_Equality Method
Determines whether two instances of Plane are equal.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
Plane lhs,
Plane rhs
)
Parameters
lhs
The object to the left of the equality operator.
rhs
The object to the right of the equality operator.
Return Value
true if left is equal to right; false otherwise.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Plane.op_Inequality Method
Determines whether two instances of Plane are not equal.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
Plane lhs,
Plane rhs
)
Parameters
lhs
The object to the left of the inequality operator.
rhs
The object to the right of the inequality operator.
Return Value
true if left is not equal to right; false otherwise.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Plane.ToString Method
Returns a String that represents the current Plane.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of the current Plane.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Plane.Transform Method
Transforms a normalized Plane by a Matrix or Quaternion.
Overload List
Name Description
Plane.Transform (Plane, Matrix) Transforms a normalized Plane by a Matrix.
Plane.Transform (Plane, Matrix, Plane) Transforms a normalized Plane by a Matrix.
Plane.Transform (Plane, Quaternion) Transforms a normalized Plane by a Quaternion rotation.
Plane.Transform (Plane, Quaternion, Plane) Transforms a normalized Plane by a Quaternion rotation.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
plane
The normalized Plane to transform. This Plane must already be normalized, so that its Normal vector is of unit length, before
this method is called.
matrix
The transform Matrix to apply to the Plane.
Return Value
A new Plane that results from applying the transform.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
plane
The normalized Plane to transform. This Plane must already be normalized, so that its Normal vector is of unit length, before
this method is called.
matrix
The transform Matrix to apply to the Plane.
result
[OutAttribute] An existing Plane filled in with the results of applying the transform.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
plane
The normalized Plane to transform. This Plane must already be normalized, so that its Normal vector is of unit length, before
this method is called.
rotation
The Quaternion rotation to apply to the Plane.
Return Value
A new Plane that results from applying the rotation.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
plane
The normalized Plane to transform. This Plane must already be normalized, so that its Normal vector is of unit length, before
this method is called.
rotation
The Quaternion rotation to apply to the Plane.
result
[OutAttribute] An existing Plane filled in with the results of applying the rotation.
See Also
Reference
Plane Structure
Plane Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PlaneIntersectionType Enumeration
Describes the intersection between a plane and a bounding volume.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum PlaneIntersectionType
Members
Member name Description
Back There is no intersection, and the bounding volume is in the negative half-space of the Plane.
Front There is no intersection, and the bounding volume is in the positive half-space of the Plane.
Intersecting The Plane is intersected.
See Also
Reference
Microsoft.Xna.Framework Namespace
Programming Guide
Math Overview
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PlayerIndex Enumeration
Specifies the index of a player.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum PlayerIndex
Members
Member name Description
One The first player.
Two The second player.
Three The third player.
Four The fourth player.
See Also
Reference
Microsoft.Xna.Framework Namespace
Programming Guide
Application Model Overview
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Point Structure
Defines a point in 2D space.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[TypeConverterAttribute("typeof(Microsoft.Xna.Framework.Design.PointConverter)")]
[SerializableAttribute]
public struct Point : IEquatable<Point>
See Also
Reference
Point Members
Microsoft.Xna.Framework Namespace
Programming Guide
Math Overview
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Point Members
The following tables list the members exposed by the Point type.
Public Constructors
Name Description
Point Initializes a new instance of Point.
Public Fields
Name Description
X Specifies the x-coordinate of the Point.
Y Specifies the y-coordinate of the Point.
Public Properties
Name Description
Zero Returns the point (0,0).
Public Methods
Name Description
Equals Overloaded. Determines whether two Point instances are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two Point instances are equal.
op_Inequality Determines whether two Point instances are not equal.
ReferenceEquals (Inherited from Object.)
ToString Returns a String that represents the current Point.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Point Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Point Fields
Public Fields
Name Description
X Specifies the x-coordinate of the Point.
Y Specifies the y-coordinate of the Point.
See Also
Reference
Point Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Point.X Field
Specifies the x-coordinate of the Point.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int X
See Also
Reference
Point Structure
Point Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Point.Y Field
Specifies the y-coordinate of the Point.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Y
See Also
Reference
Point Structure
Point Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Point Constructor
Initializes a new instance of Point.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Point (
int x,
int y
)
Parameters
x
The x-coordinate of the Point.
y
The y-coordinate of the Point.
See Also
Reference
Point Structure
Point Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Point Methods
Public Methods
Name Description
Equals Overloaded. Determines whether two Point instances are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two Point instances are equal.
op_Inequality Determines whether two Point instances are not equal.
ReferenceEquals (Inherited from Object.)
ToString Returns a String that represents the current Point.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Point Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Point.Equals Method
Determines whether two Point instances are equal.
Overload List
Name Description
Point.Equals (Object) Determines whether two Point instances are equal.
Point.Equals (Point) Determines whether two Point instances are equal.
Point.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
Point Structure
Point Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
obj
The object to compare this instance to.
Return Value
true if the instances are equal; false otherwise.
See Also
Reference
Point Structure
Point Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
other
The Point to compare this instance to.
Return Value
true if the instances are equal; false otherwise.
See Also
Reference
Point Structure
Point Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Point.GetHashCode Method
Gets the hash code for this object.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
The hash code for this object.
See Also
Reference
Point Structure
Point Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Point.op_Equality Method
Determines whether two Point instances are equal.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
Point a,
Point b
)
Parameters
a
Point on the left side of the equal sign.
b
Point on the right side of the equal sign.
Return Value
true if a and bare equal; false otherwise.
See Also
Reference
Point Structure
Point Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Point.op_Inequality Method
Determines whether two Point instances are not equal.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
Point a,
Point b
)
Parameters
a
The Point on the left side of the equal sign.
b
The Point on the right side of the equal sign.
Return Value
true if the instances are not equal; false otherwise.
See Also
Reference
Point Structure
Point Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Point.ToString Method
Returns a String that represents the current Point.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
A String that represents the current Point.
See Also
Reference
Point Structure
Point Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Point Properties
Public Properties
Name Description
Zero Returns the point (0,0).
See Also
Reference
Point Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Point.Zero Property
Returns the point (0,0).
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Point Zero { get; }
Property Value
The point (0,0).
See Also
Reference
Point Structure
Point Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PreparingDeviceSettingsEventArgs Class
Arguments for the GraphicsDeviceManager.PreparingDeviceSettings event.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public class PreparingDeviceSettingsEventArgs : EventArgs
See Also
Reference
PreparingDeviceSettingsEventArgs Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PreparingDeviceSettingsEventArgs Members
The following tables list the members exposed by the PreparingDeviceSettingsEventArgs type.
Public Constructors
Name Description
PreparingDeviceSettingsEventArgs Creates a new instance of PreparingDeviceSettingsEventArgs.
Public Properties
Name Description
GraphicsDeviceInformation Information about the GraphicsDevice.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
PreparingDeviceSettingsEventArgs Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
PreparingDeviceSettingsEventArgs Constructor
Creates a new instance of PreparingDeviceSettingsEventArgs.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public PreparingDeviceSettingsEventArgs (
GraphicsDeviceInformation graphicsDeviceInformation
)
Parameters
graphicsDeviceInformation
Information about the GraphicsDevice.
See Also
Reference
PreparingDeviceSettingsEventArgs Class
PreparingDeviceSettingsEventArgs Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PreparingDeviceSettingsEventArgs Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
PreparingDeviceSettingsEventArgs Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
PreparingDeviceSettingsEventArgs Properties
Public Properties
Name Description
GraphicsDeviceInformation Information about the GraphicsDevice.
See Also
Reference
PreparingDeviceSettingsEventArgs Class
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
PreparingDeviceSettingsEventArgs.GraphicsDeviceInformation
Property
Information about the GraphicsDevice.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)
Syntax
C#
public GraphicsDeviceInformation GraphicsDeviceInformation { get; }
Property Value
Information about the GraphicsDevice.
See Also
Reference
PreparingDeviceSettingsEventArgs Class
PreparingDeviceSettingsEventArgs Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion Structure
Defines a quaternion.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[TypeConverterAttribute("typeof(Microsoft.Xna.Framework.Design.QuaternionConverter)")]
[SerializableAttribute]
public struct Quaternion : IEquatable<Quaternion>
Remarks Quaternions represent a rotation and are typically used for smooth interpolation between two angles and for
avoiding the gimbal lock problem that can occur with euler angles.
See Also
Reference
Quaternion Members
Microsoft.Xna.Framework Namespace
Programming Guide
Math Overview
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion Members
The following tables list the members exposed by the Quaternion type.
Public Constructors
Name Description
Quaternion Overloaded. Initializes a new instance of Quaternion.
Public Fields
Name Description
W Specifies the rotation component of the quaternion.
X Specifies the x-value of the vector component of the quaternion.
Y Specifies the y-value of the vector component of the quaternion.
Z Specifies the z-value of the vector component of the quaternion.
Public Properties
Name Description
Identity Returns a Quaternion representing no rotation.
Public Methods
Name Description
Add Overloaded. Adds two Quaternions.
Concatenate Overloaded. Concatenates two Quaternions; the result represents the first rotation followed by
the second rotation.
Conjugate Overloaded. Calculates the conjugate of a Quaternion.
CreateFromAxisAngle Overloaded. Creates a Quaternion from a vector and an angle to rotate about the vector.
CreateFromRotationMatrix Overloaded. Creates a Quaternion from a rotation Matrix.
CreateFromYawPitchRoll Overloaded. Creates a new Quaternion from specified yaw, pitch, and roll angles.
Divide Overloaded. Divides a Quaternion by another Quaternion.
Dot Overloaded. Calculates the dot product of two Quaternions.
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified
object.
GetHashCode Get the hash code of this object.
GetType (Inherited from Object.)
Inverse Overloaded. Returns the inverse of a Quaternion.
Length Calculates the length of a Quaternion.
LengthSquared Calculates the length squared of a Quaternion.
Lerp Overloaded. Linearly interpolates between two quaternions.
Multiply Overloaded. Multiplies a quaternion by a scalar or another quaternion.
Negate Overloaded. Flips the sign of each component of the quaternion.
Normalize Overloaded. Divides each component of a quaternion by the length of the quaternion.
op_Addition Adds two Quaternions.
op_Division Divides a Quaternion by another Quaternion.
op_Equality Compares two Quaternions for equality.
op_Inequality Compare two Quaternions for inequality.
op_Multiply Overloaded. Multiplies a quaternion by a scalar or another quaternion.
op_Subtraction Subtracts a quaternion from another quaternion.
op_UnaryNegation Flips the sign of each component of the quaternion.
ReferenceEquals (Inherited from Object.)
Slerp Overloaded. Interpolates between two quaternions, using spherical linear interpolation.
Subtract Overloaded. Subtracts a quaternion from another quaternion.
ToString Retireves a string representation of the current object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Quaternion Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Quaternion Fields
Public Fields
Name Description
W Specifies the rotation component of the quaternion.
X Specifies the x-value of the vector component of the quaternion.
Y Specifies the y-value of the vector component of the quaternion.
Z Specifies the z-value of the vector component of the quaternion.
See Also
Reference
Quaternion Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Quaternion.W Field
Specifies the rotation component of the quaternion.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float W
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.X Field
Specifies the x-value of the vector component of the quaternion.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float X
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.Y Field
Specifies the y-value of the vector component of the quaternion.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float Y
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.Z Field
Specifies the z-value of the vector component of the quaternion.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float Z
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion Constructor
Initializes a new instance of Quaternion.
Overload List
Name Description
Quaternion (Single, Single, Single, Single) Initializes a new instance of Quaternion.
Quaternion (Vector3, Single) Initializes a new instance of Quaternion.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
x
The x-value of the quaternion.
y
The y-value of the quaternion.
z
The z-value of the quaternion.
w
The w-value of the quaternion.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vectorPart
The vector component of the quaternion.
scalarPart
The rotation component of the quaternion.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion Methods
Public Methods
Name Description
Add Overloaded. Adds two Quaternions.
Concatenate Overloaded. Concatenates two Quaternions; the result represents the first rotation followed by
the second rotation.
Conjugate Overloaded. Calculates the conjugate of a Quaternion.
CreateFromAxisAngle Overloaded. Creates a Quaternion from a vector and an angle to rotate about the vector.
CreateFromRotationMatrix Overloaded. Creates a Quaternion from a rotation Matrix.
CreateFromYawPitchRoll Overloaded. Creates a new Quaternion from specified yaw, pitch, and roll angles.
Divide Overloaded. Divides a Quaternion by another Quaternion.
Dot Overloaded. Calculates the dot product of two Quaternions.
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified
object.
GetHashCode Get the hash code of this object.
GetType (Inherited from Object.)
Inverse Overloaded. Returns the inverse of a Quaternion.
Length Calculates the length of a Quaternion.
LengthSquared Calculates the length squared of a Quaternion.
Lerp Overloaded. Linearly interpolates between two quaternions.
Multiply Overloaded. Multiplies a quaternion by a scalar or another quaternion.
Negate Overloaded. Flips the sign of each component of the quaternion.
Normalize Overloaded. Divides each component of a quaternion by the length of the quaternion.
op_Addition Adds two Quaternions.
op_Division Divides a Quaternion by another Quaternion.
op_Equality Compares two Quaternions for equality.
op_Inequality Compare two Quaternions for inequality.
op_Multiply Overloaded. Multiplies a quaternion by a scalar or another quaternion.
op_Subtraction Subtracts a quaternion from another quaternion.
op_UnaryNegation Flips the sign of each component of the quaternion.
ReferenceEquals (Inherited from Object.)
Slerp Overloaded. Interpolates between two quaternions, using spherical linear interpolation.
Subtract Overloaded. Subtracts a quaternion from another quaternion.
ToString Retireves a string representation of the current object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Quaternion Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Quaternion.Add Method
Adds two Quaternions.
Overload List
Name Description
Quaternion.Add (Quaternion, Quaternion) Adds two Quaternions.
Quaternion.Add (Quaternion, Quaternion, Quaternion) Adds two Quaternions.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
quaternion1
Quaternion to add.
quaternion2
Quaternion to add.
Return Value
Result of adding the Quaternions.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
quaternion1
Quaternion to add.
quaternion2
Quaternion to add.
result
[OutAttribute] Result of adding the Quaternions.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.Concatenate Method
Concatenates two Quaternions; the result represents the first rotation followed by the second rotation.
Overload List
Name Description
Quaternion.Concatenate (Quaternion, Quaternion) Concatenates two Quaternions; the result represents the value
1 rotation followed by the value2 rotation.
Quaternion.Concatenate (Quaternion, Quaternion, Quaternion) Concatenates two Quaternions; the result represents the value
1 rotation followed by the value2 rotation.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
The first Quaternion rotation in the series.
value2
The second Quaternion rotation in the series.
Return Value
A new Quaternion representing the concatenation of the value1 rotation followed by the value2 rotation.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
The first Quaternion rotation in the series.
value2
The second Quaternion rotation in the series.
result
[OutAttribute] The Quaternion rotation representing the concatenation of value1 followed by value2.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.Conjugate Method
Calculates the conjugate of a Quaternion.
Overload List
Name Description
Quaternion.Conjugate () Transforms this Quaternion into its conjugate.
Quaternion.Conjugate (Quaternion) Returns the conjugate of a specified Quaternion.
Quaternion.Conjugate (Quaternion, Quaternion) Returns the conjugate of a specified Quaternion.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Quaternion.Conjugate Method ()
Transforms this Quaternion into its conjugate.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Conjugate ()
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The Quaternion of which to return the conjugate.
Return Value
A new Quaternion that is the conjugate of the specified one.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The Quaternion of which to return the conjugate.
result
[OutAttribute] An existing Quaternion filled in to be the conjugate of the specified one.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.CreateFromAxisAngle Method
Creates a Quaternion from a vector and an angle to rotate about the vector.
Overload List
Name Description
Quaternion.CreateFromAxisAngle (Vector3, Single) Creates a Quaternion from a vector and an angle to rotate abo
ut the vector.
Quaternion.CreateFromAxisAngle (Vector3, Single, Quaternion) Creates a Quaternion from a vector and an angle to rotate abo
ut the vector.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
axis
The vector to rotate around.
angle
The angle to rotate around the vector.
Return Value
The created Quaternion.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
axis
The vector to rotate around.
angle
The angle to rotate around the vector.
result
[OutAttribute] The created Quaternion.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.CreateFromRotationMatrix Method
Creates a Quaternion from a rotation Matrix.
Overload List
Name Description
Quaternion.CreateFromRotationMatrix (Matrix) Creates a Quaternion from a rotation Matrix.
Quaternion.CreateFromRotationMatrix (Matrix, Quaternion) Creates a Quaternion from a rotation Matrix.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
matrix
The rotation Matrix to create the Quaternion from.
Return Value
The created Quaternion.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
matrix
The rotation Matrix to create the Quaternion from.
result
[OutAttribute] The created Quaternion.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.CreateFromYawPitchRoll Method
Creates a new Quaternion from specified yaw, pitch, and roll angles.
Overload List
Name Description
Quaternion.CreateFromYawPitchRoll (Single, Single, Single) Creates a new Quaternion from specified yaw, pitch, a
nd roll angles.
Quaternion.CreateFromYawPitchRoll (Single, Single, Single, Quaternion) Creates a new Quaternion from specified yaw, pitch, a
nd roll angles.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
yaw
The yaw angle, in radians, around the y-axis.
pitch
The pitch angle, in radians, around the x-axis.
roll
The roll angle, in radians, around the z-axis.
Return Value
A new Quaternion expressing the specified yaw, pitch, and roll angles.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
yaw
The yaw angle, in radians, around the y-axis.
pitch
The pitch angle, in radians, around the x-axis.
roll
The roll angle, in radians, around the z-axis.
result
[OutAttribute] An existing Quaternion filled in to express the specified yaw, pitch, and roll angles.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.Divide Method
Divides a Quaternion by another Quaternion.
Overload List
Name Description
Quaternion.Divide (Quaternion, Quaternion) Divides a Quaternion by another Quaternion.
Quaternion.Divide (Quaternion, Quaternion, Quaternion) Divides a Quaternion by another Quaternion.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
quaternion1
Source Quaternion.
quaternion2
The divisor.
Return Value
Result of the division.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
quaternion1
Source Quaternion.
quaternion2
The divisor.
result
[OutAttribute] Result of the division.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.Dot Method
Calculates the dot product of two Quaternions.
Overload List
Name Description
Quaternion.Dot (Quaternion, Quaternion) Calculates the dot product of two Quaternions.
Quaternion.Dot (Quaternion, Quaternion, Single) Calculates the dot product of two Quaternions.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
quaternion1
Source Quaternion.
quaternion2
Source Quaternion.
Return Value
Dot product of the Quaternions.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
quaternion1
Source Quaternion.
quaternion2
Source Quaternion.
result
[OutAttribute] Dot product of the Quaternions.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
Quaternion.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
Quaternion.Equals (Quaternion) Determines whether the specified Object is equal to the Quaternion.
Quaternion.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
obj
Object to make the comparison with.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
other
The Quaternion to compare with the current Quaternion.
Return Value
true if the specified Object is equal to the current Quaternion; false otherwise.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.GetHashCode Method
Get the hash code of this object.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
The hash code for this object.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.Inverse Method
Returns the inverse of a Quaternion.
Overload List
Name Description
Quaternion.Inverse (Quaternion) Returns the inverse of a Quaternion.
Quaternion.Inverse (Quaternion, Quaternion) Returns the inverse of a Quaternion.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
quaternion
Source Quaternion.
Return Value
The inverse of the Quaternion.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
quaternion
Source Quaternion.
result
[OutAttribute] The inverse of the Quaternion.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.Length Method
Calculates the length of a Quaternion.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float Length ()
Return Value
The length of the Quaternion.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.LengthSquared Method
Calculates the length squared of a Quaternion.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float LengthSquared ()
Return Value
The length squared of the Quaternion.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.Lerp Method
Linearly interpolates between two quaternions.
Overload List
Name Description
Quaternion.Lerp (Quaternion, Quaternion, Single) Linearly interpolates between two quaternions.
Quaternion.Lerp (Quaternion, Quaternion, Single, Quaternion) Linearly interpolates between two quaternions.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
quaternion1
Source quaternion.
quaternion2
Source quaternion.
amount
Value indicating how far to interpolate between the quaternions.
Return Value
The resulting quaternion.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
quaternion1
Source quaternion.
quaternion2
Source quaternion.
amount
Value indicating how far to interpolate between the quaternions.
result
[OutAttribute] The resulting quaternion.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.Multiply Method
Multiplies a quaternion by a scalar or another quaternion.
Overload List
Name Description
Quaternion.Multiply (Quaternion, Quaternion) Multiplies two quaternions.
Quaternion.Multiply (Quaternion, Quaternion, Quaternion) Multiplies two quaternions.
Quaternion.Multiply (Quaternion, Single) Multiplies a quaternion by a scalar value.
Quaternion.Multiply (Quaternion, Single, Quaternion) Multiplies a quaternion by a scalar value.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
quaternion1
The quaternion on the left of the multiplication.
quaternion2
The quaternion on the right of the multiplication.
Return Value
The result of the multiplication.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
quaternion1
The quaternion on the left of the multiplication.
quaternion2
The quaternion on the right of the multiplication.
result
[OutAttribute] The result of the multiplication.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
quaternion1
Source quaternion.
scaleFactor
Scalar value.
Return Value
The result of the multiplication.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
quaternion1
Source quaternion.
scaleFactor
Scalar value.
result
[OutAttribute] The result of the multiplication.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.Negate Method
Flips the sign of each component of the quaternion.
Overload List
Name Description
Quaternion.Negate (Quaternion) Flips the sign of each component of the quaternion.
Quaternion.Negate (Quaternion, Quaternion) Flips the sign of each component of the quaternion.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
quaternion
Source quaternion.
Return Value
Negated quaternion.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
quaternion
Source quaternion.
result
[OutAttribute] Negated quaternion.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.Normalize Method
Divides each component of a quaternion by the length of the quaternion.
Overload List
Name Description
Quaternion.Normalize () Divides each component of the quaternion by the length of the quaternion.
Quaternion.Normalize (Quaternion) Divides each component of the quaternion by the length of the quaternion.
Quaternion.Normalize (Quaternion, Quaternion) Divides each component of the quaternion by the length of the quaternion.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Quaternion.Normalize Method ()
Divides each component of the quaternion by the length of the quaternion.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Normalize ()
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
quaternion
Source quaternion.
Return Value
Normalized quaternion.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
quaternion
Source quaternion.
result
[OutAttribute] Normalized quaternion.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.op_Addition Method
Adds two Quaternions.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Quaternion op_Addition (
Quaternion quaternion1,
Quaternion quaternion2
)
Parameters
quaternion1
Quaternion to add.
quaternion2
Quaternion to add.
Return Value
Result of adding the Quaternions.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.op_Division Method
Divides a Quaternion by another Quaternion.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Quaternion op_Division (
Quaternion quaternion1,
Quaternion quaternion2
)
Parameters
quaternion1
Source Quaternion.
quaternion2
The divisor.
Return Value
Result of the division.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.op_Equality Method
Compares two Quaternions for equality.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
Quaternion quaternion1,
Quaternion quaternion2
)
Parameters
quaternion1
Source Quaternion.
quaternion2
Source Quaternion.
Return Value
true if the Quaternions are equal, false otherwise.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.op_Inequality Method
Compare two Quaternions for inequality.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
Quaternion quaternion1,
Quaternion quaternion2
)
Parameters
quaternion1
Source Quaternion.
quaternion2
Source Quaternion.
Return Value
true if the Quaternions are not equal; false otherwise.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.op_Multiply Method
Multiplies a quaternion by a scalar or another quaternion.
Overload List
Name Description
Quaternion.op_Multiply (Quaternion, Quaternion) Multiplies two quaternions.
Quaternion.op_Multiply (Quaternion, Single) Multiplies a quaternion by a scalar value.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
quaternion1
Source quaternion.
quaternion2
Source quaternion.
Return Value
The result of the multiplication.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
quaternion1
Source quaternion.
scaleFactor
Scalar value.
Return Value
The result of the multiplication.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.op_Subtraction Method
Subtracts a quaternion from another quaternion.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Quaternion op_Subtraction (
Quaternion quaternion1,
Quaternion quaternion2
)
Parameters
quaternion1
Source quaternion.
quaternion2
Source quaternion.
Return Value
Result of the subtraction.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.op_UnaryNegation Method
Flips the sign of each component of the quaternion.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Quaternion op_UnaryNegation (
Quaternion quaternion
)
Parameters
quaternion
Source quaternion.
Return Value
Negated quaternion.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.Slerp Method
Interpolates between two quaternions, using spherical linear interpolation.
Overload List
Name Description
Quaternion.Slerp (Quaternion, Quaternion, Single) Interpolates between two quaternions, using spherical linear in
terpolation.
Quaternion.Slerp (Quaternion, Quaternion, Single, Quaternion) Interpolates between two quaternions, using spherical linear in
terpolation.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
quaternion1
Source quaternion.
quaternion2
Source quaternion.
amount
Value that indicates how far to interpolate between the quaternions.
Return Value
Result of the interpolation.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
quaternion1
Source quaternion.
quaternion2
Source quaternion.
amount
Value that indicates how far to interpolate between the quaternions.
result
[OutAttribute] Result of the interpolation.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.Subtract Method
Subtracts a quaternion from another quaternion.
Overload List
Name Description
Quaternion.Subtract (Quaternion, Quaternion) Subtracts a quaternion from another quaternion.
Quaternion.Subtract (Quaternion, Quaternion, Quaternion) Subtracts a quaternion from another quaternion.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
quaternion1
Source quaternion.
quaternion2
Source quaternion.
Return Value
Result of the subtraction.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
quaternion1
Source quaternion.
quaternion2
Source quaternion.
result
[OutAttribute] Result of the subtraction.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion.ToString Method
Retireves a string representation of the current object.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String that represents the object.
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Quaternion Properties
Public Properties
Name Description
Identity Returns a Quaternion representing no rotation.
See Also
Reference
Quaternion Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Quaternion.Identity Property
Returns a Quaternion representing no rotation.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Quaternion Identity { get; }
Property Value
The identity Quaternion (0,0,0,1).
See Also
Reference
Quaternion Structure
Quaternion Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Ray Structure
Defines a ray.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[TypeConverterAttribute("typeof(Microsoft.Xna.Framework.Design.RayConverter)")]
[SerializableAttribute()]
public struct Ray : IEquatable<Ray>
See Also
Reference
Ray Members
Microsoft.Xna.Framework Namespace
Programming Guide
Math Overview
How To: Detect Whether a User Clicked a 3D Object
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Ray Members
The following tables list the members exposed by the Ray type.
Public Constructors
Name Description
Ray Creates a new instance of Ray.
Public Fields
Name Description
Direction Unit vector specifying the direction the Ray is pointing.
Position Specifies the starting point of the Ray.
Public Methods
Name Description
Equals Overloaded. Determines whether two instances of Ray are equal.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
Intersects Overloaded. Checks whether the Ray intersects a specified plane or bounding volume.
op_Equality Determines whether two instances of Ray are equal.
op_Inequality Determines whether two instances of Ray are not equal.
ReferenceEquals (Inherited from Object.)
ToString Returns a String that represents the current Ray.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Ray Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Ray Fields
Public Fields
Name Description
Direction Unit vector specifying the direction the Ray is pointing.
Position Specifies the starting point of the Ray.
See Also
Reference
Ray Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Ray.Direction Field
Unit vector specifying the direction the Ray is pointing.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Direction
See Also
Reference
Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Ray.Position Field
Specifies the starting point of the Ray.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Position
See Also
Reference
Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Ray Constructor
Creates a new instance of Ray.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Ray (
Vector3 position,
Vector3 direction
)
Parameters
position
The starting point of the Ray.
direction
Unit vector describing the direction of the Ray.
See Also
Reference
Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Ray Methods
Public Methods
Name Description
Equals Overloaded. Determines whether two instances of Ray are equal.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
Intersects Overloaded. Checks whether the Ray intersects a specified plane or bounding volume.
op_Equality Determines whether two instances of Ray are equal.
op_Inequality Determines whether two instances of Ray are not equal.
ReferenceEquals (Inherited from Object.)
ToString Returns a String that represents the current Ray.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Ray Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Ray.Equals Method
Determines whether two instances of Ray are equal.
Overload List
Name Description
Ray.Equals (Object) Determines whether two instances of Ray are equal.
Ray.Equals (Ray) Determines whether the specified Ray is equal to the current Ray.
Ray.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
obj
The Object to compare with the current Ray.
Return Value
true if the specified Object is equal to the current Ray; false otherwise.
See Also
Reference
Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
other
The Ray to compare with the current Ray.
Return Value
true if the specified Ray is equal to the current Ray; false otherwise.
See Also
Reference
Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Ray.GetHashCode Method
Gets the hash code for this instance.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
A hash code for the current Ray.
See Also
Reference
Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Ray.Intersects Method
Checks whether the Ray intersects a specified plane or bounding volume.
Overload List
Name Description
Ray.Intersects (BoundingBox) Checks whether the Ray intersects a specified BoundingBox.
Ray.Intersects (BoundingBox, Nullable<Single>) Checks whether the current Ray intersects a BoundingBox.
Ray.Intersects (BoundingFrustum) Checks whether the Ray intersects a specified BoundingFrustum.
Ray.Intersects (BoundingSphere) Checks whether the Ray intersects a specified BoundingSphere.
Ray.Intersects (BoundingSphere, Nullable<Single>) Checks whether the current Ray intersects a BoundingSphere.
Ray.Intersects (Plane) Determines whether this Ray intersects a specified Plane.
Ray.Intersects (Plane, Nullable<Single>) Determines whether this Ray intersects a specified Plane.
See Also
Reference
Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Detect Whether a User Clicked a 3D Object
XNA Game Studio 2.0
Parameters
box
The BoundingBox to check for intersection with the Ray.
Return Value
Distance at which the ray intersects the BoundingBox or null if there is no intersection.
See Also
Reference
Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Detect Whether a User Clicked a 3D Object
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
box
The BoundingBox to check for intersection with.
result
[OutAttribute] Distance at which the ray intersects the BoundingBox or null if there is no intersection.
See Also
Reference
Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
frustum
The BoundingFrustum to check for intersection with the Ray.
Return Value
Distance at which the ray intersects the BoundingFrustum or null if there is no intersection.
Exceptions
Exception type Condition
ArgumentNullException frustum is null.
See Also
Reference
Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Detect Whether a User Clicked a 3D Object
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sphere
The BoundingSphere to check for intersection with the Ray.
Return Value
Distance at which the ray intersects the BoundingSphere or null if there is no intersection.
See Also
Reference
Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Detect Whether a User Clicked a 3D Object
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sphere
The BoundingSphere to check for intersection with.
result
[OutAttribute] Distance at which the ray intersects the BoundingSphere or null if there is no intersection.
See Also
Reference
Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
plane
The Plane with which to calculate this Ray's intersection.
Return Value
The distance at which this Ray intersects the specified Plane, or null if there is no intersection.
See Also
Reference
Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
plane
The Plane with which to calculate this Ray's intersection.
result
[OutAttribute] The distance at which this Ray intersects the specified Plane, or null if there is no intersection.
See Also
Reference
Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Ray.op_Equality Method
Determines whether two instances of Ray are equal.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
Ray a,
Ray b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if left is equal to right; false otherwise.
See Also
Reference
Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Ray.op_Inequality Method
Determines whether two instances of Ray are not equal.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
Ray a,
Ray b
)
Parameters
a
The object to the left of the inequality operator.
b
The object to the right of the inequality operator.
Return Value
true if left is not equal to right; false otherwise.
See Also
Reference
Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Ray.ToString Method
Returns a String that represents the current Ray.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of the current Ray.
See Also
Reference
Ray Structure
Ray Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rectangle Structure
Defines a rectangle.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[TypeConverterAttribute("typeof(Microsoft.Xna.Framework.Design.RectangleConverter)")]
[SerializableAttribute]
public struct Rectangle : IEquatable<Rectangle>
See Also
Reference
Rectangle Members
Microsoft.Xna.Framework Namespace
Programming Guide
Math Overview
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rectangle Members
The following tables list the members exposed by the Rectangle type.
Public Constructors
Name Description
Rectangle Initializes a new instance of Rectangle.
Public Fields
Name Description
Height Specifies the height of the rectangle.
Width Specifies the width of the rectangle.
X Specifies the x-coordinate of the rectangle.
Y Specifies the y-coordinate of the rectangle.
Public Properties
Name Description
Bottom Returns the y-coordinate of the bottom of the rectangle.
Empty Returns a Rectangle with all of its values set to zero.
Left Returns the x-coordinate of the left side of the rectangle.
Right Returns the x-coordinate of the right side of the rectangle.
Top Returns the y-coordinate of the top of the rectangle.
Public Methods
Name Description
Contains Overloaded. Determines whether this Rectangle contains a specified point or Rectangle.
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
Inflate Pushes the edges of the Rectangle out by the horizontal and vertical values specified.
Intersects Overloaded. Determines whether a specified Rectangle intersects with this Rectangle.
Offset Overloaded. Changes the position of the Rectangle.
op_Equality Compares two rectangles for equality.
op_Inequality Compares two rectangles for inequality.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of the current object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Rectangle Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Rectangle Fields
Public Fields
Name Description
Height Specifies the height of the rectangle.
Width Specifies the width of the rectangle.
X Specifies the x-coordinate of the rectangle.
Y Specifies the y-coordinate of the rectangle.
See Also
Reference
Rectangle Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Rectangle.Height Field
Specifies the height of the rectangle.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Height
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rectangle.Width Field
Specifies the width of the rectangle.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Width
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rectangle.X Field
Specifies the x-coordinate of the rectangle.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int X
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rectangle.Y Field
Specifies the y-coordinate of the rectangle.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Y
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rectangle Constructor
Initializes a new instance of Rectangle.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Rectangle (
int x,
int y,
int width,
int height
)
Parameters
x
The x-coordinate of the rectangle.
y
The y-coordinate of the rectangle.
width
Width of the rectangle.
height
Height of the rectangle.
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rectangle Methods
Public Methods
Name Description
Contains Overloaded. Determines whether this Rectangle contains a specified point or Rectangle.
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
Inflate Pushes the edges of the Rectangle out by the horizontal and vertical values specified.
Intersects Overloaded. Determines whether a specified Rectangle intersects with this Rectangle.
Offset Overloaded. Changes the position of the Rectangle.
op_Equality Compares two rectangles for equality.
op_Inequality Compares two rectangles for inequality.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of the current object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Rectangle Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Rectangle.Contains Method
Determines whether this Rectangle contains a specified point or Rectangle.
Overload List
Name Description
Rectangle.Contains (Int32, Int32) Determines whether this Rectangle contains a specified point represented by its x- an
d y-coordinates.
Rectangle.Contains (Point) Determines whether this Rectangle contains a specified Point.
Rectangle.Contains (Point, Boolean) Determines whether this Rectangle contains a specified Point.
Rectangle.Contains (Rectangle) Determines whether this Rectangle entirely contains a specified Rectangle.
Rectangle.Contains (Rectangle, Boolean) Determines whether this Rectangle entirely contains a specified Rectangle.
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
x
The x-coordinate of the specified point.
y
The y-coordinate of the specified point.
Return Value
true if the specified point is contained within this Rectangle; false otherwise.
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The Point to evaluate.
Return Value
true if the specified Point is contained within this Rectangle; false otherwise.
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The Point to evaluate.
result
[OutAttribute] true if the specified Point is contained within this Rectangle; false otherwise.
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The Rectangle to evaluate.
Return Value
true if this Rectangle entirely contains the specified Rectangle; false otherwise.
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The Rectangle to evaluate.
result
[OutAttribute] On exit, is true if this Rectangle entirely contains the specified Rectangle, or false if not.
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rectangle.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
Rectangle.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
Rectangle.Equals (Rectangle) Determines whether the specified Object is equal to the Rectangle.
Rectangle.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
obj
Object to make the comparison with.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
other
The Object to compare with the current Rectangle.
Return Value
true if the specified Object is equal to the current Rectangle; false otherwise.
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rectangle.GetHashCode Method
Gets the hash code for this object.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for this object.
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rectangle.Inflate Method
Pushes the edges of the Rectangle out by the horizontal and vertical values specified.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Inflate (
int horizontalAmount,
int verticalAmount
)
Parameters
horizontalAmount
Value to push the sides out by.
verticalAmount
Value to push the top and bottom out by.
Remarks
Each corner of the Rectangle is pushed away from the center of the rectangle by the specified amounts. This results in the
width and height of the Rectangle increasing by twice the values provided.
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rectangle.Intersects Method
Determines whether a specified Rectangle intersects with this Rectangle.
Overload List
Name Description
Rectangle.Intersects (Rectangle) Determines whether a specified Rectangle intersects with this Rectangle.
Rectangle.Intersects (Rectangle, Boolean) Determines whether a specified Rectangle intersects with this Rectangle.
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value
The Rectangle to evaluate.
Return Value
true if the specified Rectangle intersects with this one; false otherwise.
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The Rectangle to evaluate
result
[OutAttribute] true if the specified Rectangle intersects with this one; false otherwise.
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rectangle.Offset Method
Changes the position of the Rectangle.
Overload List
Name Description
Rectangle.Offset (Int32, Int32) Changes the position of the Rectangle.
Rectangle.Offset (Point) Changes the position of the Rectangle.
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
offsetX
Change in the x-position.
offsetY
Change in the y-position.
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
amount
The values to adjust the position of the Rectangle by.
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rectangle.op_Equality Method
Compares two rectangles for equality.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
Rectangle a,
Rectangle b
)
Parameters
a
Source rectangle.
b
Source rectangle.
Return Value
true if the rectangles are equal; false otherwise.
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rectangle.op_Inequality Method
Compares two rectangles for inequality.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
Rectangle a,
Rectangle b
)
Parameters
a
Source rectangle.
b
Source rectangle.
Return Value
true if the rectangles are not equal; false otherwise.
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rectangle.ToString Method
Retrieves a string representation of the current object.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String that represents the object.
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rectangle Properties
Public Properties
Name Description
Bottom Returns the y-coordinate of the bottom of the rectangle.
Empty Returns a Rectangle with all of its values set to zero.
Left Returns the x-coordinate of the left side of the rectangle.
Right Returns the x-coordinate of the right side of the rectangle.
Top Returns the y-coordinate of the top of the rectangle.
See Also
Reference
Rectangle Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Rectangle.Bottom Property
Returns the y-coordinate of the bottom of the rectangle.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Bottom { get; }
Property Value
The y-coordinate of the bottom of the rectangle.
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rectangle.Empty Property
Returns a Rectangle with all of its values set to zero.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Rectangle Empty { get; }
Property Value
An empty Rectangle.
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rectangle.Left Property
Returns the x-coordinate of the left side of the rectangle.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Left { get; }
Property Value
The x-coordinate of the left side of the rectangle.
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rectangle.Right Property
Returns the x-coordinate of the right side of the rectangle.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Right { get; }
Property Value
The x-coordinate of the right side of the rectangle.
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rectangle.Top Property
Returns the y-coordinate of the top of the rectangle.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Top { get; }
Property Value
The y-coordinate of the top of the rectangle.
See Also
Reference
Rectangle Structure
Rectangle Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TargetPlatform Enumeration
Defines the target platform to be used when compiling content.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum TargetPlatform
Members
Member name Description
Unknown Represents an unknown platform.
Windows The Windows platform.
Xbox360 The Xbox 360 game console.
See Also
Reference
BuildContent.TargetPlatform Property
BuildXact.TargetPlatform Property
ContentProcessorContext.TargetPlatform Property
ContentWriter.TargetPlatform Property
ContentTypeWriter.GetRuntimeType Method
ContentTypeWriter.GetRuntimeReader Method
Effect.CompileEffectFromFile Method
ShaderCompiler.AssembleFromFile Method
ShaderCompiler.CompileFromFile Method
ShaderCompiler.CompileFromSource Method
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Write a Custom Importer and Processor
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2 Structure
Defines a vector with two components.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[TypeConverterAttribute("typeof(Microsoft.Xna.Framework.Design.Vector2Converter)")]
[SerializableAttribute]
public struct Vector2 : IEquatable<Vector2>
See Also
Reference
Vector2 Members
Microsoft.Xna.Framework Namespace
Programming Guide
Math Overview
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2 Members
The following tables list the members exposed by the Vector2 type.
Public Constructors
Name Description
Vector2 Overloaded. Initializes a new instance of Vector2.
Public Fields
Name Description
X Gets or sets the x-component of the vector.
Y Gets or sets the y-component of the vector.
Public Properties
Name Description
One Returns a Vector2 with both of its components set to one.
UnitX Returns the unit vector for the x-axis.
UnitY Returns the unit vector for the y-axis.
Zero Returns a Vector2 with all of its components set to zero.
Public Methods
Name Description
Add Overloaded. Adds two vectors.
Barycentric Overloaded. Returns a Vector2 containing the 2D Cartesian coordinates of a point specified in 2D bary
centric (areal) coordinates.
CatmullRom Overloaded. Performs a Catmull-Rom interpolation using the specified positions.
Clamp Overloaded. Restricts a value to be within a specified range.
Distance Overloaded. Calculates the distance between two vectors.
DistanceSquared Overloaded. Calculates the distance between two vectors squared.
Divide Overloaded. Divides a vector by a scalar or another vector.
Dot Overloaded. Calculates the dot product of two vectors.
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code of the vector object.
GetType (Inherited from Object.)
Hermite Overloaded. Performs a Hermite spline interpolation.
Length Calculates the length of the vector.
LengthSquared Calculates the length of the vector squared.
Lerp Overloaded. Performs a linear interpolation between two vectors.
Max Overloaded. Returns a vector that contains the highest value from each matching pair of components.
Min Overloaded. Returns a vector that contains the lowest value from each matching pair of components.
Multiply Overloaded. Multiplies a vector by a scalar or another vector.
Negate Overloaded. Returns a vector pointing in the opposite direction.
Normalize Overloaded. Creates a unit vector from the specified vector.
op_Addition Adds two vectors.
op_Division Overloaded. Divide a vector by a scalar or another vector.
op_Equality Tests vectors for equality.
op_Inequality Tests vectors for inequality.
op_Multiply Overloaded. Multiplies a vector by a scalar or another vector.
op_Subtraction Subtracts a vector from a vector.
op_UnaryNegation Returns a vector pointing in the opposite direction.
ReferenceEquals (Inherited from Object.)
Reflect Overloaded. Determines the reflect vector of the given vector and normal.
SmoothStep Overloaded. Interpolates between two values using a cubic equation.
Subtract Overloaded. Subtracts a vector from a vector.
ToString Retrieves a string representation of the current object.
Transform Overloaded. Transforms one or more Vector2s by a Matrix or Quaternion.
TransformNormal Overloaded. Transforms a vector normal or array of vector normals by a matrix.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Vector2 Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Vector2 Fields
Public Fields
Name Description
X Gets or sets the x-component of the vector.
Y Gets or sets the y-component of the vector.
See Also
Reference
Vector2 Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Vector2.X Field
Gets or sets the x-component of the vector.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float X
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.Y Field
Gets or sets the y-component of the vector.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float Y
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2 Constructor
Initializes a new instance of Vector2.
Overload List
Name Description
Vector2 (Single) Creates a new instance of Vector2.
Vector2 (Single, Single) Initializes a new instance of Vector2.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value
Value to initialize both components to.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
x
Initial value for the x-component of the vector.
y
Initial value for the y-component of the vector.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2 Methods
Public Methods
Name Description
Add Overloaded. Adds two vectors.
Barycentric Overloaded. Returns a Vector2 containing the 2D Cartesian coordinates of a point specified in 2D bary
centric (areal) coordinates.
CatmullRom Overloaded. Performs a Catmull-Rom interpolation using the specified positions.
Clamp Overloaded. Restricts a value to be within a specified range.
Distance Overloaded. Calculates the distance between two vectors.
DistanceSquared Overloaded. Calculates the distance between two vectors squared.
Divide Overloaded. Divides a vector by a scalar or another vector.
Dot Overloaded. Calculates the dot product of two vectors.
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code of the vector object.
GetType (Inherited from Object.)
Hermite Overloaded. Performs a Hermite spline interpolation.
Length Calculates the length of the vector.
LengthSquared Calculates the length of the vector squared.
Lerp Overloaded. Performs a linear interpolation between two vectors.
Max Overloaded. Returns a vector that contains the highest value from each matching pair of components.
Min Overloaded. Returns a vector that contains the lowest value from each matching pair of components.
Multiply Overloaded. Multiplies a vector by a scalar or another vector.
Negate Overloaded. Returns a vector pointing in the opposite direction.
Normalize Overloaded. Creates a unit vector from the specified vector.
op_Addition Adds two vectors.
op_Division Overloaded. Divide a vector by a scalar or another vector.
op_Equality Tests vectors for equality.
op_Inequality Tests vectors for inequality.
op_Multiply Overloaded. Multiplies a vector by a scalar or another vector.
op_Subtraction Subtracts a vector from a vector.
op_UnaryNegation Returns a vector pointing in the opposite direction.
ReferenceEquals (Inherited from Object.)
Reflect Overloaded. Determines the reflect vector of the given vector and normal.
SmoothStep Overloaded. Interpolates between two values using a cubic equation.
Subtract Overloaded. Subtracts a vector from a vector.
ToString Retrieves a string representation of the current object.
Transform Overloaded. Transforms one or more Vector2s by a Matrix or Quaternion.
TransformNormal Overloaded. Transforms a vector normal or array of vector normals by a matrix.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Vector2 Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Vector2.Add Method
Adds two vectors.
Overload List
Name Description
Vector2.Add (Vector2, Vector2) Adds two vectors.
Vector2.Add (Vector2, Vector2, Vector2) Adds two vectors.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
Return Value
Sum of the source vectors.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
result
[OutAttribute] Sum of the source vectors.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.Barycentric Method
Returns a Vector2 containing the 2D Cartesian coordinates of a point specified in 2D barycentric (areal) coordinates.
Overload List
Name Description
Vector2.Barycentric (Vector2, Vector2, Vector2, Single, Single) Returns a Vector2 containing the 2D Cartesian coordin
ates of a point specified in barycentric (areal) coordinat
es relative to a 2D triangle.
Vector2.Barycentric (Vector2, Vector2, Vector2, Single, Single, Vector2) Returns a Vector2 containing the 2D Cartesian coordin
ates of a point specified in barycentric (areal) coordinat
es relative to a 2D triangle.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
A Vector2 containing the 2D Cartesian coordinates of vertex 1 of the triangle.
value2
A Vector2 containing the 2D Cartesian coordinates of vertex 2 of the triangle.
value3
A Vector2 containing the 2D Cartesian coordinates of vertex 3 of the triangle.
amount1
Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in value2).
amount2
Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in value3).
Return Value
A new Vector2 containing the 2D Cartesian coordinates of the specified point.
Remarks
About Barycentric Coordinates
Given a triangle with vertices V1, V2, and V3, any point P on the plane of that triangle can be specified by three weighting
factors b1, b2, and b3, each of which indicates how much relative influence the corresponding triangle vertex contributes to
the location of the point, as specified in the following formulas.
Px = (b1 * V1x) + (b2 * V2x) + (b3 * V3x);
Py = (b1 * V1y) + (b2 * V2y) + (b3 * V3y);
Such triple weighting factors b1, b2, and b3 are called barycentric coordinates.
Barycentric coordinates express relative weights, meaning that (k * b1), (k * b2), and (k * b3) are also coordinates of the same
point as b1, b2, and b3 for any positive value of k.
If a set of barycentric coordinates is normalized so that b1 + b2 + b3 = 1, the resulting coordinates are unique for the point in
question, and are known as areal coordinates. When normalized in this way, only two coordinates are needed, say b2 and b3,
since b1 equals (1 − b2 − b3).
What Vector2 Barycentric Does
The Vector2 Barycentric method takes three vectors specifying the Cartesian coordinates of the triangle vertices, V1, V2, and
V3), and two areal coordinates b2 and b3 of some point P (b2 is the amount1 argument, and b3 is the amount2 argument).
The b2 coordinate relates to vertex V2, and the b3coordinate relates to V3.
Barycentric then calculates the Cartesian coordinate of P as follows:
Px = ( (1 - b2 - b3) * V1x ) + (b2 * V2x) + (b3 * V3x);
Py = ( (1 - b2 - b3) * V1y ) + (b2 * V2y) + (b3 * V3y);
Thus, to calculate the 2D Cartesian coordinates of P, you would pass the coordinates of the triangle vertices to Barycentric
together with the appropropriate normalized barycentric coordinates of P.
The following relationships may be useful.
If ( (amount1 <= 0) and (amount2 >= 0) and (1 − amount1 − amount2 >= 0) ), then the point is inside the triangle
defined by value1, value2, and value3.
If ( (amount1 == 0) and (amount2 >= 0) and (1 − amount1 − amount2 >= 0) ), then the point is on the line defined by
value1 and value3.
If ( (amount1 >= 0) and (amount2 == 0) and (1 − amount1 − amount2 >= 0) ), then the point is on the line defined by
value1 and value2.
If ( (amount1 >= 0) and (amount2 >= 0) and (1 − amount1 − amount2 == 0) ), then the point is on the line defined by
value2 and value3.
Barycentric coordinates are a form of general coordinates. In this context, using barycentric coordinates represents a change in
coordinate systems. What holds true for Cartesian coordinates holds true for barycentric coordinates.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
A Vector2 containing the 2D Cartesian coordinates of vertex 1 of the triangle.
value2
A Vector2 containing the 2D Cartesian coordinates of vertex 2 of the triangle.
value3
A Vector2 containing the 2D Cartesian coordinates of vertex 3 of the triangle.
amount1
Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in value2).
amount2
Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in value3).
result
[OutAttribute] The 2D Cartesian coordinates of the specified point are placed in this Vector2 on exit.
Remarks
About Barycentric Coordinates
Given a triangle with vertices V1, V2, and V3, any point P on the plane of that triangle can be specified by three weighting
factors b1, b2, and b3, each of which indicates how much relative influence the corresponding triangle vertex contributes to
the location of the point, as specified in the following formulas.
Px = (b1 * V1x) + (b2 * V2x) + (b3 * V3x);
Py = (b1 * V1y) + (b2 * V2y) + (b3 * V3y);
Such triple weighting factors b1, b2, and b3 are called barycentric coordinates.
Barycentric coordinates express relative weights, meaning that (k * b1), (k * b2), and (k * b3) are also coordinates of the same
point as b1, b2, and b3 for any positive value of k.
If a set of barycentric coordinates is normalized so that b1 + b2 + b3 = 1, the resulting coordinates are unique for the point in
question, and are known as areal coordinates. When normalized in this way, only two coordinates are needed, say b2 and b3,
since b1 equals (1 − b2 − b3).
What Vector2 Barycentric Does
The Vector2 Barycentric method takes three vectors specifying the Cartesian coordinates of the triangle vertices, V1, V2, and
V3), and two areal coordinates b2 and b3 of some point P (b2 is the amount1 argument, and b3 is the amount2 argument).
The b2 coordinate relates to vertex V2, and the b3coordinate relates to V3.
Barycentric then calculates the Cartesian coordinate of P as follows:
Px = ( (1 - b2 - b3) * V1x ) + (b2 * V2x) + (b3 * V3x);
Py = ( (1 - b2 - b3) * V1y ) + (b2 * V2y) + (b3 * V3y);
Thus, to calculate the 2D Cartesian coordinates of P, you would pass the coordinates of the triangle vertices to Barycentric
together with the appropropriate normalized barycentric coordinates of P.
The following relationships may be useful.
If ( (amount1 <= 0) and (amount2 >= 0) and (1 − amount1 − amount2 >= 0) ), then the point is inside the triangle
defined by value1, value2, and value3.
If ( (amount1 == 0) and (amount2 >= 0) and (1 − amount1 − amount2 >= 0) ), then the point is on the line defined by
value1 and value3.
If ( (amount1 >= 0) and (amount2 == 0) and (1 − amount1 − amount2 >= 0) ), then the point is on the line defined by
value1 and value2.
If ( (amount1 >= 0) and (amount2 >= 0) and (1 − amount1 − amount2 == 0) ), then the point is on the line defined by
value2 and value3.
Barycentric coordinates are a form of general coordinates. In this context, using barycentric coordinates represents a change in
coordinate systems. What holds true for Cartesian coordinates holds true for barycentric coordinates.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.CatmullRom Method
Performs a Catmull-Rom interpolation using the specified positions.
Overload List
Name Description
Vector2.CatmullRom (Vector2, Vector2, Vector2, Vector2, Single) Performs a Catmull-Rom interpolation using the spe
cified positions.
Vector2.CatmullRom (Vector2, Vector2, Vector2, Vector2, Single, Vector2) Performs a Catmull-Rom interpolation using the spe
cified positions.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
The first position in the interpolation.
value2
The second position in the interpolation.
value3
The third position in the interpolation.
value4
The fourth position in the interpolation.
amount
Weighting factor.
Return Value
A vector that is the result of the Catmull-Rom interpolation.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
The first position in the interpolation.
value2
The second position in the interpolation.
value3
The third position in the interpolation.
value4
The fourth position in the interpolation.
amount
Weighting factor.
result
[OutAttribute] A vector that is the result of the Catmull-Rom interpolation.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.Clamp Method
Restricts a value to be within a specified range.
Overload List
Name Description
Vector2.Clamp (Vector2, Vector2, Vector2) Restricts a value to be within a specified range.
Vector2.Clamp (Vector2, Vector2, Vector2, Vector2) Restricts a value to be within a specified range.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
The value to clamp.
min
The minimum value.
max
The maximum value.
Return Value
The clamped value.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
The value to clamp.
min
The minimum value.
max
The maximum value.
result
[OutAttribute] The clamped value.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.Distance Method
Calculates the distance between two vectors.
Overload List
Name Description
Vector2.Distance (Vector2, Vector2) Calculates the distance between two vectors.
Vector2.Distance (Vector2, Vector2, Single) Calculates the distance between two vectors.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
Return Value
Distance between the two vectors.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
result
[OutAttribute] The distance between the vectors.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.DistanceSquared Method
Calculates the distance between two vectors squared.
Overload List
Name Description
Vector2.DistanceSquared (Vector2, Vector2) Calculates the distance between two vectors squared.
Vector2.DistanceSquared (Vector2, Vector2, Single) Calculates the distance between two vectors squared.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
Return Value
The distance between the source vectors squared.
Remarks
Distance is calculated with the formula:
Distance squared is the value before taking the square root. Distance squared can often be used in place of distance if relative
comparisons are being made. For example, consider three points A, B, and C. To determine whether B or C is further from A,
compare the distance between A and B to the distance between A and C. Calculating the two distances involves two square
roots, which are computationally expensive. However, using distance squared provides the same information and avoids
calculating two square roots.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
result
[OutAttribute] The distance between the vectors squared.
Remarks
Distance is calculated with the formula:
Distance squared is the value before taking the square root. Distance squared can often be used in place of distance if relative
comparisons are being made. For example, consider three points A, B, and C. To determine whether B or C is further from A,
compare the distance between A and B to the distance between A and C. Calculating the two distances involves two square
roots, which are computationally expensive. However, using distance squared provides the same information and avoids
calculating two square roots.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.Divide Method
Divides a vector by a scalar or another vector.
Overload List
Name Description
Vector2.Divide (Vector2, Single) Divides a vector by a scalar value.
Vector2.Divide (Vector2, Single, Vector2) Divides a vector by a scalar value.
Vector2.Divide (Vector2, Vector2) Divides the components of a vector by the components of another vector.
Vector2.Divide (Vector2, Vector2, Vector2) Divides the components of a vector by the components of another vector.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
divider
The divisor.
Return Value
The result of the division.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
divider
The divisor.
result
[OutAttribute] The result of the division.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Divisor vector.
Return Value
The result of dividing the vectors.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
The divisor.
result
[OutAttribute] The result of the division.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.Dot Method
Calculates the dot product of two vectors.
Overload List
Name Description
Vector2.Dot (Vector2, Vector2) Calculates the dot product of two vectors.
Vector2.Dot (Vector2, Vector2, Single) Calculates the dot product of two vectors.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
Return Value
The dot product of the two vectors.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
result
[OutAttribute] The dot product of the two vectors.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
Vector2.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
Vector2.Equals (Vector2) Determines whether the specified Object is equal to the Vector2.
Vector2.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
obj
Object to make the comparison with.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
other
The Object to compare with the current Vector2.
Return Value
true if the specified Object is equal to the current Vector2; false otherwise.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.GetHashCode Method
Gets the hash code of the vector object.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code of the vector object.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.Hermite Method
Performs a Hermite spline interpolation.
Overload List
Name Description
Vector2.Hermite (Vector2, Vector2, Vector2, Vector2, Single) Performs a Hermite spline interpolation.
Vector2.Hermite (Vector2, Vector2, Vector2, Vector2, Single, Vector2) Performs a Hermite spline interpolation.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source position vector.
tangent1
Source tangent vector.
value2
Source position vector.
tangent2
Source tangent vector.
amount
Weighting factor.
Return Value
The result of the Hermite spline interpolation.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source position vector.
tangent1
Source tangent vector.
value2
Source position vector.
tangent2
Source tangent vector.
amount
Weighting factor.
result
[OutAttribute] The result of the Hermite spline interpolation.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.Length Method
Calculates the length of the vector.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float Length ()
Return Value
Length of the vector.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.LengthSquared Method
Calculates the length of the vector squared.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float LengthSquared ()
Return Value
The length of the vector squared.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.Lerp Method
Performs a linear interpolation between two vectors.
Overload List
Name Description
Vector2.Lerp (Vector2, Vector2, Single) Performs a linear interpolation between two vectors.
Vector2.Lerp (Vector2, Vector2, Single, Vector2) Performs a linear interpolation between two vectors.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
amount
Value between 0 and 1 indicating the weight of value2.
Return Value
The linear interpolation of the two vectors.
Remarks
This method performs the linear interpolation based on the following formula.
value1 + (value2 - value1) * amount
Passing amount a value of 0 will cause value1 to be returned; a value of 1 will cause value2 to be returned.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
amount
Value between 0 and 1 indicating the weight of value2.
result
[OutAttribute] The result of the interpolation.
Remarks
This method performs the linear interpolation based on the following formula.
value1 + (value2 - value1) * amount
Passing amount a value of 0 will cause value1 to be returned; a value of 1 will cause value2 to be returned.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.Max Method
Returns a vector that contains the highest value from each matching pair of components.
Overload List
Name Description
Vector2.Max (Vector2, Vector2) Returns a vector that contains the highest value from each matching pair of compone
nts.
Vector2.Max (Vector2, Vector2, Vector2) Returns a vector that contains the highest value from each matching pair of compone
nts.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
Return Value
The maximized vector.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
result
[OutAttribute] The maximized vector.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.Min Method
Returns a vector that contains the lowest value from each matching pair of components.
Overload List
Name Description
Vector2.Min (Vector2, Vector2) Returns a vector that contains the lowest value from each matching pair of componen
ts.
Vector2.Min (Vector2, Vector2, Vector2) Returns a vector that contains the lowest value from each matching pair of componen
ts.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
Return Value
The minimized vector.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
result
[OutAttribute] The minimized vector.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.Multiply Method
Multiplies a vector by a scalar or another vector.
Overload List
Name Description
Vector2.Multiply (Vector2, Single) Multiplies a vector by a scalar value.
Vector2.Multiply (Vector2, Single, Vector2) Multiplies a vector by a scalar value.
Vector2.Multiply (Vector2, Vector2) Multiplies the components of two vectors by each other.
Vector2.Multiply (Vector2, Vector2, Vector2) Multiplies the components of two vectors by each other.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
scaleFactor
Scalar value.
Return Value
Result of the multiplication.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
scaleFactor
Scalar value.
result
[OutAttribute] The result of the multiplication.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
Return Value
Result of the multiplication.
Remarks
Multiplication performed by this method is not vector multiplication (dot product and cross product) but multiplication of the
corresponding components of each vector.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
result
[OutAttribute] The result of the multiplication.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.Negate Method
Returns a vector pointing in the opposite direction.
Overload List
Name Description
Vector2.Negate (Vector2) Returns a vector pointing in the opposite direction.
Vector2.Negate (Vector2, Vector2) Returns a vector pointing in the opposite direction.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value
Source vector.
Return Value
Vector pointing in the opposite direction.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
Source vector.
result
[OutAttribute] Vector pointing in the opposite direction.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.Normalize Method
Creates a unit vector from the specified vector.
Overload List
Name Description
Vector2.Normalize () Turns the current vector into a unit vector.
Vector2.Normalize (Vector2) Creates a unit vector from the specified vector.
Vector2.Normalize (Vector2, Vector2) Returns a normalized version of the specified vector.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Vector2.Normalize Method ()
Turns the current vector into a unit vector.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Normalize ()
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
Source Vector2.
Return Value
The created unit vector.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
Source vector.
result
[OutAttribute] Normalized vector.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.op_Addition Method
Adds two vectors.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector2 op_Addition (
Vector2 value1,
Vector2 value2
)
Parameters
value1
Source vector.
value2
Source vector.
Return Value
Sum of the source vectors.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.op_Division Method
Divide a vector by a scalar or another vector.
Overload List
Name Description
Vector2.op_Division (Vector2, Single) Divides a vector by a scalar value.
Vector2.op_Division (Vector2, Vector2) Divides the components of a vector by the components of another vector.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
divider
The divisor.
Return Value
The source vector divided by b.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Divisor vector.
Return Value
The result of dividing the vectors.
Remarks
Division of a vector by another vector is not mathematically defined. This method simply divides each component of a by the
matching component of b.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.op_Equality Method
Tests vectors for equality.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
Vector2 value1,
Vector2 value2
)
Parameters
value1
Source vector.
value2
Source vector.
Return Value
true if the vectors are equal; false otherwise.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.op_Inequality Method
Tests vectors for inequality.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
Vector2 value1,
Vector2 value2
)
Parameters
value1
Vector to compare.
value2
Vector to compare.
Return Value
Returns true if the vectors are not equal, false otherwise.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.op_Multiply Method
Multiplies a vector by a scalar or another vector.
Overload List
Name Description
Vector2.op_Multiply (Single, Vector2) Multiplies a vector by a scalar value.
Vector2.op_Multiply (Vector2, Single) Multiplies a vector by a scalar value.
Vector2.op_Multiply (Vector2, Vector2) Multiplies the components of two vectors by each other.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
scaleFactor
Scalar value.
value
Source vector.
Return Value
Result of the multiplication.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
Source vector.
scaleFactor
Scalar value.
Return Value
Result of the multiplication.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
Return Value
Result of the multiplication.
Remarks
Multiplication performed by this method is not vector multiplication (dot product and cross product) but multiplication of the
corresponding components of each vector.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.op_Subtraction Method
Subtracts a vector from a vector.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector2 op_Subtraction (
Vector2 value1,
Vector2 value2
)
Parameters
value1
Source vector.
value2
source vector.
Return Value
Result of the subtraction.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.op_UnaryNegation Method
Returns a vector pointing in the opposite direction.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector2 op_UnaryNegation (
Vector2 value
)
Parameters
value
Source vector.
Return Value
Vector pointing in the opposite direction.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.Reflect Method
Determines the reflect vector of the given vector and normal.
Overload List
Name Description
Vector2.Reflect (Vector2, Vector2) Determines the reflect vector of the given vector and normal.
Vector2.Reflect (Vector2, Vector2, Vector2) Determines the reflect vector of the given vector and normal.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
vector
Source vector.
normal
Normal of vector.
Return Value
Resulting reflect vector.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector
Source vector.
normal
Normal of vector.
result
[OutAttribute] The created reflect vector.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.SmoothStep Method
Interpolates between two values using a cubic equation.
Overload List
Name Description
Vector2.SmoothStep (Vector2, Vector2, Single) Interpolates between two values using a cubic equation.
Vector2.SmoothStep (Vector2, Vector2, Single, Vector2) Interpolates between two values using a cubic equation.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source value.
value2
Source value.
amount
Weighting value.
Return Value
Interpolated value.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source value.
value2
Source value.
amount
Weighting value.
result
[OutAttribute] The interpolated value.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.Subtract Method
Subtracts a vector from a vector.
Overload List
Name Description
Vector2.Subtract (Vector2, Vector2) Subtracts a vector from a vector.
Vector2.Subtract (Vector2, Vector2, Vector2) Subtracts a vector from a vector.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
Return Value
Result of the subtraction.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
result
[OutAttribute] The result of the subtraction.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.ToString Method
Retrieves a string representation of the current object.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String that represents the object.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.Transform Method
Transforms one or more Vector2s by a Matrix or Quaternion.
Overload List
Name Description
Vector2.Transform (Vector2, Matrix) Transforms the vector (x, y, 0, 1) by the specified matri
x.
Vector2.Transform (Vector2, Matrix, Vector2) Transforms a Vector2 by the given Matrix.
Vector2.Transform (Vector2, Quaternion) Transforms a single Vector2, or the vector normal (x, y
, 0, 0), by a specified Quaternion rotation.
Vector2.Transform (Vector2, Quaternion, Vector2) Transforms a Vector2, or the vector normal (x, y, 0, 0),
by a specified Quaternion rotation.
Vector2.Transform (Vector2[], Int32, Matrix, Vector2[], Int32, Int32) Transforms a specified range in an array of Vector2s b
y a specified Matrix and places the results in a specifie
d range in a destination array.
Vector2.Transform (Vector2[], Int32, Quaternion, Vector2[], Int32, Int32) Transforms a specified range in an array of Vector2s b
y a specified Quaternion and places the results in a sp
ecified range in a destination array.
Vector2.Transform (Vector2[], Matrix, Vector2[]) Transforms an array of Vector2s by a specified Matrix.
Vector2.Transform (Vector2[], Quaternion, Vector2[]) Transforms an array of Vector2s by a specified
Quaternion.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
position
The source vector.
matrix
The transformation matrix.
Return Value
The transformed vector.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
position
The source Vector2.
matrix
The transformation Matrix.
result
[OutAttribute] The Vector2 resulting from the transformation.
Exceptions
Exception type Condition
ArgumentException The target array size must be equal or larger than the source array size.
ArgumentNullException sourceArray or destinationArray is null.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The vector to rotate.
rotation
The Quaternion rotation to apply.
Return Value
Returns a new Vector2 containing the result of the rotation.
Exceptions
Exception type Condition
ArgumentException destinationArray is too small to contain the result.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The vector to rotate.
rotation
The Quaternion rotation to apply.
result
[OutAttribute] An existing Vector2 filled in with the result of the rotation.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sourceArray
The source array.
sourceIndex
The index of the first Vector2 to transform in the source array.
matrix
The Matrix to transform by.
destinationArray
The destination array into which the resulting Vector2s will be written.
destinationIndex
The index of the position in the destination array where the first result Vector2 should be written.
length
The number of Vector2s to be transformed.
Exceptions
Exception type Condition
ArgumentException destinationArray is too small to contain the result or the combination of sourceIndex and length was g
reater than sourceArray.Length.
ArgumentNullException sourceArray or destinationArray is null.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sourceArray
The source array.
sourceIndex
The index of the first Vector2 to transform in the source array.
rotation
The Quaternion rotation to apply.
destinationArray
The destination array into which the resulting Vector2s are written.
destinationIndex
The index of the position in the destination array where the first result Vector2 should be written.
length
The number of Vector2s to be transformed.
Exceptions
Exception type Condition
ArgumentException destinationArray is too small to contain the result or the combination of sourceIndex and length was g
reater than sourceArray.Length.
ArgumentNullException sourceArray or destinationArray is null.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sourceArray
The array of Vector2s to transform.
matrix
The transform Matrix to apply.
destinationArray
An existing array into which the transformed Vector2s are written.
Exceptions
Exception type Condition
ArgumentException destinationArray is too small to contain the result.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sourceArray
The array of Vector2s to transform.
rotation
The transform Matrix to use.
destinationArray
An existing array into which the transformed Vector2s are written.
Exceptions
Exception type Condition
ArgumentException destinationArray is too small to contain the result.
ArgumentNullException sourceArray or destinationArray is null.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.TransformNormal Method
Transforms a vector normal or array of vector normals by a matrix.
Overload List
Name Description
Vector2.TransformNormal (Vector2, Matrix) Transforms a 2D vector normal by a matrix.
Vector2.TransformNormal (Vector2, Matrix, Vector2) Transforms a vector normal by a matrix.
Vector2.TransformNormal (Vector2[], Int32, Matrix, Vector2[], Int32, Int32) Transforms a specified range in an array of Vector2
vector normals by a specified Matrix and places the
results in a specified range in a destination array.
Vector2.TransformNormal (Vector2[], Matrix, Vector2[]) Transforms an array of Vector2 vector normals by a
specified Matrix.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
normal
The source vector.
matrix
The transformation matrix.
Return Value
The transformed normal.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
normal
The source vector.
matrix
The transformation matrix.
result
[OutAttribute] The Vector2 resulting from the transformation.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sourceArray
The source array.
sourceIndex
The index of the first Vector2 to transform in the source array.
matrix
The Matrix to apply.
destinationArray
The destination array into which the resulting Vector2s are written.
destinationIndex
The index of the position in the destination array where the first result Vector2 should be written.
length
The number of vector normals to be transformed.
Exceptions
Exception type Condition
ArgumentException destinationArray is too small to contain the result or the combination of sourceIndex and length was g
reater than sourceArray.Length.
ArgumentNullException sourceArray or destinationArray is null.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sourceArray
The array of vector normals to transform.
matrix
The transform Matrix to apply.
destinationArray
An existing array into which the transformed vector normals are written.
Exceptions
Exception type Condition
ArgumentException destinationArray is too small to contain the result.
ArgumentNullException sourceArray or destinationArray is null.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2 Properties
Public Properties
Name Description
One Returns a Vector2 with both of its components set to one.
UnitX Returns the unit vector for the x-axis.
UnitY Returns the unit vector for the y-axis.
Zero Returns a Vector2 with all of its components set to zero.
See Also
Reference
Vector2 Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Vector2.One Property
Returns a Vector2 with both of its components set to one.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector2 One { get; }
Property Value
Vector2 with both of its components set to one.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.UnitX Property
Returns the unit vector for the x-axis.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector2 UnitX { get; }
Property Value
The unit vector for the x-axis.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.UnitY Property
Returns the unit vector for the y-axis.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector2 UnitY { get; }
Property Value
The unit vector for the y-axis.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2.Zero Property
Returns a Vector2 with all of its components set to zero.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector2 Zero { get; }
Property Value
A Vector2 with all of its components set to zero.
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3 Structure
Defines a vector with three components.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[TypeConverterAttribute("typeof(Microsoft.Xna.Framework.Design.Vector3Converter)")]
[SerializableAttribute]
public struct Vector3 : IEquatable<Vector3>
See Also
Reference
Vector3 Members
Microsoft.Xna.Framework Namespace
Programming Guide
Math Overview
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3 Members
The following tables list the members exposed by the Vector3 type.
Public Constructors
Name Description
Vector3 Overloaded. Initializes a new instance of Vector3.
Public Fields
Name Description
X Gets or sets the x-component of the vector.
Y Gets or sets the y-component of the vector.
Z Gets or sets the z-component of the vector.
Public Properties
Name Description
Backward Returns a unit Vector3 pointing backward (0, 0, 1).
Down Returns a unit Vector3 pointing down (0, −1, 0).
Forward Returns a unit Vector3 pointing forward (0, 0, −1).
Left Returns a unit Vector3 pointing left (−1, 0, 0).
One Returns a Vector3 with ones in all of its components.
Right Returns a unit Vector3 pointing to the right (1, 0, 0).
UnitX Returns the x unit Vector3 (1, 0, 0).
UnitY Returns the y unit Vector3 (0, 1, 0).
UnitZ Returns the z unit Vector3 (0, 0, 1).
Up Returns a unit Vector3 pointing up (0, 1, 0).
Zero Returns a Vector3 with all of its components set to zero.
Public Methods
Name Description
Add Overloaded. Adds two vectors.
Barycentric Overloaded. Returns a Vector3 containing the 3D Cartesian coordinates of a point specified in Barycent
ric coordinates relative to a 3D triangle.
CatmullRom Overloaded. Performs a Catmull-Rom interpolation using the specified positions.
Clamp Overloaded. Restricts a value to be within a specified range.
Cross Overloaded. Calculates the cross product of two vectors.
Distance Overloaded. Calculates the distance between two vectors.
DistanceSquared Overloaded. Calculates the distance between two vectors squared.
Divide Overloaded. Divide a vector by a scalar or another vector.
Dot Overloaded. Calculates the dot product of two vectors.
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code of the vector object.
GetType (Inherited from Object.)
Hermite Overloaded. Performs a Hermite spline interpolation.
Length Calculates the length of the vector.
LengthSquared Calculates the length of the vector squared.
Lerp Overloaded. Performs a linear interpolation between two vectors.
Max Overloaded. Returns a vector that contains the highest value from each matching pair of components.
Min Overloaded. Returns a vector that contains the lowest value from each matching pair of components.
Multiply Overloaded. Multiplies a vector by a scalar or another vector.
Negate Overloaded. Returns a vector pointing in the opposite direction.
Normalize Overloaded. Creates a unit vector from the specified vector.
op_Addition Adds two vectors.
op_Division Overloaded. Divides a vector by a scalar or another vector.
op_Equality Tests vectors for equality.
op_Inequality Tests vectors for inequality.
op_Multiply Overloaded. Multiplies a vector by a scalar or another vector.
op_Subtraction Subtracts a vector from a vector.
op_UnaryNegation Returns a vector pointing in the opposite direction.
ReferenceEquals (Inherited from Object.)
Reflect Overloaded. Returns the reflection of a vector off a surface that has the specified normal.
SmoothStep Overloaded. Interpolates between two values using a cubic equation.
Subtract Overloaded. Subtracts a vector from a vector.
ToString Retrieves a string representation of the current object.
Transform Overloaded. Transforms a Vector3 or array of Vector3s by a specified Matrix or Quaternion.
TransformNormal Overloaded. Transforms a vector normal by a matrix.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Vector3 Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Vector3 Fields
Public Fields
Name Description
X Gets or sets the x-component of the vector.
Y Gets or sets the y-component of the vector.
Z Gets or sets the z-component of the vector.
See Also
Reference
Vector3 Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Vector3.X Field
Gets or sets the x-component of the vector.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float X
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.Y Field
Gets or sets the y-component of the vector.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float Y
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.Z Field
Gets or sets the z-component of the vector.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float Z
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3 Constructor
Initializes a new instance of Vector3.
Overload List
Name Description
Vector3 (Single) Creates a new instance of Vector3.
Vector3 (Single, Single, Single) Initializes a new instance of Vector3.
Vector3 (Vector2, Single) Initializes a new instance of Vector3.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value
Value to initialize each component to.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
x
Initial value for the x-component of the vector.
y
Initial value for the y-component of the vector.
z
Initial value for the z-component of the vector.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
A vector containing the values to initialize x and y components with.
z
Initial value for the z-component of the vector.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3 Methods
Public Methods
Name Description
Add Overloaded. Adds two vectors.
Barycentric Overloaded. Returns a Vector3 containing the 3D Cartesian coordinates of a point specified in Barycent
ric coordinates relative to a 3D triangle.
CatmullRom Overloaded. Performs a Catmull-Rom interpolation using the specified positions.
Clamp Overloaded. Restricts a value to be within a specified range.
Cross Overloaded. Calculates the cross product of two vectors.
Distance Overloaded. Calculates the distance between two vectors.
DistanceSquared Overloaded. Calculates the distance between two vectors squared.
Divide Overloaded. Divide a vector by a scalar or another vector.
Dot Overloaded. Calculates the dot product of two vectors.
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code of the vector object.
GetType (Inherited from Object.)
Hermite Overloaded. Performs a Hermite spline interpolation.
Length Calculates the length of the vector.
LengthSquared Calculates the length of the vector squared.
Lerp Overloaded. Performs a linear interpolation between two vectors.
Max Overloaded. Returns a vector that contains the highest value from each matching pair of components.
Min Overloaded. Returns a vector that contains the lowest value from each matching pair of components.
Multiply Overloaded. Multiplies a vector by a scalar or another vector.
Negate Overloaded. Returns a vector pointing in the opposite direction.
Normalize Overloaded. Creates a unit vector from the specified vector.
op_Addition Adds two vectors.
op_Division Overloaded. Divides a vector by a scalar or another vector.
op_Equality Tests vectors for equality.
op_Inequality Tests vectors for inequality.
op_Multiply Overloaded. Multiplies a vector by a scalar or another vector.
op_Subtraction Subtracts a vector from a vector.
op_UnaryNegation Returns a vector pointing in the opposite direction.
ReferenceEquals (Inherited from Object.)
Reflect Overloaded. Returns the reflection of a vector off a surface that has the specified normal.
SmoothStep Overloaded. Interpolates between two values using a cubic equation.
Subtract Overloaded. Subtracts a vector from a vector.
ToString Retrieves a string representation of the current object.
Transform Overloaded. Transforms a Vector3 or array of Vector3s by a specified Matrix or Quaternion.
TransformNormal Overloaded. Transforms a vector normal by a matrix.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Vector3 Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Vector3.Add Method
Adds two vectors.
Overload List
Name Description
Vector3.Add (Vector3, Vector3) Adds two vectors.
Vector3.Add (Vector3, Vector3, Vector3) Adds two vectors.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
Return Value
Sum of the source vectors.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
result
[OutAttribute] Sum of the source vectors.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.Barycentric Method
Returns a Vector3 containing the 3D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 3D
triangle.
Overload List
Name Description
Vector3.Barycentric (Vector3, Vector3, Vector3, Single, Single) Returns a Vector3 containing the 3D Cartesian coordin
ates of a point specified in Barycentric coordinates relat
ive to a 3D triangle.
Vector3.Barycentric (Vector3, Vector3, Vector3, Single, Single, Vector3) Returns a Vector3 containing the 3D Cartesian coordin
ates of a point specified in barycentric (areal) coordinat
es relative to a 3D triangle.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
A Vector3 containing the 3D Cartesian coordinates of vertex 1 of the triangle.
value2
A Vector3 containing the 3D Cartesian coordinates of vertex 2 of the triangle.
value3
A Vector3 containing the 3D Cartesian coordinates of vertex 3 of the triangle.
amount1
Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in value2).
amount2
Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in value3).
Return Value
A new Vector3 containing the 3D Cartesian coordinates of the specified point.
Remarks
About Barycentric Coordinates
Given a triangle with vertices V1, V2, and V3, any point P on the plane of that triangle can be specified by 3 weighting factors
b1, b2, and b3, each of which indicates how much relative influence the corresponding triangle vertex contributes to the
location of the point, as specified in the following formulas:
Px = (b1 * V1x) + (b2 * V2x) + (b3 * V3x);
Py = (b1 * V1y) + (b2 * V2y) + (b3 * V3y);
Pz = (b1 * V1z) + (b2 * V2z) + (b3 * V3z);
Such triple weighting factors b1, b2, and b3 are called Barycentric coordinates.
Barycentric coordinates express relative weights, meaning that (k * b1), (k * b2), and (k * b3) are also coordinates of the same
point as b1, b2, and b3 for any positive value of k.
If a set of Barycentric coordinates is normalized so that: b1 + b2 + b3 = 1, the resulting coordinates are unique for the point in
question, and are known as areal coordinates. When normalized in this way, only two coordinates are needed, say b2 and b3,
since b1 equals (1 - b2 - b3).
What Vector3 Barycentric Does
The Vector3 Barycentric method takes three vectors specifying the Cartesian coordinates of the triangle vertices, V1, V2, and
V3), and two areal coordinates b2 and b3 of some point P (b2 is the amount1 argument and b3 is the amount2 argument).
The b2 coordinate relates to vertex V2, and the b3coordinate relates to V3.
Barycentric then calculates the Cartesian coordinate of P as follows:
Px = ( (1 - b2 - b3) * V1x ) + (b2 * V2x) + (b3 * V3x);
Py = ( (1 - b2 - b3) * V1y ) + (b2 * V2y) + (b3 * V3y);
Pz = ( (1 - b2 - b3) * V1z ) + (b2 * V2z) + (b3 * V3z);
Thus, to calculate the 3D Cartesian coordinates of P, you would pass the coordinates of the triangle vertices to Barycentric
together with the appropropriate normalized Barycentric (areal) coordinates of P.
The following relationships may be useful:
If ( (amount1 <= 0) and (amount2 >= 0) and (1 − amount1 − amount2 >= 0) ), then the point is inside the triangle
defined by value1, value2, and value3.
If ( (amount1 == 0) and (amount2 >= 0) and (1 − amount1 − amount2 >= 0) ), then the point is on the line defined by
value1 and value3.
If ( (amount1 >= 0) and (amount2 == 0) and (1 − amount1 − amount2 >= 0) ), then the point is on the line defined by
value1 and value2.
If ( (amount1 >= 0) and (amount2 >= 0) and (1 − amount1 − amount2 == 0) ), then the point is on the line defined by
value2 and value3.
Barycentric coordinates are a form of general coordinates. In this context, using barycentric coordinates represents a change in
coordinate systems. What holds true for Cartesian coordinates holds true for barycentric coordinates.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
A Vector3 containing the 3D Cartesian coordinates of vertex 1 of the triangle.
value2
A Vector3 containing the 3D Cartesian coordinates of vertex 2 of the triangle.
value3
A Vector3 containing the 3D Cartesian coordinates of vertex 3 of the triangle.
amount1
Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in value2).
amount2
Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in value3).
result
[OutAttribute] The 3D Cartesian coordinates of the specified point are placed in this Vector3 on exit.
Remarks
About Barycentric Coordinates
Given a triangle with vertices V1, V2, and V3, any point P on the plane of that triangle can be specified by three weighting
factors b1, b2, and b3, each of which indicates how much relative influence the corresponding triangle vertex contributes to
the location of the point, as specified in the following formulas:
Px = (b1 * V1x) + (b2 * V2x) + (b3 * V3x);
Py = (b1 * V1y) + (b2 * V2y) + (b3 * V3y);
Pz = (b1 * V1z) + (b2 * V2z) + (b3 * V3z);
Such triple weighting factors b1, b2, and b3 are called barycentric coordinates.
Barycentric coordinates express relative weights, meaning that (k * b1), (k * b2), and (k * b3) are also coordinates of the same
point as b1, b2, and b3 for any positive value of k.
If a set of barycentric coordinates is normalized so that b1 + b2 + b3 = 1, the resulting coordinates are unique for the point in
question, and are known as areal coordinates. When normalized in this way, only two coordinates are needed, say b2 and b3,
since b1 equals (1 − b2 − b3).
What Vector3 Barycentric Does
The Vector3 Barycentric method takes three vectors specifying the Cartesian coordinates of the triangle vertices, V1, V2, and
V3), and two areal coordinates b2 and b3 of some point P (b2 is the amount1 argument and b3 is the amount2 argument).
The b2 coordinate relates to vertex V2, and the b3coordinate relates to V3.
Barycentric then calculates the Cartesian coordinate of P as follows:
Px = ( (1 - b2 - b3) * V1x ) + (b2 * V2x) + (b3 * V3x);
Py = ( (1 - b2 - b3) * V1y ) + (b2 * V2y) + (b3 * V3y);
Pz = ( (1 - b2 - b3) * V1z ) + (b2 * V2z) + (b3 * V3z);
Thus, to calculate the 3D Cartesian coordinates of P, you would pass the coordinates of the triangle vertices to Barycentric
together with the appropropriate normalized Barycentric (areal) coordinates of P.
The following relationships may be useful.
If ( (amount1 <= 0) and (amount2 >= 0) and (1 − amount1 − amount2 >= 0) ), then the point is inside the triangle
defined by value1, value2, and value3.
If ( (amount1 == 0) and (amount2 >= 0) and (1 − amount1 − amount2 >= 0) ), then the point is on the line defined by
value1 and value3.
If ( (amount1 >= 0) and (amount2 == 0) and (1 − amount1 − amount2 >= 0) ), then the point is on the line defined by
value1 and value2.
If ( (amount1 >= 0) and (amount2 >= 0) and (1 − amount1 − amount2 == 0) ), then the point is on the line defined by
value2 and value3.
Barycentric coordinates are a form of general coordinates. In this context, using barycentric coordinates represents a change in
coordinate systems. What holds true for Cartesian coordinates holds true for barycentric coordinates.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.CatmullRom Method
Performs a Catmull-Rom interpolation using the specified positions.
Overload List
Name Description
Vector3.CatmullRom (Vector3, Vector3, Vector3, Vector3, Single) Performs a Catmull-Rom interpolation using the spe
cified positions.
Vector3.CatmullRom (Vector3, Vector3, Vector3, Vector3, Single, Vector3) Performs a Catmull-Rom interpolation using the spe
cified positions.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
The first position in the interpolation.
value2
The second position in the interpolation.
value3
The third position in the interpolation.
value4
The fourth position in the interpolation.
amount
Weighting factor.
Return Value
A vector that is the result of the Catmull-Rom interpolation.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
The first position in the interpolation.
value2
The second position in the interpolation.
value3
The third position in the interpolation.
value4
The fourth position in the interpolation.
amount
Weighting factor.
result
[OutAttribute] A vector that is the result of the Catmull-Rom interpolation.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.Clamp Method
Restricts a value to be within a specified range.
Overload List
Name Description
Vector3.Clamp (Vector3, Vector3, Vector3) Restricts a value to be within a specified range.
Vector3.Clamp (Vector3, Vector3, Vector3, Vector3) Restricts a value to be within a specified range.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
The value to clamp.
min
The minimum value.
max
The maximum value.
Return Value
The clamped value.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
The value to clamp.
min
The minimum value.
max
The maximum value.
result
[OutAttribute] The clamped value.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.Cross Method
Calculates the cross product of two vectors.
Overload List
Name Description
Vector3.Cross (Vector3, Vector3) Calculates the cross product of two vectors.
Vector3.Cross (Vector3, Vector3, Vector3) Calculates the cross product of two vectors.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
vector1
Source vector.
vector2
Source vector.
Return Value
Cross product of the source vectors.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector1
Source vector.
vector2
Source vector.
result
[OutAttribute] The cross product of the vectors.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.Distance Method
Calculates the distance between two vectors.
Overload List
Name Description
Vector3.Distance (Vector3, Vector3) Calculates the distance between two vectors.
Vector3.Distance (Vector3, Vector3, Single) Calculates the distance between two vectors.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
Return Value
Distance between the source vectors.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
result
[OutAttribute] The distance between the vectors.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.DistanceSquared Method
Calculates the distance between two vectors squared.
Overload List
Name Description
Vector3.DistanceSquared (Vector3, Vector3) Calculates the distance between two vectors squared.
Vector3.DistanceSquared (Vector3, Vector3, Single) Calculates the distance between two vectors squared.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
Return Value
The distance between the source vectors squared.
Remarks
Distance is calculated with the following formula:
Distance squared is the value before taking the square root. Distance squared can often be used in place of distance if relative
comparisons are being made. For example, consider three points A, B, and C. To determine whether B or C is further from A,
compare the distance between A and B to the distance between A and C. Calculating the two distances involves two square
roots, which are computationally expensive. However, using distance squared provides the same information and avoids
calculating two square roots.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
result
[OutAttribute] The distance between the two vectors squared.
Remarks
Distance is calculated with the formula:
Distance squared is the value before taking the square root. Distance squared can often be used in place of distance if relative
comparisons are being made. For example, consider three points A, B, and C. To determine whether B or C is further from A,
compare the distance between A and B to the distance between A and C. Calculating the two distances involves two square
roots, which are computationally expensive. However, using distance squared provides the same information and avoids
calculating two square roots.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.Divide Method
Divide a vector by a scalar or another vector.
Overload List
Name Description
Vector3.Divide (Vector3, Single) Divides a vector by a scalar value.
Vector3.Divide (Vector3, Single, Vector3) Divides a vector by a scalar value.
Vector3.Divide (Vector3, Vector3) Divides the components of a vector by the components of another vector.
Vector3.Divide (Vector3, Vector3, Vector3) Divides the components of a vector by the components of another vector.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
The divisor.
Return Value
The source vector divided by b.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
The divisor.
result
[OutAttribute] The result of the division.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Divisor vector.
Return Value
The result of dividing the vectors.
Remarks
Division of a vector by another vector is not mathematically defined. This method simply divides each component of a by the
matching component of b.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
The divisor.
result
[OutAttribute] The result of the division.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.Dot Method
Calculates the dot product of two vectors.
Overload List
Name Description
Vector3.Dot (Vector3, Vector3) Calculates the dot product of two vectors.
Vector3.Dot (Vector3, Vector3, Single) Calculates the dot product of two vectors.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
vector1
Source vector.
vector2
Source vector.
Return Value
The dot product of the two vectors.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector1
Source vector.
vector2
Source vector.
result
[OutAttribute] The dot product of the two vectors.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
Vector3.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
Vector3.Equals (Vector3) Determines whether the specified Object is equal to the Vector3.
Vector3.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
obj
Object to make the comparison with.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
other
The Vector3 to compare with the current Vector3.
Return Value
true if the specified Vector3 is equal to the current Vector3; false otherwise.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.GetHashCode Method
Gets the hash code of the vector object.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code of the vector object.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.Hermite Method
Performs a Hermite spline interpolation.
Overload List
Name Description
Vector3.Hermite (Vector3, Vector3, Vector3, Vector3, Single) Performs a Hermite spline interpolation.
Vector3.Hermite (Vector3, Vector3, Vector3, Vector3, Single, Vector3) Performs a Hermite spline interpolation.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source position vector.
tangent1
Source tangent vector.
value2
Source position vector.
tangent2
Source tangent vector.
amount
Weighting factor.
Return Value
The result of the Hermite spline interpolation.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source position vector.
tangent1
Source tangent vector.
value2
Source position vector.
tangent2
Source tangent vector.
amount
Weighting factor.
result
[OutAttribute] The result of the Hermite spline interpolation.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.Length Method
Calculates the length of the vector.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float Length ()
Return Value
The length of the vector.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.LengthSquared Method
Calculates the length of the vector squared.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float LengthSquared ()
Return Value
The length of the vector squared.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.Lerp Method
Performs a linear interpolation between two vectors.
Overload List
Name Description
Vector3.Lerp (Vector3, Vector3, Single) Performs a linear interpolation between two vectors.
Vector3.Lerp (Vector3, Vector3, Single, Vector3) Performs a linear interpolation between two vectors.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
amount
Value between 0 and 1 indicating the weight of value2.
Return Value
The linear interpolation of the two vectors.
Remarks
This method performs the linear interpolation based on the following formula.
value1 + (value2 - value1) * amount
Passing amount a value of 0 will cause value1 to be returned; a value of 1 will cause value2 to be returned.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
amount
Value between 0 and 1 indicating the weight of value2.
result
[OutAttribute] The result of the interpolation.
Remarks
This method performs the linear interpolation based on the following formula.
value1 + (value2 - value1) * amount
Passing amount a value of 0 will cause value1 to be returned; a value of 1 will cause value2 to be returned.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.Max Method
Returns a vector that contains the highest value from each matching pair of components.
Overload List
Name Description
Vector3.Max (Vector3, Vector3) Returns a vector that contains the highest value from each matching pair of compone
nts.
Vector3.Max (Vector3, Vector3, Vector3) Returns a vector that contains the highest value from each matching pair of compone
nts.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
Return Value
The maximized vector.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
result
[OutAttribute] The maximized vector.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.Min Method
Returns a vector that contains the lowest value from each matching pair of components.
Overload List
Name Description
Vector3.Min (Vector3, Vector3) Returns a vector that contains the lowest value from each matching pair of componen
ts.
Vector3.Min (Vector3, Vector3, Vector3) Returns a vector that contains the lowest value from each matching pair of componen
ts.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
Return Value
The minimized vector.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
result
[OutAttribute] The minimized vector.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.Multiply Method
Multiplies a vector by a scalar or another vector.
Overload List
Name Description
Vector3.Multiply (Vector3, Single) Multiplies a vector by a scalar value.
Vector3.Multiply (Vector3, Single, Vector3) Multiplies a vector by a scalar value.
Vector3.Multiply (Vector3, Vector3) Multiplies the components of two vectors by each other.
Vector3.Multiply (Vector3, Vector3, Vector3) Multiplies the components of two vectors by each other.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
scaleFactor
Scalar value.
Return Value
Result of the multiplication.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
scaleFactor
Scalar value.
result
[OutAttribute] The result of the multiplication.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
Return Value
Result of the multiplication.
Remarks
Multiplication performed by this method is not vector multiplication (dot product and cross product) but multiplication of the
corresponding components of each vector.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
result
[OutAttribute] The result of the multiplication.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.Negate Method
Returns a vector pointing in the opposite direction.
Overload List
Name Description
Vector3.Negate (Vector3) Returns a vector pointing in the opposite direction.
Vector3.Negate (Vector3, Vector3) Returns a vector pointing in the opposite direction.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value
Source vector.
Return Value
Vector pointing in the opposite direction.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
Source vector.
result
[OutAttribute] Vector pointing in the opposite direction.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.Normalize Method
Creates a unit vector from the specified vector.
Overload List
Name Description
Vector3.Normalize () Turns the current vector into a unit vector.
Vector3.Normalize (Vector3) Creates a unit vector from the specified vector.
Vector3.Normalize (Vector3, Vector3) Returns a normalized version of the specified vector.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Vector3.Normalize Method ()
Turns the current vector into a unit vector.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Normalize ()
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The source Vector3.
Return Value
The created unit vector.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
Source vector.
result
[OutAttribute] The normalized vector.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.op_Addition Method
Adds two vectors.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector3 op_Addition (
Vector3 value1,
Vector3 value2
)
Parameters
value1
Source vector.
value2
Source vector.
Return Value
Sum of the vectors.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.op_Division Method
Divides a vector by a scalar or another vector.
Overload List
Name Description
Vector3.op_Division (Vector3, Single) Divides a vector by a scalar value.
Vector3.op_Division (Vector3, Vector3) Divides the components of a vector by the components of another vector.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value
Source vector.
divider
The divisor.
Return Value
The source vector divided by div.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Divisor vector.
Return Value
The result of dividing the vectors.
Remarks
Division of a vector by another vector is not mathematically defined. This method simply divides each component of a by the
matching component of b.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.op_Equality Method
Tests vectors for equality.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
Vector3 value1,
Vector3 value2
)
Parameters
value1
Source vector.
value2
Source vector.
Return Value
true if the vectors are equal; false otherwise.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.op_Inequality Method
Tests vectors for inequality.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
Vector3 value1,
Vector3 value2
)
Parameters
value1
Vector to compare.
value2
Vector to compare.
Return Value
true if the vectors are not equal; false otherwise.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.op_Multiply Method
Multiplies a vector by a scalar or another vector.
Overload List
Name Description
Vector3.op_Multiply (Single, Vector3) Multiplies a vector by a scalar value.
Vector3.op_Multiply (Vector3, Single) Multiplies a vector by a scalar value.
Vector3.op_Multiply (Vector3, Vector3) Multiplies the components of two vectors by each other.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
scaleFactor
Scalar value.
value
Source vector.
Return Value
Result of the multiplication.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
Source vector.
scaleFactor
Scalar value.
Return Value
Result of the multiplication.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
Return Value
Result of the multiplication.
Remarks
Multiplication performed by this method is not vector multiplication (dot product and cross product) but multiplication of the
corresponding components of each vector.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.op_Subtraction Method
Subtracts a vector from a vector.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector3 op_Subtraction (
Vector3 value1,
Vector3 value2
)
Parameters
value1
Source vector.
value2
Source vector.
Return Value
Result of the subtraction.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.op_UnaryNegation Method
Returns a vector pointing in the opposite direction.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector3 op_UnaryNegation (
Vector3 value
)
Parameters
value
Source vector.
Return Value
Vector pointing in the opposite direction.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.Reflect Method
Returns the reflection of a vector off a surface that has the specified normal.
Overload List
Name Description
Vector3.Reflect (Vector3, Vector3) Returns the reflection of a vector off a surface that has the specified normal.
Vector3.Reflect (Vector3, Vector3, Vector3) Returns the reflection of a vector off a surface that has the specified normal.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
vector
Source vector.
normal
Normal of the surface.
Return Value
The reflected vector.
Remarks Reflect only gives the direction of a reflection off a surface, it does not determine whether the original vector was
close enough to the surface to hit it.
Example Determining the position of a moving particle taking into account a surface being struck.
C#
static Nullable<float> RayPlaneIntersection(ref Ray ray, ref Plane plane)
{
Vector3 PointOnPlane = plane.D * plane.Normal;
float DotNormalDir = Vector3.Dot(plane.Normal, ray.Direction);
if (DotNormalDir == 0) return null;
float d = Vector3.Dot(plane.Normal, PointOnPlane - ray.Position) / DotNormalDir;
return d;
}
if (intersected == true) // The particle hit the surface, so reflect it off the surface
.
{
// If the vector position + direction * speed passes through the plane, calculate t
he reflection.
Vector3 reflectionVector = Vector3.Reflect(direction, surface.Normal);
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector
Source vector.
normal
Normal of the surface.
result
[OutAttribute] The reflected vector.
Remarks Reflect only gives the direction of a reflection off a surface, it does not determine whether the original vector was
close enough to the surface to hit it.
Example Determining the position of a moving particle taking into account a surface being struck.
C#
static Nullable<float> RayPlaneIntersection(ref Ray ray, ref Plane plane)
{
Vector3 PointOnPlane = plane.D * plane.Normal;
float DotNormalDir = Vector3.Dot(plane.Normal, ray.Direction);
if (DotNormalDir == 0) return null;
float d = Vector3.Dot(plane.Normal, PointOnPlane - ray.Position) / DotNormalDir;
return d;
}
//Define a plane with a slope of -1 with respect to the xz-axis and passing through (-5, 0,
-5).
Plane surface = new Plane(new Vector3(-1f / (float)Math.Sqrt(2), 0, -1f / (float)Math.Sqrt(
2)), 5f * (float)Math.Sqrt(2));
void MoveParticle()
{
Ray ray = new Ray(position, direction);
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.SmoothStep Method
Interpolates between two values using a cubic equation.
Overload List
Name Description
Vector3.SmoothStep (Vector3, Vector3, Single) Interpolates between two values using a cubic equation.
Vector3.SmoothStep (Vector3, Vector3, Single, Vector3) Interpolates between two values using a cubic equation.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source value.
value2
Source value.
amount
Weighting value.
Return Value
Interpolated value.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
amount
Weighting value.
result
[OutAttribute] The interpolated value.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.Subtract Method
Subtracts a vector from a vector.
Overload List
Name Description
Vector3.Subtract (Vector3, Vector3) Subtracts a vector from a vector.
Vector3.Subtract (Vector3, Vector3, Vector3) Subtracts a vector from a vector.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
Return Value
Result of the subtraction.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
result
[OutAttribute] The result of the subtraction.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.ToString Method
Retrieves a string representation of the current object.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String that represents the object.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.Transform Method
Transforms a Vector3 or array of Vector3s by a specified Matrix or Quaternion.
Overload List
Name Description
Vector3.Transform (Vector3, Matrix) Transforms a 3D vector by the given matrix.
Vector3.Transform (Vector3, Matrix, Vector3) Transforms a Vector3 by the given Matrix.
Vector3.Transform (Vector3, Quaternion) Transforms a Vector3 by a specified Quaternion rotati
on.
Vector3.Transform (Vector3, Quaternion, Vector3) Transforms a Vector3 by a specified Quaternion rotati
on.
Vector3.Transform (Vector3[], Int32, Matrix, Vector3[], Int32, Int32) Applies a specified transform Matrix to a specified ran
ge of an array of Vector3s and writes the results into a
specified range of a destination array.
Vector3.Transform (Vector3[], Int32, Quaternion, Vector3[], Int32, Int32) Applies a specified Quaternion rotation to a specified r
ange of an array of Vector3s and writes the results int
o a specified range of a destination array.
Vector3.Transform (Vector3[], Matrix, Vector3[]) Transforms a source array of Vector3s by a specified
Matrix and writes the results to an existing destination
array.
Vector3.Transform (Vector3[], Quaternion, Vector3[]) Transforms a source array of Vector3s by a specified
Quaternion rotation and writes the results to an existi
ng destination array.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
position
The source vector.
matrix
The transformation matrix.
Return Value
The transformed vector.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Programming Guide
How To: Transform a Point with a Matrix
How To: Rotate and Move a Camera
How To: Make a First-Person Camera
How To: Make a Third-Person Camera
How To: Detect Whether a User Clicked a 3D Object
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
position
The source Vector3.
matrix
The transformation Matrix.
result
[OutAttribute] The transformed vector.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The Vector3 to rotate.
rotation
The Quaternion rotation to apply.
Return Value
Returns a new Vector3 that results from the rotation.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The Vector3 to rotate.
rotation
The Quaternion rotation to apply.
result
[OutAttribute] An existing Vector3 filled in with the results of the rotation.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sourceArray
The source array.
sourceIndex
The index in the source array at which to start.
matrix
The transform Matrix to apply.
destinationArray
The existing destination array.
destinationIndex
The index in the destination array at which to start.
length
The number of Vector3s to transform.
Exceptions
Exception type Condition
ArgumentException destinationArray is too small to contain the result or the combination of sourceIndex and length was g
reater than sourceArray.Length.
ArgumentNullException sourceArray or destinationArray is null.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sourceArray
The source array.
sourceIndex
The index in the source array at which to start.
rotation
The Quaternion rotation to apply.
destinationArray
The existing destination array.
destinationIndex
The index in the destination array at which to start.
length
The number of Vector3s to transform.
Exceptions
Exception type Condition
ArgumentException destinationArray is too small to contain the result or the combination of sourceIndex and length was g
reater than sourceArray.Length.
ArgumentNullException sourceArray or destinationArray is null.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sourceArray
The source array.
matrix
The transform Matrix to apply.
destinationArray
An existing destination array into which the transformed Vector3s are written.
Exceptions
Exception type Condition
ArgumentException destinationArray is too small to contain the result.
ArgumentNullException sourceArray or destinationArray is null.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sourceArray
The source array.
rotation
The Quaternion rotation to apply.
destinationArray
An existing destination array into which the transformed Vector3s are written.
Exceptions
Exception type Condition
ArgumentException destinationArray is too small to contain the result.
ArgumentNullException sourceArray or destinationArray is null.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.TransformNormal Method
Transforms a vector normal by a matrix.
Overload List
Name Description
Vector3.TransformNormal (Vector3, Matrix) Transforms a 3D vector normal by a matrix.
Vector3.TransformNormal (Vector3, Matrix, Vector3) Transforms a vector normal by a matrix.
Vector3.TransformNormal (Vector3[], Int32, Matrix, Vector3[], Int32, Int32) Transforms a specified range in an array of
3D vector normals by a specified Matrix and writes
the results to a specified range in a destination arra
y.
Vector3.TransformNormal (Vector3[], Matrix, Vector3[]) Transforms an array of 3D vector normals by a spec
ified Matrix.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
normal
The source vector.
matrix
The transformation matrix.
Return Value
The transformed vector normal.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
normal
The source vector.
matrix
The transformation Matrix.
result
[OutAttribute] The Vector3 resulting from the transformation.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sourceArray
The source array of Vector3 normals.
sourceIndex
The starting index in the source array.
matrix
The transform Matrix to apply.
destinationArray
The destination Vector3 array.
destinationIndex
The starting index in the destination array.
length
The number of vectors to transform.
Exceptions
Exception type Condition
ArgumentException destinationArray is too small to contain the result or the combination of sourceIndex and length was g
reater than sourceArray.Length.
ArgumentNullException sourceArray or destinationArray is null.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sourceArray
The array of Vector3 normals to transform.
matrix
The transform matrix to apply.
destinationArray
An existing Vector3 array into which the results of the transforms are written.
Exceptions
Exception type Condition
ArgumentException destinationArray is too small to contain the result.
ArgumentNullException sourceArray or destinationArray is null.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3 Properties
Public Properties
Name Description
Backward Returns a unit Vector3 pointing backward (0, 0, 1).
Down Returns a unit Vector3 pointing down (0, −1, 0).
Forward Returns a unit Vector3 pointing forward (0, 0, −1).
Left Returns a unit Vector3 pointing left (−1, 0, 0).
One Returns a Vector3 with ones in all of its components.
Right Returns a unit Vector3 pointing to the right (1, 0, 0).
UnitX Returns the x unit Vector3 (1, 0, 0).
UnitY Returns the y unit Vector3 (0, 1, 0).
UnitZ Returns the z unit Vector3 (0, 0, 1).
Up Returns a unit Vector3 pointing up (0, 1, 0).
Zero Returns a Vector3 with all of its components set to zero.
See Also
Reference
Vector3 Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Vector3.Backward Property
Returns a unit Vector3 pointing backward (0, 0, 1).
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector3 Backward { get; }
Property Value
A unit Vector3 pointing backward.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.Down Property
Returns a unit Vector3 pointing down (0, −1, 0).
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector3 Down { get; }
Property Value
A unit Vector3 pointing down.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.Forward Property
Returns a unit Vector3 pointing forward (0, 0, −1).
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector3 Forward { get; }
Property Value
A unit Vector3 pointing forward.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.Left Property
Returns a unit Vector3 pointing left (−1, 0, 0).
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector3 Left { get; }
Property Value
A unit Vector3 pointing left.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.One Property
Returns a Vector3 with ones in all of its components.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector3 One { get; }
Property Value
a Vector3 with ones in all of its components.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.Right Property
Returns a unit Vector3 pointing to the right (1, 0, 0).
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector3 Right { get; }
Property Value
A unit Vector3 pointing to the right.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.UnitX Property
Returns the x unit Vector3 (1, 0, 0).
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector3 UnitX { get; }
Property Value
Returns the x unit Vector3 .
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.UnitY Property
Returns the y unit Vector3 (0, 1, 0).
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector3 UnitY { get; }
Property Value
Returns the y unit Vector3.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.UnitZ Property
Returns the z unit Vector3 (0, 0, 1).
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector3 UnitZ { get; }
Property Value
Returns the z unit Vector3.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.Up Property
Returns a unit Vector3 pointing up (0, 1, 0).
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector3 Up { get; }
Property Value
A unit Vector3 pointing up.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3.Zero Property
Returns a Vector3 with all of its components set to zero.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector3 Zero { get; }
Property Value
A Vector3 with all of its components set to zero.
See Also
Reference
Vector3 Structure
Vector3 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4 Structure
Defines a vector with four components.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[TypeConverterAttribute("typeof(Microsoft.Xna.Framework.Design.Vector4Converter)")]
[SerializableAttribute]
public struct Vector4 : IEquatable<Vector4>
See Also
Reference
Vector4 Members
Microsoft.Xna.Framework Namespace
Programming Guide
Math Overview
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4 Members
The following tables list the members exposed by the Vector4 type.
Public Constructors
Name Description
Vector4 Overloaded. Initializes a new instance of Vector4.
Public Fields
Name Description
W Gets or sets the w-component of the vector.
X Gets or sets the x-component of the vector.
Y Gets or sets the y-component of the vector.
Z Gets or sets the z-component of the vector.
Public Properties
Name Description
One Returns a Vector4 with all of its components set to one.
UnitW Returns the Vector4 (0, 0, 0, 1).
UnitX Returns the Vector4 (1, 0, 0, 0).
UnitY Returns the Vector4 (0, 1, 0, 0).
UnitZ Returns the Vector4 (0, 0, 1, 0).
Zero Returns a Vector4 with all of its components set to zero.
Public Methods
Name Description
Add Overloaded. Adds two vectors.
Barycentric Overloaded. Returns a Vector4 containing the 4D Cartesian coordinates of a point specified in barycent
ric (areal) coordinates relative to a 4D triangle.
CatmullRom Overloaded. Performs a Catmull-Rom interpolation using the specified positions.
Clamp Overloaded. Restricts a value to be within a specified range.
Distance Overloaded. Calculates the distance between two vectors.
DistanceSquared Overloaded. Calculates the distance between two vectors squared.
Divide Overloaded. Divide a vector by a scalar or another vector.
Dot Overloaded. Calculates the dot product of two vectors.
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code of this object.
GetType (Inherited from Object.)
Hermite Overloaded. Performs a Hermite spline interpolation.
Length Calculates the length of the vector.
LengthSquared Calculates the length of the vector squared.
Lerp Overloaded. Performs a linear interpolation between two vectors.
Max Overloaded. Returns a vector that contains the highest value from each matching pair of components.
Min Overloaded. Returns a vector that contains the lowest value from each matching pair of components.
Multiply Overloaded. Multiplies a vector by a scalar or another vector.
Negate Overloaded. Returns a vector pointing in the opposite direction.
Normalize Overloaded. Creates a unit vector from the specified vector.
op_Addition Adds two vectors.
op_Division Overloaded. Divides a vector by a scalar or another vector.
op_Equality Tests vectors for equality.
op_Inequality Tests vectors for inequality.
op_Multiply Overloaded. Multiplies a vector by a scalar or another vector.
op_Subtraction Subtracts a vector from a vector.
op_UnaryNegation Returns a vector pointing in the opposite direction.
ReferenceEquals (Inherited from Object.)
SmoothStep Overloaded. Interpolates between two values using a cubic equation.
Subtract Overloaded. Subtracts a vector from a vector.
ToString Retrieves a string representation of the current object.
Transform Overloaded. Transforms one or more vectors by a specified Matrix or Quaternion and returns the resul
ts in Vector4 form.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Vector4 Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Vector4 Fields
Public Fields
Name Description
W Gets or sets the w-component of the vector.
X Gets or sets the x-component of the vector.
Y Gets or sets the y-component of the vector.
Z Gets or sets the z-component of the vector.
See Also
Reference
Vector4 Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Vector4.W Field
Gets or sets the w-component of the vector.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float W
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.X Field
Gets or sets the x-component of the vector.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float X
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.Y Field
Gets or sets the y-component of the vector.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float Y
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.Z Field
Gets or sets the z-component of the vector.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float Z
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4 Constructor
Initializes a new instance of Vector4.
Overload List
Name Description
Vector4 (Single) Creates a new instance of Vector4.
Vector4 (Single, Single, Single, Single) Initializes a new instance of Vector4.
Vector4 (Vector2, Single, Single) Initializes a new instance of Vector4.
Vector4 (Vector3, Single) Initializes a new instance of Vector4.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value
Value to initialize each component to.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
x
Initial value for the x-component of the vector.
y
Initial value for the y-component of the vector.
z
Initial value for the z-component of the vector.
w
Initial value for the w-component of the vector.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
A vector containing the values to initialize x and y components with.
z
Initial value for the z-component of the vector.
w
Initial value for the w-component of the vector.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
A vector containing the values to initialize x, y, and z components with.
w
Initial value for the w-component of the vector.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4 Methods
Public Methods
Name Description
Add Overloaded. Adds two vectors.
Barycentric Overloaded. Returns a Vector4 containing the 4D Cartesian coordinates of a point specified in barycent
ric (areal) coordinates relative to a 4D triangle.
CatmullRom Overloaded. Performs a Catmull-Rom interpolation using the specified positions.
Clamp Overloaded. Restricts a value to be within a specified range.
Distance Overloaded. Calculates the distance between two vectors.
DistanceSquared Overloaded. Calculates the distance between two vectors squared.
Divide Overloaded. Divide a vector by a scalar or another vector.
Dot Overloaded. Calculates the dot product of two vectors.
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code of this object.
GetType (Inherited from Object.)
Hermite Overloaded. Performs a Hermite spline interpolation.
Length Calculates the length of the vector.
LengthSquared Calculates the length of the vector squared.
Lerp Overloaded. Performs a linear interpolation between two vectors.
Max Overloaded. Returns a vector that contains the highest value from each matching pair of components.
Min Overloaded. Returns a vector that contains the lowest value from each matching pair of components.
Multiply Overloaded. Multiplies a vector by a scalar or another vector.
Negate Overloaded. Returns a vector pointing in the opposite direction.
Normalize Overloaded. Creates a unit vector from the specified vector.
op_Addition Adds two vectors.
op_Division Overloaded. Divides a vector by a scalar or another vector.
op_Equality Tests vectors for equality.
op_Inequality Tests vectors for inequality.
op_Multiply Overloaded. Multiplies a vector by a scalar or another vector.
op_Subtraction Subtracts a vector from a vector.
op_UnaryNegation Returns a vector pointing in the opposite direction.
ReferenceEquals (Inherited from Object.)
SmoothStep Overloaded. Interpolates between two values using a cubic equation.
Subtract Overloaded. Subtracts a vector from a vector.
ToString Retrieves a string representation of the current object.
Transform Overloaded. Transforms one or more vectors by a specified Matrix or Quaternion and returns the resul
ts in Vector4 form.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Vector4 Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Vector4.Add Method
Adds two vectors.
Overload List
Name Description
Vector4.Add (Vector4, Vector4) Adds two vectors.
Vector4.Add (Vector4, Vector4, Vector4) Adds two vectors.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
Return Value
Sum of the two vectors.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
result
[OutAttribute] Sum of the source vectors.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.Barycentric Method
Returns a Vector4 containing the 4D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a
4D triangle.
Overload List
Name Description
Vector4.Barycentric (Vector4, Vector4, Vector4, Single, Single) Returns a Vector4 containing the 4D Cartesian coordin
ates of a point specified in barycentric (areal) coordinat
es relative to a 4D triangle.
Vector4.Barycentric (Vector4, Vector4, Vector4, Single, Single, Vector4) Returns a Vector4 containing the 4D Cartesian coordin
ates of a point specified in Barycentric (areal) coordinat
es relative to a 4D triangle.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
A Vector4 containing the 4D Cartesian coordinates of vertex 1 of the triangle.
value2
A Vector4 containing the 4D Cartesian coordinates of vertex 2 of the triangle.
value3
A Vector4 containing the 4D Cartesian coordinates of vertex 3 of the triangle.
amount1
Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in value2).
amount2
Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in value3).
Return Value
A new Vector4 containing the 4D Cartesian coordinates of the specified point.
Remarks
About Barycentric Coordinates
Given a triangle with vertices V1, V2, and V3, any point P on the plane of that triangle can be specified by 3 weighting factors
b1, b2, and b3, each of which indicates how much relative influence the corresponding triangle vertex contributes to the
location of the point, as specified in the following formulas.
Px = (b1 * V1x) + (b2 * V2x) + (b3 * V3x);
Py = (b1 * V1y) + (b2 * V2y) + (b3 * V3y);
Pz = (b1 * V1z) + (b2 * V2z) + (b3 * V3z);
Pw = (b1 * V1w) + (b2 * V2w) + (b3 * V3w);
Such triple weighting factors b1, b2, and b3 are called barycentric coordinates.
Barycentric coordinates express relative weights, meaning that (k * b1), (k * b2), and (k * b3) are also coordinates of the same
point as b1, b2, and b3 for any positive value of k.
If a set of barycentric coordinates is normalized so that: b1 + b2 + b3 = 1, the resulting coordinates are unique for the point in
question, and are known as areal coordinates. When normalized in this way, only two coordinates are needed, say b2 and b3,
since b1 equals (1 − b2 − b3).
What Vector4 Barycentric Does
The Vector4 Barycentric method takes three vectors specifying the Cartesian coordinates of the triangle vertices, V1, V2, and
V3), and two areal coordinates b2 and b3 of some point P (b2 is the amount1 argument and b3 is the amount2 argument).
The b2 coordinate relates to vertex V2, and the b3coordinate relates to V3.
Barycentric then calculates the Cartesian coordinate of P as follows:
Px = ( (1 - b2 - b3) * V1x ) + (b2 * V2x) + (b3 * V3x);
Py = ( (1 - b2 - b3) * V1y ) + (b2 * V2y) + (b3 * V3y);
Pz = ( (1 - b2 - b3) * V1z ) + (b2 * V2z) + (b3 * V3z);
Pw = ( (1 - b2 - b3) * V1w ) + (b2 * V2w) + (b3 * V3w);
Thus, to calculate the 3D Cartesian coordinates of P, you would pass the coordinates of the triangle vertices to Barycentric
together with the appropropriate normalized barycentric (areal) coordinates of P.
The following relationships may be useful.
If ( (amount1 <= 0) and (amount2 >= 0) and (1 − amount1 − amount2 >= 0) ), then the point is inside the triangle
defined by value1, value2, and value3.
If ( (amount1 == 0) and (amount2 >= 0) and (1 − amount1 − amount2 >= 0) ), then the point is on the line defined by
value1 and value3.
If ( (amount1 >= 0) and (amount2 == 0) and (1 − amount1 − amount2 >= 0) ), then the point is on the line defined by
value1 and value2.
If ( (amount1 >= 0) and (amount2 >= 0) and (1 − amount1 − amount2 == 0) ), then the point is on the line defined by
value2 and value3.
Barycentric coordinates are a form of general coordinates. In this context, using barycentric coordinates represents a change in
coordinate systems. What holds true for Cartesian coordinates holds true for barycentric coordinates.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
A Vector4 containing the 4D Cartesian coordinates of vertex 1 of the triangle.
value2
A Vector4 containing the 4D Cartesian coordinates of vertex 2 of the triangle.
value3
A Vector4 containing the 4D Cartesian coordinates of vertex 3 of the triangle.
amount1
Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in value2).
amount2
Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in value3).
result
[OutAttribute] The 4D Cartesian coordinates of the specified point are placed in this Vector4 on exit.
Remarks
About Barycentric Coordinates
Given a triangle with vertices V1, V2, and V3, any point P on the plane of that triangle can be specified by three weighting
factors b1, b2, and b3, each of which indicates how much relative influence the corresponding triangle vertex contributes to
the location of the point, as specified in the following formulas.
Px = (b1 * V1x) + (b2 * V2x) + (b3 * V3x);
Py = (b1 * V1y) + (b2 * V2y) + (b3 * V3y);
Pz = (b1 * V1z) + (b2 * V2z) + (b3 * V3z);
Pw = (b1 * V1w) + (b2 * V2w) + (b3 * V3w);
Such triple weighting factors b1, b2, and b3 are called barycentric coordinates.
Barycentric coordinates express relative weights, meaning that (k * b1), (k * b2), and (k * b3) are also coordinates of the same
point as b1, b2, and b3 for any positive value of k.
If a set of barycentric coordinates is normalized so that: b1 + b2 + b3 = 1, the resulting coordinates are unique for the point in
question, and are known as areal coordinates. When normalized in this way, only two coordinates are needed, say b2 and b3,
since b1 equals (1 − b2 − b3).
What Vector4 Barycentric Does
The Vector4 Barycentric method takes three vectors specifying the Cartesian coordinates of the triangle vertices, V1, V2, and
V3), and two areal coordinates b2 and b3 of some point P (b2 is the amount1 argument and b3 is the amount2 argument).
The b2 coordinate relates to vertex V2, and the b3coordinate relates to V3.
Barycentric then calculates the Cartesian coordinate of P as follows:
Px = ( (1 - b2 - b3) * V1x ) + (b2 * V2x) + (b3 * V3x);
Py = ( (1 - b2 - b3) * V1y ) + (b2 * V2y) + (b3 * V3y);
Pz = ( (1 - b2 - b3) * V1z ) + (b2 * V2z) + (b3 * V3z);
Pw = ( (1 - b2 - b3) * V1w ) + (b2 * V2w) + (b3 * V3w);
Thus, to calculate the 3D Cartesian coordinates of P, you would pass the coordinates of the triangle vertices to Barycentric
together with the appropropriate normalized barycentric (areal) coordinates of P.
The following relationships may be useful.
If ( (amount1 <= 0) and (amount2 >= 0) and (1 − amount1 − amount2 >= 0) ), then the point is inside the triangle
defined by value1, value2, and value3.
If ( (amount1 == 0) and (amount2 >= 0) and (1 − amount1 − amount2 >= 0) ), then the point is on the line defined by
value1 and value3.
If ( (amount1 >= 0) and (amount2 == 0) and (1 − amount1 − amount2 >= 0) ), then the point is on the line defined by
value1 and value2.
If ( (amount1 >= 0) and (amount2 >= 0) and (1 − amount1 − amount2 == 0) ), then the point is on the line defined by
value2 and value3.
Barycentric coordinates are a form of general coordinates. In this context, using barycentric coordinates represents a change in
coordinate systems. What holds true for Cartesian coordinates holds true for barycentric coordinates.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.CatmullRom Method
Performs a Catmull-Rom interpolation using the specified positions.
Overload List
Name Description
Vector4.CatmullRom (Vector4, Vector4, Vector4, Vector4, Single) Performs a Catmull-Rom interpolation using the spe
cified positions.
Vector4.CatmullRom (Vector4, Vector4, Vector4, Vector4, Single, Vector4) Performs a Catmull-Rom interpolation using the spe
cified positions.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
The first position in the interpolation.
value2
The second position in the interpolation.
value3
The third position in the interpolation.
value4
The fourth position in the interpolation.
amount
Weighting factor.
Return Value
A vector that is the result of the Catmull-Rom interpolation.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
The first position in the interpolation.
value2
The second position in the interpolation.
value3
The third position in the interpolation.
value4
The fourth position in the interpolation.
amount
Weighting factor.
result
[OutAttribute] A vector that is the result of the Catmull-Rom interpolation.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.Clamp Method
Restricts a value to be within a specified range.
Overload List
Name Description
Vector4.Clamp (Vector4, Vector4, Vector4) Restricts a value to be within a specified range.
Vector4.Clamp (Vector4, Vector4, Vector4, Vector4) Restricts a value to be within a specified range.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
The value to clamp.
min
The minimum value.
max
The maximum value.
Return Value
The clamped value.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
The value to clamp.
min
The minimum value.
max
The maximum value.
result
[OutAttribute] The clamped value.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.Distance Method
Calculates the distance between two vectors.
Overload List
Name Description
Vector4.Distance (Vector4, Vector4) Calculates the distance between two vectors.
Vector4.Distance (Vector4, Vector4, Single) Calculates the distance between two vectors.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
Return Value
Distance between the source vectors.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
result
[OutAttribute] The distance between the vectors.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.DistanceSquared Method
Calculates the distance between two vectors squared.
Overload List
Name Description
Vector4.DistanceSquared (Vector4, Vector4) Calculates the distance between two vectors squared.
Vector4.DistanceSquared (Vector4, Vector4, Single) Calculates the distance between two vectors squared.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
Return Value
The distance between the source vectors squared.
Remarks
Distance is calculated with the following formula:
Distance squared is the value before taking the square root. Distance squared can often be used in place of distance if relative
comparisons are being made. For example, consider three points A, B, and C. To determine whether B or C is further from A,
compare the distance between A and B to the distance between A and C. Calculating the two distances involves two square
roots, which are computationally expensive. However, using distance squared provides the same information and avoids
calculating two square roots.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
result
[OutAttribute] The distance between the two vectors squared.
Remarks
Distance is calculated with the formula:
Distance squared is the value before taking the square root. Distance squared can often be used in place of distance if relative
comparisons are being made. For example, consider three points A, B, and C. To determine whether B or C is further from A,
compare the distance between A and B to the distance between A and C. Calculating the two distances involves two square
roots, which are computationally expensive. However, using distance squared provides the same information and avoids
calculating two square roots.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.Divide Method
Divide a vector by a scalar or another vector.
Overload List
Name Description
Vector4.Divide (Vector4, Single) Divides a vector by a scalar value.
Vector4.Divide (Vector4, Single, Vector4) Divides a vector by a scalar value.
Vector4.Divide (Vector4, Vector4) Divides the components of a vector by the components of another vector.
Vector4.Divide (Vector4, Vector4, Vector4) Divides the components of a vector by the components of another vector.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
divider
The divisor.
Return Value
The source vector divided by b.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
divider
The divisor.
result
[OutAttribute] The result of the division.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Divisor vector.
Return Value
The result of dividing the vectors.
Remarks
Division of a vector by another vector is not mathematically defined. This method simply divides each component of a by the
matching component of b.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
The divisor.
result
[OutAttribute] The result of the division.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.Dot Method
Calculates the dot product of two vectors.
Overload List
Name Description
Vector4.Dot (Vector4, Vector4) Calculates the dot product of two vectors.
Vector4.Dot (Vector4, Vector4, Single) Calculates the dot product of two vectors.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
vector1
Source vector.
vector2
Source vector.
Return Value
The dot product of the two vectors.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector1
Source vector.
vector2
Source vector.
result
[OutAttribute] The dot product of the two vectors.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
Vector4.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
Vector4.Equals (Vector4) Determines whether the specified Object is equal to the Vector4.
Vector4.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
obj
Object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
other
The Vector4 to compare with the current Vector4.
Return Value
true if the specified Vector4 is equal to the current Vector4; false otherwise.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.GetHashCode Method
Gets the hash code of this object.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code of the vector object.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.Hermite Method
Performs a Hermite spline interpolation.
Overload List
Name Description
Vector4.Hermite (Vector4, Vector4, Vector4, Vector4, Single) Performs a Hermite spline interpolation.
Vector4.Hermite (Vector4, Vector4, Vector4, Vector4, Single, Vector4) Performs a Hermite spline interpolation.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source position vector.
tangent1
Source tangent vector.
value2
Source position vector.
tangent2
Source tangent vector.
amount
Weighting factor.
Return Value
The result of the Hermite spline interpolation.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source position vector.
tangent1
Source tangent vector.
value2
Source position vector.
tangent2
Source tangent vector.
amount
Weighting factor.
result
[OutAttribute] The result of the Hermite spline interpolation.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.Length Method
Calculates the length of the vector.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float Length ()
Return Value
The length of the vector.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.LengthSquared Method
Calculates the length of the vector squared.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float LengthSquared ()
Return Value
The length of the vector squared.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.Lerp Method
Performs a linear interpolation between two vectors.
Overload List
Name Description
Vector4.Lerp (Vector4, Vector4, Single) Performs a linear interpolation between two vectors.
Vector4.Lerp (Vector4, Vector4, Single, Vector4) Performs a linear interpolation between two vectors.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
amount
Value between 0 and 1 indicating the weight of value2.
Return Value
The linear interpolation of the two vectors.
Remarks
This method performs the linear interpolation based on the following formula.
value1 + (value2 - value1) * amount
Passing amount a value of 0 will cause value1 to be returned; a value of 1 will cause value2 to be returned.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
amount
Value between 0 and 1 indicating the weight of value2.
result
[OutAttribute] The result of the interpolation.
Remarks
This method performs the linear interpolation based on the following formula.
value1 + (value2 - value1) * amount
Passing amount a value of 0 will cause value1 to be returned; a value of 1 will cause value2 to be returned.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.Max Method
Returns a vector that contains the highest value from each matching pair of components.
Overload List
Name Description
Vector4.Max (Vector4, Vector4) Returns a vector that contains the highest value from each matching pair of compone
nts.
Vector4.Max (Vector4, Vector4, Vector4) Returns a vector that contains the highest value from each matching pair of compone
nts.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
Return Value
The maximized vector.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
result
[OutAttribute] The maximized vector.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.Min Method
Returns a vector that contains the lowest value from each matching pair of components.
Overload List
Name Description
Vector4.Min (Vector4, Vector4) Returns a vector that contains the lowest value from each matching pair of componen
ts.
Vector4.Min (Vector4, Vector4, Vector4) Returns a vector that contains the lowest value from each matching pair of componen
ts.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
Return Value
The minimized vector.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
result
[OutAttribute] The minimized vector.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.Multiply Method
Multiplies a vector by a scalar or another vector.
Overload List
Name Description
Vector4.Multiply (Vector4, Single) Multiplies a vector by a scalar.
Vector4.Multiply (Vector4, Single, Vector4) Multiplies a vector by a scalar value.
Vector4.Multiply (Vector4, Vector4) Multiplies the components of two vectors by each other.
Vector4.Multiply (Vector4, Vector4, Vector4) Multiplies the components of two vectors by each other.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
scaleFactor
Scalar value.
Return Value
Result of the multiplication.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
scaleFactor
Scalar value.
result
[OutAttribute] The result of the multiplication.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
Return Value
Result of the multiplication.
Remarks
Multiplication performed by this method is not vector multiplication (dot product and cross product) but multiplication of the
corresponding components of each vector.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
result
[OutAttribute] The result of the multiplication.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.Negate Method
Returns a vector pointing in the opposite direction.
Overload List
Name Description
Vector4.Negate (Vector4) Returns a vector pointing in the opposite direction.
Vector4.Negate (Vector4, Vector4) Returns a vector pointing in the opposite direction.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value
Source vector.
Return Value
Vector pointing in the opposite direction.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
Source vector.
result
[OutAttribute] Vector pointing in the opposite direction.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.Normalize Method
Creates a unit vector from the specified vector.
Overload List
Name Description
Vector4.Normalize () Turns the current vector into a unit vector.
Vector4.Normalize (Vector4) Creates a unit vector from the specified vector.
Vector4.Normalize (Vector4, Vector4) Returns a normalized version of the specified vector.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Vector4.Normalize Method ()
Turns the current vector into a unit vector.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Normalize ()
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector
The source Vector4.
Return Value
The created unit vector.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector
Source vector.
result
[OutAttribute] The normalized vector.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.op_Addition Method
Adds two vectors.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector4 op_Addition (
Vector4 value1,
Vector4 value2
)
Parameters
value1
Source vector.
value2
Source vector.
Return Value
Sum of the vectors.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.op_Division Method
Divides a vector by a scalar or another vector.
Overload List
Name Description
Vector4.op_Division (Vector4, Single) Divides a vector by a scalar value.
Vector4.op_Division (Vector4, Vector4) Divides the components of a vector by the components of another vector.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
divider
The divisor.
Return Value
The source vector divided by div.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Divisor vector.
Return Value
The result of dividing the vectors.
Remarks
Division of a vector by another vector is not mathematically defined. This method simply divides each component of a by the
matching component of b.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.op_Equality Method
Tests vectors for equality.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
Vector4 value1,
Vector4 value2
)
Parameters
value1
Source vector.
value2
Source vector.
Return Value
true if the vectors are equal; false otherwise.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.op_Inequality Method
Tests vectors for inequality.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
Vector4 value1,
Vector4 value2
)
Parameters
value1
Vector to compare.
value2
Vector to compare.
Return Value
true if the vectors are not equal; false otherwise.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.op_Multiply Method
Multiplies a vector by a scalar or another vector.
Overload List
Name Description
Vector4.op_Multiply (Single, Vector4) Multiplies a vector by a scalar.
Vector4.op_Multiply (Vector4, Single) Multiplies a vector by a scalar.
Vector4.op_Multiply (Vector4, Vector4) Multiplies the components of two vectors by each other.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
scaleFactor
Scalar value.
value1
Source vector.
Return Value
Result of the multiplication.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
scaleFactor
Scalar value.
Return Value
Result of the multiplication.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
Return Value
Result of the multiplication.
Remarks
Multiplication performed by this method is not vector multiplication (dot product and cross product) but multiplication of the
corresponding components of each vector.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.op_Subtraction Method
Subtracts a vector from a vector.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector4 op_Subtraction (
Vector4 value1,
Vector4 value2
)
Parameters
value1
Source vector.
value2
Source vector.
Return Value
Result of the subtraction.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.op_UnaryNegation Method
Returns a vector pointing in the opposite direction.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector4 op_UnaryNegation (
Vector4 value
)
Parameters
value
Source vector.
Return Value
Vector pointing in the opposite direction.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.SmoothStep Method
Interpolates between two values using a cubic equation.
Overload List
Name Description
Vector4.SmoothStep (Vector4, Vector4, Single) Interpolates between two values using a cubic equation.
Vector4.SmoothStep (Vector4, Vector4, Single, Vector4) Interpolates between two values using a cubic equation.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source value.
value2
Source value.
amount
Weighting value.
Return Value
Interpolated value.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
amount
Weighting factor.
result
[OutAttribute] The interpolated value.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.Subtract Method
Subtracts a vector from a vector.
Overload List
Name Description
Vector4.Subtract (Vector4, Vector4) Subtracts a vector from a vector.
Vector4.Subtract (Vector4, Vector4, Vector4) Subtracts a vector from a vector.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
Return Value
Result of the subtraction.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value1
Source vector.
value2
Source vector.
result
[OutAttribute] The result of the subtraction.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.ToString Method
Retrieves a string representation of the current object.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String that represents the object.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.Transform Method
Transforms one or more vectors by a specified Matrix or Quaternion and returns the results in Vector4 form.
Overload List
Name Description
Vector4.Transform (Vector2, Matrix) Transforms a Vector2 by the given Matrix.
Vector4.Transform (Vector2, Matrix, Vector4) Transforms a Vector2 by the given Matrix.
Vector4.Transform (Vector2, Quaternion) Transforms a Vector2 by a specified Quaternion into a
Vector4.
Vector4.Transform (Vector2, Quaternion, Vector4) Transforms a Vector2 by a specified Quaternion into a
Vector4.
Vector4.Transform (Vector3, Matrix) Transforms a Vector3 by the given Matrix.
Vector4.Transform (Vector3, Matrix, Vector4) Transforms a Vector3 by the given Matrix.
Vector4.Transform (Vector3, Quaternion) Transforms a Vector3 by a specified Quaternion into a
Vector4.
Vector4.Transform (Vector3, Quaternion, Vector4) Transforms a Vector3 by a specified Quaternion into a
Vector4.
Vector4.Transform (Vector4, Matrix) Transforms a Vector4 by the specified Matrix.
Vector4.Transform (Vector4, Matrix, Vector4) Transforms a Vector4 by the given Matrix.
Vector4.Transform (Vector4, Quaternion) Transforms a Vector4 by a specified Quaternion.
Vector4.Transform (Vector4, Quaternion, Vector4) Transforms a Vector4 by a specified Quaternion.
Vector4.Transform (Vector4[], Int32, Matrix, Vector4[], Int32, Int32) Transforms a specified range in an array of Vector4s b
y a specified Matrix into a specified range in a destinat
ion array.
Vector4.Transform (Vector4[], Int32, Quaternion, Vector4[], Int32, Int32) Transforms a specified range in an array of Vector4s b
y a specified Quaternion into a specified range in a de
stination array.
Vector4.Transform (Vector4[], Matrix, Vector4[]) Transforms an array of Vector4s by a specified Matrix.
Vector4.Transform (Vector4[], Quaternion, Vector4[]) Transforms an array of Vector4s by a specified
Quaternion.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Parameters
position
The source Vector2.
matrix
The transformation Matrix.
Return Value
The transformed Vector4.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
position
The source Vector2.
matrix
The transformation Matrix.
result
[OutAttribute] The Vector4 resulting from the transformation.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The Vector2 to transform.
rotation
The Quaternion rotation to apply.
Return Value
Returns the Vector4 resulting from the transformation.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The Vector2 to transform.
rotation
The Quaternion rotation to apply.
result
[OutAttribute] The Vector4 resulting from the transformation.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
position
The source Vector3.
matrix
The transformation Matrix.
Return Value
The Vector4 resulting from the transformation.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
position
The source Vector3.
matrix
The transformation Matrix.
result
[OutAttribute] The Vector4 resulting from the transformation.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The Vector3 to transform.
rotation
The Quaternion rotation to apply.
Return Value
The Vector4 resulting from the transformation.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The Vector3 to transform.
rotation
The Quaternion rotation to apply.
result
[OutAttribute] The Vector4 resulting from the transformation.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector
The source Vector4.
matrix
The transformation Matrix.
Return Value
The transformed Vector4.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector
The source Vector4.
matrix
The transformation Matrix.
result
[OutAttribute] The Vector4 resulting from the transformation.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The Vector4 to transform.
rotation
The Quaternion rotation to apply.
Return Value
The Vector4 resulting from the transformation.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The Vector4 to transform.
rotation
The Quaternion rotation to apply.
result
[OutAttribute] The Vector4 resulting from the transformation.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sourceArray
The array of Vector4s containing the range to transform.
sourceIndex
The index in the source array of the first Vector4 to transform.
matrix
The transform Matrix to apply.
destinationArray
The existing destination array of Vector4s into which to write the results.
destinationIndex
The index in the destination array of the first result Vector4 to write.
length
The number of Vector4s to transform.
Exceptions
Exception type Condition
ArgumentException destinationArray is too small to contain the result or the combination of sourceIndex and length was g
reater than sourceArray.Length.
ArgumentNullException sourceArray or destinationArray is null.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sourceArray
The array of Vector4s containing the range to transform.
sourceIndex
The index in the source array of the first Vector4 to transform.
rotation
The Quaternion rotation to apply.
destinationArray
The existing destination array of Vector4s into which to write the results.
destinationIndex
The index in the destination array of the first result Vector4 to write.
length
The number of Vector4s to transform.
Exceptions
Exception type Condition
ArgumentException destinationArray is too small to contain the result or the combination of sourceIndex and length was g
reater than sourceArray.Length.
ArgumentNullException sourceArray or destinationArray is null.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sourceArray
The array of Vector4s to transform.
matrix
The transform Matrix to apply.
destinationArray
The existing destination array into which the transformed Vector4s are written.
Exceptions
Exception type Condition
ArgumentException destinationArray is too small to contain the result.
ArgumentNullException sourceArray or destinationArray is null.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sourceArray
The array of Vector4s to transform.
rotation
The Quaternion rotation to apply.
destinationArray
The existing destination array into which the transformed Vector4s are written.
Exceptions
Exception type Condition
ArgumentException destinationArray is too small to contain the result or.
ArgumentNullException sourceArray or destinationArray is null.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4 Properties
Public Properties
Name Description
One Returns a Vector4 with all of its components set to one.
UnitW Returns the Vector4 (0, 0, 0, 1).
UnitX Returns the Vector4 (1, 0, 0, 0).
UnitY Returns the Vector4 (0, 1, 0, 0).
UnitZ Returns the Vector4 (0, 0, 1, 0).
Zero Returns a Vector4 with all of its components set to zero.
See Also
Reference
Vector4 Structure
Microsoft.Xna.Framework Namespace
XNA Game Studio 2.0
Vector4.One Property
Returns a Vector4 with all of its components set to one.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector4 One { get; }
Property Value
A Vector4 with all of its components set to one.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.UnitW Property
Returns the Vector4 (0, 0, 0, 1).
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector4 UnitW { get; }
Property Value
The Vector4 (0, 0, 0, 1).
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.UnitX Property
Returns the Vector4 (1, 0, 0, 0).
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector4 UnitX { get; }
Property Value
The Vector4 (1, 0, 0, 0).
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.UnitY Property
Returns the Vector4 (0, 1, 0, 0).
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector4 UnitY { get; }
Property Value
The Vector4 (0, 1, 0, 0).
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.UnitZ Property
Returns the Vector4 (0, 0, 1, 0).
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector4 UnitZ { get; }
Property Value
The Vector4 (0, 0, 1, 0).
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4.Zero Property
Returns a Vector4 with all of its components set to zero.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Vector4 Zero { get; }
Property Value
A Vector4 with all of its components set to zero.
See Also
Reference
Vector4 Structure
Vector4 Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Audio Namespace
Contains low-level application programming interface (API) methods that can load and manipulate XACT-created project and
content files to play audio.
Classes
Name Description
AudioEmitter Represents a 3D audio emitter. This object, used in combination with an AudioListener and the
Cue.Apply3D method, can simulate 3D audio effects for a given Cue.
AudioEngine Represents the audio engine. Applications use the methods of the audio engine to instantiate a
nd manipulate core audio objects.
AudioListener Represents a 3D audio listener. This object, used in combination with an AudioEmitter and the
Cue.Apply3D method, can simulate 3D audio effects for a given Cue.
Cue Defines methods for managing the playback of sounds.
NoAudioHardwareException The exception that is thrown when no audio hardware is present, or when audio hardware is in
stalled but device drivers for the audio hardware are not present or enabled.
SoundBank Represents a sound bank, which is a collection of cues.
WaveBank Represents a wave bank, which is a collection of wave files.
Structures
Name Description
AudioCategory Represents a particular category of sounds.
RendererDetail Represents an audio renderer, which is a device that can render audio to a user.
Enumerations
Name Description
AudioStopOptions Controls how Cue objects should stop when Stop is called.
See Also
Tasks
How To: Add a Sound File to Your Game Using XACT
How To: Play a Sound
How To: Stop or Pause a Sound
How To: Change Sound Volume Levels
Concepts
Audio Overview
XNA Game Studio 2.0
AudioCategory Structure
Represents a particular category of sounds.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct AudioCategory
See Also
Tasks
How To: Play a Sound
How To: Stop or Pause a Sound
How To: Change Sound Volume Levels
Concepts
Audio Overview
Reference
AudioCategory Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioCategory Members
The following tables list the members exposed by the AudioCategory type.
Public Properties
Name Description
Name Specifies the friendly name of this category.
Public Methods
Name Description
Equals Overloaded. Determines whether two instances of AudioCategory are equal.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Determines whether the specified AudioCategory instances are equal.
op_Inequality Determines whether the specified AudioCategory instances are not equal.
Pause Pauses all sounds associated with this category.
ReferenceEquals (Inherited from Object.)
Resume Resumes all paused sounds associated with this category.
SetVolume Sets the volume of all sounds associated with this category.
Stop Stops all sounds associated with this category.
ToString Returns a String representation of this AudioCategory.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Tasks
How To: Play a Sound
How To: Stop or Pause a Sound
How To: Change Sound Volume Levels
Concepts
Audio Overview
Reference
AudioCategory Structure
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
AudioCategory Methods
Public Methods
Name Description
Equals Overloaded. Determines whether two instances of AudioCategory are equal.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Determines whether the specified AudioCategory instances are equal.
op_Inequality Determines whether the specified AudioCategory instances are not equal.
Pause Pauses all sounds associated with this category.
ReferenceEquals (Inherited from Object.)
Resume Resumes all paused sounds associated with this category.
SetVolume Sets the volume of all sounds associated with this category.
Stop Stops all sounds associated with this category.
ToString Returns a String representation of this AudioCategory.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
AudioCategory Structure
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
AudioCategory.Equals Method
Determines whether two instances of AudioCategory are equal.
Overload List
Name Description
AudioCategory.Equals (AudioCategory) Determines whether the specified AudioCategory is equal to this AudioCategory.
AudioCategory.Equals (Object) Determines whether the specified Object is equal to this AudioCategory.
AudioCategory.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
AudioCategory Structure
AudioCategory Members
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
Parameters
other
AudioCategory to compare with this instance.
Return Value
true if the objects are equal; false otherwise.
See Also
Reference
AudioCategory Structure
AudioCategory Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
obj
Object to compare with this instance.
Return Value
true if the objects are equal; false otherwise.
See Also
Reference
AudioCategory Structure
AudioCategory Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioCategory.GetHashCode Method
Gets the hash code for this instance.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for this object.
See Also
Reference
AudioCategory Structure
AudioCategory Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioCategory.op_Equality Method
Determines whether the specified AudioCategory instances are equal.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
AudioCategory value1,
AudioCategory value2
)
Parameters
value1
Object to the left of the equality operator.
value2
Object to the right of the equality operator.
Return Value
true if the objects are equal; false otherwise.
See Also
Reference
AudioCategory Structure
AudioCategory Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioCategory.op_Inequality Method
Determines whether the specified AudioCategory instances are not equal.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
AudioCategory value1,
AudioCategory value2
)
Parameters
value1
Object to the left of the inequality operator.
value2
Object to the right of the inequality operator.
Return Value
true if the objects are not equal; false otherwise.
See Also
Reference
AudioCategory Structure
AudioCategory Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioCategory.Pause Method
Pauses all sounds associated with this category.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Pause ()
See Also
Reference
AudioCategory Structure
AudioCategory Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioCategory.Resume Method
Resumes all paused sounds associated with this category.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Resume ()
See Also
Reference
AudioCategory Structure
AudioCategory Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioCategory.SetVolume Method
Sets the volume of all sounds associated with this category.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void SetVolume (
float volume
)
Parameters
volume
Volume amplitude multiplier. volume is normally between 0.0 (silence) and 1.0 (full volume), but can range from 0.0f to
float.MaxValue.
AudioCategory.Stop Method
Stops all sounds associated with this category.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Stop (
AudioStopOptions options
)
Parameters
options
Enumerated value specifying how the sounds should be stopped.
See Also
Reference
AudioCategory Structure
AudioCategory Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioCategory.ToString Method
Returns a String representation of this AudioCategory.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
AudioCategory Structure
AudioCategory Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioCategory Properties
Public Properties
Name Description
Name Specifies the friendly name of this category.
See Also
Reference
AudioCategory Structure
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
AudioCategory.Name Property
Specifies the friendly name of this category.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Name { get; }
Property Value
Friendly name of this category.
See Also
Reference
AudioCategory Structure
AudioCategory Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioEmitter Class
Represents a 3D audio emitter. This object, used in combination with an AudioListener and the Cue.Apply3D method, can
simulate 3D audio effects for a given Cue.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class AudioEmitter
See Also
Tasks
How To: Apply Basic 3D Positional Effects to a Cue
Reference
AudioEmitter Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioEmitter Members
The following tables list the members exposed by the AudioEmitter type.
Public Constructors
Name Description
AudioEmitter Initializes a new instance of this class.
Public Properties
Name Description
DopplerScale Gets or sets a scalar applied to the level of Doppler effect calculated between this and any AudioListener.
Forward Gets or sets the forward orientation vector for this emitter.
Position Gets or sets the position of this emitter.
Up Gets or sets the upward orientation vector for this emitter.
Velocity Gets or sets the velocity vector of this emitter.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
AudioEmitter Class
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
AudioEmitter Constructor
Initializes a new instance of this class.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public AudioEmitter ()
See Also
Reference
AudioEmitter Class
AudioEmitter Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioEmitter Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
AudioEmitter Class
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
AudioEmitter Properties
Public Properties
Name Description
DopplerScale Gets or sets a scalar applied to the level of Doppler effect calculated between this and any AudioListener.
Forward Gets or sets the forward orientation vector for this emitter.
Position Gets or sets the position of this emitter.
Up Gets or sets the upward orientation vector for this emitter.
Velocity Gets or sets the velocity vector of this emitter.
See Also
Reference
AudioEmitter Class
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
AudioEmitter.DopplerScale Property
Gets or sets a scalar applied to the level of Doppler effect calculated between this and any AudioListener.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float DopplerScale { get; set; }
Property Value
The Doppler scale value.
Exceptions
Exception type Condition
ArgumentOutOfRangeException The doppler scale of an audio emitter must be greater than or equal to zero.
Remarks
By default, this value is 1.0.
This value determines how much to modify the calculated Doppler effect between this object and a AudioListener. Values
below 1.0 scale down the Doppler effect to make it less apparent. Values above 1.0 exaggerate the Doppler effect. A value of
1.0 leaves the effect unmodified.
Note that this value modifies only the calculated Doppler between this object and a AudioListener. The calculated Doppler is a
product of the relationship between AudioEmitter.Velocity and AudioListener.Velocity. If the calculation yields a result of no
Doppler effect, this value has no effect.
See Also
Reference
AudioEmitter Class
AudioEmitter Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioEmitter.Forward Property
Gets or sets the forward orientation vector for this emitter.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Forward { get; set; }
Property Value
The forward orientation vector.
Remarks
By default, this value is Vector3.Forward. In most cases, it is not necessary to modify this value.
Doppler values between an AudioEmitter and an AudioListener are calculated by the relationship between
AudioListener.Velocity and AudioEmitter.Velocity with respect to the axes defined by the Forward and Up vectors of each.
The values of the Forward and Up vectors must be orthonormal (at right angles to one another). Behavior is undefined if these
vectors are not orthonormal.
See Also
Reference
AudioEmitter Class
AudioEmitter Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioEmitter.Position Property
Gets or sets the position of this emitter.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Position { get; set; }
Property Value
The position vector.
Remarks
By default, the value of this property is Vector3.Zero.
The relative positions of an AudioEmitter and an AudioListener are used to determine speaker positioning of a sound.
See Also
Reference
AudioEmitter Class
AudioEmitter Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioEmitter.Up Property
Gets or sets the upward orientation vector for this emitter.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Up { get; set; }
Property Value
The upward orientation vector.
Remarks
By default, this value is Vector3.Up. In most cases, it is not necessary to modify this value.
Doppler values between an AudioEmitter and an AudioListener are calculated by the relationship between
AudioListener.Velocity and AudioEmitter.Velocity with respect to the axes defined by the Forward and Up vectors of each.
The values of the Forward and Up vectors must be orthonormal (at right angles to one another). Behavior is undefined if these
vectors are not orthonormal.
See Also
Reference
AudioEmitter Class
AudioEmitter Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioEmitter.Velocity Property
Gets or sets the velocity vector of this emitter.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Velocity { get; set; }
Property Value
The velocity vector.
Remarks
By default, the value of this property is Vector3.Zero.
The Doppler effect value applied to a Cue is based on the relative Velocity values of the AudioEmitter and AudioListener, scaled
by the DopplerScale value.
The Velocity property is used only to calculate Doppler values. It is not applied to the Position vector or otherwise used to set
game state. You must set Velocity and Position each frame to maintain accurate 3D audio values in your game.
See Also
Reference
AudioEmitter Class
AudioEmitter Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioEngine Class
Represents the audio engine. Applications use the methods of the audio engine to instantiate and manipulate core audio
objects.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class AudioEngine : IDisposable
See Also
Tasks
How To: Play a Sound
How To: Stop or Pause a Sound
How To: Change Sound Volume Levels
Concepts
Audio Overview
Reference
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioEngine Members
The following tables list the members exposed by the AudioEngine type.
Public Constructors
Name Description
AudioEngine Overloaded. Initializes a new instance of this class.
Public Fields
Name Description
ContentVersion Specifies the current content version.
Public Properties
Name Description
IsDisposed Gets a value that indicates whether the object is disposed.
RendererDetails Gets a collection of audio renderers.
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetCategory Gets an audio category.
GetGlobalVariable Gets the value of a global variable.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
SetGlobalVariable Sets the value of a global variable.
ToString (Inherited from Object.)
Update Performs periodic work required by the audio engine.
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
Public Events
Name Description
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micro
soft .NET common language runtime (CLR).
See Also
Tasks
How To: Play a Sound
How To: Stop or Pause a Sound
How To: Change Sound Volume Levels
Concepts
Audio Overview
Reference
AudioEngine Class
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
AudioEngine Fields
Public Fields
Name Description
ContentVersion Specifies the current content version.
See Also
Reference
AudioEngine Class
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
AudioEngine.ContentVersion Field
Specifies the current content version.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public const int ContentVersion
See Also
Reference
AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioEngine Constructor
Initializes a new instance of this class.
Overload List
Name Description
AudioEngine (String) Initializes a new instance of this class, using a path to an XACT global settings file.
AudioEngine (String, TimeSpan, Guid) Initializes a new instance of this class, using a settings file, a specific audio renderer, and
a specific speaker configuration.
See Also
Reference
AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
Parameters
settingsFile
Path to a global settings file.
Exceptions
Exception type Condition
ArgumentNullException The settingsFile parameter is null.
ArgumentException XACT could not load the data provided. Make sure you are using the correct version of the XACT to
ol.
InvalidOperationException The engine could not be created.
See Also
Reference
AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
settingsFile
Path to a global settings file.
lookAheadTime
Interactive audio and branch event look-ahead time, in milliseconds.
rendererId
ID that specifies the audio renderer to use.
Exceptions
Exception type Condition
ArgumentNullException The settingsFile parameter is null.
ArgumentException XACT could not load the data provided. Make sure you are using the correct version of the XACT to
ol.
InvalidOperationException The engine could not be created.
Remarks
The lookAheadTime parameter specifies how far ahead the audio engine will look when determining when to transition to
another sound. For sounds linked to Play events that use a wave variation list, this parameter should be set to greater than 250
milliseconds. Doing so should give the audio engine enough time to prepare streamed data before it is needed for the loop
iteration.
See Also
Reference
AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioEngine Methods
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetCategory Gets an audio category.
GetGlobalVariable Gets the value of a global variable.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
SetGlobalVariable Sets the value of a global variable.
ToString (Inherited from Object.)
Update Performs periodic work required by the audio engine.
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
See Also
Reference
AudioEngine Class
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
AudioEngine.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
AudioEngine.Dispose () Immediately releases the unmanaged resources used by this object.
AudioEngine.Dispose (Boolean) Immediately releases the unmanaged resources used by this object.
See Also
Reference
AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
AudioEngine.Dispose Method ()
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
See Also
Reference
AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
disposing
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
See Also
Reference
AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioEngine.Finalize Method
Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the
object.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void Finalize ()
See Also
Reference
AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioEngine.GetCategory Method
Gets an audio category.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public AudioCategory GetCategory (
string name
)
Parameters
name
Friendly name of the category to get.
Return Value
Audio category.
Exceptions
Exception type Condition
InvalidOperationException This resource could not be created.
See Also
Tasks
How To: Play a Sound
How To: Stop or Pause a Sound
How To: Change Sound Volume Levels
Concepts
Audio Overview
Reference
AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioEngine.GetGlobalVariable Method
Gets the value of a global variable.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float GetGlobalVariable (
string name
)
Parameters
name
Friendly name of the variable.
Return Value
Value of the variable.
Exceptions
Exception type Condition
ArgumentNullException The name parameter is null.
See Also
Concepts
Audio Overview
Reference
AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioEngine.SetGlobalVariable Method
Sets the value of a global variable.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void SetGlobalVariable (
string name,
float value
)
Parameters
name
Value of the global variable.
value
Friendly name of the global variable.
Exceptions
Exception type Condition
ArgumentNullException The name parameter is null.
See Also
Reference
AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioEngine.Update Method
Performs periodic work required by the audio engine.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Update ()
Remarks
This method drives the audio engine, and must be called once per frame.
See Also
Tasks
How To: Play a Sound
How To: Stop or Pause a Sound
How To: Change Sound Volume Levels
Concepts
Audio Overview
Reference
AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioEngine Properties
Public Properties
Name Description
IsDisposed Gets a value that indicates whether the object is disposed.
RendererDetails Gets a collection of audio renderers.
See Also
Reference
AudioEngine Class
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
AudioEngine.IsDisposed Property
Gets a value that indicates whether the object is disposed.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsDisposed { get; }
Property Value
true if the object is disposed; false otherwise.
See Also
Reference
AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioEngine.RendererDetails Property
Gets a collection of audio renderers.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ReadOnlyCollection<RendererDetail> RendererDetails { get; }
Property Value
Collection of audio renderers.
See Also
Reference
AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioEngine Events
Public Events
Name Description
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micro
soft .NET common language runtime (CLR).
See Also
Reference
AudioEngine Class
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
AudioEngine.Disposing Event
Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET
common language runtime (CLR).
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public event EventHandler Disposing
See Also
Reference
AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioListener Class
Represents a 3D audio listener. This object, used in combination with an AudioEmitter and the Cue.Apply3D method, can
simulate 3D audio effects for a given Cue.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class AudioListener
See Also
Tasks
How To: Apply Basic 3D Positional Effects to a Cue
Reference
AudioListener Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioListener Members
The following tables list the members exposed by the AudioListener type.
Public Constructors
Name Description
AudioListener Initializes a new instance of this class.
Public Properties
Name Description
Forward Gets or sets the forward orientation vector for this listener.
Position Gets or sets the position of this listener.
Up Gets or sets the upward orientation vector for this listener.
Velocity Gets or sets the velocity vector of this listener.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
AudioListener Class
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
AudioListener Constructor
Initializes a new instance of this class.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public AudioListener ()
See Also
Reference
AudioListener Class
AudioListener Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioListener Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
AudioListener Class
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
AudioListener Properties
Public Properties
Name Description
Forward Gets or sets the forward orientation vector for this listener.
Position Gets or sets the position of this listener.
Up Gets or sets the upward orientation vector for this listener.
Velocity Gets or sets the velocity vector of this listener.
See Also
Reference
AudioListener Class
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
AudioListener.Forward Property
Gets or sets the forward orientation vector for this listener.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Forward { get; set; }
Property Value
The forward orientation vector.
Remarks
By default, this value is Vector3.Forward. In most cases, it is not necessary to modify this value.
Doppler values between an AudioEmitter and an AudioListener are calculated by the relationship between
AudioListener.Velocity and AudioEmitter.Velocity with respect to the axes defined by the Forward and Up vectors of each.
The values of the Forward and Up vectors must be orthonormal (at right angles to one another). Behavior is undefined if these
vectors are not orthonormal.
See Also
Reference
AudioListener Class
AudioListener Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioListener.Position Property
Gets or sets the position of this listener.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Position { get; set; }
Property Value
The position vector.
Remarks
By default, the value of this property is Vector3.Zero.
The relative positions of an AudioEmitter and an AudioListener are used to determine speaker positioning of a sound.
See Also
Reference
AudioListener Class
AudioListener Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioListener.Up Property
Gets or sets the upward orientation vector for this listener.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Up { get; set; }
Property Value
The upward orientation vector.
Remarks
By default, this value is Vector3.Up. In most cases, it is not necessary to modify this value.
Doppler values between an AudioEmitter and an AudioListener are calculated by the relationship between
AudioListener.Velocity and AudioEmitter.Velocity with respect to the axes defined by the Forward and Up vectors of each.
The values of the Forward and Up vectors must be orthonormal (at right angles to one another). Behavior is undefined if these
vectors are not orthonormal.
See Also
Reference
AudioListener Class
AudioListener Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioListener.Velocity Property
Gets or sets the velocity vector of this listener.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Velocity { get; set; }
Property Value
The velocity vector.
Remarks
By default, the value of this property is Vector3.Zero.
The Doppler effect value applied to a Cue is based on the relative Velocity values of the AudioEmitter and AudioListener, scaled
by the DopplerScale value.
The Velocity property is used only to calculate Doppler values. It is not applied to the Position vector or otherwise used to set
game state. You must set Velocity and Position each frame to maintain accurate 3D audio values in your game.
See Also
Reference
AudioListener Class
AudioListener Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AudioStopOptions Enumeration
Controls how Cue objects should stop when Stop is called.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum AudioStopOptions
Members
Member name Description
AsAuthored Indicates the cue should stop normally, playing any release phase or transition specified in the content.
Immediate Indicates the cue should stop immediately, ignoring any release phase or transition specified in the content.
See Also
Reference
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Cue Class
Defines methods for managing the playback of sounds.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class Cue : IDisposable
Remarks
Cues are what programmers use to play sounds. Cues are typically played when certain game events occur, such as footsteps
or gunshots. A cue is composed of one or more sounds, so when the cue is triggered, the set of associated sounds is heard.
A sound specifies how one or more waves should be played. A sound also has specific properties such as volume and pitch.
The sound designer can adjust these properties.
The advantage to using the Audio API to reference cues rather than specific sounds is that an audio designer can reassign
sounds to a cue in the sound bank without programmer intervention. For example, a sound designer can try various gunshot
waves associated with a particular game event without requiring the programmer to change code or rename sounds.
Cues and sounds are referenced through SoundBank objects. The waves that compose a sound are referenced through
WaveBank objects.
See Also
Tasks
How To: Play a Sound
How To: Stop or Pause a Sound
Concepts
Audio Overview
Reference
Cue Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Cue Members
The following tables list the members exposed by the Cue type.
Public Properties
Name Description
IsCreated Returns whether the cue has been created.
IsDisposed Gets a value indicating whether the object has been disposed.
IsPaused Returns whether the cue is currently paused.
IsPlaying Returns whether the cue is playing.
IsPrepared Returns whether the cue is prepared to play.
IsPreparing Returns whether the cue is preparing to play.
IsStopped Returns whether the cue is currently stopped.
IsStopping Returns whether the cue is stopping playback.
Name Returns the friendly name of the cue.
Public Methods
Name Description
Apply3D Calculates the 3D audio values between an AudioEmitter and an AudioListener object, and applies the resu
lting values to this Cue.
Dispose Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
GetVariable Gets a cue-instance variable value based on its friendly name.
Pause Pauses playback.
Play Requests playback of a prepared or preparing Cue.
ReferenceEquals (Inherited from Object.)
Resume Resumes playback of a paused Cue.
SetVariable Sets the value of a cue-instance variable based on its friendly name.
Stop Stops playback of a Cue.
ToString (Inherited from Object.)
Protected Methods
Name Description
MemberwiseClone (Inherited from Object.)
See Also
Tasks
How To: Play a Sound
How To: Stop or Pause a Sound
Concepts
Audio Overview
Reference
Cue Class
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
Cue Methods
Public Methods
Name Description
Apply3D Calculates the 3D audio values between an AudioEmitter and an AudioListener object, and applies the resu
lting values to this Cue.
Dispose Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
GetVariable Gets a cue-instance variable value based on its friendly name.
Pause Pauses playback.
Play Requests playback of a prepared or preparing Cue.
ReferenceEquals (Inherited from Object.)
Resume Resumes playback of a paused Cue.
SetVariable Sets the value of a cue-instance variable based on its friendly name.
Stop Stops playback of a Cue.
ToString (Inherited from Object.)
Protected Methods
Name Description
MemberwiseClone (Inherited from Object.)
See Also
Reference
Cue Class
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
Cue.Apply3D Method
Calculates the 3D audio values between an AudioEmitter and an AudioListener object, and applies the resulting values to this
Cue.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Apply3D (
AudioListener listener,
AudioEmitter emitter
)
Parameters
listener
The listener to calculate.
emitter
The emitter to calculate.
Exceptions
Exception type Condition
ArgumentNullException Both listener and emitter must be non-null.
InvalidOperationException You must call the Cue.Apply3D method before you call the Cue.Play method.
Remarks
If you want to apply 3D effects to a Cue, you must call this method before you call the Play method. Not doing so will throw an
exception the next time Apply3D is called.
Calling this method automatically sets the speaker mix for any sound played by this cue to a value calculated by the difference
in Position values between listener and emitter. In preparation for the mix, the sound is converted to monoaural. Any stereo
information in the sound is discarded.
Calling this method sets the cue-instance variables Distance, DopplerPitchScalar, and OrientationAngle to the resulting values
of the 3D calculation between listener and emitter. These values do not modify sound attenuation over distance, or pitch
shifting via Doppler values, on their own. You must set up a Runtime Parameter Curve (RPC) that defines how to map the cue-
instance variable values to pitch and volume shifts, and associate sounds to these curves in the Microsoft Cross-Platform Audio
Creation Tool (XACT). For information on doing so, see How To: Apply Attenuation and Doppler 3D Audio Effects.
Example
When first retrieving a Cue object using SoundBank.GetCue, you must call Cue.Apply3D before calling Cue.Play, if you want to
apply 3D effects to the cue.
C#
// 3D audio objects
AudioEmitter emitter = new AudioEmitter();
AudioListener listener = new AudioListener();
Cue cue;
protected override void Initialize()
{
base.Initialize();
// Initialize audio objects
engine = new AudioEngine("Content\\Audio\\3DAudio.xgs");
soundBank = new SoundBank(engine, "Content\\Audio\\Sound Bank.xsb");
waveBank = new WaveBank(engine, "Content\\Audio\\Wave Bank.xwb");
// Get the cue and play it.
// For 3D cues, you must call Apply3D before calling Play.
cue = soundBank.GetCue("buzz");
cue.Apply3D(listener, emitter);
cue.Play();
}
Once you have called Cue.Apply3D then Cue.Play, you can call Cue.Apply3D each Game.Update loop after specifying new
positions and velocities for the listener and emitter objects.
C#
protected override void Update(GameTime gameTime)
{
// Allow the game to exit.
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
this.Exit();
base.Update(gameTime);
}
See Also
Tasks
How To: Apply Basic 3D Positional Effects to a Cue
How To: Apply Attenuation and Doppler 3D Audio Effects
Reference
Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Cue.Dispose Method
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
See Also
Reference
Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Cue.GetVariable Method
Gets a cue-instance variable value based on its friendly name.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float GetVariable (
string name
)
Parameters
name
Friendly name of the variable.
Return Value
Value of the variable.
RemarksCue-instance variables are useful when multiple instantiations of a single cue (and its associated sounds) are required
(for example, a "car" cue where there may be more than one car at any given time). While a global variable allows multiple
audio elements to be controlled in unison, a cue instance variable grants discrete control of each instance of a cue, even for
each copy of the same cue.
Exceptions
Exception type Condition
ArgumentNullException The name parameter is null.
See Also
Reference
Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Cue.Pause Method
Pauses playback.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Pause ()
See Also
Tasks
How To: Play a Sound
How To: Stop or Pause a Sound
Concepts
Audio Overview
Reference
Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Cue.Play Method
Requests playback of a prepared or preparing Cue.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Play ()
See Also
Tasks
How To: Play a Sound
How To: Stop or Pause a Sound
Concepts
Audio Overview
Reference
Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Cue.Resume Method
Resumes playback of a paused Cue.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Resume ()
See Also
Tasks
How To: Play a Sound
How To: Stop or Pause a Sound
Concepts
Audio Overview
Reference
Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Cue.SetVariable Method
Sets the value of a cue-instance variable based on its friendly name.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void SetVariable (
string name,
float value
)
Parameters
name
Friendly name of the variable to set.
value
Value to assign to the variable.
Exceptions
Exception type Condition
ArgumentNullException The name parameter is null.
See Also
Reference
Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Cue.Stop Method
Stops playback of a Cue.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Stop (
AudioStopOptions options
)
Parameters
options
Enumerated value specifying how the sound should stop. If set to None, the sound will play any release phase or transition
specified in the audio designer. If set to Immediate, the sound will stop immediately, ignoring any release phases or
transitions.
See Also
Tasks
How To: Play a Sound
How To: Stop or Pause a Sound
Concepts
Audio Overview
Reference
Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Cue Properties
Public Properties
Name Description
IsCreated Returns whether the cue has been created.
IsDisposed Gets a value indicating whether the object has been disposed.
IsPaused Returns whether the cue is currently paused.
IsPlaying Returns whether the cue is playing.
IsPrepared Returns whether the cue is prepared to play.
IsPreparing Returns whether the cue is preparing to play.
IsStopped Returns whether the cue is currently stopped.
IsStopping Returns whether the cue is stopping playback.
Name Returns the friendly name of the cue.
See Also
Reference
Cue Class
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
Cue.IsCreated Property
Returns whether the cue has been created.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsCreated { get; }
Property Value
true if the cue is created; false otherwise.
See Also
Reference
Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Cue.IsDisposed Property
Gets a value indicating whether the object has been disposed.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsDisposed { get; }
Property Value
true if the object has been disposed; false otherwise.
See Also
Reference
Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Cue.IsPaused Property
Returns whether the cue is currently paused.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsPaused { get; }
Property Value
true if the cue is paused; false otherwise.
Remarks
IsPlaying and IsPaused both return true if a cue is paused while playing.
See Also
Reference
Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Cue.IsPlaying Property
Returns whether the cue is playing.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsPlaying { get; }
Property Value
true if the cue is playing; false otherwise.
Remarks
IsPlaying and IsPaused both return true if a cue is paused while playing.
See Also
Reference
Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Cue.IsPrepared Property
Returns whether the cue is prepared to play.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsPrepared { get; }
Property Value
true if the cue is prepared to play; false otherwise.
Remarks
This property returns true only if the cue is prepared but has not yet been played. Cues that are played return true for
IsPlaying if they are currently playing or true for IsStopped if they are stopped.
See Also
Reference
Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Cue.IsPreparing Property
Returns whether the cue is preparing to play.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsPreparing { get; }
Property Value
true if the cue is preparing to play; false otherwise.
This property returns true only if the cue is preparing but has not yet been prepared. Cues that have been prepared return
true for IsPrepared.
See Also
Reference
Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Cue.IsStopped Property
Returns whether the cue is currently stopped.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsStopped { get; }
Property Value
true if the cue is stopped; false if otherwise.
See Also
Reference
Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Cue.IsStopping Property
Returns whether the cue is stopping playback.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsStopping { get; }
Property Value
true if the cue is stopping; false if otherwise.
See Also
Reference
Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Cue.Name Property
Returns the friendly name of the cue.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Name { get; }
Property Value
Friendly name of the cue.
See Also
Reference
Cue Class
Cue Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NoAudioHardwareException Class
The exception that is thrown when no audio hardware is present, or when audio hardware is installed but device drivers for the
audio hardware are not present or enabled.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public sealed class NoAudioHardwareException : ExternalException
See Also
Reference
NoAudioHardwareException Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NoAudioHardwareException Members
The following tables list the members exposed by the NoAudioHardwareException type.
Public Constructors
Name Description
NoAudioHardwareException Overloaded. Initializes a new instance of this class.
Public Properties
Name Description
Data (Inherited from Exception.)
ErrorCode (Inherited from ExternalException.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
NoAudioHardwareException Class
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
NoAudioHardwareException Constructor
Initializes a new instance of this class.
Overload List
Name Description
NoAudioHardwareException () Initializes a new instance of this class.
NoAudioHardwareException (String) Initializes a new instance of this class with a specified error message.
NoAudioHardwareException (String, Exception) Initializes a new instance of this class with a specified error message and a refe
rence to the inner exception that is the cause of this exception.
See Also
Reference
NoAudioHardwareException Class
NoAudioHardwareException Members
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
NoAudioHardwareException Constructor ()
Initializes a new instance of this class.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public NoAudioHardwareException ()
See Also
Reference
NoAudioHardwareException Class
NoAudioHardwareException Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
message
A message that describes the error.
See Also
Reference
NoAudioHardwareException Class
NoAudioHardwareException Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
message
A message that describes the error.
inner
The exception that is the cause of the current exception. If the inner parameter is not a null reference, the current exception is
raised in a catch block that handles the inner exception.
See Also
Reference
NoAudioHardwareException Class
NoAudioHardwareException Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NoAudioHardwareException Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
NoAudioHardwareException Class
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
NoAudioHardwareException Properties
Public Properties
Name Description
Data (Inherited from Exception.)
ErrorCode (Inherited from ExternalException.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
See Also
Reference
NoAudioHardwareException Class
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
RendererDetail Structure
Represents an audio renderer, which is a device that can render audio to a user.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public struct RendererDetail
See Also
Reference
RendererDetail Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RendererDetail Members
The following tables list the members exposed by the RendererDetail type.
Public Properties
Name Description
FriendlyName Gets the human-readable name for the renderer.
RendererId Specifies the GUID that identifies the renderer.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Compares two objects to determine whether they are the same.
op_Inequality Compares two objects to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
RendererDetail Structure
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
RendererDetail Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Compares two objects to determine whether they are the same.
op_Inequality Compares two objects to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
RendererDetail Structure
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
RendererDetail.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
RendererDetail.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
RendererDetail.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
RendererDetail Structure
RendererDetail Members
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
Parameters
obj
Object to compare to this object.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
RendererDetail Structure
RendererDetail Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RendererDetail.GetHashCode Method
Gets the hash code for this instance.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for this object.
See Also
Reference
RendererDetail Structure
RendererDetail Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RendererDetail.op_Equality Method
Compares two objects to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
RendererDetail left,
RendererDetail right
)
Parameters
left
Object to the left of the equality operator.
right
Object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
RendererDetail Structure
RendererDetail Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RendererDetail.op_Inequality Method
Compares two objects to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
RendererDetail left,
RendererDetail right
)
Parameters
left
Object to the left of the inequality operator.
right
Object to the right of the inequality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
RendererDetail Structure
RendererDetail Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RendererDetail.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
RendererDetail Structure
RendererDetail Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RendererDetail Properties
Public Properties
Name Description
FriendlyName Gets the human-readable name for the renderer.
RendererId Specifies the GUID that identifies the renderer.
See Also
Reference
RendererDetail Structure
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
RendererDetail.FriendlyName Property
Gets the human-readable name for the renderer.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string FriendlyName { get; }
Property Value
The name of the renderer.
See Also
Reference
RendererDetail Structure
RendererDetail Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RendererDetail.RendererId Property
Specifies the GUID that identifies the renderer.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Guid RendererId { get; }
Property Value
GUID of the renderer. If this value is null, the default audio output device is used.
Caution
On Xbox 360, this property is unused and ignored.
See Also
Reference
RendererDetail Structure
RendererDetail Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SoundBank Class
Represents a sound bank, which is a collection of cues.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class SoundBank : IDisposable
See Also
Tasks
How To: Play a Sound
How To: Stop or Pause a Sound
Concepts
Audio Overview
Reference
SoundBank Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SoundBank Members
The following tables list the members exposed by the SoundBank type.
Public Constructors
Name Description
SoundBank Initializes a new instance of this class using a sound bank from file.
Public Properties
Name Description
IsDisposed Gets a value that indicates whether the object is disposed.
IsInUse Returns whether the sound bank is currently in use.
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetCue Gets a cue from the sound bank.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
PlayCue Overloaded. Plays a cue.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
Public Events
Name Description
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micro
soft .NET common language runtime (CLR).
See Also
Tasks
How To: Play a Sound
How To: Stop or Pause a Sound
Concepts
Audio Overview
Reference
SoundBank Class
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
SoundBank Constructor
Initializes a new instance of this class using a sound bank from file.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public SoundBank (
AudioEngine audioEngine,
string filename
)
Parameters
audioEngine
Audio engine that will be associated with this sound bank.
filename
Path to the sound bank file.
Exceptions
Exception type Condition
ArgumentNullException The audioEngine or filename parameter is null.
ArgumentException XACT could not load the data provided. Make sure you are using the correct version of the XACT to
ol.
InvalidOperationException Unable to create the SoundBank resource.
See Also
Reference
SoundBank Class
SoundBank Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SoundBank Methods
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetCue Gets a cue from the sound bank.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
PlayCue Overloaded. Plays a cue.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
See Also
Reference
SoundBank Class
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
SoundBank.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
SoundBank.Dispose () Immediately releases the unmanaged resources used by this object.
SoundBank.Dispose (Boolean) Immediately releases the unmanaged resources used by this object.
See Also
Reference
SoundBank Class
SoundBank Members
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
SoundBank.Dispose Method ()
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
See Also
Reference
SoundBank Class
SoundBank Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
disposing
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
See Also
Reference
SoundBank Class
SoundBank Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SoundBank.Finalize Method
Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the
object.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void Finalize ()
See Also
Reference
SoundBank Class
SoundBank Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SoundBank.GetCue Method
Gets a cue from the sound bank.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Cue GetCue (
string name
)
Parameters
name
Friendly name of the cue to get.
Return Value
Cue object.
Exceptions
Exception type Condition
ArgumentNullException The name parameter is null.
Remarks
Each Cue instance that you retrieve is unique, even when retrieving multiple cues with the same name. This allows multiple
instances of the same Cue to exist and play simultaneously.
The Cue instance that you retrieve using this method is valid only as long as it is in scope. If the Cue instance is allowed to go
out of scope, such as in the case of the Cue being retrieved and played without otherwise being stored, the Cue is marked to be
disposed by the garbage collector. This will result in the Cue stopping playback at an indeterminate time when the garbage
collector disposes of the Cue. To prevent this behavior, store Cue objects to prevent them from falling out of scope.
Alternatively, you can call PlayCue to play a cue immediately that will not fall out of scope.
See Also
Tasks
How To: Play a Sound
How To: Stop or Pause a Sound
Concepts
Audio Overview
Reference
SoundBank Class
SoundBank Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SoundBank.PlayCue Method
Plays a cue.
Overload List
Name Description
SoundBank.PlayCue (String) Plays a cue.
SoundBank.PlayCue (String, AudioListener, AudioEmitter) Plays a cue using 3D positional information specified in an
AudioListener and AudioEmitter.
See Also
Reference
SoundBank Class
SoundBank Members
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
Parameters
name
Name of the cue to play.
Exceptions
Exception type Condition
ArgumentNullException The name parameter is null.
InvalidOperationException The name parameter specifies a cue that does not exist.
Remarks
Each Cue instance that you play is unique, even when playing multiple cues with the same name. This allows multiple instances
of the same Cue to play simultaneously.
Calling this method does not return a Cue object. Therefore, once the cue has started playing, it cannot be controlled through
any methods of Cue, such as Stop, Pause, or Resume. The cue will play until its authored end, at which point it will be released.
Because no Cue object is retrieved, cues played using this method are also unable to use Apply3D to apply 3D effects to the
cue. To retrieve a cue that you can control during playback, or apply 3D effects to, use GetCue.
See Also
Tasks
How To: Play a Sound
How To: Stop or Pause a Sound
Reference
SoundBank.PlayCue Method
SoundBank Class
SoundBank Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
name
Name of the cue to play.
listener
AudioListener that specifies listener 3D audio information.
emitter
AudioEmitter that specifies emitter 3D audio information.
Exceptions
Exception type Condition
ArgumentNullException The name parameter is null.
InvalidOperationException The name parameter specifies a cue that does not exist.
Remarks
The 3D audio information in the specified listener and emitter is used to initialize the cue instance and apply a static positional
3D audio effect (the direction from which the player hears the sound). Position and velocity are not updated over time; the 3D
audio effects are calculated based on the emitter and listener position at the time of the call. Typically, this is used for short-
lived sounds, or when the object and listener are stationary for the duration of the sound but placed somewhere in the world
space.
For example, a sound that is played off to the right will continue to sound as if it is coming from the right, even if the listener
moves or turns. For very short sounds, this may be imperceptable and thus acceptable. As another example, a voice that comes
from the player's vehicle will always be the same distance and direction relative to the player, so static positioning in this case
would be correct.
Attenuation and doppler effects, if enabled, will also be static for the duration of the sound.
To enable dynamic 3D audio when the emitter or listener are moving, use GetCue and Apply3D instead.
Each Cue instance that you play is unique, even when playing multiple cues with the same name. This allows multiple instances
of the same Cue to play simultaneously.
Calling this method does not return a Cue object. Therefore, once the cue has started playing, it cannot be controlled through
any methods of Cue, such as Stop, Pause, or Resume. The cue will play until its authored end, at which point it will be released.
Because no Cue object is retrieved, cues played using this method are also unable to use Apply3D to apply dynamic 3D effects
to the cue. To retrieve a cue that you can control during playback, or apply dynamic 3D effects to, use GetCue.
For more information about 3D audio, see How To: Apply Basic 3D Positional Effects to a Cue and
How To: Apply Attenuation and Doppler 3D Audio Effects.
See Also
Concepts
Audio Overview
Tutorial 3: Making Sounds with XNA Game Studio and XACT
Tasks
How To: Play a Sound
How To: Stop or Pause a Sound
How To: Apply Basic 3D Positional Effects to a Cue
How To: Apply Attenuation and Doppler 3D Audio Effects
Reference
SoundBank.PlayCue Method
SoundBank Class
SoundBank Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SoundBank Properties
Public Properties
Name Description
IsDisposed Gets a value that indicates whether the object is disposed.
IsInUse Returns whether the sound bank is currently in use.
See Also
Reference
SoundBank Class
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
SoundBank.IsDisposed Property
Gets a value that indicates whether the object is disposed.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsDisposed { get; }
Property Value
true if the object is disposed; false otherwise.
See Also
Reference
SoundBank Class
SoundBank Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SoundBank.IsInUse Property
Returns whether the sound bank is currently in use.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsInUse { get; }
Property Value
true if the sound bank is in use; false otherwise.
Remarks
This value will return true if the sound bank is currently referenced by at least one valid cue instance or other client. For
example, the game itself might reference the sound bank.
See Also
Reference
SoundBank Class
SoundBank Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SoundBank Events
Public Events
Name Description
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micro
soft .NET common language runtime (CLR).
See Also
Reference
SoundBank Class
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
SoundBank.Disposing Event
Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET
common language runtime (CLR).
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public event EventHandler Disposing
See Also
Reference
SoundBank Class
SoundBank Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
WaveBank Class
Represents a wave bank, which is a collection of wave files.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class WaveBank : IDisposable
See Also
Tasks
How To: Play a Sound
How To: Stop or Pause a Sound
Concepts
Audio Overview
Reference
WaveBank Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
WaveBank Members
The following tables list the members exposed by the WaveBank type.
Public Constructors
Name Description
WaveBank Overloaded. Initializes a new instance of this class.
Public Properties
Name Description
IsDisposed Gets a value that indicates whether the object is disposed.
IsInUse Returns whether the wave bank is currently in use.
IsPrepared Returns whether the wave bank is prepared to play.
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
Public Events
Name Description
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micro
soft .NET common language runtime (CLR).
See Also
Tasks
How To: Play a Sound
How To: Stop or Pause a Sound
Concepts
Audio Overview
Reference
WaveBank Class
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
WaveBank Constructor
Initializes a new instance of this class.
Overload List
Name Description
WaveBank (AudioEngine, String) Initializes a new, in-memory instance of this class using a specified AudioEngine
and path to a wave bank file.
WaveBank (AudioEngine, String, Int32, Int16) Initializes a new, streaming instance of this class, using a provided AudioEngine a
nd streaming wave bank parameters.
See Also
Reference
WaveBank Class
WaveBank Members
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
Parameters
audioEngine
Instance of an AudioEngine to associate this wave bank with.
nonStreamingWaveBankFilename
Path to the wave bank file to load.
Exceptions
Exception type Condition
ArgumentNullException The audioEngine or nonStreamingWaveBankFilenameparameter is null.
InvalidOperationException Unable to create the WaveBank resource.
Remarks
This constructor generates an in-memory version of a wave bank. The entire wave bank contents are held in memory.
See Also
Reference
WaveBank Class
WaveBank Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
audioEngine
Instance of an AudioEngine to associate this wave bank with.
streamingWaveBankFilename
Path to the wave bank file to stream from.
offset
Offset within the wave bank data file. This offset must be DVD sector aligned.
packetsize
Stream packet size, in sectors, to use for each stream. The minimum value is 2.
Exceptions
Exception type Condition
ArgumentNullException The audioEngine or nonStreamingWaveBankFilenameparameter is null.
InvalidOperationException Unable to create the WaveBank resource.
Remarks
This constructor constructs a streaming wave bank whose contents are streamed from storage as needed.
When setting packetsize, note that the size of a DVD sector is 2,048 bytes. Therefore, setting this value to 2 would result in a
packet size of 4,096 bytes. Setting it to 3 would specify packets of 6,144 bytes, setting it to 4 would specify packets of 8,192
bytes, and so on. The optimal DVD size is a multiple of 16 (1 DVD block = 16 DVD sectors).
After creating a streaming wave bank, you must call Update at least once from the AudioEngine that was used to create the
streaming wave bank before attempting to play a wave from the wave bank. This properly prepares the wave bank for use.
Attempts to play waves out of any wave bank before the wave bank is prepared will result in an error.
See Also
Reference
WaveBank Class
WaveBank Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
WaveBank Methods
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
See Also
Reference
WaveBank Class
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
WaveBank.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
WaveBank.Dispose () Immediately releases the unmanaged resources used by this object.
WaveBank.Dispose (Boolean) Immediately releases the unmanaged resources used by this object.
See Also
Reference
WaveBank Class
WaveBank Members
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
WaveBank.Dispose Method ()
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
See Also
Reference
WaveBank Class
WaveBank Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
disposing
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
See Also
Reference
WaveBank Class
WaveBank Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
WaveBank.Finalize Method
Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the
object.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void Finalize ()
See Also
Reference
WaveBank Class
WaveBank Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
WaveBank Properties
Public Properties
Name Description
IsDisposed Gets a value that indicates whether the object is disposed.
IsInUse Returns whether the wave bank is currently in use.
IsPrepared Returns whether the wave bank is prepared to play.
See Also
Reference
WaveBank Class
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
WaveBank.IsDisposed Property
Gets a value that indicates whether the object is disposed.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsDisposed { get; }
Property Value
true if the object is disposed; false otherwise.
See Also
Reference
WaveBank Class
WaveBank Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
WaveBank.IsInUse Property
Returns whether the wave bank is currently in use.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsInUse { get; }
Property Value
true if the wave bank is in use; false otherwise.
Remarks
This value will return true if the wave bank is currently referenced by at least one valid cue instance or other client. For
example, the game itself might reference the wave bank.
See Also
Reference
WaveBank Class
WaveBank Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
WaveBank.IsPrepared Property
Returns whether the wave bank is prepared to play.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsPrepared { get; }
Property Value
true if the wave bank is prepared; false otherwise.
See Also
Reference
WaveBank Class
WaveBank Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
WaveBank Events
Public Events
Name Description
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micro
soft .NET common language runtime (CLR).
See Also
Reference
WaveBank Class
Microsoft.Xna.Framework.Audio Namespace
XNA Game Studio 2.0
WaveBank.Disposing Event
Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET
common language runtime (CLR).
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public event EventHandler Disposing
See Also
Reference
WaveBank Class
WaveBank Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Content Namespace
Contains the run-time components of the Content Pipeline.
Classes
Name Description
ContentLoadException Exception used to report errors from the ContentManager.Load method.
ContentManager The ContentManager is the run-time component which loads managed obje
cts from the binary files produced by the design time content pipeline. It also
manages the lifespan of the loaded objects, disposing the content manager
will also dispose any assets which are themselves IDisposable.
ContentReader A worker object that implements most of ContentManager.Load. A new
ContentReader is constructed for each asset loaded.
ContentSerializerAttribute A custom Attribute that marks a field or property to control how it is serializ
ed or to indicate that protected or private data should be included in serializ
ation.
ContentSerializerCollectionItemNameAttribute A custom Attribute that marks a collection class to specify the XML element
name for each item in the collection.
ContentSerializerIgnoreAttribute A custom Attribute that marks public fields or properties to prevent them fro
m being serialized.
ContentTypeReader Worker for reading a specific managed type from a binary format. Derive fro
m this class to add new data types to the content pipeline system.
ContentTypeReader Worker for reading a specific managed type from a binary format.
ContentTypeReaderManager A manager that constructs and keeps track of type reader objects.
ResourceContentManager Subclass of ContentManager which is specialized to read from .resx resource
files, rather than directly from individual files on disk.
See Also
Tasks
How To: Add a Game Asset to Your Game
How To: Render a Model
Using a Custom Importer or Content Processor
How To: Write a Custom Importer and Processor
Concepts
Content Pipeline
Overview of the Content Pipeline
XNA Game Studio 2.0
ContentLoadException Class
Exception used to report errors from the ContentManager.Load method.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public class ContentLoadException : Exception
See Also
Reference
ContentLoadException Members
Microsoft.Xna.Framework.Content Namespace
Programming Guide
Content Pipeline
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentLoadException Members
The following tables list the members exposed by the ContentLoadException type.
Public Constructors
Name Description
ContentLoadException Overloaded. Creates a new instance of ContentLoadException.
Public Properties
Name Description
Data (Inherited from Exception.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ContentLoadException Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ContentLoadException Constructor
Creates a new instance of ContentLoadException.
Overload List
Name Description
ContentLoadException () Creates a new instance of ContentLoadException.
ContentLoadException (SerializationInfo, StreamingContext) Creates a new instance of ContentLoadException.
ContentLoadException (String) Creates a new instance of ContentLoadException.
ContentLoadException (String, Exception) Creates a new instance of ContentLoadException.
See Also
Reference
ContentLoadException Class
ContentLoadException Members
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ContentLoadException Constructor ()
Creates a new instance of ContentLoadException.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ContentLoadException ()
See Also
Reference
ContentLoadException Class
ContentLoadException Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
info
Describes the value types that were being loaded when the exception occurred.
context
Describes the stream where the exception occurred.
See Also
Reference
ContentLoadException Class
ContentLoadException Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
message
A message that describes the error.
See Also
Reference
ContentLoadException Class
ContentLoadException Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
message
A message that describes the error.
innerException
The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current
exception is raised in a catch block that handles the inner exception.
See Also
Reference
ContentLoadException Class
ContentLoadException Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentLoadException Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ContentLoadException Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ContentLoadException Properties
Public Properties
Name Description
Data (Inherited from Exception.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
See Also
Reference
ContentLoadException Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ContentManager Class
The ContentManager is the run-time component which loads managed objects from the binary files produced by the design
time content pipeline. It also manages the lifespan of the loaded objects, disposing the content manager will also dispose any
assets which are themselves IDisposable.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class ContentManager : IDisposable
See Also
Reference
ContentManager Members
Microsoft.Xna.Framework.Content Namespace
Programming Guide
Content Pipeline
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentManager Members
The following tables list the members exposed by the ContentManager type.
Public Constructors
Name Description
ContentManager Overloaded. Initializes a new instance of ContentManager.
Public Properties
Name Description
RootDirectory Gets or sets the root directory associated with this ContentManager.
ServiceProvider Gets the service provider associated with the ContentManager.
Public Methods
Name Description
Dispose Overloaded. Releases the resources used by the ContentManager class.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
Load Loads an asset that has been processed by the Content Pipeline.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Unload Disposes all data that was loaded by this ContentManager.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
OpenStream Opens a stream for reading the specified asset. Derived classes can replace this to implement pack files
or asset compression.
ReadAsset Low-level worker method that reads asset data.
See Also
Reference
ContentManager Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ContentManager Constructor
Initializes a new instance of ContentManager.
Overload List
Name Description
ContentManager (IServiceProvider) Initializes a new instance of ContentManager.
ContentManager (IServiceProvider, String) Initializes a new instance of ContentManager.
See Also
Reference
ContentManager Class
ContentManager Members
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
Parameters
serviceProvider
The service provider that the ContentManager should use to locate services.
Exceptions
Exception type Condition
ArgumentNullException The serviceProvider parameter is null.
Remarks
Caution
When creating a new ContentManager, if no instance of Game is otherwise required by the application, it is often better to cr
eate a new class that implements the IServiceProvider interface rather than creating an instance of Game just to create a new
instance of GraphicsDeviceManager.
By default, the ContentManager searches for content in the directory where the executable is located.
Example
To create a ContentManager that uses Game.Services:
C#
ContentManager contentManager = new ContentManager( Services );
See Also
Reference
ContentManager Class
ContentManager Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
serviceProvider
The service provider the ContentManager should use to locate services.
rootDirectory
The root directory to search for content.
Exceptions
Exception type Condition
ArgumentNullException The serviceProvider or rootDirectory parameter is null.
Remarks
Caution
When creating a new ContentManager, if no instance of Game is otherwise required by the application, it is often better to cr
eate a new class that implements the IServiceProvider interface rather than creating an instance of Game just to create a new
instance of GraphicsDeviceManager.
Example
To create a ContentManager that uses Game.Services and searches for resources from the root of the C: drive:
C#
ContentManager contentManager = new ContentManager( Services, "C:\\" );
See Also
Reference
ContentManager Class
ContentManager Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentManager Methods
Public Methods
Name Description
Dispose Overloaded. Releases the resources used by the ContentManager class.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
Load Loads an asset that has been processed by the Content Pipeline.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Unload Disposes all data that was loaded by this ContentManager.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
OpenStream Opens a stream for reading the specified asset. Derived classes can replace this to implement pack files
or asset compression.
ReadAsset Low-level worker method that reads asset data.
See Also
Reference
ContentManager Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ContentManager.Dispose Method
Releases the resources used by the ContentManager class.
Overload List
Name Description
ContentManager.Dispose () Releases all resources used by the ContentManager class.
ContentManager.Dispose (Boolean) Releases the unmanaged resources used by the ContentManager and optionally releases t
he managed resources.
See Also
Reference
ContentManager Class
ContentManager Members
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ContentManager.Dispose Method ()
Releases all resources used by the ContentManager class.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
See Also
Reference
ContentManager Class
ContentManager Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
disposing
true to release both managed and unmanaged resources; false to release only unmanaged resources.
See Also
Reference
ContentManager Class
ContentManager Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of asset to load. Model, Effect, SpriteFont, Texture, Texture2D, Texture3D and TextureCube are all supported by
default by the standard Content Pipeline processor, but additional types may be loaded by extending the processor.
Parameters
assetName
Asset name, relative to the loader root directory, and not including the .xnb file extension.
Return Value
The loaded asset. Repeated calls to load the same asset will return the same object instance.
Exceptions
Exception type Condition
ObjectDisposedException Load was called after the ContentManager was disposed.
ArgumentNullException The assetName argument is null.
ContentLoadException The type of the assetName in the file does not match the type of asset requested as specified by T.
Remarks
Before a ContentManager can load an asset, you need to add the asset to your game project using the steps described in
How To: Add a Game Asset to Your Game.
The following are the Content Pipeline run-time classes supported by Load and the file formats they are associated with.
Effect Class .fx
Model Class .fbx, .x
SpriteFont Class
.bmp, .spritefont, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga
Note
The default content processor for .bmp files is the texture processor. To process a .bmp file for use as a Spr
ite Font, click Sprite Font Texture - XNA Framework in the Properties pane for the .bmp file after it has
been added to the project.
Texture Class, .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga
Texture2D Class
Texture3D Class, .dds
TextureCube Class
Note that these are the formats of the original assets; after processing, all assets will be .xnb files.
Example
To load a Model from the directory .\content\models\ with the asset name of "box":
C#
Model model = contentManager.Load<Model>( ".\\content\\models\\box" );
See Also
Tasks
How To: Add a Game Asset to Your Game
How To: Write a Custom Importer and Processor
Reference
ContentManager Class
ContentManager Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentManager.OpenStream Method
Opens a stream for reading the specified asset. Derived classes can replace this to implement pack files or asset compression.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected virtual Stream OpenStream (
string assetName
)
Parameters
assetName
The name of the asset being read.
Return Value
The opened stream.
Exceptions
Exception type Condition
ContentLoadException Unable to open the file containing assetName, or the file was not found.
See Also
Reference
ContentManager Class
ContentManager Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
Type of the asset specified for loading.
Parameters
assetName
The name of the asset to be loaded from disk.
recordDisposableObject
Delegate function for handling the disposition of assets. If recordDisposableObject is null, the default lifespan tracking and
management is used, so unloading or disposing of the content manager frees everything that has been loaded through it. If
recordDisposableObject specifies a valid delegate, that delegate is used instead of the default lifespan tracking and is called
every time the loader encounters a type that implements IDisposable. You must use your own code to unload assets loaded
in this fashion, since ContentManager's Unload method will not be aware of them.
Return Value
Returns the loaded asset.
Exceptions
Exception type Condition
ObjectDisposedException ReadAsset was called after the ContentManager was disposed.
ArgumentNullException The assetName argument is null.
Remarks
This protected method loads an .xnb file from disk. Unlike ContentManager's public Load method, it always returns a new copy
of the specified asset, even if the asset has been loaded previously.
You can customize how shared assets are managed by overriding ContentManager's Load method. In your own Load method,
keep track of what has been loaded, and call ReadAsset when you need a new asset from disk.
See Also
Reference
ContentManager Class
ContentManager Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentManager.Unload Method
Disposes all data that was loaded by this ContentManager.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public virtual void Unload ()
Exceptions
Exception type Condition
ObjectDisposedException Unload was called after the ContentManager was disposed.
See Also
Reference
ContentManager Class
ContentManager Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentManager Properties
Public Properties
Name Description
RootDirectory Gets or sets the root directory associated with this ContentManager.
ServiceProvider Gets the service provider associated with the ContentManager.
See Also
Reference
ContentManager Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ContentManager.RootDirectory Property
Gets or sets the root directory associated with this ContentManager.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string RootDirectory { get; set; }
Property Value
The root directory associated with this ContentManager.
Exceptions
Exception type Condition
ArgumentNullException RootDirectory cannot be null.
InvalidOperationException This property cannot be changed after content has been loaded into the ContentManager.
See Also
Reference
ContentManager Class
ContentManager Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentManager.ServiceProvider Property
Gets the service provider associated with the ContentManager.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public IServiceProvider ServiceProvider { get; }
Property Value
The service provider associated with the ContentManager.
See Also
Reference
ContentManager Class
ContentManager Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentReader Class
A worker object that implements most of ContentManager.Load. A new ContentReader is constructed for each asset loaded.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class ContentReader : BinaryReader
See Also
Reference
ContentReader Members
Microsoft.Xna.Framework.Content Namespace
Programming Guide
Content Pipeline
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentReader Members
The following tables list the members exposed by the ContentReader type.
Public Properties
Name Description
AssetName Gets the name of the asset currently being read by this ContentReader.
BaseStream (Inherited from BinaryReader.)
ContentManager Gets the ContentManager associated with the ContentReader.
Public Methods
Name Description
Close (Inherited from BinaryReader.)
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
PeekChar (Inherited from BinaryReader.)
Read (Inherited from BinaryReader.)
ReadBoolean (Inherited from BinaryReader.)
ReadByte (Inherited from BinaryReader.)
ReadBytes (Inherited from BinaryReader.)
ReadChar (Inherited from BinaryReader.)
ReadChars (Inherited from BinaryReader.)
ReadDecimal (Inherited from BinaryReader.)
ReadDouble (Inherited from BinaryReader.)
ReadExternalReference Reads a link to an external file.
ReadInt16 (Inherited from BinaryReader.)
ReadInt32 (Inherited from BinaryReader.)
ReadInt64 (Inherited from BinaryReader.)
ReadMatrix Reads a Matrix value from the currently open stream.
ReadObject Overloaded. Reads a single managed object from the current stream. Can be called recursively.
ReadQuaternion Reads a Quaternion value from the current stream.
ReadRawObject Overloaded. Reads a single managed object from the current stream as an instance of the specified t
ype. If a base class of the actual object type is specified only data from the base type will be read.
ReadSByte (Inherited from BinaryReader.)
ReadSharedResource Reads a shared resource ID, and records it for subsequent fix-up.
ReadSingle (Inherited from BinaryReader.)
ReadString (Inherited from BinaryReader.)
ReadUInt16 (Inherited from BinaryReader.)
ReadUInt32 (Inherited from BinaryReader.)
ReadUInt64 (Inherited from BinaryReader.)
ReadVector2 Reads a Vector2 value from the current stream.
ReadVector3 Reads a Vector3 value from the current stream.
ReadVector4 Reads a Vector4 value from the current stream.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Dispose (Inherited from BinaryReader.)
FillBuffer (Inherited from BinaryReader.)
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ContentReader Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ContentReader Methods
Public Methods
Name Description
Close (Inherited from BinaryReader.)
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
PeekChar (Inherited from BinaryReader.)
Read (Inherited from BinaryReader.)
ReadBoolean (Inherited from BinaryReader.)
ReadByte (Inherited from BinaryReader.)
ReadBytes (Inherited from BinaryReader.)
ReadChar (Inherited from BinaryReader.)
ReadChars (Inherited from BinaryReader.)
ReadDecimal (Inherited from BinaryReader.)
ReadDouble (Inherited from BinaryReader.)
ReadExternalReference Reads a link to an external file.
ReadInt16 (Inherited from BinaryReader.)
ReadInt32 (Inherited from BinaryReader.)
ReadInt64 (Inherited from BinaryReader.)
ReadMatrix Reads a Matrix value from the currently open stream.
ReadObject Overloaded. Reads a single managed object from the current stream. Can be called recursively.
ReadQuaternion Reads a Quaternion value from the current stream.
ReadRawObject Overloaded. Reads a single managed object from the current stream as an instance of the specified t
ype. If a base class of the actual object type is specified only data from the base type will be read.
ReadSByte (Inherited from BinaryReader.)
ReadSharedResource Reads a shared resource ID, and records it for subsequent fix-up.
ReadSingle (Inherited from BinaryReader.)
ReadString (Inherited from BinaryReader.)
ReadUInt16 (Inherited from BinaryReader.)
ReadUInt32 (Inherited from BinaryReader.)
ReadUInt64 (Inherited from BinaryReader.)
ReadVector2 Reads a Vector2 value from the current stream.
ReadVector3 Reads a Vector3 value from the current stream.
ReadVector4 Reads a Vector4 value from the current stream.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Dispose (Inherited from BinaryReader.)
FillBuffer (Inherited from BinaryReader.)
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ContentReader Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
Type Parameters
T
The type of asset stored in the external file.
Return Value
The asset stored in the external file.
See Also
Reference
ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentReader.ReadMatrix Method
Reads a Matrix value from the currently open stream.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Matrix ReadMatrix ()
Return Value
The Matrix that was read.
See Also
Reference
ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentReader.ReadObject Method
Reads a single managed object from the current stream. Can be called recursively.
Overload List
Name Description
ContentReader.ReadObject () Reads a single managed object from the current stream. Can be called rec
ursively.
ContentReader.ReadObject (ContentTypeReader) Reads a single managed object from the current stream. Can be called rec
ursively.
ContentReader.ReadObject (ContentTypeReader, T) Reads a single managed object from the current stream. Can be called rec
ursively.
ContentReader.ReadObject (T) Reads a single managed object from the current stream. Can be called rec
ursively.
See Also
Reference
ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
Type Parameters
T
The type of object to read.
Return Value
The object that was read.
See Also
Reference
ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of object to read.
Parameters
typeReader
The ContentTypeReader to use to read the object.
Return Value
The object that was read.
See Also
Reference
ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of object to read.
Parameters
typeReader
The ContentTypeReader to use to read the object.
existingInstance
An existing object to write into.
Return Value
The object that was read.
See Also
Reference
ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of object to read.
Parameters
existingInstance
An existing object to write into.
Return Value
The object that was read.
See Also
Reference
ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentReader.ReadQuaternion Method
Reads a Quaternion value from the current stream.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Quaternion ReadQuaternion ()
Return Value
The Quaternion that was read.
See Also
Reference
ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentReader.ReadRawObject Method
Reads a single managed object from the current stream as an instance of the specified type. If a base class of the actual object
type is specified only data from the base type will be read.
Overload List
Name Description
ContentReader.ReadRawObject () Reads a single managed object from the current stream as an instance
of the specified type. If you specify a base class of the actual object typ
e, this method reads data only from the base type.
ContentReader.ReadRawObject (ContentTypeReader) Reads a single managed object from the current stream as an instance
of the specified type. If a base class of the actual object type is specifie
d only data from the base type will be read.
ContentReader.ReadRawObject (ContentTypeReader, T) Reads a single managed object from the current stream as an instance
of the specified type. If you specify a base class of the actual object typ
e, this method reads data only from the base type.
ContentReader.ReadRawObject (T) Reads a single managed object from the current stream as an instance
of the specified type. If you specify a base class of the actual object typ
e, the method reads data only from the base type.
See Also
Reference
ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
Type Parameters
T
The type of object to read.
Return Value
The object that was read.
See Also
Reference
ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of object to read.
Parameters
typeReader
The ContentTypeReader to use to read the object.
Return Value
The object that was read.
Exceptions
Exception type Condition
ArgumentNullException typeReader is null.
See Also
Reference
ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of object to read.
Parameters
typeReader
The ContentTypeReader to use to read the object.
existingInstance
An existing object to write into.
Return Value
The object that was read.
Exceptions
Exception type Condition
ArgumentNullException typeReader is null.
See Also
Reference
ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of object to read.
Parameters
existingInstance
An existing object to write into.
Return Value
The object that was read.
See Also
Reference
ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of the shared resource.
Parameters
fixup
The fix-up action to perform.
Exceptions
Exception type Condition
ArgumentNullException fixup is null.
ContentLoadException Error loading the resource.
See Also
Reference
ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentReader.ReadVector2 Method
Reads a Vector2 value from the current stream.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector2 ReadVector2 ()
Return Value
The Vector2 that was read.
See Also
Reference
ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentReader.ReadVector3 Method
Reads a Vector3 value from the current stream.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 ReadVector3 ()
Return Value
The Vector3 that was read.
See Also
Reference
ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentReader.ReadVector4 Method
Reads a Vector4 value from the current stream.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector4 ReadVector4 ()
Return Value
The Vector4 that was read.
See Also
Reference
ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentReader Properties
Public Properties
Name Description
AssetName Gets the name of the asset currently being read by this ContentReader.
BaseStream (Inherited from BinaryReader.)
ContentManager Gets the ContentManager associated with the ContentReader.
See Also
Reference
ContentReader Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ContentReader.AssetName Property
Gets the name of the asset currently being read by this ContentReader.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string AssetName { get; }
Property Value
Name of the asset currently being read by this ContentReader.
Remarks
AssetName can be useful to include in the exception message if a custom ContentTypeReader encounters an error.
See Also
Reference
ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentReader.ContentManager Property
Gets the ContentManager associated with the ContentReader.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ContentManager ContentManager { get; }
Property Value
The ContentManager associated with the ContentReader.
See Also
Reference
ContentReader Class
ContentReader Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentSerializerAttribute Class
A custom Attribute that marks a field or property to control how it is serialized or to indicate that protected or private data
should be included in serialization.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[AttributeUsageAttribute(384)]
public sealed class ContentSerializerAttribute : Attribute
See Also
Reference
ContentSerializerAttribute Members
Microsoft.Xna.Framework.Content Namespace
Programming Guide
Content Pipeline
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentSerializerAttribute Members
The following tables list the members exposed by the ContentSerializerAttribute type.
Public Constructors
Name Description
ContentSerializerAttribute Creates a new instance of ContentSerializerAttribute.
Public Properties
Name Description
AllowNull Get or set a value indicating whether this member can have a null value (default=true).
CollectionItemName Gets or sets the XML element name for each item in a collection (default = "Item").
ElementName Gets or sets the XML element name (default=name of the managed type member).
FlattenContent Gets or sets a value idicating whether to write member contents directly into the current XML cont
ext rather than wrapping the member in a new XML element (default=false).
HasCollectionItemName Indicates whether an explicit CollectionItemName string is being used or the default value.
Optional Indicates whether to write this element if the member is null and skip past it if not found when des
erializing XML (default=false).
SharedResource Indicates whether this member is referenced from multiple parents and should be serialized as a u
nique ID reference (default=false).
TypeId (Inherited from Attribute.)
Public Methods
Name Description
Clone Creates a copy of the ContentSerializerAttribute.
Equals (Inherited from Object.)
GetCustomAttribute (Inherited from Attribute.)
GetCustomAttributes (Inherited from Attribute.)
GetType (Inherited from Object.)
IsDefaultAttribute (Inherited from Attribute.)
IsDefined (Inherited from Attribute.)
Match (Inherited from Attribute.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ContentSerializerAttribute Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ContentSerializerAttribute Constructor
Creates a new instance of ContentSerializerAttribute.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ContentSerializerAttribute ()
Example
C#
[ContentSerializerAttribute()]
See Also
Reference
ContentSerializerAttribute Class
ContentSerializerAttribute Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentSerializerAttribute Methods
Public Methods
Name Description
Clone Creates a copy of the ContentSerializerAttribute.
Equals (Inherited from Object.)
GetCustomAttribute (Inherited from Attribute.)
GetCustomAttributes (Inherited from Attribute.)
GetType (Inherited from Object.)
IsDefaultAttribute (Inherited from Attribute.)
IsDefined (Inherited from Attribute.)
Match (Inherited from Attribute.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ContentSerializerAttribute Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ContentSerializerAttribute.Clone Method
Creates a copy of the ContentSerializerAttribute.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ContentSerializerAttribute Clone ()
Return Value
The copy.
See Also
Reference
ContentSerializerAttribute Class
ContentSerializerAttribute Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentSerializerAttribute Properties
Public Properties
Name Description
AllowNull Get or set a value indicating whether this member can have a null value (default=true).
CollectionItemName Gets or sets the XML element name for each item in a collection (default = "Item").
ElementName Gets or sets the XML element name (default=name of the managed type member).
FlattenContent Gets or sets a value idicating whether to write member contents directly into the current XML cont
ext rather than wrapping the member in a new XML element (default=false).
HasCollectionItemName Indicates whether an explicit CollectionItemName string is being used or the default value.
Optional Indicates whether to write this element if the member is null and skip past it if not found when des
erializing XML (default=false).
SharedResource Indicates whether this member is referenced from multiple parents and should be serialized as a u
nique ID reference (default=false).
TypeId (Inherited from Attribute.)
See Also
Reference
ContentSerializerAttribute Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ContentSerializerAttribute.AllowNull Property
Get or set a value indicating whether this member can have a null value (default=true).
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool AllowNull { get; set; }
Property Value
Value indicating whether this member can have a null value.
Example
ContentSerializerAttribute with AllowNull set to false.
C#
[ContentSerializerAttribute( AllowNull = false )]
See Also
Reference
ContentSerializerAttribute Class
ContentSerializerAttribute Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentSerializerAttribute.CollectionItemName Property
Gets or sets the XML element name for each item in a collection (default = "Item").
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string CollectionItemName { get; set; }
Property Value
The XML element name for each item in the collection.
Exceptions
Exception type Condition
ArgumentNullException CollectionItemName is null.
Example
ContentSerializerAttribute with CollectionItemName set to the string "PlayerName":
C#
[ContentSerializerAttribute( CollectionItemName = "PlayerName" )]
See Also
Reference
ContentSerializerAttribute Class
ContentSerializerAttribute Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentSerializerAttribute.ElementName Property
Gets or sets the XML element name (default=name of the managed type member).
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string ElementName { get; set; }
Property Value
The XML element name.
Example
ContentSerializerAttribute with ElementName set to the string "PlayerName".
C#
[ContentSerializerAttribute( ElementName = "PlayerName" )]
See Also
Reference
ContentSerializerAttribute Class
ContentSerializerAttribute Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentSerializerAttribute.FlattenContent Property
Gets or sets a value idicating whether to write member contents directly into the current XML context rather than wrapping the
member in a new XML element (default=false).
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool FlattenContent { get; set; }
Property Value
Value idicating whether to write member contents directly into the current XML context rather than wrapping the member in a
new XML element.
Example
ContentSerializerAttribute with FlattenContent set true.
C#
[ContentSerializerAttribute( FlattenContent = true )]
See Also
Reference
ContentSerializerAttribute Class
ContentSerializerAttribute Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentSerializerAttribute.HasCollectionItemName Property
Indicates whether an explicit CollectionItemName string is being used or the default value.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool HasCollectionItemName { get; }
Property Value
true if an explicit CollectionItemName string is being used; false otherwise.
Example
ContentSerializerAttribute with HasCollectionItemName set true.
C#
[ContentSerializerAttribute( HasCollectionItemName = true )]
See Also
Reference
ContentSerializerAttribute Class
ContentSerializerAttribute Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentSerializerAttribute.Optional Property
Indicates whether to write this element if the member is null and skip past it if not found when deserializing XML
(default=false).
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool Optional { get; set; }
Property Value
true if the member should be skipped when null.
Example
ContentSerializerAttribute with Optional set true.
C#
[ContentSerializerAttribute( Optional = true )]
See Also
Reference
ContentSerializerAttribute Class
ContentSerializerAttribute Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentSerializerAttribute.SharedResource Property
Indicates whether this member is referenced from multiple parents and should be serialized as a unique ID reference
(default=false).
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SharedResource { get; set; }
Property Value
true if this member is referenced from multiple parents; false otherwise.
Example
ContentSerializerAttribute with SharedResource set true.
C#
[ContentSerializerAttribute( SharedResource = true )]
See Also
Reference
ContentSerializerAttribute Class
ContentSerializerAttribute Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentSerializerCollectionItemNameAttribute Class
A custom Attribute that marks a collection class to specify the XML element name for each item in the collection.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[AttributeUsageAttribute(4)]
public sealed class ContentSerializerCollectionItemNameAttribute : Attribute
See Also
Reference
ContentSerializerCollectionItemNameAttribute Members
Microsoft.Xna.Framework.Content Namespace
Programming Guide
Content Pipeline
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentSerializerCollectionItemNameAttribute Members
The following tables list the members exposed by the ContentSerializerCollectionItemNameAttribute type.
Public Constructors
Name Description
ContentSerializerCollectionItemNameAttribute Creates a new instance of ContentSerializerCollectionItemNameAttribute.
Public Properties
Name Description
CollectionItemName Gets the name that will be used for each item in the collection.
TypeId (Inherited from Attribute.)
Public Methods
Name Description
Equals (Inherited from Object.)
GetCustomAttribute (Inherited from Attribute.)
GetCustomAttributes (Inherited from Attribute.)
GetType (Inherited from Object.)
IsDefaultAttribute (Inherited from Attribute.)
IsDefined (Inherited from Attribute.)
Match (Inherited from Attribute.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ContentSerializerCollectionItemNameAttribute Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ContentSerializerCollectionItemNameAttribute Constructor
Creates a new instance of ContentSerializerCollectionItemNameAttribute.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ContentSerializerCollectionItemNameAttribute (
string collectionItemName
)
Parameters
collectionItemName
The name for each item in the collection.
Exceptions
Exception type Condition
ArgumentNullException collectionItemName is null.
Example
C#
[ContentSerializerCollectionItemNameAttribute( "CollectionItem" )]
See Also
Reference
ContentSerializerCollectionItemNameAttribute Class
ContentSerializerCollectionItemNameAttribute Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentSerializerCollectionItemNameAttribute Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetCustomAttribute (Inherited from Attribute.)
GetCustomAttributes (Inherited from Attribute.)
GetType (Inherited from Object.)
IsDefaultAttribute (Inherited from Attribute.)
IsDefined (Inherited from Attribute.)
Match (Inherited from Attribute.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ContentSerializerCollectionItemNameAttribute Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ContentSerializerCollectionItemNameAttribute Properties
Public Properties
Name Description
CollectionItemName Gets the name that will be used for each item in the collection.
TypeId (Inherited from Attribute.)
See Also
Reference
ContentSerializerCollectionItemNameAttribute Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ContentSerializerCollectionItemNameAttribute.CollectionItemName
Property
Gets the name that will be used for each item in the collection.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string CollectionItemName { get; }
Property Value
The name used for each item in the collection.
See Also
Reference
ContentSerializerCollectionItemNameAttribute Class
ContentSerializerCollectionItemNameAttribute Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentSerializerIgnoreAttribute Class
A custom Attribute that marks public fields or properties to prevent them from being serialized.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[AttributeUsageAttribute(384)]
public sealed class ContentSerializerIgnoreAttribute : Attribute
See Also
Reference
ContentSerializerIgnoreAttribute Members
Microsoft.Xna.Framework.Content Namespace
Programming Guide
Content Pipeline
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentSerializerIgnoreAttribute Members
The following tables list the members exposed by the ContentSerializerIgnoreAttribute type.
Public Constructors
Name Description
ContentSerializerIgnoreAttribute Creates a new instance of ContentSerializerIgnoreAttribute.
Public Properties
Name Description
TypeId (Inherited from Attribute.)
Public Methods
Name Description
Equals (Inherited from Object.)
GetCustomAttribute (Inherited from Attribute.)
GetCustomAttributes (Inherited from Attribute.)
GetType (Inherited from Object.)
IsDefaultAttribute (Inherited from Attribute.)
IsDefined (Inherited from Attribute.)
Match (Inherited from Attribute.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ContentSerializerIgnoreAttribute Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ContentSerializerIgnoreAttribute Constructor
Creates a new instance of ContentSerializerIgnoreAttribute.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ContentSerializerIgnoreAttribute ()
Example
C#
[ContentSerializerIgnoreAttribute()]
See Also
Reference
ContentSerializerIgnoreAttribute Class
ContentSerializerIgnoreAttribute Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentSerializerIgnoreAttribute Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetCustomAttribute (Inherited from Attribute.)
GetCustomAttributes (Inherited from Attribute.)
GetType (Inherited from Object.)
IsDefaultAttribute (Inherited from Attribute.)
IsDefined (Inherited from Attribute.)
Match (Inherited from Attribute.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ContentSerializerIgnoreAttribute Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ContentSerializerIgnoreAttribute Properties
Public Properties
Name Description
TypeId (Inherited from Attribute.)
See Also
Reference
ContentSerializerIgnoreAttribute Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ContentTypeReader Class
Worker for reading a specific managed type from a binary format.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public abstract class ContentTypeReader
See Also
Reference
ContentTypeReader Members
Microsoft.Xna.Framework.Content Namespace
Programming Guide
Content Pipeline
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentTypeReader Members
The following tables list the members exposed by the ContentTypeReader type.
Protected Constructors
Name Description
ContentTypeReader Creates a new instance of ContentTypeReader.
Public Properties
Name Description
TargetType Gets the type handled by this reader component.
TypeVersion Gets a format version number for this type.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
Initialize Retrieves and caches nested type readers. Called by the framework at creation time.
MemberwiseClone (Inherited from Object.)
Read Reads a strongly typed object from the current stream.
See Also
Reference
ContentTypeReader Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ContentTypeReader Constructor
Creates a new instance of ContentTypeReader.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected ContentTypeReader (
Type targetType
)
Parameters
targetType
The type handled by this reader component.
See Also
Reference
ContentTypeReader Class
ContentTypeReader Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentTypeReader Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
Initialize Retrieves and caches nested type readers. Called by the framework at creation time.
MemberwiseClone (Inherited from Object.)
Read Reads a strongly typed object from the current stream.
See Also
Reference
ContentTypeReader Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ContentTypeReader.Initialize Method
Retrieves and caches nested type readers. Called by the framework at creation time.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected internal virtual void Initialize (
ContentTypeReaderManager manager
)
Parameters
manager
The content manager.
See Also
Reference
ContentTypeReader Class
ContentTypeReader Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentTypeReader.Read Method
Reads a strongly typed object from the current stream.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected internal abstract Object Read (
ContentReader input,
Object existingInstance
)
Parameters
input
The ContentReader used to read the object.
existingInstance
The object receiving the data, or null if a new instance of the object should be created.
Return Value
The object that was read.
See Also
Reference
ContentTypeReader Class
ContentTypeReader Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentTypeReader Properties
Public Properties
Name Description
TargetType Gets the type handled by this reader component.
TypeVersion Gets a format version number for this type.
See Also
Reference
ContentTypeReader Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ContentTypeReader.TargetType Property
Gets the type handled by this reader component.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Type TargetType { get; }
Property Value
The type handled by this reader component.
See Also
Reference
ContentTypeReader Class
ContentTypeReader Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentTypeReader.TypeVersion Property
Gets a format version number for this type.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public virtual int TypeVersion { get; }
Property Value
The version number for this type.
See Also
Reference
ContentTypeReader Class
ContentTypeReader Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
See Also
Reference
ContentTypeReader Members
Microsoft.Xna.Framework.Content Namespace
Programming Guide
Content Pipeline
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentTypeReader Members
The following tables list the members exposed by the ContentTypeReader type.
Protected Constructors
Name Description
ContentTypeReader Creates a new instance of ContentTypeReader.
Public Properties
Name Description
TargetType (Inherited from ContentTypeReader.)
TypeVersion (Inherited from ContentTypeReader.)
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
Read Overloaded. Reads a strongly typed object from the current stream.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ContentTypeReader Generic Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ContentTypeReader Constructor
Creates a new instance of ContentTypeReader.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected ContentTypeReader ()
See Also
Reference
ContentTypeReader Generic Class
ContentTypeReader Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentTypeReader Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
Read Overloaded. Reads a strongly typed object from the current stream.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ContentTypeReader Generic Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ContentTypeReader.Read Method
Reads a strongly typed object from the current stream.
Overload List
Name Description
ContentTypeReader.Read (ContentReader, Object) Reads an object from the current stream.
ContentTypeReader.Read (ContentReader, T) Reads a strongly typed object from the current stream.
See Also
Reference
ContentTypeReader Generic Class
ContentTypeReader Members
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
Parameters
input
The ContentReader used to read the object.
existingInstance
An existing object to read into.
Return Value
The object that was read.
Exceptions
Exception type Condition
ContentLoadException Error loading the object. File contains an object of a type other than the type requested.
See Also
Reference
ContentTypeReader Generic Class
ContentTypeReader Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
input
The ContentReader used to read the object.
existingInstance
An existing object to read into.
Return Value
The type of object to read.
See Also
Reference
ContentTypeReader Generic Class
ContentTypeReader Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentTypeReader Properties
Public Properties
Name Description
TargetType (Inherited from ContentTypeReader.)
TypeVersion (Inherited from ContentTypeReader.)
See Also
Reference
ContentTypeReader Generic Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ContentTypeReaderManager Class
A manager that constructs and keeps track of type reader objects.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class ContentTypeReaderManager
See Also
Reference
ContentTypeReaderManager Members
Microsoft.Xna.Framework.Content Namespace
Programming Guide
Content Pipeline
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ContentTypeReaderManager Members
The following tables list the members exposed by the ContentTypeReaderManager type.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
GetTypeReader Looks up a reader for the specified type.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ContentTypeReaderManager Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ContentTypeReaderManager Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
GetTypeReader Looks up a reader for the specified type.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ContentTypeReaderManager Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ContentTypeReaderManager.GetTypeReader Method
Looks up a reader for the specified type.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ContentTypeReader GetTypeReader (
Type targetType
)
Parameters
targetType
The type the reader will handle.
Return Value
The created ContentTypeReader.
Exceptions
Exception type Condition
ContentLoadException Cannot find the requested ContentTypeReader.
ArgumentNullException targetType cannot be null.
See Also
Reference
ContentTypeReaderManager Class
ContentTypeReaderManager Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ResourceContentManager Class
Subclass of ContentManager which is specialized to read from .resx resource files, rather than directly from individual files on
disk.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class ResourceContentManager : ContentManager
See Also
Reference
ResourceContentManager Members
Microsoft.Xna.Framework.Content Namespace
Programming Guide
Content Pipeline
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ResourceContentManager Members
The following tables list the members exposed by the ResourceContentManager type.
Public Constructors
Name Description
ResourceContentManager Creates a new instance of ResourceContentManager.
Public Properties
Name Description
RootDirectory (Inherited from ContentManager.)
ServiceProvider (Inherited from ContentManager.)
Public Methods
Name Description
Dispose (Inherited from ContentManager.)
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
Load (Inherited from ContentManager.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Unload (Inherited from ContentManager.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
OpenStream Opens a stream for reading the specified resource. Derived classes can replace this to implement pack fil
es or asset compression.
ReadAsset (Inherited from ContentManager.)
See Also
Reference
ResourceContentManager Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ResourceContentManager Constructor
Creates a new instance of ResourceContentManager.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ResourceContentManager (
IServiceProvider serviceProvider,
ResourceManager resourceManager
)
Parameters
serviceProvider
The service provider the ContentManager should use to locate services.
resourceManager
The resource manager for the ResourceContentManager to read from.
Exceptions
Exception type Condition
ArgumentNullException resourceManager is null.
See Also
Reference
ResourceContentManager Class
ResourceContentManager Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ResourceContentManager Methods
Public Methods
Name Description
Dispose (Inherited from ContentManager.)
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
Load (Inherited from ContentManager.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Unload (Inherited from ContentManager.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
OpenStream Opens a stream for reading the specified resource. Derived classes can replace this to implement pack fil
es or asset compression.
ReadAsset (Inherited from ContentManager.)
See Also
Reference
ResourceContentManager Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
ResourceContentManager.OpenStream Method
Opens a stream for reading the specified resource. Derived classes can replace this to implement pack files or asset
compression.
Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override Stream OpenStream (
string assetName
)
Parameters
assetName
The name of the asset being read.
Return Value
The opened stream.
Exceptions
Exception type Condition
ContentLoadException Error loading assetName. The resource was not a binary resource, or the resource was not found.
See Also
Reference
ResourceContentManager Class
ResourceContentManager Members
Microsoft.Xna.Framework.Content Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ResourceContentManager Properties
Public Properties
Name Description
RootDirectory (Inherited from ContentManager.)
ServiceProvider (Inherited from ContentManager.)
See Also
Reference
ResourceContentManager Class
Microsoft.Xna.Framework.Content Namespace
XNA Game Studio 2.0
Microsoft.Xna.Framework.Design Namespace
Provides a unified way of converting types of values to other types.
Classes
Name Description
BoundingBoxConverter Provides a unified way of converting BoundingBox values to other types, as well as for accessing
standard values and subproperties.
BoundingSphereConverter Provides a unified way of converting BoundingSphere values to other types, as well as for access
ing standard values and subproperties.
ColorConverter Provides a unified way of converting Color values to other types, as well as for accessing standar
d values and subproperties.
MathTypeConverter Provides a unified way of converting math type values to other types, as well as for accessing sta
ndard values and subproperties.
MatrixConverter Provides a unified way of converting Matrix values to other types, as well as for accessing standa
rd values and subproperties.
PlaneConverter Provides a unified way of converting Plane values to other types, as well as for accessing standar
d values and subproperties.
PointConverter Provides a unified way of converting Point values to other types, as well as for accessing standar
d values and subproperties.
QuaternionConverter Provides a unified way of converting Quaternion values to other types, as well as for accessing s
tandard values and subproperties.
RayConverter Provides a unified way of converting Ray values to other types, as well as for accessing standard
values and subproperties.
RectangleConverter Provides a unified way of converting Rectangle values to other types, as well as for accessing sta
ndard values and subproperties.
Vector2Converter Provides a unified way of converting Vector2 values to other types, as well as for accessing stan
dard values and subproperties.
Vector3Converter Provides a unified way of converting Vector3 values to other types, as well as for accessing stan
dard values and subproperties.
Vector4Converter Provides a unified way of converting Vector4 values to other types, as well as for accessing stan
dard values and subproperties.
XNA Game Studio 2.0
BoundingBoxConverter Class
Provides a unified way of converting BoundingBox values to other types, as well as for accessing standard values and
subproperties.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class BoundingBoxConverter : MathTypeConverter
See Also
Reference
BoundingBoxConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingBoxConverter Members
The following tables list the members exposed by the BoundingBoxConverter type.
Public Constructors
Name Description
BoundingBoxConverter Initializes a new instance of the BoundingBoxConverter class.
Public Methods
Name Description
CanConvertFrom (Inherited from TypeConverter.)
CanConvertTo (Inherited from TypeConverter.)
ConvertFrom Overloaded. Converts the given value to the type of this converter.
ConvertFromInvariantString (Inherited from TypeConverter.)
ConvertFromString (Inherited from TypeConverter.)
ConvertTo Overloaded. Converts the given value object to the specified type, using the specified context
and culture information.
ConvertToInvariantString (Inherited from TypeConverter.)
ConvertToString (Inherited from TypeConverter.)
CreateInstance Overloaded. Re-creates an object given a set of property values for the object.
Equals (Inherited from Object.)
GetCreateInstanceSupported (Inherited from TypeConverter.)
GetHashCode (Inherited from Object.)
GetProperties (Inherited from TypeConverter.)
GetPropertiesSupported (Inherited from TypeConverter.)
GetStandardValues (Inherited from TypeConverter.)
GetStandardValuesExclusive (Inherited from TypeConverter.)
GetStandardValuesSupported (Inherited from TypeConverter.)
GetType (Inherited from Object.)
IsValid (Inherited from TypeConverter.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
GetConvertFromException (Inherited from TypeConverter.)
GetConvertToException (Inherited from TypeConverter.)
MemberwiseClone (Inherited from Object.)
SortProperties (Inherited from TypeConverter.)
See Also
Reference
BoundingBoxConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
BoundingBoxConverter Fields
See Also
Reference
BoundingBoxConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
BoundingBoxConverter Constructor
Initializes a new instance of the BoundingBoxConverter class.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public BoundingBoxConverter ()
See Also
Reference
BoundingBoxConverter Class
BoundingBoxConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingBoxConverter Methods
Public Methods
Name Description
CanConvertFrom (Inherited from TypeConverter.)
CanConvertTo (Inherited from TypeConverter.)
ConvertFrom Overloaded. Converts the given value to the type of this converter.
ConvertFromInvariantString (Inherited from TypeConverter.)
ConvertFromString (Inherited from TypeConverter.)
ConvertTo Overloaded. Converts the given value object to the specified type, using the specified context
and culture information.
ConvertToInvariantString (Inherited from TypeConverter.)
ConvertToString (Inherited from TypeConverter.)
CreateInstance Overloaded. Re-creates an object given a set of property values for the object.
Equals (Inherited from Object.)
GetCreateInstanceSupported (Inherited from TypeConverter.)
GetHashCode (Inherited from Object.)
GetProperties (Inherited from TypeConverter.)
GetPropertiesSupported (Inherited from TypeConverter.)
GetStandardValues (Inherited from TypeConverter.)
GetStandardValuesExclusive (Inherited from TypeConverter.)
GetStandardValuesSupported (Inherited from TypeConverter.)
GetType (Inherited from Object.)
IsValid (Inherited from TypeConverter.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
GetConvertFromException (Inherited from TypeConverter.)
GetConvertToException (Inherited from TypeConverter.)
MemberwiseClone (Inherited from Object.)
SortProperties (Inherited from TypeConverter.)
See Also
Reference
BoundingBoxConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
BoundingBoxConverter.ConvertFrom Method
Converts the given value to the type of this converter.
Overload List
Name Description
BoundingBoxConverter.ConvertFrom (ITypeDescriptorContext, CultureInfo, Object) Converts the given object to the type of thi
s converter, using the specified context and
culture information.
BoundingBoxConverter.ConvertFrom (Object) (Inherited from TypeConverter.)
See Also
Reference
BoundingBoxConverter Class
BoundingBoxConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
BoundingBoxConverter.ConvertFrom Method
(ITypeDescriptorContext, CultureInfo, Object)
Converts the given object to the type of this converter, using the specified context and culture information.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override Object ConvertFrom (
ITypeDescriptorContext context,
CultureInfo culture,
Object value
)
Parameters
context
The format context.
culture
The current culture.
value
The object to convert.
Return Value
The converted value.
See Also
Reference
BoundingBoxConverter Class
BoundingBoxConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingBoxConverter.ConvertTo Method
Converts the given value object to the specified type, using the specified context and culture information.
Overload List
Name Description
BoundingBoxConverter.ConvertTo (ITypeDescriptorContext, CultureInfo, Object, Type) Converts the given value object to the s
pecified type, using the specified context
and culture information.
BoundingBoxConverter.ConvertTo (Object, Type) (Inherited from TypeConverter.)
See Also
Reference
BoundingBoxConverter Class
BoundingBoxConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
BoundingBoxConverter.ConvertTo Method
(ITypeDescriptorContext, CultureInfo, Object, Type)
Converts the given value object to the specified type, using the specified context and culture information.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override Object ConvertTo (
ITypeDescriptorContext context,
CultureInfo culture,
Object value,
Type destinationType
)
Parameters
context
The format context.
culture
The culture to use in the conversion.
value
The object to convert.
destinationType
The destination type.
Return Value
The converted value.
Exceptions
Exception type Condition
ArgumentNullException destinationType is null.
See Also
Reference
BoundingBoxConverter Class
BoundingBoxConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingBoxConverter.CreateInstance Method
Re-creates an object given a set of property values for the object.
Overload List
Name Description
BoundingBoxConverter.CreateInstance (ITypeDescriptorContext, IDictionary) Creates an instance of the type that this
BoundingBoxConverter is associated with, using t
he specified context, given a set of property value
s for the object.
BoundingBoxConverter.CreateInstance (IDictionary) (Inherited from TypeConverter.)
See Also
Reference
BoundingBoxConverter Class
BoundingBoxConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
BoundingBoxConverter.CreateInstance Method
(ITypeDescriptorContext, IDictionary)
Creates an instance of the type that this BoundingBoxConverter is associated with, using the specified context, given a set of
property values for the object.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override Object CreateInstance (
ITypeDescriptorContext context,
IDictionary propertyValues
)
Parameters
context
The format context.
propertyValues
The new property values.
Return Value
An object representing propertyValues, or null if the object cannot be created.
See Also
Reference
BoundingBoxConverter Class
BoundingBoxConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingSphereConverter Class
Provides a unified way of converting BoundingSphere values to other types, as well as for accessing standard values and
subproperties.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class BoundingSphereConverter : MathTypeConverter
See Also
Reference
BoundingSphereConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingSphereConverter Members
The following tables list the members exposed by the BoundingSphereConverter type.
Public Constructors
Name Description
BoundingSphereConverter Initializes a new instance of the BoundingSphereConverter class.
Public Methods
Name Description
CanConvertFrom (Inherited from TypeConverter.)
CanConvertTo (Inherited from TypeConverter.)
ConvertFrom Overloaded. Converts the given value to the type of this converter.
ConvertFromInvariantString (Inherited from TypeConverter.)
ConvertFromString (Inherited from TypeConverter.)
ConvertTo Overloaded. Converts the given value object to the specified type, using the specified context
and culture information.
ConvertToInvariantString (Inherited from TypeConverter.)
ConvertToString (Inherited from TypeConverter.)
CreateInstance Overloaded. Re-creates an object given a set of property values for the object.
Equals (Inherited from Object.)
GetCreateInstanceSupported (Inherited from TypeConverter.)
GetHashCode (Inherited from Object.)
GetProperties (Inherited from TypeConverter.)
GetPropertiesSupported (Inherited from TypeConverter.)
GetStandardValues (Inherited from TypeConverter.)
GetStandardValuesExclusive (Inherited from TypeConverter.)
GetStandardValuesSupported (Inherited from TypeConverter.)
GetType (Inherited from Object.)
IsValid (Inherited from TypeConverter.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
GetConvertFromException (Inherited from TypeConverter.)
GetConvertToException (Inherited from TypeConverter.)
MemberwiseClone (Inherited from Object.)
SortProperties (Inherited from TypeConverter.)
See Also
Reference
BoundingSphereConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
BoundingSphereConverter Fields
See Also
Reference
BoundingSphereConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
BoundingSphereConverter Constructor
Initializes a new instance of the BoundingSphereConverter class.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public BoundingSphereConverter ()
See Also
Reference
BoundingSphereConverter Class
BoundingSphereConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingSphereConverter Methods
Public Methods
Name Description
CanConvertFrom (Inherited from TypeConverter.)
CanConvertTo (Inherited from TypeConverter.)
ConvertFrom Overloaded. Converts the given value to the type of this converter.
ConvertFromInvariantString (Inherited from TypeConverter.)
ConvertFromString (Inherited from TypeConverter.)
ConvertTo Overloaded. Converts the given value object to the specified type, using the specified context
and culture information.
ConvertToInvariantString (Inherited from TypeConverter.)
ConvertToString (Inherited from TypeConverter.)
CreateInstance Overloaded. Re-creates an object given a set of property values for the object.
Equals (Inherited from Object.)
GetCreateInstanceSupported (Inherited from TypeConverter.)
GetHashCode (Inherited from Object.)
GetProperties (Inherited from TypeConverter.)
GetPropertiesSupported (Inherited from TypeConverter.)
GetStandardValues (Inherited from TypeConverter.)
GetStandardValuesExclusive (Inherited from TypeConverter.)
GetStandardValuesSupported (Inherited from TypeConverter.)
GetType (Inherited from Object.)
IsValid (Inherited from TypeConverter.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
GetConvertFromException (Inherited from TypeConverter.)
GetConvertToException (Inherited from TypeConverter.)
MemberwiseClone (Inherited from Object.)
SortProperties (Inherited from TypeConverter.)
See Also
Reference
BoundingSphereConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
BoundingSphereConverter.ConvertFrom Method
Converts the given value to the type of this converter.
Overload List
Name Description
BoundingSphereConverter.ConvertFrom (ITypeDescriptorContext, CultureInfo, Object) Converts the given object to the type of
this converter, using the specified conte
xt and culture information.
BoundingSphereConverter.ConvertFrom (Object) (Inherited from TypeConverter.)
See Also
Reference
BoundingSphereConverter Class
BoundingSphereConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
BoundingSphereConverter.ConvertFrom Method
(ITypeDescriptorContext, CultureInfo, Object)
Converts the given object to the type of this converter, using the specified context and culture information.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override Object ConvertFrom (
ITypeDescriptorContext context,
CultureInfo culture,
Object value
)
Parameters
context
The format context.
culture
The current culture.
value
The object to convert.
Return Value
The converted value.
See Also
Reference
BoundingSphereConverter Class
BoundingSphereConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingSphereConverter.ConvertTo Method
Converts the given value object to the specified type, using the specified context and culture information.
Overload List
Name Description
BoundingSphereConverter.ConvertTo (ITypeDescriptorContext, CultureInfo, Object, Type) Converts the given value object to th
e specified type, using the specified c
ontext and culture information.
BoundingSphereConverter.ConvertTo (Object, Type) (Inherited from TypeConverter.)
See Also
Reference
BoundingSphereConverter Class
BoundingSphereConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
BoundingSphereConverter.ConvertTo Method
(ITypeDescriptorContext, CultureInfo, Object, Type)
Converts the given value object to the specified type, using the specified context and culture information.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override Object ConvertTo (
ITypeDescriptorContext context,
CultureInfo culture,
Object value,
Type destinationType
)
Parameters
context
The format context.
culture
The culture to use in the conversion.
value
The object to convert.
destinationType
The destination type.
Return Value
The converted value.
Exceptions
Exception type Condition
ArgumentNullException destinationType is null.
See Also
Reference
BoundingSphereConverter Class
BoundingSphereConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BoundingSphereConverter.CreateInstance Method
Re-creates an object given a set of property values for the object.
Overload List
Name Description
BoundingSphereConverter.CreateInstance (ITypeDescriptorContext, IDictionary) Creates an instance of the type that this
BoundingSphereConverter is associated with,
using the specified context, given a set of prop
erty values for the object.
BoundingSphereConverter.CreateInstance (IDictionary) (Inherited from TypeConverter.)
See Also
Reference
BoundingSphereConverter Class
BoundingSphereConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
BoundingSphereConverter.CreateInstance Method
(ITypeDescriptorContext, IDictionary)
Creates an instance of the type that this BoundingSphereConverter is associated with, using the specified context, given a set of
property values for the object.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override Object CreateInstance (
ITypeDescriptorContext context,
IDictionary propertyValues
)
Parameters
context
The format context.
propertyValues
The new property values.
Return Value
An object representing propertyValues, or null if the object cannot be created.
See Also
Reference
BoundingSphereConverter Class
BoundingSphereConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ColorConverter Class
Provides a unified way of converting Color values to other types, as well as for accessing standard values and subproperties.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class ColorConverter : MathTypeConverter
See Also
Reference
ColorConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ColorConverter Members
The following tables list the members exposed by the ColorConverter type.
Public Constructors
Name Description
ColorConverter Initializes a new instance of the ColorConverter class.
Public Methods
Name Description
CanConvertFrom (Inherited from TypeConverter.)
CanConvertTo (Inherited from TypeConverter.)
ConvertFrom Overloaded. Converts the given value to the type of this converter.
ConvertFromInvariantString (Inherited from TypeConverter.)
ConvertFromString (Inherited from TypeConverter.)
ConvertTo Overloaded. Converts the given value object to the specified type, using the specified context
and culture information.
ConvertToInvariantString (Inherited from TypeConverter.)
ConvertToString (Inherited from TypeConverter.)
CreateInstance Overloaded. Re-creates an object given a set of property values for the object.
Equals (Inherited from Object.)
GetCreateInstanceSupported (Inherited from TypeConverter.)
GetHashCode (Inherited from Object.)
GetProperties (Inherited from TypeConverter.)
GetPropertiesSupported (Inherited from TypeConverter.)
GetStandardValues (Inherited from TypeConverter.)
GetStandardValuesExclusive (Inherited from TypeConverter.)
GetStandardValuesSupported (Inherited from TypeConverter.)
GetType (Inherited from Object.)
IsValid (Inherited from TypeConverter.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
GetConvertFromException (Inherited from TypeConverter.)
GetConvertToException (Inherited from TypeConverter.)
MemberwiseClone (Inherited from Object.)
SortProperties (Inherited from TypeConverter.)
See Also
Reference
ColorConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
ColorConverter Fields
See Also
Reference
ColorConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
ColorConverter Constructor
Initializes a new instance of the ColorConverter class.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ColorConverter ()
See Also
Reference
ColorConverter Class
ColorConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ColorConverter Methods
Public Methods
Name Description
CanConvertFrom (Inherited from TypeConverter.)
CanConvertTo (Inherited from TypeConverter.)
ConvertFrom Overloaded. Converts the given value to the type of this converter.
ConvertFromInvariantString (Inherited from TypeConverter.)
ConvertFromString (Inherited from TypeConverter.)
ConvertTo Overloaded. Converts the given value object to the specified type, using the specified context
and culture information.
ConvertToInvariantString (Inherited from TypeConverter.)
ConvertToString (Inherited from TypeConverter.)
CreateInstance Overloaded. Re-creates an object given a set of property values for the object.
Equals (Inherited from Object.)
GetCreateInstanceSupported (Inherited from TypeConverter.)
GetHashCode (Inherited from Object.)
GetProperties (Inherited from TypeConverter.)
GetPropertiesSupported (Inherited from TypeConverter.)
GetStandardValues (Inherited from TypeConverter.)
GetStandardValuesExclusive (Inherited from TypeConverter.)
GetStandardValuesSupported (Inherited from TypeConverter.)
GetType (Inherited from Object.)
IsValid (Inherited from TypeConverter.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
GetConvertFromException (Inherited from TypeConverter.)
GetConvertToException (Inherited from TypeConverter.)
MemberwiseClone (Inherited from Object.)
SortProperties (Inherited from TypeConverter.)
See Also
Reference
ColorConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
ColorConverter.ConvertFrom Method
Converts the given value to the type of this converter.
Overload List
Name Description
ColorConverter.ConvertFrom (ITypeDescriptorContext, CultureInfo, Object) Converts the given value to the type of this convert
er.
ColorConverter.ConvertFrom (Object) (Inherited from TypeConverter.)
See Also
Reference
ColorConverter Class
ColorConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
Parameters
context
The format context.
culture
The current culture.
value
The object to convert.
Return Value
The converted value.
See Also
Reference
ColorConverter Class
ColorConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ColorConverter.ConvertTo Method
Converts the given value object to the specified type, using the specified context and culture information.
Overload List
Name Description
ColorConverter.ConvertTo (ITypeDescriptorContext, CultureInfo, Object, Type) Converts the given value object to the specified
type, using the specified context and culture info
rmation.
ColorConverter.ConvertTo (Object, Type) (Inherited from TypeConverter.)
See Also
Reference
ColorConverter Class
ColorConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
Parameters
context
The format context.
culture
The culture to use in the conversion.
value
The object to convert.
destinationType
The destination type.
Return Value
The converted value.
See Also
Reference
ColorConverter Class
ColorConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ColorConverter.CreateInstance Method
Re-creates an object given a set of property values for the object.
Overload List
Name Description
ColorConverter.CreateInstance (ITypeDescriptorContext, IDictionary) Re-creates an object given a set of property values for the
object.
ColorConverter.CreateInstance (IDictionary) (Inherited from TypeConverter.)
See Also
Reference
ColorConverter Class
ColorConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
ColorConverter.CreateInstance Method
(ITypeDescriptorContext, IDictionary)
Re-creates an object given a set of property values for the object.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override Object CreateInstance (
ITypeDescriptorContext context,
IDictionary propertyValues
)
Parameters
context
The format context.
propertyValues
The new property values.
Return Value
An object representing propertyValues, or null if the object cannot be created.
See Also
Reference
ColorConverter Class
ColorConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathTypeConverter Class
Provides a unified way of converting math type values to other types, as well as for accessing standard values and
subproperties.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class MathTypeConverter : ExpandableObjectConverter
See Also
Reference
MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathTypeConverter Members
The following tables list the members exposed by the MathTypeConverter type.
Public Constructors
Name Description
MathTypeConverter Initializes a new instance of the MathTypeConverter class.
Protected Fields
Name Description
propertyDescriptions Represents a collection of PropertyDescriptor objects.
supportStringConvert Returns whether string conversion is supported.
Public Methods
Name Description
CanConvertFrom Overloaded. Returns whether this converter can convert an object of one type to the type of t
his converter.
CanConvertTo Overloaded. Returns whether this converter can convert the object to the specified type.
ConvertFrom (Inherited from TypeConverter.)
ConvertFromInvariantString (Inherited from TypeConverter.)
ConvertFromString (Inherited from TypeConverter.)
ConvertTo (Inherited from TypeConverter.)
ConvertToInvariantString (Inherited from TypeConverter.)
ConvertToString (Inherited from TypeConverter.)
CreateInstance (Inherited from TypeConverter.)
Equals (Inherited from Object.)
GetCreateInstanceSupported Overloaded. Returns whether changing a value on this object requires a call to the CreateInst
ance method to create a new value.
GetHashCode (Inherited from Object.)
GetProperties Overloaded. Returns a collection of properties for the type of array specified by the value par
ameter.
GetPropertiesSupported Overloaded. Returns whether this object supports properties.
GetStandardValues (Inherited from TypeConverter.)
GetStandardValuesExclusive (Inherited from TypeConverter.)
GetStandardValuesSupported (Inherited from TypeConverter.)
GetType (Inherited from Object.)
IsValid (Inherited from TypeConverter.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
GetConvertFromException (Inherited from TypeConverter.)
GetConvertToException (Inherited from TypeConverter.)
MemberwiseClone (Inherited from Object.)
SortProperties (Inherited from TypeConverter.)
See Also
Reference
MathTypeConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
MathTypeConverter Fields
Protected Fields
Name Description
propertyDescriptions Represents a collection of PropertyDescriptor objects.
supportStringConvert Returns whether string conversion is supported.
See Also
Reference
MathTypeConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
MathTypeConverter.propertyDescriptions Field
Represents a collection of PropertyDescriptor objects.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected PropertyDescriptorCollection propertyDescriptions
See Also
Reference
MathTypeConverter Class
MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathTypeConverter.supportStringConvert Field
Returns whether string conversion is supported.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected bool supportStringConvert
See Also
Reference
MathTypeConverter Class
MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathTypeConverter Constructor
Initializes a new instance of the MathTypeConverter class.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public MathTypeConverter ()
See Also
Reference
MathTypeConverter Class
MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathTypeConverter Methods
Public Methods
Name Description
CanConvertFrom Overloaded. Returns whether this converter can convert an object of one type to the type of t
his converter.
CanConvertTo Overloaded. Returns whether this converter can convert the object to the specified type.
ConvertFrom (Inherited from TypeConverter.)
ConvertFromInvariantString (Inherited from TypeConverter.)
ConvertFromString (Inherited from TypeConverter.)
ConvertTo (Inherited from TypeConverter.)
ConvertToInvariantString (Inherited from TypeConverter.)
ConvertToString (Inherited from TypeConverter.)
CreateInstance (Inherited from TypeConverter.)
Equals (Inherited from Object.)
GetCreateInstanceSupported Overloaded. Returns whether changing a value on this object requires a call to the CreateInst
ance method to create a new value.
GetHashCode (Inherited from Object.)
GetProperties Overloaded. Returns a collection of properties for the type of array specified by the value par
ameter.
GetPropertiesSupported Overloaded. Returns whether this object supports properties.
GetStandardValues (Inherited from TypeConverter.)
GetStandardValuesExclusive (Inherited from TypeConverter.)
GetStandardValuesSupported (Inherited from TypeConverter.)
GetType (Inherited from Object.)
IsValid (Inherited from TypeConverter.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
GetConvertFromException (Inherited from TypeConverter.)
GetConvertToException (Inherited from TypeConverter.)
MemberwiseClone (Inherited from Object.)
SortProperties (Inherited from TypeConverter.)
See Also
Reference
MathTypeConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
MathTypeConverter.CanConvertFrom Method
Returns whether this converter can convert an object of one type to the type of this converter.
Overload List
Name Description
MathTypeConverter.CanConvertFrom (ITypeDescriptorContext, Type) Returns whether this converter can convert an object of t
he given type to the type of this converter, using the spe
cified context.
MathTypeConverter.CanConvertFrom (Type) (Inherited from TypeConverter.)
See Also
Reference
MathTypeConverter Class
MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
MathTypeConverter.CanConvertFrom Method
(ITypeDescriptorContext, Type)
Returns whether this converter can convert an object of the given type to the type of this converter, using the specified context.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override bool CanConvertFrom (
ITypeDescriptorContext context,
Type sourceType
)
Parameters
context
The format context.
sourceType
The type you want to convert from.
Return Value
true if this converter can perform the conversion; false otherwise.
See Also
Reference
MathTypeConverter Class
MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathTypeConverter.CanConvertTo Method
Returns whether this converter can convert the object to the specified type.
Overload List
Name Description
MathTypeConverter.CanConvertTo (ITypeDescriptorContext, Type) Returns whether this converter can convert an object of one
type to the type of this converter.
MathTypeConverter.CanConvertTo (Type) (Inherited from TypeConverter.)
See Also
Reference
MathTypeConverter Class
MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
MathTypeConverter.CanConvertTo Method
(ITypeDescriptorContext, Type)
Returns whether this converter can convert an object of one type to the type of this converter.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override bool CanConvertTo (
ITypeDescriptorContext context,
Type destinationType
)
Parameters
context
The format context.
destinationType
The destination type.
Return Value
true if this converter can perform the conversion; false otherwise.
See Also
Reference
MathTypeConverter Class
MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathTypeConverter.GetCreateInstanceSupported Method
Returns whether changing a value on this object requires a call to the CreateInstance method to create a new value.
Overload List
Name Description
MathTypeConverter.GetCreateInstanceSupported (ITypeDescriptorContext) Returns whether changing a value on this object re
quires a call to CreateInstance to create a new val
ue, using the specified context.
MathTypeConverter.GetCreateInstanceSupported () (Inherited from TypeConverter.)
See Also
Reference
MathTypeConverter Class
MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
MathTypeConverter.GetCreateInstanceSupported Method
(ITypeDescriptorContext)
Returns whether changing a value on this object requires a call to CreateInstance to create a new value, using the specified
context.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override bool GetCreateInstanceSupported (
ITypeDescriptorContext context
)
Parameters
context
The format context.
Return Value
true if changing a property on this object requires a call to CreateInstance to create a new value; false otherwise.
See Also
Reference
MathTypeConverter Class
MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathTypeConverter.GetProperties Method
Returns a collection of properties for the type of array specified by the value parameter.
Overload List
Name Description
MathTypeConverter.GetProperties (ITypeDescriptorContext, Object, Attribute[]) Returns a collection of properties for the type o
f array specified by the value parameter.
MathTypeConverter.GetProperties (ITypeDescriptorContext, Object) (Inherited from TypeConverter.)
MathTypeConverter.GetProperties (Object) (Inherited from TypeConverter.)
See Also
Reference
MathTypeConverter Class
MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
MathTypeConverter.GetProperties Method
(ITypeDescriptorContext, Object, Attribute[])
Returns a collection of properties for the type of array specified by the value parameter.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override PropertyDescriptorCollection GetProperties (
ITypeDescriptorContext context,
Object value,
Attribute[] attributes
)
Parameters
context
The format context.
value
The type of array for which to get properties.
attributes
An array to use as a filter.
Return Value
The properties that are exposed for this data type, or null if there are no properties.
See Also
Reference
MathTypeConverter Class
MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MathTypeConverter.GetPropertiesSupported Method
Returns whether this object supports properties.
Overload List
Name Description
MathTypeConverter.GetPropertiesSupported (ITypeDescriptorContext) Returns whether this object supports properties, using t
he specified context.
MathTypeConverter.GetPropertiesSupported () (Inherited from TypeConverter.)
See Also
Reference
MathTypeConverter Class
MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
MathTypeConverter.GetPropertiesSupported Method
(ITypeDescriptorContext)
Returns whether this object supports properties, using the specified context.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override bool GetPropertiesSupported (
ITypeDescriptorContext context
)
Parameters
context
The format context.
Return Value
true if GetProperties should be called to find the properties of this object; false otherwise.
See Also
Reference
MathTypeConverter Class
MathTypeConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MatrixConverter Class
Provides a unified way of converting Matrix values to other types, as well as for accessing standard values and subproperties.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class MatrixConverter : MathTypeConverter
See Also
Reference
MatrixConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MatrixConverter Members
The following tables list the members exposed by the MatrixConverter type.
Public Constructors
Name Description
MatrixConverter Initializes a new instance of the MatrixConverter class.
Public Methods
Name Description
CanConvertFrom (Inherited from TypeConverter.)
CanConvertTo (Inherited from TypeConverter.)
ConvertFrom (Inherited from TypeConverter.)
ConvertFromInvariantString (Inherited from TypeConverter.)
ConvertFromString (Inherited from TypeConverter.)
ConvertTo Overloaded. Converts the given value object to the specified type, using the specified context
and culture information.
ConvertToInvariantString (Inherited from TypeConverter.)
ConvertToString (Inherited from TypeConverter.)
CreateInstance Overloaded. Re-creates an object given a set of property values for the object.
Equals (Inherited from Object.)
GetCreateInstanceSupported (Inherited from TypeConverter.)
GetHashCode (Inherited from Object.)
GetProperties (Inherited from TypeConverter.)
GetPropertiesSupported (Inherited from TypeConverter.)
GetStandardValues (Inherited from TypeConverter.)
GetStandardValuesExclusive (Inherited from TypeConverter.)
GetStandardValuesSupported (Inherited from TypeConverter.)
GetType (Inherited from Object.)
IsValid (Inherited from TypeConverter.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
GetConvertFromException (Inherited from TypeConverter.)
GetConvertToException (Inherited from TypeConverter.)
MemberwiseClone (Inherited from Object.)
SortProperties (Inherited from TypeConverter.)
See Also
Reference
MatrixConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
MatrixConverter Fields
See Also
Reference
MatrixConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
MatrixConverter Constructor
Initializes a new instance of the MatrixConverter class.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public MatrixConverter ()
See Also
Reference
MatrixConverter Class
MatrixConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MatrixConverter Methods
Public Methods
Name Description
CanConvertFrom (Inherited from TypeConverter.)
CanConvertTo (Inherited from TypeConverter.)
ConvertFrom (Inherited from TypeConverter.)
ConvertFromInvariantString (Inherited from TypeConverter.)
ConvertFromString (Inherited from TypeConverter.)
ConvertTo Overloaded. Converts the given value object to the specified type, using the specified context
and culture information.
ConvertToInvariantString (Inherited from TypeConverter.)
ConvertToString (Inherited from TypeConverter.)
CreateInstance Overloaded. Re-creates an object given a set of property values for the object.
Equals (Inherited from Object.)
GetCreateInstanceSupported (Inherited from TypeConverter.)
GetHashCode (Inherited from Object.)
GetProperties (Inherited from TypeConverter.)
GetPropertiesSupported (Inherited from TypeConverter.)
GetStandardValues (Inherited from TypeConverter.)
GetStandardValuesExclusive (Inherited from TypeConverter.)
GetStandardValuesSupported (Inherited from TypeConverter.)
GetType (Inherited from Object.)
IsValid (Inherited from TypeConverter.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
GetConvertFromException (Inherited from TypeConverter.)
GetConvertToException (Inherited from TypeConverter.)
MemberwiseClone (Inherited from Object.)
SortProperties (Inherited from TypeConverter.)
See Also
Reference
MatrixConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
MatrixConverter.ConvertTo Method
Converts the given value object to the specified type, using the specified context and culture information.
Overload List
Name Description
MatrixConverter.ConvertTo (ITypeDescriptorContext, CultureInfo, Object, Type) Converts the given value object to the specified
type, using the specified context and culture inf
ormation.
MatrixConverter.ConvertTo (Object, Type) (Inherited from TypeConverter.)
See Also
Reference
MatrixConverter Class
MatrixConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
Parameters
context
The format context.
culture
The culture to use in the conversion.
value
The object to convert.
destinationType
The destination type.
Return Value
The converted value.
Exceptions
Exception type Condition
ArgumentNullException destinationType is null.
See Also
Reference
MatrixConverter Class
MatrixConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MatrixConverter.CreateInstance Method
Re-creates an object given a set of property values for the object.
Overload List
Name Description
MatrixConverter.CreateInstance (ITypeDescriptorContext, IDictionary) Creates an instance of the type that this MatrixConverter
is associated with, using the specified context, given a set
of property values for the object.
MatrixConverter.CreateInstance (IDictionary) (Inherited from TypeConverter.)
See Also
Reference
MatrixConverter Class
MatrixConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
MatrixConverter.CreateInstance Method
(ITypeDescriptorContext, IDictionary)
Creates an instance of the type that this MatrixConverter is associated with, using the specified context, given a set of property
values for the object.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override Object CreateInstance (
ITypeDescriptorContext context,
IDictionary propertyValues
)
Parameters
context
The format context.
propertyValues
The new property values.
Return Value
An object representing propertyValues, or null if the object cannot be created.
See Also
Reference
MatrixConverter Class
MatrixConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PlaneConverter Class
Provides a unified way of converting Plane values to other types, as well as for accessing standard values and subproperties.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class PlaneConverter : MathTypeConverter
See Also
Reference
PlaneConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PlaneConverter Members
The following tables list the members exposed by the PlaneConverter type.
Public Constructors
Name Description
PlaneConverter Initializes a new instance of the PlaneConverter class.
Public Methods
Name Description
CanConvertFrom (Inherited from TypeConverter.)
CanConvertTo (Inherited from TypeConverter.)
ConvertFrom (Inherited from TypeConverter.)
ConvertFromInvariantString (Inherited from TypeConverter.)
ConvertFromString (Inherited from TypeConverter.)
ConvertTo Overloaded. Converts the given value object to the specified type, using the specified context
and culture information.
ConvertToInvariantString (Inherited from TypeConverter.)
ConvertToString (Inherited from TypeConverter.)
CreateInstance Overloaded. Re-creates an object given a set of property values for the object.
Equals (Inherited from Object.)
GetCreateInstanceSupported (Inherited from TypeConverter.)
GetHashCode (Inherited from Object.)
GetProperties (Inherited from TypeConverter.)
GetPropertiesSupported (Inherited from TypeConverter.)
GetStandardValues (Inherited from TypeConverter.)
GetStandardValuesExclusive (Inherited from TypeConverter.)
GetStandardValuesSupported (Inherited from TypeConverter.)
GetType (Inherited from Object.)
IsValid (Inherited from TypeConverter.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
GetConvertFromException (Inherited from TypeConverter.)
GetConvertToException (Inherited from TypeConverter.)
MemberwiseClone (Inherited from Object.)
SortProperties (Inherited from TypeConverter.)
See Also
Reference
PlaneConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
PlaneConverter Fields
See Also
Reference
PlaneConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
PlaneConverter Constructor
Initializes a new instance of the PlaneConverter class.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public PlaneConverter ()
See Also
Reference
PlaneConverter Class
PlaneConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PlaneConverter Methods
Public Methods
Name Description
CanConvertFrom (Inherited from TypeConverter.)
CanConvertTo (Inherited from TypeConverter.)
ConvertFrom (Inherited from TypeConverter.)
ConvertFromInvariantString (Inherited from TypeConverter.)
ConvertFromString (Inherited from TypeConverter.)
ConvertTo Overloaded. Converts the given value object to the specified type, using the specified context
and culture information.
ConvertToInvariantString (Inherited from TypeConverter.)
ConvertToString (Inherited from TypeConverter.)
CreateInstance Overloaded. Re-creates an object given a set of property values for the object.
Equals (Inherited from Object.)
GetCreateInstanceSupported (Inherited from TypeConverter.)
GetHashCode (Inherited from Object.)
GetProperties (Inherited from TypeConverter.)
GetPropertiesSupported (Inherited from TypeConverter.)
GetStandardValues (Inherited from TypeConverter.)
GetStandardValuesExclusive (Inherited from TypeConverter.)
GetStandardValuesSupported (Inherited from TypeConverter.)
GetType (Inherited from Object.)
IsValid (Inherited from TypeConverter.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
GetConvertFromException (Inherited from TypeConverter.)
GetConvertToException (Inherited from TypeConverter.)
MemberwiseClone (Inherited from Object.)
SortProperties (Inherited from TypeConverter.)
See Also
Reference
PlaneConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
PlaneConverter.ConvertTo Method
Converts the given value object to the specified type, using the specified context and culture information.
Overload List
Name Description
PlaneConverter.ConvertTo (ITypeDescriptorContext, CultureInfo, Object, Type) Converts the given value object to the specified
type, using the specified context and culture info
rmation.
PlaneConverter.ConvertTo (Object, Type) (Inherited from TypeConverter.)
See Also
Reference
PlaneConverter Class
PlaneConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
Parameters
context
The format context.
culture
The culture to use in the conversion.
value
The object to convert.
destinationType
The destination type.
Return Value
The converted value.
Exceptions
Exception type Condition
ArgumentNullException destinationType is null.
See Also
Reference
PlaneConverter Class
PlaneConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PlaneConverter.CreateInstance Method
Re-creates an object given a set of property values for the object.
Overload List
Name Description
PlaneConverter.CreateInstance (ITypeDescriptorContext, IDictionary) Creates an instance of the type that this PlaneConverter is
associated with, using the specified context, given a set of
property values for the object.
PlaneConverter.CreateInstance (IDictionary) (Inherited from TypeConverter.)
See Also
Reference
PlaneConverter Class
PlaneConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
PlaneConverter.CreateInstance Method
(ITypeDescriptorContext, IDictionary)
Creates an instance of the type that this PlaneConverter is associated with, using the specified context, given a set of property
values for the object.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override Object CreateInstance (
ITypeDescriptorContext context,
IDictionary propertyValues
)
Parameters
context
The format context.
propertyValues
The new property values.
Return Value
An object representing propertyValues, or null if the object cannot be created.
See Also
Reference
PlaneConverter Class
PlaneConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PointConverter Class
Provides a unified way of converting Point values to other types, as well as for accessing standard values and subproperties.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class PointConverter : MathTypeConverter
See Also
Reference
PointConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PointConverter Members
The following tables list the members exposed by the PointConverter type.
Public Constructors
Name Description
PointConverter Initializes a new instance of the PointConverter class.
Public Methods
Name Description
CanConvertFrom (Inherited from TypeConverter.)
CanConvertTo (Inherited from TypeConverter.)
ConvertFrom Overloaded. Converts the given value to the type of this converter.
ConvertFromInvariantString (Inherited from TypeConverter.)
ConvertFromString (Inherited from TypeConverter.)
ConvertTo Overloaded. Converts the given value object to the specified type, using the specified context
and culture information.
ConvertToInvariantString (Inherited from TypeConverter.)
ConvertToString (Inherited from TypeConverter.)
CreateInstance Overloaded. Re-creates an object given a set of property values for the object.
Equals (Inherited from Object.)
GetCreateInstanceSupported (Inherited from TypeConverter.)
GetHashCode (Inherited from Object.)
GetProperties (Inherited from TypeConverter.)
GetPropertiesSupported (Inherited from TypeConverter.)
GetStandardValues (Inherited from TypeConverter.)
GetStandardValuesExclusive (Inherited from TypeConverter.)
GetStandardValuesSupported (Inherited from TypeConverter.)
GetType (Inherited from Object.)
IsValid (Inherited from TypeConverter.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
GetConvertFromException (Inherited from TypeConverter.)
GetConvertToException (Inherited from TypeConverter.)
MemberwiseClone (Inherited from Object.)
SortProperties (Inherited from TypeConverter.)
See Also
Reference
PointConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
PointConverter Fields
See Also
Reference
PointConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
PointConverter Constructor
Initializes a new instance of the PointConverter class.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public PointConverter ()
See Also
Reference
PointConverter Class
PointConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PointConverter Methods
Public Methods
Name Description
CanConvertFrom (Inherited from TypeConverter.)
CanConvertTo (Inherited from TypeConverter.)
ConvertFrom Overloaded. Converts the given value to the type of this converter.
ConvertFromInvariantString (Inherited from TypeConverter.)
ConvertFromString (Inherited from TypeConverter.)
ConvertTo Overloaded. Converts the given value object to the specified type, using the specified context
and culture information.
ConvertToInvariantString (Inherited from TypeConverter.)
ConvertToString (Inherited from TypeConverter.)
CreateInstance Overloaded. Re-creates an object given a set of property values for the object.
Equals (Inherited from Object.)
GetCreateInstanceSupported (Inherited from TypeConverter.)
GetHashCode (Inherited from Object.)
GetProperties (Inherited from TypeConverter.)
GetPropertiesSupported (Inherited from TypeConverter.)
GetStandardValues (Inherited from TypeConverter.)
GetStandardValuesExclusive (Inherited from TypeConverter.)
GetStandardValuesSupported (Inherited from TypeConverter.)
GetType (Inherited from Object.)
IsValid (Inherited from TypeConverter.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
GetConvertFromException (Inherited from TypeConverter.)
GetConvertToException (Inherited from TypeConverter.)
MemberwiseClone (Inherited from Object.)
SortProperties (Inherited from TypeConverter.)
See Also
Reference
PointConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
PointConverter.ConvertFrom Method
Converts the given value to the type of this converter.
Overload List
Name Description
PointConverter.ConvertFrom (ITypeDescriptorContext, CultureInfo, Object) Converts the given object to the type of this conver
ter, using the specified context and culture informat
ion.
PointConverter.ConvertFrom (Object) (Inherited from TypeConverter.)
See Also
Reference
PointConverter Class
PointConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
Parameters
context
The format context.
culture
The current culture.
value
The object to convert.
Return Value
The converted value.
Exceptions
Exception type Condition
ArgumentException Invalid string format.
See Also
Reference
PointConverter Class
PointConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PointConverter.ConvertTo Method
Converts the given value object to the specified type, using the specified context and culture information.
Overload List
Name Description
PointConverter.ConvertTo (ITypeDescriptorContext, CultureInfo, Object, Type) Converts the given value object to the specified t
ype, using the specified context and culture infor
mation.
PointConverter.ConvertTo (Object, Type) (Inherited from TypeConverter.)
See Also
Reference
PointConverter Class
PointConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
Parameters
context
The format context.
culture
The culture to use in the conversion.
value
The object to convert.
destinationType
The destination type.
Return Value
The converted value.
Exceptions
Exception type Condition
ArgumentNullException destinationType is null.
See Also
Reference
PointConverter Class
PointConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PointConverter.CreateInstance Method
Re-creates an object given a set of property values for the object.
Overload List
Name Description
PointConverter.CreateInstance (ITypeDescriptorContext, IDictionary) Creates an instance of the type that this PointConverter is
associated with, using the specified context, given a set of
property values for the object.
PointConverter.CreateInstance (IDictionary) (Inherited from TypeConverter.)
See Also
Reference
PointConverter Class
PointConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
PointConverter.CreateInstance Method
(ITypeDescriptorContext, IDictionary)
Creates an instance of the type that this PointConverter is associated with, using the specified context, given a set of property
values for the object.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override Object CreateInstance (
ITypeDescriptorContext context,
IDictionary propertyValues
)
Parameters
context
The format context.
propertyValues
The new property values.
Return Value
An object representing propertyValues, or null if the object cannot be created.
See Also
Reference
PointConverter Class
PointConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
QuaternionConverter Class
Provides a unified way of converting Quaternion values to other types, as well as for accessing standard values and
subproperties.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class QuaternionConverter : MathTypeConverter
See Also
Reference
QuaternionConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
QuaternionConverter Members
The following tables list the members exposed by the QuaternionConverter type.
Public Constructors
Name Description
QuaternionConverter Initializes a new instance of the QuaternionConverter class.
Public Methods
Name Description
CanConvertFrom (Inherited from TypeConverter.)
CanConvertTo (Inherited from TypeConverter.)
ConvertFrom Overloaded. Converts the given value to the type of this converter.
ConvertFromInvariantString (Inherited from TypeConverter.)
ConvertFromString (Inherited from TypeConverter.)
ConvertTo Overloaded. Converts the given value object to the specified type, using the specified context
and culture information.
ConvertToInvariantString (Inherited from TypeConverter.)
ConvertToString (Inherited from TypeConverter.)
CreateInstance Overloaded. Re-creates an object given a set of property values for the object.
Equals (Inherited from Object.)
GetCreateInstanceSupported (Inherited from TypeConverter.)
GetHashCode (Inherited from Object.)
GetProperties (Inherited from TypeConverter.)
GetPropertiesSupported (Inherited from TypeConverter.)
GetStandardValues (Inherited from TypeConverter.)
GetStandardValuesExclusive (Inherited from TypeConverter.)
GetStandardValuesSupported (Inherited from TypeConverter.)
GetType (Inherited from Object.)
IsValid (Inherited from TypeConverter.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
GetConvertFromException (Inherited from TypeConverter.)
GetConvertToException (Inherited from TypeConverter.)
MemberwiseClone (Inherited from Object.)
SortProperties (Inherited from TypeConverter.)
See Also
Reference
QuaternionConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
QuaternionConverter Fields
See Also
Reference
QuaternionConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
QuaternionConverter Constructor
Initializes a new instance of the QuaternionConverter class.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public QuaternionConverter ()
See Also
Reference
QuaternionConverter Class
QuaternionConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
QuaternionConverter Methods
Public Methods
Name Description
CanConvertFrom (Inherited from TypeConverter.)
CanConvertTo (Inherited from TypeConverter.)
ConvertFrom Overloaded. Converts the given value to the type of this converter.
ConvertFromInvariantString (Inherited from TypeConverter.)
ConvertFromString (Inherited from TypeConverter.)
ConvertTo Overloaded. Converts the given value object to the specified type, using the specified context
and culture information.
ConvertToInvariantString (Inherited from TypeConverter.)
ConvertToString (Inherited from TypeConverter.)
CreateInstance Overloaded. Re-creates an object given a set of property values for the object.
Equals (Inherited from Object.)
GetCreateInstanceSupported (Inherited from TypeConverter.)
GetHashCode (Inherited from Object.)
GetProperties (Inherited from TypeConverter.)
GetPropertiesSupported (Inherited from TypeConverter.)
GetStandardValues (Inherited from TypeConverter.)
GetStandardValuesExclusive (Inherited from TypeConverter.)
GetStandardValuesSupported (Inherited from TypeConverter.)
GetType (Inherited from Object.)
IsValid (Inherited from TypeConverter.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
GetConvertFromException (Inherited from TypeConverter.)
GetConvertToException (Inherited from TypeConverter.)
MemberwiseClone (Inherited from Object.)
SortProperties (Inherited from TypeConverter.)
See Also
Reference
QuaternionConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
QuaternionConverter.ConvertFrom Method
Converts the given value to the type of this converter.
Overload List
Name Description
QuaternionConverter.ConvertFrom (ITypeDescriptorContext, CultureInfo, Object) Converts the given object to the type of this c
onverter, using the specified context and cult
ure information.
QuaternionConverter.ConvertFrom (Object) (Inherited from TypeConverter.)
See Also
Reference
QuaternionConverter Class
QuaternionConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
QuaternionConverter.ConvertFrom Method
(ITypeDescriptorContext, CultureInfo, Object)
Converts the given object to the type of this converter, using the specified context and culture information.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override Object ConvertFrom (
ITypeDescriptorContext context,
CultureInfo culture,
Object value
)
Parameters
context
The format context.
culture
The current culture.
value
The object to convert.
Return Value
The converted value.
Exceptions
Exception type Condition
ArgumentException Invalid string format.
See Also
Reference
QuaternionConverter Class
QuaternionConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
QuaternionConverter.ConvertTo Method
Converts the given value object to the specified type, using the specified context and culture information.
Overload List
Name Description
QuaternionConverter.ConvertTo (ITypeDescriptorContext, CultureInfo, Object, Type) Converts the given value object to the spe
cified type, using the specified context and
culture information.
QuaternionConverter.ConvertTo (Object, Type) (Inherited from TypeConverter.)
See Also
Reference
QuaternionConverter Class
QuaternionConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
QuaternionConverter.ConvertTo Method
(ITypeDescriptorContext, CultureInfo, Object, Type)
Converts the given value object to the specified type, using the specified context and culture information.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override Object ConvertTo (
ITypeDescriptorContext context,
CultureInfo culture,
Object value,
Type destinationType
)
Parameters
context
The format context.
culture
The culture to use in the conversion.
value
The object to convert.
destinationType
The destination type.
Return Value
The converted value.
Exceptions
Exception type Condition
ArgumentNullException destinationType is null.
See Also
Reference
QuaternionConverter Class
QuaternionConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
QuaternionConverter.CreateInstance Method
Re-creates an object given a set of property values for the object.
Overload List
Name Description
QuaternionConverter.CreateInstance (ITypeDescriptorContext, IDictionary) Creates an instance of the type that this
QuaternionConverter is associated with, using the s
pecified context, given a set of property values for t
he object.
QuaternionConverter.CreateInstance (IDictionary) (Inherited from TypeConverter.)
See Also
Reference
QuaternionConverter Class
QuaternionConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
QuaternionConverter.CreateInstance Method
(ITypeDescriptorContext, IDictionary)
Creates an instance of the type that this QuaternionConverter is associated with, using the specified context, given a set of
property values for the object.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override Object CreateInstance (
ITypeDescriptorContext context,
IDictionary propertyValues
)
Parameters
context
The format context.
propertyValues
The new property values.
Return Value
An object representing propertyValues, or null if the object cannot be created.
See Also
Reference
QuaternionConverter Class
QuaternionConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RayConverter Class
Provides a unified way of converting Ray values to other types, as well as for accessing standard values and subproperties.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class RayConverter : MathTypeConverter
See Also
Reference
RayConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RayConverter Members
The following tables list the members exposed by the RayConverter type.
Public Constructors
Name Description
RayConverter Initializes a new instance of the RayConverter class.
Public Methods
Name Description
CanConvertFrom (Inherited from TypeConverter.)
CanConvertTo (Inherited from TypeConverter.)
ConvertFrom Overloaded. Converts the given value to the type of this converter.
ConvertFromInvariantString (Inherited from TypeConverter.)
ConvertFromString (Inherited from TypeConverter.)
ConvertTo Overloaded. Converts the given value object to the specified type, using the specified context
and culture information.
ConvertToInvariantString (Inherited from TypeConverter.)
ConvertToString (Inherited from TypeConverter.)
CreateInstance Overloaded. Re-creates an object given a set of property values for the object.
Equals (Inherited from Object.)
GetCreateInstanceSupported (Inherited from TypeConverter.)
GetHashCode (Inherited from Object.)
GetProperties (Inherited from TypeConverter.)
GetPropertiesSupported (Inherited from TypeConverter.)
GetStandardValues (Inherited from TypeConverter.)
GetStandardValuesExclusive (Inherited from TypeConverter.)
GetStandardValuesSupported (Inherited from TypeConverter.)
GetType (Inherited from Object.)
IsValid (Inherited from TypeConverter.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
GetConvertFromException (Inherited from TypeConverter.)
GetConvertToException (Inherited from TypeConverter.)
MemberwiseClone (Inherited from Object.)
SortProperties (Inherited from TypeConverter.)
See Also
Reference
RayConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
RayConverter Fields
See Also
Reference
RayConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
RayConverter Constructor
Initializes a new instance of the RayConverter class.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public RayConverter ()
See Also
Reference
RayConverter Class
RayConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RayConverter Methods
Public Methods
Name Description
CanConvertFrom (Inherited from TypeConverter.)
CanConvertTo (Inherited from TypeConverter.)
ConvertFrom Overloaded. Converts the given value to the type of this converter.
ConvertFromInvariantString (Inherited from TypeConverter.)
ConvertFromString (Inherited from TypeConverter.)
ConvertTo Overloaded. Converts the given value object to the specified type, using the specified context
and culture information.
ConvertToInvariantString (Inherited from TypeConverter.)
ConvertToString (Inherited from TypeConverter.)
CreateInstance Overloaded. Re-creates an object given a set of property values for the object.
Equals (Inherited from Object.)
GetCreateInstanceSupported (Inherited from TypeConverter.)
GetHashCode (Inherited from Object.)
GetProperties (Inherited from TypeConverter.)
GetPropertiesSupported (Inherited from TypeConverter.)
GetStandardValues (Inherited from TypeConverter.)
GetStandardValuesExclusive (Inherited from TypeConverter.)
GetStandardValuesSupported (Inherited from TypeConverter.)
GetType (Inherited from Object.)
IsValid (Inherited from TypeConverter.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
GetConvertFromException (Inherited from TypeConverter.)
GetConvertToException (Inherited from TypeConverter.)
MemberwiseClone (Inherited from Object.)
SortProperties (Inherited from TypeConverter.)
See Also
Reference
RayConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
RayConverter.ConvertFrom Method
Converts the given value to the type of this converter.
Overload List
Name Description
RayConverter.ConvertFrom (ITypeDescriptorContext, CultureInfo, Object) Converts the given object to the type of this converte
r, using the specified context and culture information
.
RayConverter.ConvertFrom (Object) (Inherited from TypeConverter.)
See Also
Reference
RayConverter Class
RayConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
Parameters
context
The format context.
culture
The current culture.
value
The object to convert.
Return Value
The converted value.
See Also
Reference
RayConverter Class
RayConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RayConverter.ConvertTo Method
Converts the given value object to the specified type, using the specified context and culture information.
Overload List
Name Description
RayConverter.ConvertTo (ITypeDescriptorContext, CultureInfo, Object, Type) Converts the given value object to the specified ty
pe, using the specified context and culture inform
ation.
RayConverter.ConvertTo (Object, Type) (Inherited from TypeConverter.)
See Also
Reference
RayConverter Class
RayConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
Parameters
context
The format context.
culture
The culture to use in the conversion.
value
The object to convert.
destinationType
The destination type.
Return Value
The converted value.
Exceptions
Exception type Condition
ArgumentNullException destinationType is null.
See Also
Reference
RayConverter Class
RayConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RayConverter.CreateInstance Method
Re-creates an object given a set of property values for the object.
Overload List
Name Description
RayConverter.CreateInstance (ITypeDescriptorContext, IDictionary) Creates an instance of the type that this RayConverter is as
sociated with, using the specified context, given a set of pro
perty values for the object.
RayConverter.CreateInstance (IDictionary) (Inherited from TypeConverter.)
See Also
Reference
RayConverter Class
RayConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
Parameters
context
The format context.
propertyValues
The new property values.
Return Value
An object representing propertyValues, or null if the object cannot be created.
See Also
Reference
RayConverter Class
RayConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RectangleConverter Class
Provides a unified way of converting Rectangle values to other types, as well as for accessing standard values and
subproperties.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class RectangleConverter : MathTypeConverter
See Also
Reference
RectangleConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RectangleConverter Members
The following tables list the members exposed by the RectangleConverter type.
Public Constructors
Name Description
RectangleConverter Initializes a new instance of the RectangleConverter class.
Public Methods
Name Description
CanConvertFrom (Inherited from TypeConverter.)
CanConvertTo (Inherited from TypeConverter.)
ConvertFrom (Inherited from TypeConverter.)
ConvertFromInvariantString (Inherited from TypeConverter.)
ConvertFromString (Inherited from TypeConverter.)
ConvertTo Overloaded. Converts the given value object to the specified type, using the specified context
and culture information.
ConvertToInvariantString (Inherited from TypeConverter.)
ConvertToString (Inherited from TypeConverter.)
CreateInstance Overloaded. Re-creates an object given a set of property values for the object.
Equals (Inherited from Object.)
GetCreateInstanceSupported (Inherited from TypeConverter.)
GetHashCode (Inherited from Object.)
GetProperties (Inherited from TypeConverter.)
GetPropertiesSupported (Inherited from TypeConverter.)
GetStandardValues (Inherited from TypeConverter.)
GetStandardValuesExclusive (Inherited from TypeConverter.)
GetStandardValuesSupported (Inherited from TypeConverter.)
GetType (Inherited from Object.)
IsValid (Inherited from TypeConverter.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
GetConvertFromException (Inherited from TypeConverter.)
GetConvertToException (Inherited from TypeConverter.)
MemberwiseClone (Inherited from Object.)
SortProperties (Inherited from TypeConverter.)
See Also
Reference
RectangleConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
RectangleConverter Fields
See Also
Reference
RectangleConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
RectangleConverter Constructor
Initializes a new instance of the RectangleConverter class.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public RectangleConverter ()
See Also
Reference
RectangleConverter Class
RectangleConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RectangleConverter Methods
Public Methods
Name Description
CanConvertFrom (Inherited from TypeConverter.)
CanConvertTo (Inherited from TypeConverter.)
ConvertFrom (Inherited from TypeConverter.)
ConvertFromInvariantString (Inherited from TypeConverter.)
ConvertFromString (Inherited from TypeConverter.)
ConvertTo Overloaded. Converts the given value object to the specified type, using the specified context
and culture information.
ConvertToInvariantString (Inherited from TypeConverter.)
ConvertToString (Inherited from TypeConverter.)
CreateInstance Overloaded. Re-creates an object given a set of property values for the object.
Equals (Inherited from Object.)
GetCreateInstanceSupported (Inherited from TypeConverter.)
GetHashCode (Inherited from Object.)
GetProperties (Inherited from TypeConverter.)
GetPropertiesSupported (Inherited from TypeConverter.)
GetStandardValues (Inherited from TypeConverter.)
GetStandardValuesExclusive (Inherited from TypeConverter.)
GetStandardValuesSupported (Inherited from TypeConverter.)
GetType (Inherited from Object.)
IsValid (Inherited from TypeConverter.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
GetConvertFromException (Inherited from TypeConverter.)
GetConvertToException (Inherited from TypeConverter.)
MemberwiseClone (Inherited from Object.)
SortProperties (Inherited from TypeConverter.)
See Also
Reference
RectangleConverter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
RectangleConverter.ConvertTo Method
Converts the given value object to the specified type, using the specified context and culture information.
Overload List
Name Description
RectangleConverter.ConvertTo (ITypeDescriptorContext, CultureInfo, Object, Type) Converts the given value object to the speci
fied type, using the specified context and cul
ture information.
RectangleConverter.ConvertTo (Object, Type) (Inherited from TypeConverter.)
See Also
Reference
RectangleConverter Class
RectangleConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
RectangleConverter.ConvertTo Method
(ITypeDescriptorContext, CultureInfo, Object, Type)
Converts the given value object to the specified type, using the specified context and culture information.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override Object ConvertTo (
ITypeDescriptorContext context,
CultureInfo culture,
Object value,
Type destinationType
)
Parameters
context
The format context.
culture
The culture to use in the conversion.
value
The object to convert.
destinationType
The destination type.
Return Value
The converted value.
Exceptions
Exception type Condition
ArgumentNullException destinationType is null.
See Also
Reference
RectangleConverter Class
RectangleConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RectangleConverter.CreateInstance Method
Re-creates an object given a set of property values for the object.
Overload List
Name Description
RectangleConverter.CreateInstance (ITypeDescriptorContext, IDictionary) Creates an instance of the type that this
RectangleConverter is associated with, using the spec
ified context, given a set of property values for the ob
ject.
RectangleConverter.CreateInstance (IDictionary) (Inherited from TypeConverter.)
See Also
Reference
RectangleConverter Class
RectangleConverter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
RectangleConverter.CreateInstance Method
(ITypeDescriptorContext, IDictionary)
Creates an instance of the type that this RectangleConverter is associated with, using the specified context, given a set of
property values for the object.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override Object CreateInstance (
ITypeDescriptorContext context,
IDictionary propertyValues
)
Parameters
context
The format context.
propertyValues
The new property values.
Return Value
An object representing propertyValues, or null if the object cannot be created.
See Also
Reference
RectangleConverter Class
RectangleConverter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2Converter Class
Provides a unified way of converting Vector2 values to other types, as well as for accessing standard values and subproperties.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class Vector2Converter : MathTypeConverter
See Also
Reference
Vector2Converter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2Converter Members
The following tables list the members exposed by the Vector2Converter type.
Public Constructors
Name Description
Vector2Converter Initializes a new instance of the Vector2Converter class.
Public Methods
Name Description
CanConvertFrom (Inherited from TypeConverter.)
CanConvertTo (Inherited from TypeConverter.)
ConvertFrom Overloaded. Converts the given value to the type of this converter.
ConvertFromInvariantString (Inherited from TypeConverter.)
ConvertFromString (Inherited from TypeConverter.)
ConvertTo Overloaded. Converts the given value object to the specified type, using the specified context
and culture information.
ConvertToInvariantString (Inherited from TypeConverter.)
ConvertToString (Inherited from TypeConverter.)
CreateInstance Overloaded. Re-creates an object given a set of property values for the object.
Equals (Inherited from Object.)
GetCreateInstanceSupported (Inherited from TypeConverter.)
GetHashCode (Inherited from Object.)
GetProperties (Inherited from TypeConverter.)
GetPropertiesSupported (Inherited from TypeConverter.)
GetStandardValues (Inherited from TypeConverter.)
GetStandardValuesExclusive (Inherited from TypeConverter.)
GetStandardValuesSupported (Inherited from TypeConverter.)
GetType (Inherited from Object.)
IsValid (Inherited from TypeConverter.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
GetConvertFromException (Inherited from TypeConverter.)
GetConvertToException (Inherited from TypeConverter.)
MemberwiseClone (Inherited from Object.)
SortProperties (Inherited from TypeConverter.)
See Also
Reference
Vector2Converter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
Vector2Converter Fields
See Also
Reference
Vector2Converter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
Vector2Converter Constructor
Initializes a new instance of the Vector2Converter class.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector2Converter ()
See Also
Reference
Vector2Converter Class
Vector2Converter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2Converter Methods
Public Methods
Name Description
CanConvertFrom (Inherited from TypeConverter.)
CanConvertTo (Inherited from TypeConverter.)
ConvertFrom Overloaded. Converts the given value to the type of this converter.
ConvertFromInvariantString (Inherited from TypeConverter.)
ConvertFromString (Inherited from TypeConverter.)
ConvertTo Overloaded. Converts the given value object to the specified type, using the specified context
and culture information.
ConvertToInvariantString (Inherited from TypeConverter.)
ConvertToString (Inherited from TypeConverter.)
CreateInstance Overloaded. Re-creates an object given a set of property values for the object.
Equals (Inherited from Object.)
GetCreateInstanceSupported (Inherited from TypeConverter.)
GetHashCode (Inherited from Object.)
GetProperties (Inherited from TypeConverter.)
GetPropertiesSupported (Inherited from TypeConverter.)
GetStandardValues (Inherited from TypeConverter.)
GetStandardValuesExclusive (Inherited from TypeConverter.)
GetStandardValuesSupported (Inherited from TypeConverter.)
GetType (Inherited from Object.)
IsValid (Inherited from TypeConverter.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
GetConvertFromException (Inherited from TypeConverter.)
GetConvertToException (Inherited from TypeConverter.)
MemberwiseClone (Inherited from Object.)
SortProperties (Inherited from TypeConverter.)
See Also
Reference
Vector2Converter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
Vector2Converter.ConvertFrom Method
Converts the given value to the type of this converter.
Overload List
Name Description
Vector2Converter.ConvertFrom (ITypeDescriptorContext, CultureInfo, Object) Converts the given object to the type of this conv
erter, using the specified context and culture info
rmation.
Vector2Converter.ConvertFrom (Object) (Inherited from TypeConverter.)
See Also
Reference
Vector2Converter Class
Vector2Converter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
Vector2Converter.ConvertFrom Method
(ITypeDescriptorContext, CultureInfo, Object)
Converts the given object to the type of this converter, using the specified context and culture information.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override Object ConvertFrom (
ITypeDescriptorContext context,
CultureInfo culture,
Object value
)
Parameters
context
The format context.
culture
The current culture.
value
The object to convert.
Return Value
The converted value.
Exceptions
Exception type Condition
ArgumentException Invalid string format.
See Also
Reference
Vector2Converter Class
Vector2Converter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2Converter.ConvertTo Method
Converts the given value object to the specified type, using the specified context and culture information.
Overload List
Name Description
Vector2Converter.ConvertTo (ITypeDescriptorContext, CultureInfo, Object, Type) Converts the given value object to the specifie
d type, using the specified context and culture
information.
Vector2Converter.ConvertTo (Object, Type) (Inherited from TypeConverter.)
See Also
Reference
Vector2Converter Class
Vector2Converter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
Parameters
context
The format context.
culture
The culture to use in the conversion.
value
The object to convert.
destinationType
The destination type.
Return Value
The converted value.
Exceptions
Exception type Condition
ArgumentNullException destinationType is null.
See Also
Reference
Vector2Converter Class
Vector2Converter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector2Converter.CreateInstance Method
Re-creates an object given a set of property values for the object.
Overload List
Name Description
Vector2Converter.CreateInstance (ITypeDescriptorContext, IDictionary) Creates an instance of the type that this
Vector2Converter is associated with, using the specifie
d context, given a set of property values for the object.
Vector2Converter.CreateInstance (IDictionary) (Inherited from TypeConverter.)
See Also
Reference
Vector2Converter Class
Vector2Converter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
Vector2Converter.CreateInstance Method
(ITypeDescriptorContext, IDictionary)
Creates an instance of the type that this Vector2Converter is associated with, using the specified context, given a set of
property values for the object.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override Object CreateInstance (
ITypeDescriptorContext context,
IDictionary propertyValues
)
Parameters
context
The format context.
propertyValues
The new property values.
Return Value
An object representing propertyValues, or null if the object cannot be created.
See Also
Reference
Vector2Converter Class
Vector2Converter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3Converter Class
Provides a unified way of converting Vector3 values to other types, as well as for accessing standard values and subproperties.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class Vector3Converter : MathTypeConverter
See Also
Reference
Vector3Converter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3Converter Members
The following tables list the members exposed by the Vector3Converter type.
Public Constructors
Name Description
Vector3Converter Initializes a new instance of the Vector3Converter class.
Public Methods
Name Description
CanConvertFrom (Inherited from TypeConverter.)
CanConvertTo (Inherited from TypeConverter.)
ConvertFrom Overloaded. Converts the given value to the type of this converter.
ConvertFromInvariantString (Inherited from TypeConverter.)
ConvertFromString (Inherited from TypeConverter.)
ConvertTo Overloaded. Converts the given value object to the specified type, using the specified context
and culture information.
ConvertToInvariantString (Inherited from TypeConverter.)
ConvertToString (Inherited from TypeConverter.)
CreateInstance Overloaded. Re-creates an object given a set of property values for the object.
Equals (Inherited from Object.)
GetCreateInstanceSupported (Inherited from TypeConverter.)
GetHashCode (Inherited from Object.)
GetProperties (Inherited from TypeConverter.)
GetPropertiesSupported (Inherited from TypeConverter.)
GetStandardValues (Inherited from TypeConverter.)
GetStandardValuesExclusive (Inherited from TypeConverter.)
GetStandardValuesSupported (Inherited from TypeConverter.)
GetType (Inherited from Object.)
IsValid (Inherited from TypeConverter.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
GetConvertFromException (Inherited from TypeConverter.)
GetConvertToException (Inherited from TypeConverter.)
MemberwiseClone (Inherited from Object.)
SortProperties (Inherited from TypeConverter.)
See Also
Reference
Vector3Converter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
Vector3Converter Fields
See Also
Reference
Vector3Converter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
Vector3Converter Constructor
Initializes a new instance of the Vector3Converter class.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3Converter ()
See Also
Reference
Vector3Converter Class
Vector3Converter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3Converter Methods
Public Methods
Name Description
CanConvertFrom (Inherited from TypeConverter.)
CanConvertTo (Inherited from TypeConverter.)
ConvertFrom Overloaded. Converts the given value to the type of this converter.
ConvertFromInvariantString (Inherited from TypeConverter.)
ConvertFromString (Inherited from TypeConverter.)
ConvertTo Overloaded. Converts the given value object to the specified type, using the specified context
and culture information.
ConvertToInvariantString (Inherited from TypeConverter.)
ConvertToString (Inherited from TypeConverter.)
CreateInstance Overloaded. Re-creates an object given a set of property values for the object.
Equals (Inherited from Object.)
GetCreateInstanceSupported (Inherited from TypeConverter.)
GetHashCode (Inherited from Object.)
GetProperties (Inherited from TypeConverter.)
GetPropertiesSupported (Inherited from TypeConverter.)
GetStandardValues (Inherited from TypeConverter.)
GetStandardValuesExclusive (Inherited from TypeConverter.)
GetStandardValuesSupported (Inherited from TypeConverter.)
GetType (Inherited from Object.)
IsValid (Inherited from TypeConverter.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
GetConvertFromException (Inherited from TypeConverter.)
GetConvertToException (Inherited from TypeConverter.)
MemberwiseClone (Inherited from Object.)
SortProperties (Inherited from TypeConverter.)
See Also
Reference
Vector3Converter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
Vector3Converter.ConvertFrom Method
Converts the given value to the type of this converter.
Overload List
Name Description
Vector3Converter.ConvertFrom (ITypeDescriptorContext, CultureInfo, Object) Converts the given object to the type of this conv
erter, using the specified context and culture info
rmation.
Vector3Converter.ConvertFrom (Object) (Inherited from TypeConverter.)
See Also
Reference
Vector3Converter Class
Vector3Converter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
Vector3Converter.ConvertFrom Method
(ITypeDescriptorContext, CultureInfo, Object)
Converts the given object to the type of this converter, using the specified context and culture information.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override Object ConvertFrom (
ITypeDescriptorContext context,
CultureInfo culture,
Object value
)
Parameters
context
The format context.
culture
The current culture.
value
The object to convert.
Return Value
The converted value.
Exceptions
Exception type Condition
ArgumentException Invalid string format.
See Also
Reference
Vector3Converter Class
Vector3Converter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3Converter.ConvertTo Method
Converts the given value object to the specified type, using the specified context and culture information.
Overload List
Name Description
Vector3Converter.ConvertTo (ITypeDescriptorContext, CultureInfo, Object, Type) Converts the given value object to the specifie
d type, using the specified context and culture
information.
Vector3Converter.ConvertTo (Object, Type) (Inherited from TypeConverter.)
See Also
Reference
Vector3Converter Class
Vector3Converter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
Parameters
context
The format context.
culture
The culture to use in the conversion.
value
The object to convert.
destinationType
The destination type.
Return Value
The converted value.
Exceptions
Exception type Condition
ArgumentNullException destinationType is null.
See Also
Reference
Vector3Converter Class
Vector3Converter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector3Converter.CreateInstance Method
Re-creates an object given a set of property values for the object.
Overload List
Name Description
Vector3Converter.CreateInstance (ITypeDescriptorContext, IDictionary) Creates an instance of the type that this
Vector3Converter is associated with, using the specifie
d context, given a set of property values for the object.
Vector3Converter.CreateInstance (IDictionary) (Inherited from TypeConverter.)
See Also
Reference
Vector3Converter Class
Vector3Converter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
Vector3Converter.CreateInstance Method
(ITypeDescriptorContext, IDictionary)
Creates an instance of the type that this Vector3Converter is associated with, using the specified context, given a set of
property values for the object.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override Object CreateInstance (
ITypeDescriptorContext context,
IDictionary propertyValues
)
Parameters
context
The format context.
propertyValues
The new property values.
Return Value
An object representing propertyValues, or null if the object cannot be created.
See Also
Reference
Vector3Converter Class
Vector3Converter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4Converter Class
Provides a unified way of converting Vector4 values to other types, as well as for accessing standard values and subproperties.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class Vector4Converter : MathTypeConverter
See Also
Reference
Vector4Converter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4Converter Members
The following tables list the members exposed by the Vector4Converter type.
Public Constructors
Name Description
Vector4Converter Initializes a new instance of the Vector4Converter class.
Public Methods
Name Description
CanConvertFrom (Inherited from TypeConverter.)
CanConvertTo (Inherited from TypeConverter.)
ConvertFrom Overloaded. Converts the given value to the type of this converter.
ConvertFromInvariantString (Inherited from TypeConverter.)
ConvertFromString (Inherited from TypeConverter.)
ConvertTo Overloaded. Converts the given value object to the specified type, using the specified context
and culture information.
ConvertToInvariantString (Inherited from TypeConverter.)
ConvertToString (Inherited from TypeConverter.)
CreateInstance Overloaded. Re-creates an object given a set of property values for the object.
Equals (Inherited from Object.)
GetCreateInstanceSupported (Inherited from TypeConverter.)
GetHashCode (Inherited from Object.)
GetProperties (Inherited from TypeConverter.)
GetPropertiesSupported (Inherited from TypeConverter.)
GetStandardValues (Inherited from TypeConverter.)
GetStandardValuesExclusive (Inherited from TypeConverter.)
GetStandardValuesSupported (Inherited from TypeConverter.)
GetType (Inherited from Object.)
IsValid (Inherited from TypeConverter.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
GetConvertFromException (Inherited from TypeConverter.)
GetConvertToException (Inherited from TypeConverter.)
MemberwiseClone (Inherited from Object.)
SortProperties (Inherited from TypeConverter.)
See Also
Reference
Vector4Converter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
Vector4Converter Fields
See Also
Reference
Vector4Converter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
Vector4Converter Constructor
Initializes a new instance of the Vector4Converter class.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector4Converter ()
See Also
Reference
Vector4Converter Class
Vector4Converter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4Converter Methods
Public Methods
Name Description
CanConvertFrom (Inherited from TypeConverter.)
CanConvertTo (Inherited from TypeConverter.)
ConvertFrom Overloaded. Converts the given value to the type of this converter.
ConvertFromInvariantString (Inherited from TypeConverter.)
ConvertFromString (Inherited from TypeConverter.)
ConvertTo Overloaded. Converts the given value object to the specified type, using the specified context
and culture information.
ConvertToInvariantString (Inherited from TypeConverter.)
ConvertToString (Inherited from TypeConverter.)
CreateInstance Overloaded. Re-creates an object given a set of property values for the object.
Equals (Inherited from Object.)
GetCreateInstanceSupported (Inherited from TypeConverter.)
GetHashCode (Inherited from Object.)
GetProperties (Inherited from TypeConverter.)
GetPropertiesSupported (Inherited from TypeConverter.)
GetStandardValues (Inherited from TypeConverter.)
GetStandardValuesExclusive (Inherited from TypeConverter.)
GetStandardValuesSupported (Inherited from TypeConverter.)
GetType (Inherited from Object.)
IsValid (Inherited from TypeConverter.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
GetConvertFromException (Inherited from TypeConverter.)
GetConvertToException (Inherited from TypeConverter.)
MemberwiseClone (Inherited from Object.)
SortProperties (Inherited from TypeConverter.)
See Also
Reference
Vector4Converter Class
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
Vector4Converter.ConvertFrom Method
Converts the given value to the type of this converter.
Overload List
Name Description
Vector4Converter.ConvertFrom (ITypeDescriptorContext, CultureInfo, Object) Converts the given object to the type of this conv
erter, using the specified context and culture info
rmation.
Vector4Converter.ConvertFrom (Object) (Inherited from TypeConverter.)
See Also
Reference
Vector4Converter Class
Vector4Converter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
Vector4Converter.ConvertFrom Method
(ITypeDescriptorContext, CultureInfo, Object)
Converts the given object to the type of this converter, using the specified context and culture information.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override Object ConvertFrom (
ITypeDescriptorContext context,
CultureInfo culture,
Object value
)
Parameters
context
The format context.
culture
The current culture.
value
The object to convert.
Return Value
The converted value.
Exceptions
Exception type Condition
ArgumentException Invalid string format.
See Also
Reference
Vector4Converter Class
Vector4Converter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4Converter.ConvertTo Method
Converts the given value object to the specified type, using the specified context and culture information.
Overload List
Name Description
Vector4Converter.ConvertTo (ITypeDescriptorContext, CultureInfo, Object, Type) Converts the given value object to the specifie
d type, using the specified context and culture
information.
Vector4Converter.ConvertTo (Object, Type) (Inherited from TypeConverter.)
See Also
Reference
Vector4Converter Class
Vector4Converter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
Parameters
context
The format context.
culture
The culture to use in the conversion.
value
The object to convert.
destinationType
The destination type.
Return Value
The converted value.
Exceptions
Exception type Condition
ArgumentNullException destinationType is null.
See Also
Reference
Vector4Converter Class
Vector4Converter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Vector4Converter.CreateInstance Method
Re-creates an object given a set of property values for the object.
Overload List
Name Description
Vector4Converter.CreateInstance (ITypeDescriptorContext, IDictionary) Creates an instance of the type that this
Vector4Converter is associated with, using the specifie
d context, given a set of property values for the object.
Vector4Converter.CreateInstance (IDictionary) (Inherited from TypeConverter.)
See Also
Reference
Vector4Converter Class
Vector4Converter Members
Microsoft.Xna.Framework.Design Namespace
XNA Game Studio 2.0
Vector4Converter.CreateInstance Method
(ITypeDescriptorContext, IDictionary)
Creates an instance of the type that this Vector4Converter is associated with, using the specified context, given a set of
property values for the object.
Namespace: Microsoft.Xna.Framework.Design
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override Object CreateInstance (
ITypeDescriptorContext context,
IDictionary propertyValues
)
Parameters
context
The format context.
propertyValues
The new property values.
Return Value
An object representing propertyValues, or null if the object cannot be created.
See Also
Reference
Vector4Converter Class
Vector4Converter Members
Microsoft.Xna.Framework.Design Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.GamerServices Namespace
Contains classes that implement various services related to gamers. These services communicate directly with the gamer, the
gamer's data, or otherwise reflect choices the gamer makes. Gamer services include input device and profile data APIs.
Classes
Name Description
FriendCollection Represents the complete friends list of a local gamer.
FriendGamer Provides the presence information of a friend of the local gamer.
GameDefaults Describes a gamer's preferred settings.
Gamer Abstract base class for types that represent game players (profiles that have an associ
ated gamertag). The concrete types SignedInGamer and NetworkGamer derive from t
his.
GamerCollection Represents a collection of gamers. This collection cannot be modified and is updated
automatically during the call to Update.
GamerPrivilegeException Thrown if a gamer services or multiplayer API is called without a valid, signed-in profi
le.
GamerPrivileges Describes what operations a gamer is allowed to perform.
GamerProfile Profile settings describing information about a gamer such as their motto, reputation,
and gamer picture. This data is accessible for both locally signed in profiles and remot
e gamers that you are playing with in a multiplayer session.
GamerServicesComponent Wraps the functionality of the GamerServicesDispatcher.
GamerServicesDispatcher Implements the Windows-specific portion of a GamerServicesDispatcher class.
GamerServicesNotAvailableException Thrown if the gamer services system cannot be successfully initialized.
Guide Provides access to the Guide user interface.
GuideAlreadyVisibleException Thrown if an attmept is made to display a component of the Guide user interface whe
n a Guide component is already displayed.
SignedInEventArgs Represents the arguments passed to a SignedIn event.
SignedInGamer Represents a gamer (a profile that has an associated gamertag) on the local system.
SignedInGamerCollection Represents a collection of gamers on the local system.
SignedOutEventArgs Represents the arguments passed to a SignedOut event.
Structures
Name Description
GamerCollection.GamerCollectionEnumerator Provides the ability to iterate through the gamers in an GamerCollection.
Enumerations
Name Description
ControllerSensitivity Indicates how sensitive this gamer prefers controller input to be.
GameDifficulty Indicates how difficult this gamer likes things to be.
GamerPrivilegeSetting Describes the conditions in which a privilege is available.
GamerZone This style of social gaming preferred by this Xbox Live member.
MessageBoxIcon Defines the different icons for a message box.
NotificationPosition Determines where notifications appear on the screen.
RacingCameraAngle Indicates which camera angle this gamer prefers to use in racing games.
See Also
Concepts
Gamer Services Overview
XNA Game Studio 2.0
ControllerSensitivity Enumeration
Indicates how sensitive this gamer prefers controller input to be.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum ControllerSensitivity
Members
Member name Description
High Highly sensitive controller input is preferred.
Low Below average sensitivity is preferred.
Medium Average controller sensitivity is preferred.
See Also
Reference
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
FriendCollection Class
Represents the complete friends list of a local gamer.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class FriendCollection : GamerCollection<FriendGamer>, IDisposable
See Also
Reference
FriendCollection Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
FriendCollection Members
The following tables list the members exposed by the FriendCollection type.
Public Properties
Name Description
Count (Inherited from ReadOnlyCollection.)
IsDisposed Gets a value that indicates whether the object is disposed.
Item (Inherited from ReadOnlyCollection.)
Protected Properties
Name Description
Items (Inherited from ReadOnlyCollection.)
Public Methods
Name Description
Contains (Inherited from ReadOnlyCollection.)
CopyTo (Inherited from ReadOnlyCollection.)
Dispose Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetEnumerator (Inherited from ReadOnlyCollection.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
IndexOf (Inherited from ReadOnlyCollection.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows this object to free resources and perform other cleanup operations before garbage collection recl
aims the object.
MemberwiseClone (Inherited from Object.)
See Also
Reference
FriendCollection Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
FriendCollection Methods
Public Methods
Name Description
Contains (Inherited from ReadOnlyCollection.)
CopyTo (Inherited from ReadOnlyCollection.)
Dispose Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetEnumerator (Inherited from ReadOnlyCollection.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
IndexOf (Inherited from ReadOnlyCollection.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows this object to free resources and perform other cleanup operations before garbage collection recl
aims the object.
MemberwiseClone (Inherited from Object.)
See Also
Reference
FriendCollection Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
FriendCollection.Dispose Method
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
Remarks Call Dispose when you are finished using the FriendCollection. The Dispose method leaves the FriendCollection in
an unusable state. After calling Dispose, you must release all references to the FriendCollection so the garbage collector can
reclaim the memory that the FriendCollection was occupying.
Note
Always call Dispose before you release your last reference to the FriendCollection. Otherwise, the resources it is using will n
ot be freed until the garbage collector calls the FriendCollection object's Finalize method.
See Also
Reference
FriendCollection Class
FriendCollection Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
FriendCollection.Finalize Method
Allows this object to free resources and perform other cleanup operations before garbage collection reclaims the object.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void Finalize ()
Remarks This method overrides Finalize. Application code should not call this method; an object's Finalize method is
automatically invoked during garbage collection, unless a call to the SuppressFinalize method has disabled finalization by the
garbage collector.
See Also
Reference
FriendCollection Class
FriendCollection Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
FriendCollection Properties
Public Properties
Name Description
Count (Inherited from ReadOnlyCollection.)
IsDisposed Gets a value that indicates whether the object is disposed.
Item (Inherited from ReadOnlyCollection.)
Protected Properties
Name Description
Items (Inherited from ReadOnlyCollection.)
See Also
Reference
FriendCollection Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
FriendCollection.IsDisposed Property
Gets a value that indicates whether the object is disposed.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsDisposed { get; }
Property Value
true if the object is disposed; false otherwise.
See Also
Reference
FriendCollection Class
FriendCollection Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
FriendGamer Class
Provides the presence information of a friend of the local gamer.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class FriendGamer : Gamer
See Also
Reference
FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
FriendGamer Members
The following tables list the members exposed by the FriendGamer type.
Public Properties
Name Description
FriendRequestReceivedFrom Gets whether the local gamer who requested the friends list has recieved a friend request fro
m this gamer.
FriendRequestSentTo Gets whether the local gamer who requested the friends list has sent a friend request to this g
amer.
Gamertag (Inherited from Gamer.)
HasVoice Gets whether this friend currently has voice capability.
InviteAccepted Gets whether this friend has accepted an invitation from the local gamer who requested the fri
ends list.
InviteReceivedFrom Gets whether the local gamer who requested the friends list has recieved an invitation from th
is friend.
InviteRejected Gets whether this friend has rejected an invitation from the local gamer who requested the fri
ends list.
InviteSentTo Gets whether the local gamer who requested the friends list has sent an invitation to this frien
d.
IsAway Gets whether this friend is currently away from the computer or console.
IsBusy Gets whether this friend is currently busy.
IsDisposed (Inherited from Gamer.)
IsJoinable Gets whether this friend is currently in a public session that can be joined.
IsOnline Gets whether this friend is currently online.
IsPlaying Gets whether this friend is currently playing a game.
Presence Gets a title-defined presence string describing what this friend is currently doing.
SignedInGamers (Inherited from Gamer.)
Tag (Inherited from Gamer.)
Public Methods
Name Description
BeginGetProfile (Inherited from Gamer.)
EndGetProfile (Inherited from Gamer.)
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetProfile (Inherited from Gamer.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
FriendGamer Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
FriendGamer Methods
Public Methods
Name Description
BeginGetProfile (Inherited from Gamer.)
EndGetProfile (Inherited from Gamer.)
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetProfile (Inherited from Gamer.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
FriendGamer Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
FriendGamer Properties
Public Properties
Name Description
FriendRequestReceivedFrom Gets whether the local gamer who requested the friends list has recieved a friend request fro
m this gamer.
FriendRequestSentTo Gets whether the local gamer who requested the friends list has sent a friend request to this g
amer.
Gamertag (Inherited from Gamer.)
HasVoice Gets whether this friend currently has voice capability.
InviteAccepted Gets whether this friend has accepted an invitation from the local gamer who requested the fri
ends list.
InviteReceivedFrom Gets whether the local gamer who requested the friends list has recieved an invitation from th
is friend.
InviteRejected Gets whether this friend has rejected an invitation from the local gamer who requested the fri
ends list.
InviteSentTo Gets whether the local gamer who requested the friends list has sent an invitation to this frien
d.
IsAway Gets whether this friend is currently away from the computer or console.
IsBusy Gets whether this friend is currently busy.
IsDisposed (Inherited from Gamer.)
IsJoinable Gets whether this friend is currently in a public session that can be joined.
IsOnline Gets whether this friend is currently online.
IsPlaying Gets whether this friend is currently playing a game.
Presence Gets a title-defined presence string describing what this friend is currently doing.
SignedInGamers (Inherited from Gamer.)
Tag (Inherited from Gamer.)
See Also
Reference
FriendGamer Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
FriendGamer.FriendRequestReceivedFrom Property
Gets whether the local gamer who requested the friends list has recieved a friend request from this gamer.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool FriendRequestReceivedFrom { get; }
Property Value
true if the local gamer who requested the friends list has recieved a friend request from this gamer; false otherwise.
See Also
Reference
FriendGamer Class
FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
FriendGamer.FriendRequestSentTo Property
Gets whether the local gamer who requested the friends list has sent a friend request to this gamer.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool FriendRequestSentTo { get; }
Property Value
true if the local gamer who requested the friends list has sent a friend request to this gamer; false otherwise.
See Also
Reference
FriendGamer Class
FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
FriendGamer.HasVoice Property
Gets whether this friend currently has voice capability.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool HasVoice { get; }
Property Value
true if this friend currently has voice capability; false otherwise.
See Also
Reference
FriendGamer Class
FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
FriendGamer.InviteAccepted Property
Gets whether this friend has accepted an invitation from the local gamer who requested the friends list.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool InviteAccepted { get; }
Property Value
true if this friend has accepted an invitation from the local gamer who requested the friends list; false otherwise.
See Also
Reference
FriendGamer Class
FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
FriendGamer.InviteReceivedFrom Property
Gets whether the local gamer who requested the friends list has recieved an invitation from this friend.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool InviteReceivedFrom { get; }
Property Value
true if the local gamer who requested the friends list has recieved an invitation from this friend; false otherwise.
See Also
Reference
FriendGamer Class
FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
FriendGamer.InviteRejected Property
Gets whether this friend has rejected an invitation from the local gamer who requested the friends list.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool InviteRejected { get; }
Property Value
true if this friend has rejected an invitation from the local gamer who requested the friends list; false otherwise.
See Also
Reference
FriendGamer Class
FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
FriendGamer.InviteSentTo Property
Gets whether the local gamer who requested the friends list has sent an invitation to this friend.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool InviteSentTo { get; }
Property Value
true if the local gamer who requested the friends list has sent an invitation to this friend; false otherwise.
See Also
Reference
FriendGamer Class
FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
FriendGamer.IsAway Property
Gets whether this friend is currently away from the computer or console.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsAway { get; }
Property Value
true if this friend is currently away from the computer or console; false otherwise.
See Also
Reference
FriendGamer Class
FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
FriendGamer.IsBusy Property
Gets whether this friend is currently busy.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsBusy { get; }
Property Value
true if this friend is currently busy; false otherwise.
See Also
Reference
FriendGamer Class
FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
FriendGamer.IsJoinable Property
Gets whether this friend is currently in a public session that can be joined.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsJoinable { get; }
Property Value
true if this friend is currently in a public session that can be joined; false otherwise.
See Also
Reference
FriendGamer Class
FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
FriendGamer.IsOnline Property
Gets whether this friend is currently online.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsOnline { get; }
Property Value
true if this friend is currently online; false otherwise.
See Also
Reference
FriendGamer Class
FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
FriendGamer.IsPlaying Property
Gets whether this friend is currently playing a game.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsPlaying { get; }
Property Value
true if this friend is currently playing a game; false otherwise.
See Also
Reference
FriendGamer Class
FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
FriendGamer.Presence Property
Gets a title-defined presence string describing what this friend is currently doing.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Presence { get; }
Property Value
Title-defined presence string describing what this friend is currently doing.
See Also
Reference
FriendGamer Class
FriendGamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameDefaults Class
Describes a gamer's preferred settings.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class GameDefaults
GameDefaults Members
The following tables list the members exposed by the GameDefaults type.
Public Properties
Name Description
AccelerateWithButtons Gets whether the gamer prefers to use controller buttons to accelerate in racing games.
AutoAim Gets whether the title should automatically correct the gamer's aim.
AutoCenter Gets whether the title should automatically center the view when the gamer moves.
BrakeWithButtons Gets whether the gamer prefers to use controller buttons to brake in racing games.
ControllerSensitivity Gets the preferred controller sensitivity setting for this gamer.
GameDifficulty Gets the preferred difficulty setting for this gamer.
InvertYAxis Gets whether the gamer prefers to invert the y-axis input of the controller.
ManualTransmission Gets whether the gamer prefers to drive a manual shift transmission in racing games.
MoveWithRightThumbStick Gets whether the gamer prefers to move using the right thumbstick.
PrimaryColor Gets the preferred color for the player character.
RacingCameraAngle Gets the gamer's preferred camera angle for racing games.
SecondaryColor Gets a secondary color selection for the player character.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GameDefaults Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GameDefaults Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GameDefaults Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GameDefaults Properties
Public Properties
Name Description
AccelerateWithButtons Gets whether the gamer prefers to use controller buttons to accelerate in racing games.
AutoAim Gets whether the title should automatically correct the gamer's aim.
AutoCenter Gets whether the title should automatically center the view when the gamer moves.
BrakeWithButtons Gets whether the gamer prefers to use controller buttons to brake in racing games.
ControllerSensitivity Gets the preferred controller sensitivity setting for this gamer.
GameDifficulty Gets the preferred difficulty setting for this gamer.
InvertYAxis Gets whether the gamer prefers to invert the y-axis input of the controller.
ManualTransmission Gets whether the gamer prefers to drive a manual shift transmission in racing games.
MoveWithRightThumbStick Gets whether the gamer prefers to move using the right thumbstick.
PrimaryColor Gets the preferred color for the player character.
RacingCameraAngle Gets the gamer's preferred camera angle for racing games.
SecondaryColor Gets a secondary color selection for the player character.
See Also
Reference
GameDefaults Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GameDefaults.AccelerateWithButtons Property
Gets whether the gamer prefers to use controller buttons to accelerate in racing games.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool AccelerateWithButtons { get; }
Property Value
true if the gamer prefers to use controller buttons to accelerate in racing games; false otherwise. If false, use triggers for
acceleration.
See Also
Reference
GameDefaults Class
GameDefaults Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameDefaults.AutoAim Property
Gets whether the title should automatically correct the gamer's aim.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool AutoAim { get; }
Property Value
true if the title should automatically correct the gamer's aim; false otherwise.
See Also
Reference
GameDefaults Class
GameDefaults Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameDefaults.AutoCenter Property
Gets whether the title should automatically center the view when the gamer moves.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool AutoCenter { get; }
Property Value
true if the title should automatically center the view when the gamer moves; false otherwise.
See Also
Reference
GameDefaults Class
GameDefaults Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameDefaults.BrakeWithButtons Property
Gets whether the gamer prefers to use controller buttons to brake in racing games.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool BrakeWithButtons { get; }
Property Value
true if the gamer prefers to use controller buttons to brake in racing games; false otherwise. If false, use the triggers for
braking.
See Also
Reference
GameDefaults Class
GameDefaults Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameDefaults.ControllerSensitivity Property
Gets the preferred controller sensitivity setting for this gamer.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ControllerSensitivity ControllerSensitivity { get; }
Property Value
The preferred controller sensitivity setting for this gamer.
See Also
Reference
GameDefaults Class
GameDefaults Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameDefaults.GameDifficulty Property
Gets the preferred difficulty setting for this gamer.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GameDifficulty GameDifficulty { get; }
Property Value
The preferred difficulty setting for this gamer.
See Also
Reference
GameDefaults Class
GameDefaults Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameDefaults.InvertYAxis Property
Gets whether the gamer prefers to invert the y-axis input of the controller.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool InvertYAxis { get; }
Property Value
true if the gamer prefers to invert the y-axis input of the controller; false otherwise.
See Also
Reference
GameDefaults Class
GameDefaults Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameDefaults.ManualTransmission Property
Gets whether the gamer prefers to drive a manual shift transmission in racing games.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool ManualTransmission { get; }
Property Value
true if the gamer prefers to drive a manual shift transmission in racing games; false otherwise.
See Also
Reference
GameDefaults Class
GameDefaults Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameDefaults.MoveWithRightThumbStick Property
Gets whether the gamer prefers to move using the right thumbstick.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool MoveWithRightThumbStick { get; }
Property Value
true if the gamer prefers to move using the right thumbstick; false otherwise. If this value is false, use the left thumbstick for
player movement.
See Also
Reference
GameDefaults Class
GameDefaults Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameDefaults.PrimaryColor Property
Gets the preferred color for the player character.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Nullable<Color> PrimaryColor { get; }
Property Value
The preferred color for the player character.
See Also
Reference
GameDefaults Class
GameDefaults Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameDefaults.RacingCameraAngle Property
Gets the gamer's preferred camera angle for racing games.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public RacingCameraAngle RacingCameraAngle { get; }
Property Value
The gamer's preferred camera angle for racing games.
See Also
Reference
GameDefaults Class
GameDefaults Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameDefaults.SecondaryColor Property
Gets a secondary color selection for the player character.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Nullable<Color> SecondaryColor { get; }
Property Value
A secondary color selection for the player character.
See Also
Reference
GameDefaults Class
GameDefaults Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameDifficulty Enumeration
Indicates how difficult this gamer likes things to be.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum GameDifficulty
Members
Member name Description
Easy Below-average difficulty.
Hard Above-average difficulty.
Normal Average difficulty.
See Also
Reference
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Gamer Class
Abstract base class for types that represent game players (profiles that have an associated gamertag). The concrete types
SignedInGamer and NetworkGamer derive from this.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public abstract class Gamer
See Also
Reference
Gamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Gamer Members
The following tables list the members exposed by the Gamer type.
Public Properties
Name Description
Gamertag Gets the gamertag string.
IsDisposed Gets a value indicating whether the object is disposed.
SignedInGamers Represents a collection of all gamers on the local system.
Tag Gets or sets a custom object which can be used to attach arbitrary user defined data to the gamer.
Public Methods
Name Description
BeginGetProfile Starts an asynchronous profile read operation.
EndGetProfile Ends an asynchronous profile read operation.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetProfile Reads profile data for this gamer.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Gamer Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
Gamer Methods
Public Methods
Name Description
BeginGetProfile Starts an asynchronous profile read operation.
EndGetProfile Ends an asynchronous profile read operation.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetProfile Reads profile data for this gamer.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Gamer Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
Gamer.BeginGetProfile Method
Starts an asynchronous profile read operation.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public IAsyncResult BeginGetProfile (
AsyncCallback callback,
Object asyncState
)
Parameters
callback
The method to be called once the asynchronous operation has finished.
asyncState
State of the asynchronous operation.
Return Value
An IAsyncResult used to track the progress of the method. Call EndGetProfile to access these results.
Exceptions
Exception type Condition
ObjectDisposedException This object has already been disposed.
See Also
Reference
GetProfile
EndGetProfile
Gamer Class
Gamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Gamer.EndGetProfile Method
Ends an asynchronous profile read operation.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GamerProfile EndGetProfile (
IAsyncResult result
)
Parameters
result
An IAsyncResult used to track the progress of the operation.
Return Value
The profile data for this gamer.
See Also
Reference
GetProfile
BeginGetProfile
Gamer Class
Gamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Gamer.GetProfile Method
Reads profile data for this gamer.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GamerProfile GetProfile ()
Return Value
The profile data for this gamer.
Remarks This operation can take some time if called on a remote gamer instance, in which case you might prefer to use the
non-blocking alternative BeginGetProfile, but will complete quickly when used with a locally signed in profile.
See Also
Reference
BeginGetProfile
Gamer Class
Gamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Gamer.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
Gamer Class
Gamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Gamer Properties
Public Properties
Name Description
Gamertag Gets the gamertag string.
IsDisposed Gets a value indicating whether the object is disposed.
SignedInGamers Represents a collection of all gamers on the local system.
Tag Gets or sets a custom object which can be used to attach arbitrary user defined data to the gamer.
See Also
Reference
Gamer Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
Gamer.Gamertag Property
Gets the gamertag string.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Gamertag { get; }
Property Value
Name of the gamertag.
See Also
Reference
Gamer Class
Gamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Gamer.IsDisposed Property
Gets a value indicating whether the object is disposed.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsDisposed { get; }
Property Value
true if the object is disposed; false otherwise.
See Also
Reference
Gamer Class
Gamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Gamer.SignedInGamers Property
Represents a collection of all gamers on the local system. The collection is sorted by the gamer index, skipping non-existent
gamer indices. For example, if gamers 1 and 3 are signed in, the collection contains two instances of SignedInGamer, with
gamer 1 first in the collection.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static SignedInGamerCollection SignedInGamers { get; }
Property Value
Collection of current gamers on the local system.
See Also
Reference
Gamer Class
Gamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Gamer.Tag Property
Gets or sets a custom object which can be used to attach arbitrary user defined data to the gamer.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Object Tag { get; set; }
Property Value
A custom object used to attach arbitrary user defined data to the gamer.
See Also
Reference
Gamer Class
Gamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Remarks
Access this collection using the following methods.
AllGamers
LocalGamers
RemoteGamers
See Also
Reference
GamerCollection Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerCollection Members
The following tables list the members exposed by the GamerCollection type.
Public Properties
Name Description
Count (Inherited from ReadOnlyCollection.)
Item (Inherited from ReadOnlyCollection.)
Protected Properties
Name Description
Items (Inherited from ReadOnlyCollection.)
Public Methods
Name Description
Contains (Inherited from ReadOnlyCollection.)
CopyTo (Inherited from ReadOnlyCollection.)
Equals (Inherited from Object.)
GetEnumerator Returns a strongly typed GamerCollection.GamerCollectionEnumerator Generic Structure that can iterate t
hrough a GamerCollection.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
IndexOf (Inherited from ReadOnlyCollection.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
System.Collections.Generic.IEnumerable<Microsoft.Xna.Framework.GamerServices.Gamer>.GetEnumerator Returns an e
numerator th
at can iterate
through the c
ollection.
See Also
Reference
GamerCollection Generic Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GamerCollection Methods
Public Methods
Name Description
Contains (Inherited from ReadOnlyCollection.)
CopyTo (Inherited from ReadOnlyCollection.)
Equals (Inherited from Object.)
GetEnumerator Returns a strongly typed GamerCollection.GamerCollectionEnumerator Generic Structure that can iterate t
hrough a GamerCollection.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
IndexOf (Inherited from ReadOnlyCollection.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
System.Collections.Generic.IEnumerable<Microsoft.Xna.Framework.GamerServices.Gamer>.GetEnumerator Returns an e
numerator th
at can iterate
through the c
ollection.
See Also
Reference
GamerCollection Generic Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GamerCollection.GetEnumerator Method
Returns a strongly typed GamerCollection.GamerCollectionEnumerator Generic Structure that can iterate through a
GamerCollection.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GamerCollectionEnumerator GetEnumerator ()
Return Value
The GamerCollection.GamerCollectionEnumerator Generic Structure.
See Also
Reference
GamerCollection Generic Class
GamerCollection Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
System.Collections.Generic.IEnumerable<Microsoft.Xna.Framework.GamerServices.Gamer>.GetEnumerator
Method
Returns an enumerator that can iterate through the collection.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private IEnumerator<Gamer> System.Collections.Generic.IEnumerable<Microsoft.Xna.Framework.GamerServices.Gamer>.GetEnumerator ()
Return Value
Enumerator that can iterate through the collection.
See Also
Reference
GamerCollection Generic Class
GamerCollection Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerCollection Properties
Public Properties
Name Description
Count (Inherited from ReadOnlyCollection.)
Item (Inherited from ReadOnlyCollection.)
Protected Properties
Name Description
Items (Inherited from ReadOnlyCollection.)
See Also
Reference
GamerCollection Generic Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
See Also
Reference
GamerCollection.GamerCollectionEnumerator Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerCollection.GamerCollectionEnumerator Members
The following tables list the members exposed by the GamerCollection.GamerCollectionEnumerator type.
Public Properties
Name Description
Current Gets the current element in the GamerCollection.
Public Methods
Name Description
Dispose Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetType (Inherited from Object.)
MoveNext Advances the enumerator to the next element of the GamerCollection.
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
System.Collections.IEnumerator.Current Gets the current element in the GamerCollection as a Object.
System.Collections.IEnumerator.Reset Sets the enumerator to its initial position, which is before the first element in the
GamerCollection.
See Also
Reference
GamerCollection.GamerCollectionEnumerator Generic Structure
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GamerCollection.GamerCollectionEnumerator Methods
Public Methods
Name Description
Dispose Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetType (Inherited from Object.)
MoveNext Advances the enumerator to the next element of the GamerCollection.
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
System.Collections.IEnumerator.Current Gets the current element in the GamerCollection as a Object.
System.Collections.IEnumerator.Reset Sets the enumerator to its initial position, which is before the first element in the
GamerCollection.
See Also
Reference
GamerCollection.GamerCollectionEnumerator Generic Structure
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GamerCollection.GamerCollectionEnumerator.Dispose Method
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
See Also
Reference
GamerCollection.GamerCollectionEnumerator Generic Structure
GamerCollection.GamerCollectionEnumerator Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerCollection.GamerCollectionEnumerator.MoveNext
Method
Advances the enumerator to the next element of the GamerCollection.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool MoveNext ()
Return Value
true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the
collection.
Exceptions
Exception type Condition
InvalidOperationException The collection was modified after the enumerator was created.
Remarks
After an enumerator is created or after a call to the System.Collections.IEnumerator.Reset Method method, an enumerator is
positioned before the first element of the collection, and the first call to the MoveNext method moves the enumerator over
the first element of the collection.
After the end of the collection is passed, subsequent calls to MoveNext return false until
System.Collections.IEnumerator.Reset Method is called.
An enumerator remains valid as long as the collection remains unchanged. If changes, such as adding, modifying, or deleting
elements are made to the collection, the enumerator is irrecoverably invalidated and the next call to MoveNext or
System.Collections.IEnumerator.Reset Method throws an InvalidOperationException.
See Also
Reference
GamerCollection.GamerCollectionEnumerator Generic Structure
GamerCollection.GamerCollectionEnumerator Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
System.Collections.IEnumerator.Reset Method
Sets the enumerator to its initial position, which is before the first element in the GamerCollection.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private void System.Collections.IEnumerator.Reset ()
Exceptions
Exception type Condition
InvalidOperationException
The collection was modified after the enumerator was created.
Remarks
An enumerator remains valid as long as the collection remains unchanged. If changes, such as adding, modifying, or deleting
elements are made to the collection, the enumerator is irrecoverably invalidated and the next call to the MoveNext method or
the System.Collections.IEnumerator.Reset method throws an InvalidOperationException.
Note
Notes to Implementers: All calls to System.Collections.IEnumerator.Reset must result in the same state for the enumerato
r. The preferred implementation is to move the enumerator to the beginning of the collection, before the first element. This in
validates the enumerator if the collection has been modified since the enumerator was created, which is consistent with
MoveNext and Current.
See Also
Reference
GamerCollection.GamerCollectionEnumerator Generic Structure
GamerCollection.GamerCollectionEnumerator Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerCollection.GamerCollectionEnumerator Properties
Public Properties
Name Description
Current Gets the current element in the GamerCollection.
See Also
Reference
GamerCollection.GamerCollectionEnumerator Generic Structure
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GamerCollection.GamerCollectionEnumerator.Current Property
Gets the current element in the GamerCollection.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public T Current { get; }
Property Value
The current element in the GamerCollection.
See Also
Reference
GamerCollection.GamerCollectionEnumerator Generic Structure
GamerCollection.GamerCollectionEnumerator Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerCollection.GamerCollectionEnumerator.System.Collections.IEnumerator.Current
Property
Gets the current element in the GamerCollection as a Object.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private Object System.Collections.IEnumerator.Current { get; }
Property Value
The current element in the GamerCollection as a Object.
See Also
Reference
GamerCollection.GamerCollectionEnumerator Generic Structure
GamerCollection.GamerCollectionEnumerator Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerPrivilegeException Class
Thrown if a gamer services or multiplayer API is called without a valid, signed-in profile.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public class GamerPrivilegeException : Exception
Remarks
This exception is thrown if any of the following conditons are met.
No profile is currently signed in.
The signed-in profile has parental control settings prohibiting the requested action.
See Also
Reference
GamerPrivilegeException Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerPrivilegeException Members
The following tables list the members exposed by the GamerPrivilegeException type.
Public Constructors
Name Description
GamerPrivilegeException Overloaded. Creates an empty instance of GamerPrivilegeException.
Public Properties
Name Description
Data (Inherited from Exception.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GamerPrivilegeException Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GamerPrivilegeException Constructor
Creates an empty instance of GamerPrivilegeException.
Overload List
Name Description
GamerPrivilegeException () Creates an instance of GamerPrivilegeException.
GamerPrivilegeException (SerializationInfo, StreamingContext) Initializes a new instance of GamerPrivilegeException with th
e specified streaming context.
GamerPrivilegeException (String) Initializes a new instance of GamerPrivilegeException with th
e specified error message.
GamerPrivilegeException (String, Exception) Initializes a new instance of GamerPrivilegeException with th
e specified error message and inner exception.
See Also
Reference
GamerPrivilegeException Class
GamerPrivilegeException Members
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GamerPrivilegeException Constructor ()
Creates an instance of GamerPrivilegeException.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GamerPrivilegeException ()
See Also
Reference
GamerPrivilegeException Class
GamerPrivilegeException Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
info
Describes the gamer services or multiplayer API being accessed when the exception occurred.
context
Describes the stream where the exception occurred.
See Also
Reference
GamerPrivilegeException Class
GamerPrivilegeException Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
message
A message that describes the error.
See Also
Reference
GamerPrivilegeException Class
GamerPrivilegeException Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
message
A message that describes the error.
innerException
The inner exception related to this exception.
See Also
Reference
GamerPrivilegeException Class
GamerPrivilegeException Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerPrivilegeException Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GamerPrivilegeException Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GamerPrivilegeException Properties
Public Properties
Name Description
Data (Inherited from Exception.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
See Also
Reference
GamerPrivilegeException Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GamerPrivileges Class
Describes what operations a gamer is allowed to perform.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class GamerPrivileges
Remarks
GamerPrivileges can be defined by parental control settings, and will also be set automatically in response to things like age,
region, and whether the gamer has a LIVE Gold or LIVE Silver account. Games do not need to explicitly check privileges,
because a GamerPrivilegeException will be thrown if they try to perform an unsupported operation, but these privilege bits
may be useful to detect that an operation is unavailable before calling it so as to grey-out the relevant menu option.
See Also
Reference
GamerPrivileges Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerPrivileges Members
The following tables list the members exposed by the GamerPrivileges type.
Public Properties
Name Description
AllowCommunication Checks whether this gamer is allowed to send and receive communications using voice, text, mes
saging, or game invites.
AllowOnlineSessions Checks whether this gamer is allowed to play in online multiplayer sessions.
AllowProfileViewing Checks whether this gamer is allowed to view the profiles of other gamers.
AllowPurchaseContent Checks whether this gamer is allowed to purchase content from LIVE Marketplace.
AllowTradeContent Checks whether this gamer is allowed to trade content with other gamers.
AllowUserCreatedContent Checks whether this gamer is allowed to access user content that was created by other gamers.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GamerPrivileges Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GamerPrivileges Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GamerPrivileges Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GamerPrivileges Properties
Public Properties
Name Description
AllowCommunication Checks whether this gamer is allowed to send and receive communications using voice, text, mes
saging, or game invites.
AllowOnlineSessions Checks whether this gamer is allowed to play in online multiplayer sessions.
AllowProfileViewing Checks whether this gamer is allowed to view the profiles of other gamers.
AllowPurchaseContent Checks whether this gamer is allowed to purchase content from LIVE Marketplace.
AllowTradeContent Checks whether this gamer is allowed to trade content with other gamers.
AllowUserCreatedContent Checks whether this gamer is allowed to access user content that was created by other gamers.
See Also
Reference
GamerPrivileges Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GamerPrivileges.AllowCommunication Property
Checks whether this gamer is allowed to send and receive communications using voice, text, messaging, or game invites.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GamerPrivilegeSetting AllowCommunication { get; }
Property Value
true if this gamer is allowed to send and receive communications using voice, text, messaging, or game invites; false
otherwise.
Remarks
Titles do not need to do anything special to disable voice if this privilege is disabled: the framework will handle that
automatically.
See Also
Reference
GamerPrivileges Class
GamerPrivileges Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerPrivileges.AllowOnlineSessions Property
Checks whether this gamer is allowed to play in online multiplayer sessions.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool AllowOnlineSessions { get; }
Property Value
true if this gamer is allowed to play in online multiplayer sessions; false otherwise.
Remarks
This may be disabled based on parental control settings, and also depending on whether the gamer has a LIVE Gold or LIVE
Silver membership. Note that this does not affect system link sessions, which are always available.
See Also
Reference
GamerPrivileges Class
GamerPrivileges Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerPrivileges.AllowProfileViewing Property
Checks whether this gamer is allowed to view the profiles of other gamers.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GamerPrivilegeSetting AllowProfileViewing { get; }
Property Value
true if this gamer is allowed to view the profiles of other gamers; false otherwise.
See Also
Reference
GamerPrivileges Class
GamerPrivileges Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerPrivileges.AllowPurchaseContent Property
Checks whether this gamer is allowed to purchase content from LIVE Marketplace.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool AllowPurchaseContent { get; }
Property Value
true if this gamer is allowed to purchase content from LIVE Marketplace; false otherwise.
See Also
Reference
GamerPrivileges Class
GamerPrivileges Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerPrivileges.AllowTradeContent Property
Checks whether this gamer is allowed to trade content with other gamers.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool AllowTradeContent { get; }
Property Value
true if this gamer is allowed to trade content with other gamers; false otherwise.
See Also
Reference
GamerPrivileges Class
GamerPrivileges Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerPrivileges.AllowUserCreatedContent Property
Checks whether this gamer is allowed to access user content that was created by other gamers.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GamerPrivilegeSetting AllowUserCreatedContent { get; }
Property Value
true if this gamer is allowed to access user content that was created by other gamers false otherwise.
See Also
Reference
GamerPrivileges Class
GamerPrivileges Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerPrivilegeSetting Enumeration
Describes the conditions in which a privilege is available.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum GamerPrivilegeSetting
Members
Member na Description
me
Blocked This privilege is not available for the current gamer profile.
Everyone This privilege is available for the current gamer profile.
FriendsOnly his privilege is only available for friends of the current gamer profile. Use the IsFriend method to check which g
amers are friends.
See Also
Reference
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerProfile Class
Profile settings describing information about a gamer such as their motto, reputation, and gamer picture. This data is
accessible for both locally signed in profiles and remote gamers that you are playing with in a multiplayer session.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class GamerProfile : IDisposable
See Also
Reference
GamerProfile Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerProfile Members
The following tables list the members exposed by the GamerProfile type.
Public Properties
Name Description
GamerPicture Gets the gamer picture, which will be 64 pixels by 64 pixels.
GamerScore Gets the GamerScore of this gamer.
GamerZone Gets the GamerZone setting.
IsDisposed Gets a value that indicates whether the object is disposed.
Motto Gets the gamer motto string.
Region Gets the region of this gamer.
Reputation Gets the gamer reputation, as a number of stars ranging 0 to 5.
TitlesPlayed Gets the number of titles this gamer has played.
TotalAchievements Gets the total number of achievements this gamer has obtained.
Public Methods
Name Description
Dispose Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Tasks
How To: Use Gamertags and Gamer Pictures
Reference
Gamer.SignedInGamers Property
GamerProfile Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GamerProfile Methods
Public Methods
Name Description
Dispose Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GamerProfile Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GamerProfile.Dispose Method
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
See Also
Reference
GamerProfile Class
GamerProfile Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerProfile Properties
Public Properties
Name Description
GamerPicture Gets the gamer picture, which will be 64 pixels by 64 pixels.
GamerScore Gets the GamerScore of this gamer.
GamerZone Gets the GamerZone setting.
IsDisposed Gets a value that indicates whether the object is disposed.
Motto Gets the gamer motto string.
Region Gets the region of this gamer.
Reputation Gets the gamer reputation, as a number of stars ranging 0 to 5.
TitlesPlayed Gets the number of titles this gamer has played.
TotalAchievements Gets the total number of achievements this gamer has obtained.
See Also
Reference
GamerProfile Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GamerProfile.GamerPicture Property
Gets the gamer picture, which will be 64 pixels by 64 pixels.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Texture2D GamerPicture { get; }
Property Value
The gamer picture, which will be 64 pixels by 64 pixels.
See Also
Reference
GamerProfile Class
GamerProfile Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerProfile.GamerScore Property
Gets the GamerScore of this gamer.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int GamerScore { get; }
Property Value
The GamerScore of this gamer.
See Also
Reference
GamerProfile Class
GamerProfile Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerProfile.GamerZone Property
Gets the GamerZone setting.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GamerZone GamerZone { get; }
Property Value
The GamerZone setting.
See Also
Reference
GamerProfile Class
GamerProfile Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerProfile.IsDisposed Property
Gets a value that indicates whether the object is disposed.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsDisposed { get; }
Property Value
true if the object is disposed; false otherwise.
See Also
Reference
GamerProfile Class
GamerProfile Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerProfile.Motto Property
Gets the gamer motto string.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Motto { get; }
Property Value
The gamer motto.
See Also
Reference
GamerProfile Class
GamerProfile Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerProfile.Region Property
Gets the region of this gamer.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public RegionInfo Region { get; }
Property Value
The region of this gamer.
See Also
Reference
GamerProfile Class
GamerProfile Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerProfile.Reputation Property
Gets the gamer reputation, as a number of stars ranging 0 to 5.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float Reputation { get; }
Property Value
The gamer reputation, representing a number of stars ranging 0 to 5.
See Also
Reference
GamerProfile Class
GamerProfile Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerProfile.TitlesPlayed Property
Gets the number of titles this gamer has played.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int TitlesPlayed { get; }
Property Value
The number of titles this gamer has played.
See Also
Reference
GamerProfile Class
GamerProfile Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerProfile.TotalAchievements Property
Gets the total number of achievements this gamer has obtained.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int TotalAchievements { get; }
Property Value
The total number of achievements this gamer has obtained.
See Also
Reference
GamerProfile Class
GamerProfile Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerServicesComponent Class
Wraps the functionality of the GamerServicesDispatcher.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class GamerServicesComponent : GameComponent
Remarks If a game will use gamer services, a GamerServicesComponent should be added to the game's Components
collection. GamerServicesComponent will take care of initializing and updating the GamerServicesDispatcher at the
appropriate times.
See Also
Reference
GamerServicesComponent Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerServicesComponent Members
The following tables list the members exposed by the GamerServicesComponent type.
Public Constructors
Name Description
GamerServicesComponent Creates a new GamerServicesComponent.
Public Properties
Name Description
Enabled (Inherited from GameComponent.)
Game (Inherited from GameComponent.)
UpdateOrder (Inherited from GameComponent.)
Public Methods
Name Description
Dispose (Inherited from GameComponent.)
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
Initialize Initializes the GamerServicesDispatcher.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Update Updates the GamerServicesDispatcher.
Protected Methods
Name Description
MemberwiseClone (Inherited from Object.)
OnEnabledChanged (Inherited from GameComponent.)
OnUpdateOrderChanged (Inherited from GameComponent.)
Public Events
Name Description
Disposed (Inherited from GameComponent.)
EnabledChanged (Inherited from GameComponent.)
UpdateOrderChanged (Inherited from GameComponent.)
See Also
Reference
GamerServicesComponent Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GamerServicesComponent Constructor
Creates a new GamerServicesComponent.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GamerServicesComponent (
Game game
)
Parameters
game
The game that will be associated with this component.
See Also
Reference
GamerServicesComponent Class
GamerServicesComponent Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerServicesComponent Methods
Public Methods
Name Description
Dispose (Inherited from GameComponent.)
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
Initialize Initializes the GamerServicesDispatcher.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Update Updates the GamerServicesDispatcher.
Protected Methods
Name Description
MemberwiseClone (Inherited from Object.)
OnEnabledChanged (Inherited from GameComponent.)
OnUpdateOrderChanged (Inherited from GameComponent.)
See Also
Reference
GamerServicesComponent Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GamerServicesComponent.Initialize Method
Initializes the GamerServicesDispatcher.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override void Initialize ()
See Also
Reference
GamerServicesComponent Class
GamerServicesComponent Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerServicesComponent.Update Method
Updates the GamerServicesDispatcher.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override void Update (
GameTime gameTime
)
Parameters
gameTime
The game timing state.
See Also
Reference
GamerServicesComponent Class
GamerServicesComponent Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerServicesComponent Properties
Public Properties
Name Description
Enabled (Inherited from GameComponent.)
Game (Inherited from GameComponent.)
UpdateOrder (Inherited from GameComponent.)
See Also
Reference
GamerServicesComponent Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GamerServicesComponent Events
Public Events
Name Description
Disposed (Inherited from GameComponent.)
EnabledChanged (Inherited from GameComponent.)
UpdateOrderChanged (Inherited from GameComponent.)
See Also
Reference
GamerServicesComponent Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GamerServicesDispatcher Class
Implements the Windows-specific portion of a GamerServicesDispatcher class.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static class GamerServicesDispatcher
Remarks
Use the GamerServicesDispatcher class to access gamer services functionality from your game. This functionality includes,
among other services, displaying the guide from your game, determining which profiles are checked in, and determining the
privileges for a specific gamer profile.
During startup of your game, initialize an instance of GamerServicesDispatcher. During the lifetime of your game, call
Update for every frame.
Commonly, you do not directly interact with the GamerServicesDispatcher object. Instead, use the
GamerServicesComponent class, which wraps the functionality of GamerServicesDispatcher. However, for applications that
do not use the default game template, you must interact with the GamerServicesDispatcher instance of your application.
See Also
Tasks
How To: Initialize and Update the Gamer Services Pump
Concepts
Gamer Services Overview
Reference
GamerServicesDispatcher Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerServicesDispatcher Members
The following tables list the members exposed by the GamerServicesDispatcher type.
Public Properties
Name Description
IsInitialized Determines if Initialize has been called.
WindowHandle Gets or sets the handle to the underlying game window.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
Initialize Initializes gamer services functionality for the game.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Update Updates the status of gamer services and raises related events.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Public Events
Name Description
InstallingTitleUpdate Notifies the game when a Games for Windows - LIVE title update is being installed.
See Also
Tasks
How To: Initialize and Update the Gamer Services Pump
Concepts
Gamer Services Overview
Reference
GamerServicesDispatcher Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GamerServicesDispatcher Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
Initialize Initializes gamer services functionality for the game.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Update Updates the status of gamer services and raises related events.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GamerServicesDispatcher Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GamerServicesDispatcher.Initialize Method
Initializes gamer services functionality for the game.
Call this method during startup of your game.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static void Initialize (
IServiceProvider serviceProvider
)
Parameters
serviceProvider
The service provider to be used when locating additional services services. For example, IGraphicsDeviceService.
Exceptions
Exception type Condition
ArgumentNullException serviceProvider is null.
InvalidOperationException The gamer services functionality is already initialized.
See Also
Tasks
How To: Initialize and Update the Gamer Services Pump
Concepts
Gamer Services Overview
Reference
GamerServicesDispatcher Class
GamerServicesDispatcher Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerServicesDispatcher.Update Method
Updates the status of gamer services and raises related events.It is recommended that you call this method once per frame.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static void Update ()
See Also
Tasks
How To: Initialize and Update the Gamer Services Pump
Concepts
Gamer Services Overview
Reference
GamerServicesDispatcher Class
GamerServicesDispatcher Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerServicesDispatcher Properties
Public Properties
Name Description
IsInitialized Determines if Initialize has been called.
WindowHandle Gets or sets the handle to the underlying game window.
See Also
Reference
GamerServicesDispatcher Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GamerServicesDispatcher.IsInitialized Property
Determines if Initialize has been called.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool IsInitialized { get; }
Property Value
true if gamer services have been initialized; false otherwise.
See Also
Reference
GamerServicesDispatcher Class
GamerServicesDispatcher Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerServicesDispatcher.WindowHandle Property
Gets or sets the handle to the underlying game window.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static IntPtr WindowHandle { get; set; }
Property Value
Handle to a window.
See Also
Reference
GamerServicesDispatcher Class
GamerServicesDispatcher Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerServicesDispatcher Events
Public Events
Name Description
InstallingTitleUpdate Notifies the game when a Games for Windows - LIVE title update is being installed.
See Also
Reference
GamerServicesDispatcher Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GamerServicesDispatcher.InstallingTitleUpdate Event
Notifies the game when a Games for Windows - LIVE title update is being installed.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static event EventHandler<EventArgs> InstallingTitleUpdate
Remarks Gamer services and networking functionality is no longer available after this event has been raised: games should
typically exit in response to InstallingTitleUpdate. If you are using the GamerServicesComponent, this event is automatically
hooked up to call Exit, so you do not need to do anything special to handle title updates.
See Also
Reference
GamerServicesDispatcher Class
GamerServicesDispatcher Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerServicesNotAvailableException Class
Thrown if the gamer services system cannot be successfully initialized.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public class GamerServicesNotAvailableException : Exception
Remarks
The following are likely causes for this exception.
If the current game uses the XNA Framework redistributable file (xnafx_redist.msi). Currently, this file does not include
the Games for Windows – LIVE functionality.
If another Games for Windows – LIVE title is already running.
See Also
Reference
GamerServicesNotAvailableException Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerServicesNotAvailableException Members
The following tables list the members exposed by the GamerServicesNotAvailableException type.
Public Constructors
Name Description
GamerServicesNotAvailableException Overloaded. Creates an instance of GamerServicesNotAvailableException.
Public Properties
Name Description
Data (Inherited from Exception.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GamerServicesNotAvailableException Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GamerServicesNotAvailableException Constructor
Creates an instance of GamerServicesNotAvailableException.
Overload List
Name Description
GamerServicesNotAvailableException () Creates an empty instance of
GamerServicesNotAvailableException.
GamerServicesNotAvailableException (SerializationInfo, StreamingContext) Initializes a new instance of
GamerServicesNotAvailableException with the spe
cified streaming context.
GamerServicesNotAvailableException (String) Initializes a new instance of
GamerServicesNotAvailableException with the spe
cified error message.
GamerServicesNotAvailableException (String, Exception) Initializes a new instance of
GamerServicesNotAvailableException with the spe
cified error message and the inner exception.
See Also
Reference
GamerServicesNotAvailableException Class
GamerServicesNotAvailableException Members
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GamerServicesNotAvailableException Constructor ()
Creates an empty instance of GamerServicesNotAvailableException.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GamerServicesNotAvailableException ()
See Also
Reference
GamerServicesNotAvailableException Class
GamerServicesNotAvailableException Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerServicesNotAvailableException Constructor
(SerializationInfo, StreamingContext)
Initializes a new instance of GamerServicesNotAvailableException with the specified streaming context.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected GamerServicesNotAvailableException (
SerializationInfo info,
StreamingContext context
)
Parameters
info
Describes the gamer services being accessed when the exception occurred.
context
Describes the stream where the exception occurred.
See Also
Reference
GamerServicesNotAvailableException Class
GamerServicesNotAvailableException Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
message
A message that describes the error.
See Also
Reference
GamerServicesNotAvailableException Class
GamerServicesNotAvailableException Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
message
A message that describes the error.
innerException
The inner exception related to this exception.
See Also
Reference
GamerServicesNotAvailableException Class
GamerServicesNotAvailableException Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerServicesNotAvailableException Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GamerServicesNotAvailableException Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GamerServicesNotAvailableException Properties
Public Properties
Name Description
Data (Inherited from Exception.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
See Also
Reference
GamerServicesNotAvailableException Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GamerZone Enumeration
This style of social gaming preferred by this Xbox Live member.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum GamerZone
Members
Member name Description
Family Family-friendly game play.
Pro Competitive game play.
Recreation Non-competitive game play.
Underground Alternative approach to game play.
Unknown Unknown.
See Also
Reference
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Guide Class
Provides access to the Guide user interface. This interface contains message boxes, a text entry system, and other common
interface elements.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static class Guide
See Also
Reference
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Guide Members
The following tables list the members exposed by the Guide type.
Public Properties
Name Description
IsScreenSaverEnabled Gets or sets the current state of the screen saver.
IsVisible Determines whether a Guide user interface screen is active.
NotificationPosition Determines where notifications appear on the screen.
Public Methods
Name Description
BeginShowKeyboardInput Begins the process for displaying a dialog for keyboard input from a gamer.
BeginShowMessageBox Begins the process of displaying a message box with the specified parameters.
BeginShowStorageDeviceSelector Overloaded. Begins the process for displaying the storage device selector user interfac
e.
DelayNotifications Delays system notifications for the specified amount of time.
EndShowKeyboardInput Ends the display of the keyboard input dialog box.
EndShowMessageBox Ends the display of a message box.
EndShowStorageDeviceSelector Ends the display of the storage selector user interface.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ShowComposeMessage Shows the Compose Message user interface.
ShowFriendRequest Shows the Friend Request user interface.
ShowFriends Shows the Friends user interface.
ShowGamerCard Shows the Gamer Card user interface.
ShowMessages Shows the Messages user interface.
ShowPlayerReview Shows the Player Review user interface.
ShowPlayers Shows the Players user interface.
ShowSignIn Shows the user interface a gamer uses for signing into Xbox LIVE.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Guide Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
Guide Methods
Public Methods
Name Description
BeginShowKeyboardInput Begins the process for displaying a dialog for keyboard input from a gamer.
BeginShowMessageBox Begins the process of displaying a message box with the specified parameters.
BeginShowStorageDeviceSelector Overloaded. Begins the process for displaying the storage device selector user interfac
e.
DelayNotifications Delays system notifications for the specified amount of time.
EndShowKeyboardInput Ends the display of the keyboard input dialog box.
EndShowMessageBox Ends the display of a message box.
EndShowStorageDeviceSelector Ends the display of the storage selector user interface.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ShowComposeMessage Shows the Compose Message user interface.
ShowFriendRequest Shows the Friend Request user interface.
ShowFriends Shows the Friends user interface.
ShowGamerCard Shows the Gamer Card user interface.
ShowMessages Shows the Messages user interface.
ShowPlayerReview Shows the Player Review user interface.
ShowPlayers Shows the Players user interface.
ShowSignIn Shows the user interface a gamer uses for signing into Xbox LIVE.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Guide Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
Guide.BeginShowKeyboardInput Method
Begins the process for displaying a dialog for keyboard input from a gamer. The display operation is performed
asynchronously.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static IAsyncResult BeginShowKeyboardInput (
PlayerIndex player,
string title,
string description,
string defaultText,
AsyncCallback callback,
Object state
)
Parameters
player
Index of the player providing input. For Windows-based XNA games, the only valid option is PlayerIndex.One.
title
Title of the dialog box.
description
Text of the dialog box.
defaultText
Text displayed when the dialog box is initially shown.
callback
The method to be called once the asynchronous operation has finished.
state
A user-created object uniquely identifying this request.
Return Value
An IAsyncResult used to track the progress of the method.
Exceptions
Exception type Condition
ArgumentException title, description, or defaultText is larger than the maximum allowed string length of 260 char
acters.
ArgumentOutOfRangeException player is not a valid value. For Windows-based XNA games, the only valid option is PlayerIn
dex.One.
See Also
Reference
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Guide.BeginShowMessageBox Method
Begins the process of displaying a message box with the specified parameters. The display operation is performed
asynchronously.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static IAsyncResult BeginShowMessageBox (
PlayerIndex player,
string title,
string text,
IEnumerable<string> buttons,
int focusButton,
MessageBoxIcon icon,
AsyncCallback callback,
Object state
)
Parameters
player
Target player of the message box. On Windows, the only valid option is PlayerIndex.One.
title
Title of the message box.
text
Text of the message box.
buttons
Captions for the message box buttons. The maximum number is three.
focusButton
Zero-based index specifying which button has focus.
icon
Type of icon displayed in the message box.
callback
The method to be called once the asynchronous operation has finished.
state
A user-created object uniquely identifying this request.
Return Value
An IAsyncResult used to track the progress of the method.
Exceptions
Exception type Condition
InvalidOperationException IsInitialized was not previously called or a Guide user interface screen is currently active.
See Also
Reference
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Guide.BeginShowStorageDeviceSelector Method
Begins the process for displaying the storage device selector user interface.
Overload List
Name Description
Guide.BeginShowStorageDeviceSelector (AsyncCallback, Object) Begins the process for displaying th
e storage device selector user interfa
ce.
Guide.BeginShowStorageDeviceSelector (Int32, Int32, AsyncCallback, Object) Begins the process for displaying th
e storage device selector user interfa
ce, specifying the size of the data to
be written to the storage device.
Guide.BeginShowStorageDeviceSelector (PlayerIndex, AsyncCallback, Object) Begins the process for displaying th
e storage device selector user interfa
ce, specifying the index of the player
to be shown the user interface.
Guide.BeginShowStorageDeviceSelector (PlayerIndex, Int32, Int32, AsyncCallback, Object) Begins the process for displaying th
e storage device selector user interfa
ce, specifying the index of the player
to be shown the user interface, as w
ell as the size of the data to be writte
n to the storage device.
See Also
Reference
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
Guide.BeginShowStorageDeviceSelector Method
(AsyncCallback, Object)
Begins the process for displaying the storage device selector user interface. The display operation is performed
asynchronously.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static IAsyncResult BeginShowStorageDeviceSelector (
AsyncCallback callback,
Object state
)
Parameters
callback
The method to be called once the asynchronous operation has finished.
state
A user-created object uniquely identifying this request.
Return Value
An IAsyncResult used to track the progress of the method.
See Also
Reference
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sizeInBytes
Size, in bytes, of the data to write to the storage device.
directoryCount
Number of directories to write to the storage device.
callback
The method to be called once the asynchronous operation has finished.
state
A user-created object uniquely identifying this request.
Return Value
An IAsyncResult used to track the progress of the method.
See Also
Reference
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
player
Index of the player being shown the user interface display. On Windows, the only valid option is PlayerIndex.One.
callback
The method to be called once the asynchronous operation has finished.
state
A user-created object uniquely identifying this request.
Return Value
An IAsyncResult used to track the progress of the method.
See Also
Reference
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
player
Index of the player being shown the user interface display. On Windows, the only valid option is PlayerIndex.One.
sizeInBytes
Size, in bytes, of the data to write to the storage device.
directoryCount
Number of directories to write to the storage device.
callback
The method to be called once the asynchronous operation has finished.
state
A user-created object uniquely identifying this request.
Return Value
An IAsyncResult used to track the progress of the method.
See Also
Reference
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Guide.DelayNotifications Method
Delays system notifications for the specified amount of time.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static void DelayNotifications (
TimeSpan delay
)
Parameters
delay
Time, in seconds, of the delay.
Calling this function while notifications are already delayed has no effect. The maximum delay is 120. If the specified duration
exceeds the maximum, the maximum value is used.
Remarks
Use DelayNotifications to suppress pop-up notifications during critical times, such as cut scenes. Once the delay interval has
passed, any deferred notifications are individually displayed in the order they were sent.
Titles cannot call DelayNotifications multiple times in a row. There must be an opportunity for the system application to
display notifications to gamers.
See Also
Reference
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Guide.EndShowKeyboardInput Method
Ends the display of the keyboard input dialog box.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static string EndShowKeyboardInput (
IAsyncResult result
)
Parameters
result
The IAsyncResult returned from BeginShowKeyboardInput.
Return Value
Input received from the gamer.
See Also
Reference
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Guide.EndShowMessageBox Method
Ends the display of a message box.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Nullable<int> EndShowMessageBox (
IAsyncResult result
)
Parameters
result
The IAsyncResult returned from BeginShowMessageBox.
Return Value
Remarks
This call blocks until the display operation is finished. Typically, you call this from the callback function specified in the callback
argument of BeginShowMessageBox.
Each call to EndShowMessageBox must match an earlier call to BeginShowMessageBox.
See Also
Reference
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Guide.EndShowStorageDeviceSelector Method
Ends the display of the storage selector user interface.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static StorageDevice EndShowStorageDeviceSelector (
IAsyncResult asyncResult
)
Parameters
asyncResult
The IAsyncResult returned from BeginShowStorageDeviceSelector.
Return Value
Storage device selected by the gamer.
See Also
Reference
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Guide.ShowComposeMessage Method
Shows the Compose Message user interface. A gamer uses this user interface to write messages to other gamers.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static void ShowComposeMessage (
PlayerIndex player,
string text,
IEnumerable<Gamer> recipients
)
Parameters
player
Gamer composing the message.
text
Text of the message.
recipients
Collection of gamers receiving the message.
If this is null, the Select Gamertag user interface is displayed.
Exceptions
Exception type Condition
ArgumentOutOfRangeException For Windows applications, this exception is thrown if player is not PlayerIndex.One.
ArgumentException The message text is null, empty, or exceeds 200 characters. This exception is also thrown if an
y recipients have a value of null or if there are more than 100 recipients.
See Also
Reference
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Guide.ShowFriendRequest Method
Shows the Friend Request user interface.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static void ShowFriendRequest (
PlayerIndex player,
Gamer gamer
)
Parameters
player
Index of the player making the request.
The profile specified by player must be signed in when calling this function.
gamer
Recipient of the request.
See Also
Reference
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Guide.ShowFriends Method
Shows the Friends user interface.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static void ShowFriends (
PlayerIndex player
)
Parameters
player
Index of the player making the request.
The profile specified by player must be signed in when calling this function.
See Also
Reference
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Guide.ShowGamerCard Method
Shows the Gamer Card user interface.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static void ShowGamerCard (
PlayerIndex player,
Gamer gamer
)
Parameters
player
Index of the player making the request.
The profile specified by player must be signed in when calling this function.
gamer
Owner of the gamer card being requested for display.
See Also
Reference
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Guide.ShowMessages Method
Shows the Messages user interface.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static void ShowMessages (
PlayerIndex player
)
Parameters
player
Index of the player making the request.
The profile specified by player must be signed in when calling this function.
See Also
Reference
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Guide.ShowPlayerReview Method
Shows the Player Review user interface.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static void ShowPlayerReview (
PlayerIndex player,
Gamer gamer
)
Parameters
player
Index of the player making the request.
The profile specified by player must be signed in when calling this function.
gamer
Player being reviewed.
See Also
Reference
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Guide.ShowPlayers Method
Shows the Players user interface.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static void ShowPlayers (
PlayerIndex player
)
Parameters
player
Index of the player making the request.
The profile specified by player must be signed in when calling this function.
See Also
Reference
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Guide.ShowSignIn Method
Shows the user interface a gamer uses for signing into Xbox LIVE.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static void ShowSignIn (
int paneCount,
bool onlineOnly
)
Parameters
paneCount
Number of panes displayed at sign in. Each pane accepts a single gamer.
On Windows, only a single pane can be displayed. On Xbox 360, valid values are 1, 2, and 4.
onlineOnly
Determines the profile types being displayed. true if only online profiles are displayed; false otherwise. If onlineOnly is true,
local gamers can sign in as guests of a profile currently signed in.
Exceptions
Exception type Condition
ArgumentException The paneCount argument is invalid. The valid options for this parameter are 1, 2, and 4.
See Also
Reference
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Guide Properties
Public Properties
Name Description
IsScreenSaverEnabled Gets or sets the current state of the screen saver.
IsVisible Determines whether a Guide user interface screen is active.
NotificationPosition Determines where notifications appear on the screen.
See Also
Reference
Guide Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
Guide.IsScreenSaverEnabled Property
Gets or sets the current state of the screen saver. This property has no effect for Windows games.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool IsScreenSaverEnabled { get; set; }
Property Value
true if the screen saver is enabled; false otherwise.
Remarks
The IsScreenSaverEnabled property is a per-game property. Disabling the screen saver for this game does not permanently
disable the screen saver. Use this method when displaying cutscenes or during other periods where the gamer could become
inactive for a long period of time.
See Also
Reference
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Guide.IsVisible Property
Determines whether a Guide user interface screen is active.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool IsVisible { get; set; }
Property Value
true if a user interface screen is displayed; false otherwise. It is not possible to bring up another Guide user interface screen, if
IsVisible is true.
Exceptions
Exception type Condition
InvalidOperationException The gamer services functionality must be initialized before this property is accessed.
See Also
Reference
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Guide.NotificationPosition Property
Determines where notifications appear on the screen.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static NotificationPosition NotificationPosition { get; set; }
Property Value
Defines the positioning of the notification message box.
See Also
Reference
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GuideAlreadyVisibleException Class
Thrown if an attmept is made to display a component of the Guide user interface when a Guide component is already
displayed.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public class GuideAlreadyVisibleException : Exception
See Also
Reference
GuideAlreadyVisibleException Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GuideAlreadyVisibleException Members
The following tables list the members exposed by the GuideAlreadyVisibleException type.
Public Constructors
Name Description
GuideAlreadyVisibleException Overloaded. Creates an instance of GuideAlreadyVisibleException.
Public Properties
Name Description
Data (Inherited from Exception.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GuideAlreadyVisibleException Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GuideAlreadyVisibleException Constructor
Creates an instance of GuideAlreadyVisibleException.
Overload List
Name Description
GuideAlreadyVisibleException () Initializes an empty instance of GuideAlreadyVisibleExc
eption.
GuideAlreadyVisibleException (SerializationInfo, StreamingContext) Initializes an instance of GuideAlreadyVisibleException
with the specified streaming context.
GuideAlreadyVisibleException (String) Initializes an instance of GuideAlreadyVisibleException
with the specified error message.
GuideAlreadyVisibleException (String, Exception) Initializes an instance of GuideAlreadyVisibleException
with the specified error message and related inner excepti
on.
See Also
Reference
GuideAlreadyVisibleException Class
GuideAlreadyVisibleException Members
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GuideAlreadyVisibleException Constructor ()
Initializes an empty instance of GuideAlreadyVisibleException.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GuideAlreadyVisibleException ()
See Also
Reference
GuideAlreadyVisibleException Class
GuideAlreadyVisibleException Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
info
Describes the displayed Guide component when the exception occurred.
context
Describes the stream where the exception occurred.
See Also
Reference
GuideAlreadyVisibleException Class
GuideAlreadyVisibleException Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
message
A message describing the error.
See Also
Reference
GuideAlreadyVisibleException Class
GuideAlreadyVisibleException Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
message
A message describing the error.
innerException
The inner exception related to this exception.
See Also
Reference
GuideAlreadyVisibleException Class
GuideAlreadyVisibleException Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GuideAlreadyVisibleException Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GuideAlreadyVisibleException Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
GuideAlreadyVisibleException Properties
Public Properties
Name Description
Data (Inherited from Exception.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
See Also
Reference
GuideAlreadyVisibleException Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
MessageBoxIcon Enumeration
Defines the different icons for a message box.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum MessageBoxIcon
Members
Member name Description
Alert Displays the Alert icon.
Error Displays the Error icon.
None No icon is displayed.
Warning Displays the Warning icon.
See Also
Reference
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NotificationPosition Enumeration
Determines where notifications appear on the screen. Used to specify the notification position for the NotificationPosition
property.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum NotificationPosition
Members
Member name Description
BottomCenter Positions the message box at the bottom of the screen and centered.
BottomLeft Positions the message box at the bottom-left of the screen.
BottomRight Positions the message box at the bottom-right of the screen.
Center Positions the message box at the center of the screen.
CenterLeft Positions the message box at the center of the screen and left-aligned.
CenterRight Positions the message box at the center of the screen and right-aligned.
TopCenter Positions the message box at the top of the screen and centered.
TopLeft Positions the message box at the top-left of the screen.
TopRight Positions the message box at the top-right of the screen.
See Also
Reference
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RacingCameraAngle Enumeration
Indicates which camera angle this gamer prefers to use in racing games.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum RacingCameraAngle
Members
Member name Description
Back Traditional third-person camera view from behind the car.
Front Camera view from in front of the car. The car itself is not visible.
Inside Camera view from inside the the car, looking through the windscreen.
See Also
Reference
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SignedInEventArgs Class
Represents the arguments passed to a SignedIn event. These arguments are passed to event handlers when a new gamer signs
in. This class contains the SignedInGamer instance that recently signed in.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class SignedInEventArgs : EventArgs
See Also
Reference
SignedInEventArgs Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SignedInEventArgs Members
The following tables list the members exposed by the SignedInEventArgs type.
Public Constructors
Name Description
SignedInEventArgs Creates a new instance of SignedInEventArgs.
Public Properties
Name Description
Gamer Gets the gamer that just signed in.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
SignedInEventArgs Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
SignedInEventArgs Fields
See Also
Reference
SignedInEventArgs Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
SignedInEventArgs Constructor
Creates a new instance of SignedInEventArgs.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public SignedInEventArgs (
SignedInGamer gamer
)
Parameters
gamer
The gamer that just signed in.
Exceptions
Exception type Condition
ArgumentNullException gamer is null.
See Also
Reference
SignedInEventArgs Class
SignedInEventArgs Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SignedInEventArgs Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
SignedInEventArgs Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
SignedInEventArgs Properties
Public Properties
Name Description
Gamer Gets the gamer that just signed in.
See Also
Reference
SignedInEventArgs Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
SignedInEventArgs.Gamer Property
Gets the gamer that just signed in.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public SignedInGamer Gamer { get; }
Property Value
The gamer that just signed in.
See Also
Reference
SignedInEventArgs Class
SignedInEventArgs Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SignedInGamer Class
Represents a gamer (a profile that has an associated gamertag) on the local system.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class SignedInGamer : Gamer
Remarks
Gamers can be either on a local system or in a multiplayer session. For more information about gamers in a multiplayer
session, see NetworkGamer.
See Also
Reference
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SignedInGamer Members
The following tables list the members exposed by the SignedInGamer type.
Public Properties
Name Description
GameDefaults Describes a gamer's preferred settings.
Gamertag (Inherited from Gamer.)
IsDisposed (Inherited from Gamer.)
IsGuest Determines whether the gamer is the guest of an Xbox LIVE–enabled profile.
IsSignedInToLive Determines whether the gamer has an Xbox LIVE–enabled profile.
PlayerIndex Gets the index of the gamer.
Privileges Describes what operations a gamer is allowed to perform.
SignedInGamers (Inherited from Gamer.)
Tag (Inherited from Gamer.)
Public Methods
Name Description
BeginGetProfile (Inherited from Gamer.)
EndGetProfile (Inherited from Gamer.)
Equals (Inherited from Object.)
GetFriends Reads the friends list of this local gamer. This includes both the gamertags of the friends and their current
presence information.
GetHashCode (Inherited from Object.)
GetProfile (Inherited from Gamer.)
GetType (Inherited from Object.)
IsFriend Queries whether the specified gamer is a friend of this local gamer.
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Public Events
Name Description
SignedIn Occurs when a new gamer signs into the local system.
SignedOut Occurs when a gamer signs out on the local system.
See Also
Reference
SignedInGamer Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
SignedInGamer Methods
Public Methods
Name Description
BeginGetProfile (Inherited from Gamer.)
EndGetProfile (Inherited from Gamer.)
Equals (Inherited from Object.)
GetFriends Reads the friends list of this local gamer. This includes both the gamertags of the friends and their current
presence information.
GetHashCode (Inherited from Object.)
GetProfile (Inherited from Gamer.)
GetType (Inherited from Object.)
IsFriend Queries whether the specified gamer is a friend of this local gamer.
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
SignedInGamer Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
SignedInGamer.GetFriends Method
Reads the friends list of this local gamer. This includes both the gamertags of the friends and their current presence
information.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public FriendCollection GetFriends ()
Return Value
The friends of this local gamer.
Exceptions
Exception type Condition
ObjectDisposedException This object has already been disposed.
GamerPrivilegeException A signed-in gamer profile is required to perform this operation. A LIVE profile may also be required.
There are no profiles currently signed in, or the profile is not signed in to LIVE.
See Also
Reference
SignedInGamer Class
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SignedInGamer.IsFriend Method
Queries whether the specified gamer is a friend of this local gamer.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsFriend (
Gamer gamer
)
Parameters
gamer
The gamer to query.
Return Value
true if the specified gamer is a friend of the local gamer; false otherwise.
Exceptions
Exception type Condition
ArgumentNullException gamer is null.
GamerPrivilegeException A signed in gamer profile is required to perform this operation. A LIVE profile may also be required.
There are no profiles currently signed in, or the profile is not signed in to LIVE.
ObjectDisposedException The gamer object has already been disposed.
See Also
Reference
SignedInGamer Class
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SignedInGamer Properties
Public Properties
Name Description
GameDefaults Describes a gamer's preferred settings.
Gamertag (Inherited from Gamer.)
IsDisposed (Inherited from Gamer.)
IsGuest Determines whether the gamer is the guest of an Xbox LIVE–enabled profile.
IsSignedInToLive Determines whether the gamer has an Xbox LIVE–enabled profile.
PlayerIndex Gets the index of the gamer.
Privileges Describes what operations a gamer is allowed to perform.
SignedInGamers (Inherited from Gamer.)
Tag (Inherited from Gamer.)
See Also
Reference
SignedInGamer Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
SignedInGamer.GameDefaults Property
Describes a gamer's preferred settings.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GameDefaults GameDefaults { get; }
Property Value
The gamer's preferred settings.
RemarksWherever possible, games should default to these values.
See Also
Reference
SignedInGamer Class
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SignedInGamer.IsGuest Property
Determines whether the gamer is the guest of an Xbox LIVE–enabled profile.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsGuest { get; }
Property Value
true if the gamer is a guest; false otherwise.
See Also
Reference
SignedInGamer Class
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SignedInGamer.IsSignedInToLive Property
Determines whether the gamer has an Xbox LIVE–enabled profile.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsSignedInToLive { get; }
Property Value
true if the gamer is able to sign in to Xbox LIVE; false otherwise.
See Also
Reference
SignedInGamer Class
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SignedInGamer.PlayerIndex Property
Gets the index of the gamer.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public PlayerIndex PlayerIndex { get; }
Property Value
Index of the gamer.
Exceptions
Exception type Condition
ObjectDisposedException Thrown if the associated profile is no longer valid. For example, the profile may have signed out.
See Also
Reference
SignedInGamer Class
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SignedInGamer.Privileges Property
Describes what operations a gamer is allowed to perform.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GamerPrivileges Privileges { get; }
Property Value
The operations a gamer is allowed to perform.
Remarks Privileges can be defined by parental control settings, and also will be set automatically in response to things like
age, region, and whether the gamer has a LIVE Gold or LIVE Silver membership. Games do not need to explicitly check
privileges, because a GamerPrivilegeException will be thrown if an unsupported operation is selected. However, these privilege
bits may be useful to detect that an operation is unavailable before calling it so as to grey-out the relevant menu option.
See Also
Reference
SignedInGamer Class
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SignedInGamer Events
Public Events
Name Description
SignedIn Occurs when a new gamer signs into the local system.
SignedOut Occurs when a gamer signs out on the local system.
See Also
Reference
SignedInGamer Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
SignedInGamer.SignedIn Event
Occurs when a new gamer signs into the local system.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static event EventHandler<SignedInEventArgs> SignedIn
Remarks
This event is called during Update. When this event is fired, the LocalGamers collection contains the newly signed-in gamer.
See Also
Reference
SignedOut
SignedInGamer Class
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SignedInGamer.SignedOut Event
Occurs when a gamer signs out on the local system.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static event EventHandler<SignedOutEventArgs> SignedOut
Remarks
This event is called during Update. When this event is fired, the LocalGamers collection has already removed the newly signed-
out gamer.
See Also
Reference
SignedIn
SignedInGamer Class
SignedInGamer Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SignedInGamerCollection Class
Represents a collection of gamers on the local system.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class SignedInGamerCollection : GamerCollection<SignedInGamer>
See Also
Reference
SignedInGamerCollection Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SignedInGamerCollection Members
The following tables list the members exposed by the SignedInGamerCollection type.
Public Properties
Name Description
Count (Inherited from ReadOnlyCollection.)
Item Overloaded. Gets a specific SignedInGamer object.
Protected Properties
Name Description
Items (Inherited from ReadOnlyCollection.)
Public Methods
Name Description
Contains (Inherited from ReadOnlyCollection.)
CopyTo (Inherited from ReadOnlyCollection.)
Equals (Inherited from Object.)
GetEnumerator (Inherited from ReadOnlyCollection.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
IndexOf (Inherited from ReadOnlyCollection.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
SignedInGamerCollection Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
SignedInGamerCollection Methods
Public Methods
Name Description
Contains (Inherited from ReadOnlyCollection.)
CopyTo (Inherited from ReadOnlyCollection.)
Equals (Inherited from Object.)
GetEnumerator (Inherited from ReadOnlyCollection.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
IndexOf (Inherited from ReadOnlyCollection.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
SignedInGamerCollection Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
SignedInGamerCollection Properties
Public Properties
Name Description
Count (Inherited from ReadOnlyCollection.)
Item Overloaded. Gets a specific SignedInGamer object.
Protected Properties
Name Description
Items (Inherited from ReadOnlyCollection.)
See Also
Reference
SignedInGamerCollection Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
SignedInGamerCollection.Item Property
Gets a specific SignedInGamer object.
Overload List
Name Description
SignedInGamerCollection.Item (PlayerIndex) Gets a specific local gamer based on that player's PlayerIndex on the local system.
SignedInGamerCollection.Item (Int32) (Inherited from ReadOnlyCollection.)
See Also
Reference
SignedInGamerCollection Class
SignedInGamerCollection Members
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
Property Value
The local gamer at the specified PlayerIndex.
See Also
Reference
SignedInGamerCollection Class
SignedInGamerCollection Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SignedOutEventArgs Class
Represents the arguments passed to a SignedOut event. These arguments are passed to event handlers when a gamer signs
out. This class contains the SignedInGamer instance that recently signed out.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class SignedOutEventArgs : EventArgs
See Also
Reference
SignedOutEventArgs Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SignedOutEventArgs Members
The following tables list the members exposed by the SignedOutEventArgs type.
Public Constructors
Name Description
SignedOutEventArgs Creates a new instance of SignedOutEventArgs.
Public Properties
Name Description
Gamer Gets the gamer that just signed out.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
SignedOutEventArgs Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
SignedOutEventArgs Fields
See Also
Reference
SignedOutEventArgs Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
SignedOutEventArgs Constructor
Creates a new instance of SignedOutEventArgs.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public SignedOutEventArgs (
SignedInGamer gamer
)
Parameters
gamer
The gamer that just signed out.
Exceptions
Exception type Condition
ArgumentNullException gamer is null.
See Also
Reference
SignedOutEventArgs Class
SignedOutEventArgs Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SignedOutEventArgs Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
SignedOutEventArgs Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
SignedOutEventArgs Properties
Public Properties
Name Description
Gamer Gets the gamer that just signed out.
See Also
Reference
SignedOutEventArgs Class
Microsoft.Xna.Framework.GamerServices Namespace
XNA Game Studio 2.0
SignedOutEventArgs.Gamer Property
Gets the gamer that just signed out.
Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public SignedInGamer Gamer { get; }
Property Value
The gamer that just signed out.
See Also
Reference
SignedOutEventArgs Class
SignedOutEventArgs Members
Microsoft.Xna.Framework.GamerServices Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics Namespace
Contains low-level application programming interface (API) methods that take advantage of hardware acceleration capabilities
to display 3D objects.
Classes
Name Description
BasicDirectionalLight Provides methods for manipulating the directional lights used by the BasicEffect class.
BasicEffect Represents shader model 1.1 Effect that has optional support for vertex colors, texturing, and
lighting.
ClipPlane Represents the device clipping plane.
ClipPlaneCollection Manipulates a collection of ClipPlane objects.
CompilationFailedException The exception that is thrown if the compilation of an effect fails.
CompilerIncludeHandler The abstract base class for custom compiler include file handlers.
DepthStencilBuffer Queries and prepares depth stencil buffers.
DeviceLostException The exception that is thrown when the device has been lost but cannot be reset at this time. T
herefore, rendering is not possible.
DeviceNotResetException The exception that is thrown when the device has been lost but can be reset at this time.
DeviceNotSupportedException The exception that is thrown when the graphics device does not support the requested capa
bilities.
DeviceStillDrawingException The error that is thrown when the device is still drawing.
DriverInternalErrorException The exception that is thrown when an internal driver error occurs. Applications should destro
y and recreate the device when receiving this error.
DynamicIndexBuffer Describes the rendering order of the vertices in a vertex buffer.
DynamicVertexBuffer Represents a list of 3D vertices to be streamed to the graphics device.
Effect Used to set and query effects and choose techniques.
EffectAnnotation Represents an annotation to an EffectParameter.
EffectAnnotationCollection Manipulates a collection of EffectAnnotation objects.
EffectFunction Represents a function on an Effect.
EffectFunctionCollection Manipulates a collection of EffectFunction objects.
EffectParameter Represents an Effect parameter.
EffectParameterBlock Represents an EffectParameter state block.
EffectParameterCollection Manipulates a collection of EffectParameter objects.
EffectPass Represents an effect pass.
EffectPassCollection Manipulates a collection of EffectPass objects.
EffectPool Allows applications to share resources between effects.
EffectTechnique Represents an effect technique.
EffectTechniqueCollection Manipulates a collection of EffectTechnique objects.
GammaRamp Contains red, green, and blue ramp data.
GraphicsAdapter Provides methods to retrieve and manipulate graphics adapters.
GraphicsDevice Performs primitive-based rendering, creates resources, handles system-level variables, adjus
ts gamma ramp levels, and creates shaders.
GraphicsDeviceCapabilities Represents the capabilities of the hardware.
GraphicsResource Queries and prepares resources.
IndexBuffer Describes the rendering order of the vertices in a vertex buffer.
Model Represents a 3D model composed of multiple ModelMesh objects which may be moved ind
ependently.
ModelBone Represents bone data for a model.
ModelBoneCollection Represents a set of bones associated with a model.
ModelEffectCollection Represents a collection of effects associated with a model.
ModelMesh Represents a mesh that is part of a Model.
ModelMeshCollection Represents a collection of ModelMesh objects.
ModelMeshPart Represents a batch of geometry information to submit to the graphics device during renderi
ng. Each ModelMeshPart is a subdivision of a ModelMesh object. The ModelMesh class is spl
it into multiple ModelMeshPart objects, typically based on material information.
ModelMeshPartCollection Represents a collection of ModelMeshPart objects.
OcclusionQuery Used to perform an occlusion query against the latest drawn objects.
OutOfVideoMemoryException The exception that is thrown when Direct3D does not have enough display memory to perfo
rm the operation.
PixelShader Encapsulates the functionality of a pixel shader.
PresentationParameters Contains presentation parameters.
RenderState Defines the render state of a graphics device.
RenderTarget Represents a resource that will be written to at the end of a render pass. This is the base clas
s for RenderTarget2D and RenderTargetCube.
RenderTarget2D Represents a 2D texture resource that will be written to at the end of a render pass.
RenderTargetCube Represents a cubic texture resource that will be written to at the end of a render pass.
ResolveTexture2D Represents a 2D grid of texels.
ResourceCreatedEventArgs Contains event data.
ResourceDestroyedEventArgs Arguments for a ResourceDestroyed event.
SamplerState Contains sampler states for the device.
SamplerStateCollection Collection of SamplerState objects.
ShaderCompiler Compiles and decompiles high-level shader language (HLSL) shaders.
ShaderConstant Describes a shader constant.
ShaderConstantCollection Manipulates a collection of ShaderConstant objects.
ShaderConstantTable Contains the variables that are used by high-level language shaders and effects.
SpriteBatch Enables a group of sprites to be drawn using the same settings.
SpriteFont Represents a font texture.
StateBlock Encapsulates render states.
Texture Represents a texture resource.
Texture2D Represents a 2D grid of texels.
Texture3D Represents a 3D volume of texels.
TextureCollection Represents a collection of Texture objects.
TextureCube Represents a set of six 2D textures, one for each face of a cube.
VertexBuffer Represents a list of 3D vertices to be streamed to the graphics device.
VertexDeclaration Represents a vertex declaration.
VertexShader Encapsulates the functionality of a vertex shader.
VertexStream Represents a vertex stream.
VertexStreamCollection Collection of VertexStream objects.
Interfaces
Name Description
IDynamicGraphicsResource For internal use only.
IGraphicsDeviceService Defines a mechanism for retrieving GraphicsDevice objects.
IGraphicsResource For internal use only.
Structures
Name Description
Color Represents a color using Red, Green, Blue, and Alpha values.
CompiledEffect Represents a compiled Effect.
CompiledShader Represents a compiled shader.
CompilerMacro Represents a compiler macro.
DisplayMode Describes the display mode.
DisplayModeCollection Manipulates a collection of DisplayMode structures.
GraphicsDeviceCapabilities.AddressCaps Represents the texture addressing capabilities for Texture structures.
GraphicsDeviceCapabilities.BlendCaps Represents the supported blend capabilities.
GraphicsDeviceCapabilities.CompareCaps Represents comparison capabilities.
GraphicsDeviceCapabilities.CursorCaps Represents hardware support for cursors.
GraphicsDeviceCapabilities.DeclarationTypeCaps Represents data types contained in a vertex declaration.
GraphicsDeviceCapabilities.DeviceCaps Represents device-specific capabilities.
GraphicsDeviceCapabilities.DriverCaps Represents driver-specific capabilities.
GraphicsDeviceCapabilities.FilterCaps Represents texture filter capabilities.
GraphicsDeviceCapabilities.LineCaps Represents the capabilities for line-drawing primitives.
GraphicsDeviceCapabilities.PixelShaderCaps Represents pixel shader capabilities.
GraphicsDeviceCapabilities.PrimitiveCaps Represents driver primitive capabilities.
GraphicsDeviceCapabilities.RasterCaps Represents raster-drawing capabilities.
GraphicsDeviceCapabilities.ShadingCaps Represents shading operations capabilities
GraphicsDeviceCapabilities.StencilCaps Represents driver stencil capabilities.
GraphicsDeviceCapabilities.TextureCaps Represents miscellaneous texture-mapping capabilities
GraphicsDeviceCapabilities.VertexFormatCaps Represents flexible vertex format capabilities.
GraphicsDeviceCapabilities.VertexProcessingCaps Represents vertex processing capabilities.
GraphicsDeviceCapabilities.VertexShaderCaps Represents vertex shader version 2_0 extended capabilities.
GraphicsDeviceCreationParameters Describes the creation parameters for a device.
ModelBoneCollection.Enumerator Provides the ability to iterate through the bones in an
ModelBoneCollection.
ModelEffectCollection.Enumerator Provides the ability to iterate through the bones in an
ModelEffectCollection.
ModelMeshCollection.Enumerator Provides the ability to iterate through the bones in an
ModelMeshCollection.
ModelMeshPartCollection.Enumerator Provides the ability to iterate through the bones in an
ModelMeshPartCollection.
RasterStatus Describes the raster status.
ShaderSemantic Semantics map a parameter to vertex or pixel shader registers. They can
also be optional descriptive strings attached to non-register parameters.
TextureCreationParameters Describes the parameters to use when initializing a new instance of a text
ure.
TextureInformation Encapsulates information describing texture resources.
VertexElement Defines input vertex data to the pipeline.
VertexPositionColor Describes a custom vertex format structure that contains position and col
or information.
VertexPositionColorTexture Describes a custom vertex format structure that contains position, color, a
nd one set of texture coordinates.
VertexPositionNormalTexture Describes a custom vertex format structure that contains position, normal
data, and one set of texture coordinates.
VertexPositionTexture Describes a custom vertex format structure that contains position and on
e set of texture coordinates.
Viewport Defines the window dimensions of a render-target surface onto which a
3D volume projects.
Enumerations
Name Description
Blend Defines color blending factors.
BlendFunction Defines how to combine a source color with the destination color already on the render target
for color blending.
BufferUsage Specifies special usage of the buffer contents.
ClearOptions Specifies the buffer to use when calling Clear.
ColorWriteChannels Defines the color channels that can be chosen for a per-channel write to a render target color
buffer.
CompareFunction Defines comparison functions that can be chosen for alpha, stencil, or depth-buffer tests.
CompilerIncludeHandlerType Identifies an include file as a local or system resource.
CompilerOptions Defines optimization options that may be chosen for shader and effect code compilation.
CubeMapFace Defines the faces of a cube map in the TextureCube class type.
CullMode Defines winding orders that may be used to identify back faces for culling.
DepthFormat Defines the format of data in a depth buffer.
DeviceType Specifies the type of device driver.
EffectParameterClass Defines classes that can be used for effect parameters or shader constants.
EffectParameterType Defines types that can be used for effect parameters or shader constants.
FillMode Describes options for filling the vertices and lines that define a primitive.
FilterOptions Defines modes describing how to filter an image or mipmap when it is minified or magnified
to fit a set of vertices.
FogMode Defines constants that describe the fog mode.
GraphicsDeviceStatus Describes the status of the device.
ImageFileFormat Defines supported image file formats that may be used for textures.
IndexElementSize Defines the size of an element of an index buffer.
MultiSampleType Defines the levels of full-scene multisampling that the game machine can apply.
PresentInterval Defines flags that describe the relationship between the adapter refresh rate and the rate at w
hich Present operations are completed.
PresentOptions Defines flags that control the behavior of the back buffer and depth buffer.
PrimitiveType Defines how data in a vertex stream is interpreted during a draw call.
QueryUsages Defines options for querying device resource formats.
RenderTargetUsage Determines how render target data is used once a new render target is set.
ResourceType Defines resource types.
SaveStateMode Defines options for saving the graphics device state before and after an effect technique is ap
plied.
SetDataOptions Describes whether existing buffer data will be overwritten or discarded during a SetData oper
ation.
ShaderProfile Defines vertex and pixel shader versions.
ShaderRegisterSet Defines the data type of a shader register.
SpriteBlendMode The following flags are used to specify sprite blending rendering options to the flags paramet
er in Begin:
SpriteEffects Defines sprite rotation options.
SpriteSortMode Defines sprite sort-rendering options.
StencilOperation Defines stencil buffer operations.
SurfaceFormat Defines various types of surface formats.
SwapEffect Defines how the device front buffer and back buffer are to be swapped when Present is called.
TextureAddressMode Defines constants that describe supported texture-addressing modes.
TextureFilter Defines how a texture will be filtered as it is minified for each mipmap level.
TextureUsage Specifies special usage of the texture data.
TextureWrapCoordinates Defines supported wrap coordinates.
VertexElementFormat Defines vertex element formats.
VertexElementMethod Defines the tessellator processing method for a vertex element.
VertexElementUsage Defines usage for vertex elements.
See Also
Tasks
How To: Draw a Sprite
How To: Animate a Sprite
How To: Draw a Masked Sprite over a Background
How To: Make a Scrolling Background
How To: Rotate a Sprite
How To: Rotate a Group of Sprites
How To: Scale a Sprite
How To: Tint a Sprite
How To: Check for Shader Model 2.0 Support
How To: Use BasicEffect
How To: Draw Points, Lines, and Other 3D Primitives
How To: Create and Apply Custom Effects
How To: Create Custom Texture Effects
Concepts
2D Graphics Overview
3D Graphics Overview
XNA Game Studio 2.0
BasicDirectionalLight Class
Provides methods for manipulating the directional lights used by the BasicEffect class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class BasicDirectionalLight
See Also
Reference
BasicDirectionalLight Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicDirectionalLight Members
The following tables list the members exposed by the BasicDirectionalLight type.
Public Properties
Name Description
DiffuseColor Gets or sets the diffuse color of this light.
Direction Gets or sets light direciton.
Enabled Enables this light.
SpecularColor Gets or sets the specular color of the light.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
BasicDirectionalLight Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
BasicDirectionalLight Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
BasicDirectionalLight Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
BasicDirectionalLight Properties
Public Properties
Name Description
DiffuseColor Gets or sets the diffuse color of this light.
Direction Gets or sets light direciton.
Enabled Enables this light.
SpecularColor Gets or sets the specular color of the light.
See Also
Reference
BasicDirectionalLight Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
BasicDirectionalLight.DiffuseColor Property
Gets or sets the diffuse color of this light.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 DiffuseColor { get; set; }
Property Value
The diffuse color of this light.
See Also
Reference
BasicDirectionalLight Class
BasicDirectionalLight Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicDirectionalLight.Direction Property
Gets or sets light direciton.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Direction { get; set; }
Property Value
Gets or sets the light direciton. This value must be a unit vector.
See Also
Reference
BasicDirectionalLight Class
BasicDirectionalLight Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicDirectionalLight.Enabled Property
Enables this light.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool Enabled { get; set; }
Property Value
true to enable this light; false otherwise.
See Also
Reference
BasicDirectionalLight Class
BasicDirectionalLight Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicDirectionalLight.SpecularColor Property
Gets or sets the specular color of the light.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 SpecularColor { get; set; }
Property Value
The specular color of the light.
See Also
Reference
BasicDirectionalLight Class
BasicDirectionalLight Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicEffect Class
Represents shader model 1.1 Effect that has optional support for vertex colors, texturing, and lighting.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class BasicEffect : Effect
See Also
Tasks
How To: Use BasicEffect
How To: Create and Apply Custom Effects
Reference
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicEffect Members
The following tables list the members exposed by the BasicEffect type.
Public Constructors
Name Description
BasicEffect Overloaded. Initializes a new instance of the BasicEffect class.
Public Properties
Name Description
Alpha Gets or sets the alpha this effect material.
AmbientLightColor Gets or sets the ambient light color of this effect.
Creator (Inherited from Effect.)
CurrentTechnique (Inherited from Effect.)
DiffuseColor Gets or sets the diffuse color of this effect material. Value takes 0 to 1.
DirectionalLight0 Gets the first directional light for this effect.
DirectionalLight1 Gets the second directional light for this effect.
DirectionalLight2 Gets the third directional light for this effect.
EffectPool (Inherited from Effect.)
EmissiveColor Gets or sets the emissive color of the effect material.
FogColor Gets or sets the fog color for this effect.
FogEnabled Enables fog for this effect.
FogEnd Gets or sets the ending distance of fog.
FogStart Gets or sets the fog start distance.
Functions (Inherited from Effect.)
GraphicsDevice (Inherited from Effect.)
IsDisposed (Inherited from Effect.)
LightingEnabled Enables lighting for this effect.
Parameters (Inherited from Effect.)
PreferPerPixelLighting Gets or sets a value indicating that per-pixel lighting should be used if it is available for the current a
dapter. Per-pixel lighting is available if a graphics adapter supports Pixel Shader Model 2.0.
Projection Gets or sets the projection matrix.
SpecularColor Gets or sets the specular color of this effect material.
SpecularPower Gets or sets the specular power of this effect material.
Techniques (Inherited from Effect.)
Texture Gets or sets a texture to be applied by this effect.
TextureEnabled Enables textures for this effect.
VertexColorEnabled Enables use vertex colors for this effect.
View Gets or sets the view matrix.
World Gets or sets the world matrix.
Public Methods
Name Description
Begin (Inherited from Effect.)
Clone Creates a clone of an effect.
CommitChanges (Inherited from Effect.)
CompileEffectFromFile (Inherited from Effect.)
CompileEffectFromSource (Inherited from Effect.)
Disassemble (Inherited from Effect.)
Dispose (Inherited from Effect.)
EnableDefaultLighting Enables default lighting for this effect.
End (Inherited from Effect.)
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
MemberwiseClone (Inherited from Object.)
raise_Disposing (Inherited from Effect.)
raise_Lost (Inherited from Effect.)
raise_Reset (Inherited from Effect.)
Public Events
Name Description
Disposing (Inherited from Effect.)
Lost (Inherited from Effect.)
Reset (Inherited from Effect.)
See Also
Reference
BasicEffect Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
BasicEffect Constructor
Initializes a new instance of the BasicEffect class.
Overload List
Name Description
BasicEffect (GraphicsDevice, BasicEffect) Initializes a new instance of the BasicEffect class.
BasicEffect (GraphicsDevice, EffectPool) Initializes a new instance of the BasicEffect class.
See Also
Reference
BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
device
The graphics device that will create the effect.
clone
The effect to clone.
See Also
Reference
BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
device
The graphics device that will create the effect.
effectPool
Specifies a pool of resources to share between effects.
See Also
Reference
BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicEffect Methods
Public Methods
Name Description
Begin (Inherited from Effect.)
Clone Creates a clone of an effect.
CommitChanges (Inherited from Effect.)
CompileEffectFromFile (Inherited from Effect.)
CompileEffectFromSource (Inherited from Effect.)
Disassemble (Inherited from Effect.)
Dispose (Inherited from Effect.)
EnableDefaultLighting Enables default lighting for this effect.
End (Inherited from Effect.)
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
MemberwiseClone (Inherited from Object.)
raise_Disposing (Inherited from Effect.)
raise_Lost (Inherited from Effect.)
raise_Reset (Inherited from Effect.)
See Also
Reference
BasicEffect Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
BasicEffect.Clone Method
Creates a clone of an effect.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override Effect Clone (
GraphicsDevice device
)
Parameters
device
The cloned effect.
Return Value
The device associated with the effect.
See Also
Reference
BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicEffect.EnableDefaultLighting Method
Enables default lighting for this effect.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void EnableDefaultLighting ()
See Also
Reference
BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicEffect Properties
Public Properties
Name Description
Alpha Gets or sets the alpha this effect material.
AmbientLightColor Gets or sets the ambient light color of this effect.
Creator (Inherited from Effect.)
CurrentTechnique (Inherited from Effect.)
DiffuseColor Gets or sets the diffuse color of this effect material. Value takes 0 to 1.
DirectionalLight0 Gets the first directional light for this effect.
DirectionalLight1 Gets the second directional light for this effect.
DirectionalLight2 Gets the third directional light for this effect.
EffectPool (Inherited from Effect.)
EmissiveColor Gets or sets the emissive color of the effect material.
FogColor Gets or sets the fog color for this effect.
FogEnabled Enables fog for this effect.
FogEnd Gets or sets the ending distance of fog.
FogStart Gets or sets the fog start distance.
Functions (Inherited from Effect.)
GraphicsDevice (Inherited from Effect.)
IsDisposed (Inherited from Effect.)
LightingEnabled Enables lighting for this effect.
Parameters (Inherited from Effect.)
PreferPerPixelLighting Gets or sets a value indicating that per-pixel lighting should be used if it is available for the current a
dapter. Per-pixel lighting is available if a graphics adapter supports Pixel Shader Model 2.0.
Projection Gets or sets the projection matrix.
SpecularColor Gets or sets the specular color of this effect material.
SpecularPower Gets or sets the specular power of this effect material.
Techniques (Inherited from Effect.)
Texture Gets or sets a texture to be applied by this effect.
TextureEnabled Enables textures for this effect.
VertexColorEnabled Enables use vertex colors for this effect.
View Gets or sets the view matrix.
World Gets or sets the world matrix.
See Also
Reference
BasicEffect Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
BasicEffect.Alpha Property
Gets or sets the alpha this effect material.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float Alpha { get; set; }
Property Value
The alpha of this effect material.
See Also
Reference
BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicEffect.AmbientLightColor Property
Gets or sets the ambient light color of this effect.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 AmbientLightColor { get; set; }
Property Value
The ambient light color of this effect. Valid values are between 0 and 1.
See Also
Reference
BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicEffect.DiffuseColor Property
Gets or sets the diffuse color of this effect material. Value takes 0 to 1.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 DiffuseColor { get; set; }
Property Value
The diffuse color of this effect material. Valid values are between 0 and 1.
See Also
Reference
BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicEffect.DirectionalLight0 Property
Gets the first directional light for this effect.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public BasicDirectionalLight DirectionalLight0 { get; }
Property Value
A directional light for this effect.
See Also
Reference
BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicEffect.DirectionalLight1 Property
Gets the second directional light for this effect.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public BasicDirectionalLight DirectionalLight1 { get; }
Property Value
A directional light for this effect.
See Also
Reference
BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicEffect.DirectionalLight2 Property
Gets the third directional light for this effect.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public BasicDirectionalLight DirectionalLight2 { get; }
Property Value
A directional light for this effect.
See Also
Reference
BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicEffect.EmissiveColor Property
Gets or sets the emissive color of the effect material.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 EmissiveColor { get; set; }
Property Value
The emissive color of the effect material. Valid values are between 0 and 1.
See Also
Reference
BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicEffect.FogColor Property
Gets or sets the fog color for this effect.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 FogColor { get; set; }
Property Value
The fog color for this effect.
See Also
Reference
BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicEffect.FogEnabled Property
Enables fog for this effect.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool FogEnabled { get; set; }
Property Value
true to enable fog; false otherwise.
See Also
Reference
BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicEffect.FogEnd Property
Gets or sets the ending distance of fog.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float FogEnd { get; set; }
Property Value
Fog end distance specified as a positive value.
See Also
Reference
BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicEffect.FogStart Property
Gets or sets the fog start distance.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float FogStart { get; set; }
Property Value
Fog start distance specified as a positive value. This distance is expressed in world space coordinates.
See Also
Reference
BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicEffect.LightingEnabled Property
Enables lighting for this effect.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool LightingEnabled { get; set; }
Property Value
true to enable lighting; false otherwise.
Remarks The lighting for BasicEffect is per-vertex and uses three directional lights: DirectionalLight0, DirectionalLight1, and
DirectionalLight2.
See Also
Reference
BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicEffect.PreferPerPixelLighting Property
Gets or sets a value indicating that per-pixel lighting should be used if it is available for the current adapter. Per-pixel lighting is
available if a graphics adapter supports Pixel Shader Model 2.0.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool PreferPerPixelLighting { get; set; }
Property Value
true to use per-pixel lighting if it is available; false to disable per-pixel lighting. The default value is true. When
PreferPerPixelLighting is true, if the graphics adapter does not support a minimum of Pixel Shader Model 2.0, BasicEffect
will automatically fall-back to per-vertex lighting. When PreferPerPixelLighting is false, per-vertex lighting is used
regardless of whether per-pixel lighting is supported by the graphics adapter.
Remarks
There are two common types of real-time lighting used in games. Per-vertex lighting is where lighting contributions are
determined at each vertex and then the results are interpolated across the triangle. Depending on how tessellated the mesh is,
this can result in severe artifacts. Per-pixel lighting interpolates the per-vertex normal across the triangle, but calculates the
contribution at each pixel, which results in much smoother lighting, particularly when a specular highlight falls between
vertices.
See Also
Reference
BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicEffect.Projection Property
Gets or sets the projection matrix.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Matrix Projection { get; set; }
Property Value
The projection matrix.
See Also
Reference
BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicEffect.SpecularColor Property
Gets or sets the specular color of this effect material.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 SpecularColor { get; set; }
Property Value
The specular color of this effect material. Valid values are between 0 and 1.
See Also
Reference
BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicEffect.SpecularPower Property
Gets or sets the specular power of this effect material.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float SpecularPower { get; set; }
Property Value
The specular power of this effect material.
See Also
Reference
BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicEffect.Texture Property
Gets or sets a texture to be applied by this effect.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Texture2D Texture { get; set; }
Property Value
Texture to be applied by this effect.
Remarks If the TextureFilter sampler state is not set, the default filter for BasicEffect is TextureFilter.Linear.
See Also
Reference
BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicEffect.TextureEnabled Property
Enables textures for this effect.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool TextureEnabled { get; set; }
Property Value
true to enable textures; false otherwise.
See Also
Reference
BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicEffect.VertexColorEnabled Property
Enables use vertex colors for this effect.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool VertexColorEnabled { get; set; }
Property Value
true to enable vertex colors; false otherwise.
See Also
Reference
BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicEffect.View Property
Gets or sets the view matrix.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Matrix View { get; set; }
Property Value
The view matrix.
See Also
Reference
BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicEffect.World Property
Gets or sets the world matrix.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Matrix World { get; set; }
Property Value
The world matrix.
See Also
Reference
BasicEffect Class
BasicEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BasicEffect Events
Public Events
Name Description
Disposing (Inherited from Effect.)
Lost (Inherited from Effect.)
Reset (Inherited from Effect.)
See Also
Reference
BasicEffect Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Blend Enumeration
Defines color blending factors.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum Blend
Members
Memb Description
er na
me
Zero Each component of the color is multiplied by (0, 0, 0, 0).
One Each component of the color is multiplied by (1, 1, 1, 1).
Sourc Each component of the color is multiplied by the source color. This can be represented as (R s, Gs, Bs, As), where R, G,
eColor B, and A respectively stand for the red, green, blue, and alpha source values.
Invers Each component of the color is multiplied by the inverse of the source color. This can be represented as (1 − R s, 1 − G
eSour s, 1 − Bs, 1 − As) where R, G, B, and A respectively stand for the red, green, blue, and alpha destination values.
ceCol
or
Sourc Each component of the color is multiplied by the alpha value of the source. This can be represented as (As, As, As, As),
eAlph where As is the alpha source value.
a
Invers Each component of the color is multiplied by the inverse of the alpha value of the source. This can be represented as (
eSour 1 − As, 1 − As, 1 − As, 1 − As), where As is the alpha destination value.
ceAlp
ha
Destin Each component of the color is multiplied by the alpha value of the destination. This can be represented as (Ad, Ad, Ad
ation , Ad), where Ad is the destination alpha value.
Alpha
Invers Each component of the color is multiplied by the inverse of the alpha value of the destination. This can be represented
eDesti as (1 − Ad, 1 − Ad, 1 − Ad, 1 − Ad), where Ad is the alpha destination value.
nation
Alpha
Destin Each component color is multiplied by the destination color. This can be represented as (R d, Gd, Bd, Ad), where R, G, B,
ationC and A respectively stand for red, green, blue, and alpha destination values.
olor
Invers Each component of the color is multiplied by the inverse of the destination color. This can be represented as (1 − R d,
eDesti 1 − Gd, 1 − Bd, 1 − Ad), where R d, Gd, Bd, and Ad respectively stand for the red, green, blue, and alpha destination val
nation ues.
Color
Sourc Each component of the color is multiplied by either the alpha of the source color, or the inverse of the alpha of the so
eAlph urce color, whichever is greater. This can be represented as (f, f, f, 1), where f = min(A, 1 − Ad).
aSatur
ation
BothI (Win32 only) Each component of the source color is multiplied by the inverse of the alpha of the source color, and eac
nverse h component of the destination color is multiplied by the alpha of the source color. This can be represented as (1 − As
Sourc , 1 − As, 1 − As, 1 − As), with a destination blend factor of (As, As, As, As); the destination blend selection is overridden
eAlph . This blend mode is supported only for the SourceBlend render state.
a
Blend Each component of the color is multiplied by a constant set in BlendFactor.
Factor
Invers Each component of the color is multiplied by the inverse of a constant set in BlendFactor. This blend mode is supporte
eBlen d only if SupportsBlendFactor is true in the SourceBlendCapabilities or DestinationBlendCapabilities properties.
dFact
or
BothS This mode is obsolete. The same effect can be achieved by setting the source and destination blend factors to Source
ource Alpha and InverseSourceAlpha in separate calls.
Alpha
Remarks
The alpha value of a color controls its transparency. Enabling alpha blending with AlphaBlendEnable allows colors, materials,
and textures on a surface to be blended with transparency onto another surface.
Alpha blending is determined by the SourceBlend and DestinationBlend properties. With the default BlendFunction, the source
pixel times the SourceBlend is added to the destination pixel (the pixel on the back buffer) times the DestinationBlend to
produce a color that is a blend of the two pixel colors. The BlendFunction determines the operation used on the outcome of the
source blend and destination blend components.
See Also
Reference
GraphicsDeviceCapabilities.BlendCaps Structure
RenderState.AlphaDestinationBlend Property
RenderState.AlphaSourceBlend Property
RenderState.DestinationBlend Property
RenderState.SourceBlend Property
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BlendFunction Enumeration
Defines how to combine a source color with the destination color already on the render target for color blending.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum BlendFunction
Members
Member name Description
Add
The result is the destination added to the source.
Result = (Source Color * Source Blend) + (Destination Color * Destination Blend)
Max
The result is the maximum of the source and destination.
Result = max( (Source Color * Source Blend), (Destination Color * Destination Blend) )
Min
The result is the minimum of the source and destination.
Result = min( (Source Color * Source Blend), (Destination Color * Destination Blend) )
ReverseSubtract
The result is the source subtracted from the destination.
Result = (Destination Color * Destination Blend) − (Source Color * Source Blend)
Subtract
The result is the destination subtracted from the source.
Result = (Source Color * Source Blend) − (Destination Color * Destination Blend)
Remarks
The alpha value of a color controls its transparency. Enabling alpha blending with AlphaBlendEnable allows colors, materials,
and textures on a surface to be blended with transparency onto another surface.
Alpha blending is determined by the SourceBlend and DestinationBlend properties. With the default BlendFunction, the source
pixel times the SourceBlend is added to the destination pixel (the pixel on the back buffer) times the DestinationBlend to
produce a color that is a blend of the two pixel colors. The BlendFunction determines the operation used on the outcome of the
source blend and destination blend components.
See Also
Reference
BlendFunction
SourceBlend
DestinationBlend
SupportsBlendOperation
AlphaSourceBlend
AlphaDestinationBlend
AlphaBlendOperation
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
BufferUsage Enumeration
Specifies special usage of the buffer contents.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[FlagsAttribute]
public enum BufferUsage
Members
Membe Description
r name
None None
Points Indicates that the vertex or index buffer will be used for drawing point sprites. The buffer is loaded in system memor
y if software vertex processing is needed to emulate point sprites.
WriteO Indicates that the application only writes to the vertex buffer. If specified, the driver chooses the best memory locatio
nly n for efficient writing and rendering. Attempts to read from a write-only vertex buffer fail.
See Also
Reference
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ClearOptions Enumeration
Specifies the buffer to use when calling Clear.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[FlagsAttribute]
public enum ClearOptions
Members
Member name Description
DepthBuffer A depth buffer.
Stencil A stencil buffer.
Target A render target.
See Also
Reference
Clear
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ClipPlane Class
Represents the device clipping plane.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class ClipPlane
See Also
Reference
ClipPlane Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ClipPlane Members
The following tables list the members exposed by the ClipPlane type.
Public Properties
Name Description
IsEnabled Indicates whether the clipping plane is enabled.
Plane Gets or sets the coefficients of a user-defined clipping plane for the device.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Gets a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ClipPlane Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ClipPlane Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Gets a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ClipPlane Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ClipPlane.ToString Method
Gets a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
ClipPlane Class
ClipPlane Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ClipPlane Properties
Public Properties
Name Description
IsEnabled Indicates whether the clipping plane is enabled.
Plane Gets or sets the coefficients of a user-defined clipping plane for the device.
See Also
Reference
ClipPlane Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ClipPlane.IsEnabled Property
Indicates whether the clipping plane is enabled.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsEnabled { get; set; }
Property Value
true if the clipping plane is enabled; false if disabled.
See Also
Reference
ClipPlane Class
ClipPlane Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ClipPlane.Plane Property
Gets or sets the coefficients of a user-defined clipping plane for the device.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Plane Plane { get; set; }
Property Value
User-defined clipping plane.
See Also
Reference
ClipPlane Class
ClipPlane Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ClipPlaneCollection Class
Manipulates a collection of ClipPlane objects.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class ClipPlaneCollection
See Also
Reference
ClipPlaneCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ClipPlaneCollection Members
The following tables list the members exposed by the ClipPlaneCollection type.
Public Properties
Name Description
Item Gets a specific ClipPlane object using an index value.
Public Methods
Name Description
DisableAll Disables all clipping planes on the device.
EnableAll Enables all clipping planes that have been set.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ClipPlaneCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ClipPlaneCollection Methods
Public Methods
Name Description
DisableAll Disables all clipping planes on the device.
EnableAll Enables all clipping planes that have been set.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ClipPlaneCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ClipPlaneCollection.DisableAll Method
Disables all clipping planes on the device.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void DisableAll ()
See Also
Reference
ClipPlaneCollection Class
ClipPlaneCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ClipPlaneCollection.EnableAll Method
Enables all clipping planes that have been set.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void EnableAll ()
See Also
Reference
ClipPlaneCollection Class
ClipPlaneCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ClipPlaneCollection Properties
Public Properties
Name Description
Item Gets a specific ClipPlane object using an index value.
See Also
Reference
ClipPlaneCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ClipPlaneCollection.Item Property
Gets a specific ClipPlane object using an index value.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ClipPlane this [
int index
] { get; }
Property Value
The ClipPlane object at index index.
Exceptions
Exception type Condition
InvalidOperationException index was out of range.
See Also
Reference
ClipPlaneCollection Class
ClipPlaneCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color Structure
Represents a color using Red, Green, Blue, and Alpha values.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct Color : IPackedVector<UInt32>, IEquatable<Color>
See Also
Reference
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color Members
The following tables list the members exposed by the Color type.
Public Constructors
Name Description
Color Overloaded. Initializes a new instance of Color.
Public Properties
Name Description
A Gets the alpha component value.
AliceBlue Gets a system-defined color with the value R:240 G:248 B:255 A:255.
AntiqueWhite Gets a system-defined color with the value R:250 G:235 B:215 A:255.
Aqua Gets a system-defined color with the value R:0 G:255 B:255 A:255.
Aquamarine Gets a system-defined color with the value R:127 G:255 B:212 A:255.
Azure Gets a system-defined color with the value R:240 G:255 B:255 A:255.
B Gets the blue component value of this Color.
Beige Gets a system-defined color with the value R:245 G:245 B:220 A:255.
Bisque Gets a system-defined color with the value R:255 G:228 B:196 A:255.
Black Gets a system-defined color with the value R:0 G:0 B:0 A:255.
BlanchedAlmond Gets a system-defined color with the value R:255 G:235 B:205 A:255.
Blue Gets a system-defined color with the value R:0 G:0 B:255 A:255.
BlueViolet Gets a system-defined color with the value R:138 G:43 B:226 A:255.
Brown Gets a system-defined color with the value R:165 G:42 B:42 A:255.
BurlyWood Gets a system-defined color with the value R:222 G:184 B:135 A:255.
CadetBlue Gets a system-defined color with the value R:95 G:158 B:160 A:255.
Chartreuse Gets a system-defined color with the value R:127 G:255 B:0 A:255.
Chocolate Gets a system-defined color with the value R:210 G:105 B:30 A:255.
Coral Gets a system-defined color with the value R:255 G:127 B:80 A:255.
CornflowerBlue Gets a system-defined color with the value R:100 G:149 B:237 A:255.
Cornsilk Gets a system-defined color with the value R:255 G:248 B:220 A:255.
Crimson Gets a system-defined color with the value R:220 G:20 B:60 A:255.
Cyan Gets a system-defined color with the value R:0 G:255 B:255 A:255.
DarkBlue Gets a system-defined color with the value R:0 G:0 B:139 A:255.
DarkCyan Gets a system-defined color with the value R:0 G:139 B:139 A:255.
DarkGoldenrod Gets a system-defined color with the value R:184 G:134 B:11 A:255.
DarkGray Gets a system-defined color with the value R:169 G:169 B:169 A:255.
DarkGreen Gets a system-defined color with the value R:0 G:100 B:0 A:255.
DarkKhaki Gets a system-defined color with the value R:189 G:183 B:107 A:255.
DarkMagenta Gets a system-defined color with the value R:139 G:0 B:139 A:255.
DarkOliveGreen Gets a system-defined color with the value R:85 G:107 B:47 A:255.
DarkOrange Gets a system-defined color with the value R:255 G:140 B:0 A:255.
DarkOrchid Gets a system-defined color with the value R:153 G:50 B:204 A:255.
DarkRed Gets a system-defined color with the value R:139 G:0 B:0 A:255.
DarkSalmon Gets a system-defined color with the value R:233 G:150 B:122 A:255.
DarkSeaGreen Gets a system-defined color with the value R:143 G:188 B:139 A:255.
DarkSlateBlue Gets a system-defined color with the value R:72 G:61 B:139 A:255.
DarkSlateGray Gets a system-defined color with the value R:47 G:79 B:79 A:255.
DarkTurquoise Gets a system-defined color with the value R:0 G:206 B:209 A:255.
DarkViolet Gets a system-defined color with the value R:148 G:0 B:211 A:255.
DeepPink Gets a system-defined color with the value R:255 G:20 B:147 A:255.
DeepSkyBlue Gets a system-defined color with the value R:0 G:191 B:255 A:255.
DimGray Gets a system-defined color with the value R:105 G:105 B:105 A:255.
DodgerBlue Gets a system-defined color with the value R:30 G:144 B:255 A:255.
Firebrick Gets a system-defined color with the value R:178 G:34 B:34 A:255.
FloralWhite Gets a system-defined color with the value R:255 G:250 B:240 A:255.
ForestGreen Gets a system-defined color with the value R:34 G:139 B:34 A:255.
Fuchsia Gets a system-defined color with the value R:255 G:0 B:255 A:255.
G Gets the green component value of this Color.
Gainsboro Gets a system-defined color with the value R:220 G:220 B:220 A:255.
GhostWhite Gets a system-defined color with the value R:248 G:248 B:255 A:255.
Gold Gets a system-defined color with the value R:255 G:215 B:0 A:255.
Goldenrod Gets a system-defined color with the value R:218 G:165 B:32 A:255.
Gray Gets a system-defined color with the value R:128 G:128 B:128 A:255.
Green Gets a system-defined color with the value R:0 G:128 B:0 A:255.
GreenYellow Gets a system-defined color with the value R:173 G:255 B:47 A:255.
Honeydew Gets a system-defined color with the value R:240 G:255 B:240 A:255.
HotPink Gets a system-defined color with the value R:255 G:105 B:180 A:255.
IndianRed Gets a system-defined color with the value R:205 G:92 B:92 A:255.
Indigo Gets a system-defined color with the value R:75 G:0 B:130 A:255.
Ivory Gets a system-defined color with the value R:255 G:255 B:240 A:255.
Khaki Gets a system-defined color with the value R:240 G:230 B:140 A:255.
Lavender Gets a system-defined color with the value R:230 G:230 B:250 A:255.
LavenderBlush Gets a system-defined color with the value R:255 G:240 B:245 A:255.
LawnGreen Gets a system-defined color with the value R:124 G:252 B:0 A:255.
LemonChiffon Gets a system-defined color with the value R:255 G:250 B:205 A:255.
LightBlue Gets a system-defined color with the value R:173 G:216 B:230 A:255.
LightCoral Gets a system-defined color with the value R:240 G:128 B:128 A:255.
LightCyan Gets a system-defined color with the value R:224 G:255 B:255 A:255.
LightGoldenrodYellow Gets a system-defined color with the value R:250 G:250 B:210 A:255.
LightGray Gets a system-defined color with the value R:211 G:211 B:211 A:255.
LightGreen Gets a system-defined color with the value R:144 G:238 B:144 A:255.
LightPink Gets a system-defined color with the value R:255 G:182 B:193 A:255.
LightSalmon Gets a system-defined color with the value R:255 G:160 B:122 A:255.
LightSeaGreen Gets a system-defined color with the value R:32 G:178 B:170 A:255.
LightSkyBlue Gets a system-defined color with the value R:135 G:206 B:250 A:255.
LightSlateGray Gets a system-defined color with the value R:119 G:136 B:153 A:255.
LightSteelBlue Gets a system-defined color with the value R:176 G:196 B:222 A:255.
LightYellow Gets a system-defined color with the value R:255 G:255 B:224 A:255.
Lime Gets a system-defined color with the value R:0 G:255 B:0 A:255.
LimeGreen Gets a system-defined color with the value R:50 G:205 B:50 A:255.
Linen Gets a system-defined color with the value R:250 G:240 B:230 A:255.
Magenta Gets a system-defined color with the value R:255 G:0 B:255 A:255.
Maroon Gets a system-defined color with the value R:128 G:0 B:0 A:255.
MediumAquamarine Gets a system-defined color with the value R:102 G:205 B:170 A:255.
MediumBlue Gets a system-defined color with the value R:0 G:0 B:205 A:255.
MediumOrchid Gets a system-defined color with the value R:186 G:85 B:211 A:255.
MediumPurple Gets a system-defined color with the value R:147 G:112 B:219 A:255.
MediumSeaGreen Gets a system-defined color with the value R:60 G:179 B:113 A:255.
MediumSlateBlue Gets a system-defined color with the value R:123 G:104 B:238 A:255.
MediumSpringGreen Gets a system-defined color with the value R:0 G:250 B:154 A:255.
MediumTurquoise Gets a system-defined color with the value R:72 G:209 B:204 A:255.
MediumVioletRed Gets a system-defined color with the value R:199 G:21 B:133 A:255.
MidnightBlue Gets a system-defined color with the value R:25 G:25 B:112 A:255.
MintCream Gets a system-defined color with the value R:245 G:255 B:250 A:255.
MistyRose Gets a system-defined color with the value R:255 G:228 B:225 A:255.
Moccasin Gets a system-defined color with the value R:255 G:228 B:181 A:255.
NavajoWhite Gets a system-defined color with the value R:255 G:222 B:173 A:255.
Navy Gets a system-defined color R:0 G:0 B:128 A:255.
OldLace Gets a system-defined color with the value R:253 G:245 B:230 A:255.
Olive Gets a system-defined color with the value R:128 G:128 B:0 A:255.
OliveDrab Gets a system-defined color with the value R:107 G:142 B:35 A:255.
Orange Gets a system-defined color with the value R:255 G:165 B:0 A:255.
OrangeRed Gets a system-defined color with the value R:255 G:69 B:0 A:255.
Orchid Gets a system-defined color with the value R:218 G:112 B:214 A:255.
PackedValue Gets the current color as a packed value.
PaleGoldenrod Gets a system-defined color with the value R:238 G:232 B:170 A:255.
PaleGreen Gets a system-defined color with the value R:152 G:251 B:152 A:255.
PaleTurquoise Gets a system-defined color with the value R:175 G:238 B:238 A:255.
PaleVioletRed Gets a system-defined color with the value R:219 G:112 B:147 A:255.
PapayaWhip Gets a system-defined color with the value R:255 G:239 B:213 A:255.
PeachPuff Gets a system-defined color with the value R:255 G:218 B:185 A:255.
Peru Gets a system-defined color with the value R:205 G:133 B:63 A:255.
Pink Gets a system-defined color with the value R:255 G:192 B:203 A:255.
Plum Gets a system-defined color with the value R:221 G:160 B:221 A:255.
PowderBlue Gets a system-defined color with the value R:176 G:224 B:230 A:255.
Purple Gets a system-defined color with the value R:128 G:0 B:128 A:255.
R Gets the red component value of this Color.
Red Gets a system-defined color with the value R:255 G:0 B:0 A:255.
RosyBrown Gets a system-defined color with the value R:188 G:143 B:143 A:255.
RoyalBlue Gets a system-defined color with the value R:65 G:105 B:225 A:255.
SaddleBrown Gets a system-defined color with the value R:139 G:69 B:19 A:255.
Salmon Gets a system-defined color with the value R:250 G:128 B:114 A:255.
SandyBrown Gets a system-defined color with the value R:244 G:164 B:96 A:255.
SeaGreen Gets a system-defined color with the value R:46 G:139 B:87 A:255.
SeaShell Gets a system-defined color with the value R:255 G:245 B:238 A:255.
Sienna Gets a system-defined color with the value R:160 G:82 B:45 A:255.
Silver Gets a system-defined color with the value R:192 G:192 B:192 A:255.
SkyBlue Gets a system-defined color with the value R:135 G:206 B:235 A:255.
SlateBlue Gets a system-defined color with the value R:106 G:90 B:205 A:255.
SlateGray Gets a system-defined color with the value R:112 G:128 B:144 A:255.
Snow Gets a system-defined color with the value R:255 G:250 B:250 A:255.
SpringGreen Gets a system-defined color with the value R:0 G:255 B:127 A:255.
SteelBlue Gets a system-defined color with the value R:70 G:130 B:180 A:255.
Tan Gets a system-defined color with the value R:210 G:180 B:140 A:255.
Teal Gets a system-defined color with the value R:0 G:128 B:128 A:255.
Thistle Gets a system-defined color with the value R:216 G:191 B:216 A:255.
Tomato Gets a system-defined color with the value R:255 G:99 B:71 A:255.
TransparentBlack Gets a system-defined color with the value R:0 G:0 B:0 A:0.
TransparentWhite Gets a system-defined color with the value R:255 G:255 B:255 A:0.
Turquoise Gets a system-defined color with the value R:64 G:224 B:208 A:255.
Violet Gets a system-defined color with the value R:238 G:130 B:238 A:255.
Wheat Gets a system-defined color with the value R:245 G:222 B:179 A:255.
White Gets a system-defined color with the value R:255 G:255 B:255 A:255.
WhiteSmoke Gets a system-defined color with the value R:245 G:245 B:245 A:255.
Yellow Gets a system-defined color with the value R:255 G:255 B:0 A:255.
YellowGreen Gets a system-defined color with the value R:154 G:205 B:50 A:255.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Compares two objects to determine whether they are the same.
op_Inequality Compares two objects to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Gets a string representation of this object.
ToVector3 Returns the current color as a Vector3.
ToVector4 Returns the current color as a Vector4.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Returns the packed value of the curren
t color as a Vector4.
See Also
Reference
Color Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Color Constructor
Initializes a new instance of Color.
Overload List
Name Description
Color (Byte, Byte, Byte) Initializes a new instance of Color.
Color (Byte, Byte, Byte, Byte) Initializes a new instance of Color.
Color (Vector3) Initializes a new instance of Color.
Color (Vector4) Initializes a new instance of Color.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
r
The red component of a color.
g
The green component of a color.
b
The blue component of a color.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
r
The red component of a color.
g
The green component of a color.
b
The blue component of a color.
a
The alpha component of a color.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector
A Vector3 containing the Red, Green, and Blue values defining a color.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector
A Vector4 containing the Red, Green, Blue, and Alpha values defining a color.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Compares two objects to determine whether they are the same.
op_Inequality Compares two objects to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Gets a string representation of this object.
ToVector3 Returns the current color as a Vector3.
ToVector4 Returns the current color as a Vector4.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Returns the packed value of the curren
t color as a Vector4.
See Also
Reference
Color Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Color.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
Color.Equals (Color) Returns a value that indicates whether the current instance is equal to a specified object.
Color.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
Color.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
other
The Color to compare with the current Color.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
obj
The Object to compare with the current Color.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.GetHashCode Method
Gets the hash code for this instance.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for this object.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4
Method
Returns the packed value of the current color as a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
Vector4 vector
)
Parameters
vector
The packed value of the current color.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.op_Equality Method
Compares two objects to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
Color a,
Color b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.op_Inequality Method
Compares two objects to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
Color a,
Color b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.ToString Method
Gets a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.ToVector3 Method
Returns the current color as a Vector3.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 ToVector3 ()
Return Value
The current color represented as a Vector3.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.ToVector4 Method
Returns the current color as a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector4 ToVector4 ()
Return Value
The current color.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color Properties
Public Properties
Name Description
A Gets the alpha component value.
AliceBlue Gets a system-defined color with the value R:240 G:248 B:255 A:255.
AntiqueWhite Gets a system-defined color with the value R:250 G:235 B:215 A:255.
Aqua Gets a system-defined color with the value R:0 G:255 B:255 A:255.
Aquamarine Gets a system-defined color with the value R:127 G:255 B:212 A:255.
Azure Gets a system-defined color with the value R:240 G:255 B:255 A:255.
B Gets the blue component value of this Color.
Beige Gets a system-defined color with the value R:245 G:245 B:220 A:255.
Bisque Gets a system-defined color with the value R:255 G:228 B:196 A:255.
Black Gets a system-defined color with the value R:0 G:0 B:0 A:255.
BlanchedAlmond Gets a system-defined color with the value R:255 G:235 B:205 A:255.
Blue Gets a system-defined color with the value R:0 G:0 B:255 A:255.
BlueViolet Gets a system-defined color with the value R:138 G:43 B:226 A:255.
Brown Gets a system-defined color with the value R:165 G:42 B:42 A:255.
BurlyWood Gets a system-defined color with the value R:222 G:184 B:135 A:255.
CadetBlue Gets a system-defined color with the value R:95 G:158 B:160 A:255.
Chartreuse Gets a system-defined color with the value R:127 G:255 B:0 A:255.
Chocolate Gets a system-defined color with the value R:210 G:105 B:30 A:255.
Coral Gets a system-defined color with the value R:255 G:127 B:80 A:255.
CornflowerBlue Gets a system-defined color with the value R:100 G:149 B:237 A:255.
Cornsilk Gets a system-defined color with the value R:255 G:248 B:220 A:255.
Crimson Gets a system-defined color with the value R:220 G:20 B:60 A:255.
Cyan Gets a system-defined color with the value R:0 G:255 B:255 A:255.
DarkBlue Gets a system-defined color with the value R:0 G:0 B:139 A:255.
DarkCyan Gets a system-defined color with the value R:0 G:139 B:139 A:255.
DarkGoldenrod Gets a system-defined color with the value R:184 G:134 B:11 A:255.
DarkGray Gets a system-defined color with the value R:169 G:169 B:169 A:255.
DarkGreen Gets a system-defined color with the value R:0 G:100 B:0 A:255.
DarkKhaki Gets a system-defined color with the value R:189 G:183 B:107 A:255.
DarkMagenta Gets a system-defined color with the value R:139 G:0 B:139 A:255.
DarkOliveGreen Gets a system-defined color with the value R:85 G:107 B:47 A:255.
DarkOrange Gets a system-defined color with the value R:255 G:140 B:0 A:255.
DarkOrchid Gets a system-defined color with the value R:153 G:50 B:204 A:255.
DarkRed Gets a system-defined color with the value R:139 G:0 B:0 A:255.
DarkSalmon Gets a system-defined color with the value R:233 G:150 B:122 A:255.
DarkSeaGreen Gets a system-defined color with the value R:143 G:188 B:139 A:255.
DarkSlateBlue Gets a system-defined color with the value R:72 G:61 B:139 A:255.
DarkSlateGray Gets a system-defined color with the value R:47 G:79 B:79 A:255.
DarkTurquoise Gets a system-defined color with the value R:0 G:206 B:209 A:255.
DarkViolet Gets a system-defined color with the value R:148 G:0 B:211 A:255.
DeepPink Gets a system-defined color with the value R:255 G:20 B:147 A:255.
DeepSkyBlue Gets a system-defined color with the value R:0 G:191 B:255 A:255.
DimGray Gets a system-defined color with the value R:105 G:105 B:105 A:255.
DodgerBlue Gets a system-defined color with the value R:30 G:144 B:255 A:255.
Firebrick Gets a system-defined color with the value R:178 G:34 B:34 A:255.
FloralWhite Gets a system-defined color with the value R:255 G:250 B:240 A:255.
ForestGreen Gets a system-defined color with the value R:34 G:139 B:34 A:255.
Fuchsia Gets a system-defined color with the value R:255 G:0 B:255 A:255.
G Gets the green component value of this Color.
Gainsboro Gets a system-defined color with the value R:220 G:220 B:220 A:255.
GhostWhite Gets a system-defined color with the value R:248 G:248 B:255 A:255.
Gold Gets a system-defined color with the value R:255 G:215 B:0 A:255.
Goldenrod Gets a system-defined color with the value R:218 G:165 B:32 A:255.
Gray Gets a system-defined color with the value R:128 G:128 B:128 A:255.
Green Gets a system-defined color with the value R:0 G:128 B:0 A:255.
GreenYellow Gets a system-defined color with the value R:173 G:255 B:47 A:255.
Honeydew Gets a system-defined color with the value R:240 G:255 B:240 A:255.
HotPink Gets a system-defined color with the value R:255 G:105 B:180 A:255.
IndianRed Gets a system-defined color with the value R:205 G:92 B:92 A:255.
Indigo Gets a system-defined color with the value R:75 G:0 B:130 A:255.
Ivory Gets a system-defined color with the value R:255 G:255 B:240 A:255.
Khaki Gets a system-defined color with the value R:240 G:230 B:140 A:255.
Lavender Gets a system-defined color with the value R:230 G:230 B:250 A:255.
LavenderBlush Gets a system-defined color with the value R:255 G:240 B:245 A:255.
LawnGreen Gets a system-defined color with the value R:124 G:252 B:0 A:255.
LemonChiffon Gets a system-defined color with the value R:255 G:250 B:205 A:255.
LightBlue Gets a system-defined color with the value R:173 G:216 B:230 A:255.
LightCoral Gets a system-defined color with the value R:240 G:128 B:128 A:255.
LightCyan Gets a system-defined color with the value R:224 G:255 B:255 A:255.
LightGoldenrodYellow Gets a system-defined color with the value R:250 G:250 B:210 A:255.
LightGray Gets a system-defined color with the value R:211 G:211 B:211 A:255.
LightGreen Gets a system-defined color with the value R:144 G:238 B:144 A:255.
LightPink Gets a system-defined color with the value R:255 G:182 B:193 A:255.
LightSalmon Gets a system-defined color with the value R:255 G:160 B:122 A:255.
LightSeaGreen Gets a system-defined color with the value R:32 G:178 B:170 A:255.
LightSkyBlue Gets a system-defined color with the value R:135 G:206 B:250 A:255.
LightSlateGray Gets a system-defined color with the value R:119 G:136 B:153 A:255.
LightSteelBlue Gets a system-defined color with the value R:176 G:196 B:222 A:255.
LightYellow Gets a system-defined color with the value R:255 G:255 B:224 A:255.
Lime Gets a system-defined color with the value R:0 G:255 B:0 A:255.
LimeGreen Gets a system-defined color with the value R:50 G:205 B:50 A:255.
Linen Gets a system-defined color with the value R:250 G:240 B:230 A:255.
Magenta Gets a system-defined color with the value R:255 G:0 B:255 A:255.
Maroon Gets a system-defined color with the value R:128 G:0 B:0 A:255.
MediumAquamarine Gets a system-defined color with the value R:102 G:205 B:170 A:255.
MediumBlue Gets a system-defined color with the value R:0 G:0 B:205 A:255.
MediumOrchid Gets a system-defined color with the value R:186 G:85 B:211 A:255.
MediumPurple Gets a system-defined color with the value R:147 G:112 B:219 A:255.
MediumSeaGreen Gets a system-defined color with the value R:60 G:179 B:113 A:255.
MediumSlateBlue Gets a system-defined color with the value R:123 G:104 B:238 A:255.
MediumSpringGreen Gets a system-defined color with the value R:0 G:250 B:154 A:255.
MediumTurquoise Gets a system-defined color with the value R:72 G:209 B:204 A:255.
MediumVioletRed Gets a system-defined color with the value R:199 G:21 B:133 A:255.
MidnightBlue Gets a system-defined color with the value R:25 G:25 B:112 A:255.
MintCream Gets a system-defined color with the value R:245 G:255 B:250 A:255.
MistyRose Gets a system-defined color with the value R:255 G:228 B:225 A:255.
Moccasin Gets a system-defined color with the value R:255 G:228 B:181 A:255.
NavajoWhite Gets a system-defined color with the value R:255 G:222 B:173 A:255.
Navy Gets a system-defined color R:0 G:0 B:128 A:255.
OldLace Gets a system-defined color with the value R:253 G:245 B:230 A:255.
Olive Gets a system-defined color with the value R:128 G:128 B:0 A:255.
OliveDrab Gets a system-defined color with the value R:107 G:142 B:35 A:255.
Orange Gets a system-defined color with the value R:255 G:165 B:0 A:255.
OrangeRed Gets a system-defined color with the value R:255 G:69 B:0 A:255.
Orchid Gets a system-defined color with the value R:218 G:112 B:214 A:255.
PackedValue Gets the current color as a packed value.
PaleGoldenrod Gets a system-defined color with the value R:238 G:232 B:170 A:255.
PaleGreen Gets a system-defined color with the value R:152 G:251 B:152 A:255.
PaleTurquoise Gets a system-defined color with the value R:175 G:238 B:238 A:255.
PaleVioletRed Gets a system-defined color with the value R:219 G:112 B:147 A:255.
PapayaWhip Gets a system-defined color with the value R:255 G:239 B:213 A:255.
PeachPuff Gets a system-defined color with the value R:255 G:218 B:185 A:255.
Peru Gets a system-defined color with the value R:205 G:133 B:63 A:255.
Pink Gets a system-defined color with the value R:255 G:192 B:203 A:255.
Plum Gets a system-defined color with the value R:221 G:160 B:221 A:255.
PowderBlue Gets a system-defined color with the value R:176 G:224 B:230 A:255.
Purple Gets a system-defined color with the value R:128 G:0 B:128 A:255.
R Gets the red component value of this Color.
Red Gets a system-defined color with the value R:255 G:0 B:0 A:255.
RosyBrown Gets a system-defined color with the value R:188 G:143 B:143 A:255.
RoyalBlue Gets a system-defined color with the value R:65 G:105 B:225 A:255.
SaddleBrown Gets a system-defined color with the value R:139 G:69 B:19 A:255.
Salmon Gets a system-defined color with the value R:250 G:128 B:114 A:255.
SandyBrown Gets a system-defined color with the value R:244 G:164 B:96 A:255.
SeaGreen Gets a system-defined color with the value R:46 G:139 B:87 A:255.
SeaShell Gets a system-defined color with the value R:255 G:245 B:238 A:255.
Sienna Gets a system-defined color with the value R:160 G:82 B:45 A:255.
Silver Gets a system-defined color with the value R:192 G:192 B:192 A:255.
SkyBlue Gets a system-defined color with the value R:135 G:206 B:235 A:255.
SlateBlue Gets a system-defined color with the value R:106 G:90 B:205 A:255.
SlateGray Gets a system-defined color with the value R:112 G:128 B:144 A:255.
Snow Gets a system-defined color with the value R:255 G:250 B:250 A:255.
SpringGreen Gets a system-defined color with the value R:0 G:255 B:127 A:255.
SteelBlue Gets a system-defined color with the value R:70 G:130 B:180 A:255.
Tan Gets a system-defined color with the value R:210 G:180 B:140 A:255.
Teal Gets a system-defined color with the value R:0 G:128 B:128 A:255.
Thistle Gets a system-defined color with the value R:216 G:191 B:216 A:255.
Tomato Gets a system-defined color with the value R:255 G:99 B:71 A:255.
TransparentBlack Gets a system-defined color with the value R:0 G:0 B:0 A:0.
TransparentWhite Gets a system-defined color with the value R:255 G:255 B:255 A:0.
Turquoise Gets a system-defined color with the value R:64 G:224 B:208 A:255.
Violet Gets a system-defined color with the value R:238 G:130 B:238 A:255.
Wheat Gets a system-defined color with the value R:245 G:222 B:179 A:255.
White Gets a system-defined color with the value R:255 G:255 B:255 A:255.
WhiteSmoke Gets a system-defined color with the value R:245 G:245 B:245 A:255.
Yellow Gets a system-defined color with the value R:255 G:255 B:0 A:255.
YellowGreen Gets a system-defined color with the value R:154 G:205 B:50 A:255.
See Also
Reference
Color Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Color.A Property
Gets the alpha component value.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public byte A { get; }
Property Value
The alpha component value of this Color.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.AliceBlue Property
Gets a system-defined color with the value R:240 G:248 B:255 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color AliceBlue { get; }
Property Value
A system-defined color with the value R:240 G:248 B:255 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.AntiqueWhite Property
Gets a system-defined color with the value R:250 G:235 B:215 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color AntiqueWhite { get; }
Property Value
A system-defined color with the value R:250 G:235 B:215 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Aqua Property
Gets a system-defined color with the value R:0 G:255 B:255 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Aqua { get; }
Property Value
A system-defined color with the value R:0 G:255 B:255 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Aquamarine Property
Gets a system-defined color with the value R:127 G:255 B:212 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Aquamarine { get; }
Property Value
A system-defined color with the value R:127 G:255 B:212 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Azure Property
Gets a system-defined color with the value R:240 G:255 B:255 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Azure { get; }
Property Value
A system-defined color with the value R:240 G:255 B:255 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.B Property
Gets the blue component value of this Color.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public byte B { get; }
Property Value
The blue component value of this Color.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Beige Property
Gets a system-defined color with the value R:245 G:245 B:220 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Beige { get; }
Property Value
A system-defined color with the value R:245 G:245 B:220 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Bisque Property
Gets a system-defined color with the value R:255 G:228 B:196 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Bisque { get; }
Property Value
A system-defined color with the value R:255 G:228 B:196 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Black Property
Gets a system-defined color with the value R:0 G:0 B:0 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Black { get; }
Property Value
A system-defined color with the value R:0 G:0 B:0 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.BlanchedAlmond Property
Gets a system-defined color with the value R:255 G:235 B:205 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color BlanchedAlmond { get; }
Property Value
A system-defined color with the value R:255 G:235 B:205 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Blue Property
Gets a system-defined color with the value R:0 G:0 B:255 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Blue { get; }
Property Value
A system-defined color with the value R:0 G:0 B:255 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.BlueViolet Property
Gets a system-defined color with the value R:138 G:43 B:226 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color BlueViolet { get; }
Property Value
A system-defined color with the value R:138 G:43 B:226 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Brown Property
Gets a system-defined color with the value R:165 G:42 B:42 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Brown { get; }
Property Value
A system-defined color with the value R:165 G:42 B:42 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.BurlyWood Property
Gets a system-defined color with the value R:222 G:184 B:135 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color BurlyWood { get; }
Property Value
A system-defined color with the value R:222 G:184 B:135 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.CadetBlue Property
Gets a system-defined color with the value R:95 G:158 B:160 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color CadetBlue { get; }
Property Value
A system-defined color with the value R:95 G:158 B:160 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Chartreuse Property
Gets a system-defined color with the value R:127 G:255 B:0 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Chartreuse { get; }
Property Value
A system-defined color with the value R:127 G:255 B:0 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Chocolate Property
Gets a system-defined color with the value R:210 G:105 B:30 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Chocolate { get; }
Property Value
A system-defined color with the value R:210 G:105 B:30 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Coral Property
Gets a system-defined color with the value R:255 G:127 B:80 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Coral { get; }
Property Value
A system-defined color with the value R:255 G:127 B:80 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.CornflowerBlue Property
Gets a system-defined color with the value R:100 G:149 B:237 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color CornflowerBlue { get; }
Property Value
A system-defined color with the value R:100 G:149 B:237 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Cornsilk Property
Gets a system-defined color with the value R:255 G:248 B:220 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Cornsilk { get; }
Property Value
A system-defined color with the value R:255 G:248 B:220 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Crimson Property
Gets a system-defined color with the value R:220 G:20 B:60 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Crimson { get; }
Property Value
A system-defined color with the value R:220 G:20 B:60 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Cyan Property
Gets a system-defined color with the value R:0 G:255 B:255 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Cyan { get; }
Property Value
A system-defined color with the value R:0 G:255 B:255 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.DarkBlue Property
Gets a system-defined color with the value R:0 G:0 B:139 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color DarkBlue { get; }
Property Value
A system-defined color with the value R:0 G:0 B:139 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.DarkCyan Property
Gets a system-defined color with the value R:0 G:139 B:139 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color DarkCyan { get; }
Property Value
A system-defined color with the value R:0 G:139 B:139 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.DarkGoldenrod Property
Gets a system-defined color with the value R:184 G:134 B:11 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color DarkGoldenrod { get; }
Property Value
A system-defined color with the value R:184 G:134 B:11 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.DarkGray Property
Gets a system-defined color with the value R:169 G:169 B:169 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color DarkGray { get; }
Property Value
A system-defined color with the value R:169 G:169 B:169 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.DarkGreen Property
Gets a system-defined color with the value R:0 G:100 B:0 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color DarkGreen { get; }
Property Value
A system-defined color with the value R:0 G:100 B:0 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.DarkKhaki Property
Gets a system-defined color with the value R:189 G:183 B:107 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color DarkKhaki { get; }
Property Value
A system-defined color with the value R:189 G:183 B:107 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.DarkMagenta Property
Gets a system-defined color with the value R:139 G:0 B:139 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color DarkMagenta { get; }
Property Value
A system-defined color with the value R:139 G:0 B:139 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.DarkOliveGreen Property
Gets a system-defined color with the value R:85 G:107 B:47 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color DarkOliveGreen { get; }
Property Value
A system-defined color with the value R:85 G:107 B:47 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.DarkOrange Property
Gets a system-defined color with the value R:255 G:140 B:0 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color DarkOrange { get; }
Property Value
A system-defined color with the value R:255 G:140 B:0 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.DarkOrchid Property
Gets a system-defined color with the value R:153 G:50 B:204 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color DarkOrchid { get; }
Property Value
A system-defined color with the value R:153 G:50 B:204 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.DarkRed Property
Gets a system-defined color with the value R:139 G:0 B:0 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color DarkRed { get; }
Property Value
A system-defined color with the value R:139 G:0 B:0 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.DarkSalmon Property
Gets a system-defined color with the value R:233 G:150 B:122 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color DarkSalmon { get; }
Property Value
A system-defined color with the value R:233 G:150 B:122 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.DarkSeaGreen Property
Gets a system-defined color with the value R:143 G:188 B:139 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color DarkSeaGreen { get; }
Property Value
A system-defined color with the value R:143 G:188 B:139 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.DarkSlateBlue Property
Gets a system-defined color with the value R:72 G:61 B:139 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color DarkSlateBlue { get; }
Property Value
A system-defined color with the value R:72 G:61 B:139 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.DarkSlateGray Property
Gets a system-defined color with the value R:47 G:79 B:79 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color DarkSlateGray { get; }
Property Value
A system-defined color with the value R:47 G:79 B:79 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.DarkTurquoise Property
Gets a system-defined color with the value R:0 G:206 B:209 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color DarkTurquoise { get; }
Property Value
A system-defined color with the value R:0 G:206 B:209 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.DarkViolet Property
Gets a system-defined color with the value R:148 G:0 B:211 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color DarkViolet { get; }
Property Value
A system-defined color with the value R:148 G:0 B:211 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.DeepPink Property
Gets a system-defined color with the value R:255 G:20 B:147 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color DeepPink { get; }
Property Value
A system-defined color with the value R:255 G:20 B:147 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.DeepSkyBlue Property
Gets a system-defined color with the value R:0 G:191 B:255 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color DeepSkyBlue { get; }
Property Value
A system-defined color with the value R:0 G:191 B:255 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.DimGray Property
Gets a system-defined color with the value R:105 G:105 B:105 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color DimGray { get; }
Property Value
A system-defined color with the value R:105 G:105 B:105 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.DodgerBlue Property
Gets a system-defined color with the value R:30 G:144 B:255 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color DodgerBlue { get; }
Property Value
A system-defined color with the value R:30 G:144 B:255 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Firebrick Property
Gets a system-defined color with the value R:178 G:34 B:34 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Firebrick { get; }
Property Value
A system-defined color with the value R:178 G:34 B:34 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.FloralWhite Property
Gets a system-defined color with the value R:255 G:250 B:240 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color FloralWhite { get; }
Property Value
A system-defined color with the value R:255 G:250 B:240 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.ForestGreen Property
Gets a system-defined color with the value R:34 G:139 B:34 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color ForestGreen { get; }
Property Value
A system-defined color with the value R:34 G:139 B:34 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Fuchsia Property
Gets a system-defined color with the value R:255 G:0 B:255 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Fuchsia { get; }
Property Value
A system-defined color with the value R:255 G:0 B:255 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.G Property
Gets the green component value of this Color.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public byte G { get; }
Property Value
The green component value of this Color.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Gainsboro Property
Gets a system-defined color with the value R:220 G:220 B:220 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Gainsboro { get; }
Property Value
A system-defined color with the value R:220 G:220 B:220 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.GhostWhite Property
Gets a system-defined color with the value R:248 G:248 B:255 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color GhostWhite { get; }
Property Value
A system-defined color with the value R:248 G:248 B:255 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Gold Property
Gets a system-defined color with the value R:255 G:215 B:0 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Gold { get; }
Property Value
A system-defined color with the value R:255 G:215 B:0 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Goldenrod Property
Gets a system-defined color with the value R:218 G:165 B:32 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Goldenrod { get; }
Property Value
A system-defined color with the value R:218 G:165 B:32 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Gray Property
Gets a system-defined color with the value R:128 G:128 B:128 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Gray { get; }
Property Value
A system-defined color with the value R:128 G:128 B:128 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Green Property
Gets a system-defined color with the value R:0 G:128 B:0 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Green { get; }
Property Value
A system-defined color with the value R:0 G:128 B:0 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.GreenYellow Property
Gets a system-defined color with the value R:173 G:255 B:47 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color GreenYellow { get; }
Property Value
A system-defined color with the value R:173 G:255 B:47 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Honeydew Property
Gets a system-defined color with the value R:240 G:255 B:240 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Honeydew { get; }
Property Value
A system-defined color with the value R:240 G:255 B:240 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.HotPink Property
Gets a system-defined color with the value R:255 G:105 B:180 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color HotPink { get; }
Property Value
A system-defined color with the value R:255 G:105 B:180 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.IndianRed Property
Gets a system-defined color with the value R:205 G:92 B:92 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color IndianRed { get; }
Property Value
A system-defined color with the value R:205 G:92 B:92 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Indigo Property
Gets a system-defined color with the value R:75 G:0 B:130 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Indigo { get; }
Property Value
A system-defined color with the value R:75 G:0 B:130 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Ivory Property
Gets a system-defined color with the value R:255 G:255 B:240 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Ivory { get; }
Property Value
A system-defined color with the value R:255 G:255 B:240 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Khaki Property
Gets a system-defined color with the value R:240 G:230 B:140 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Khaki { get; }
Property Value
A system-defined color with the value R:240 G:230 B:140 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Lavender Property
Gets a system-defined color with the value R:230 G:230 B:250 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Lavender { get; }
Property Value
A system-defined color with the value R:230 G:230 B:250 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.LavenderBlush Property
Gets a system-defined color with the value R:255 G:240 B:245 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color LavenderBlush { get; }
Property Value
A system-defined color with the value R:255 G:240 B:245 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.LawnGreen Property
Gets a system-defined color with the value R:124 G:252 B:0 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color LawnGreen { get; }
Property Value
A system-defined color with the value R:124 G:252 B:0 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.LemonChiffon Property
Gets a system-defined color with the value R:255 G:250 B:205 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color LemonChiffon { get; }
Property Value
A system-defined color with the value R:255 G:250 B:205 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.LightBlue Property
Gets a system-defined color with the value R:173 G:216 B:230 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color LightBlue { get; }
Property Value
A system-defined color with the value R:173 G:216 B:230 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.LightCoral Property
Gets a system-defined color with the value R:240 G:128 B:128 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color LightCoral { get; }
Property Value
A system-defined color with the value R:240 G:128 B:128 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.LightCyan Property
Gets a system-defined color with the value R:224 G:255 B:255 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color LightCyan { get; }
Property Value
A system-defined color with the value R:224 G:255 B:255 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.LightGoldenrodYellow Property
Gets a system-defined color with the value R:250 G:250 B:210 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color LightGoldenrodYellow { get; }
Property Value
A system-defined color with the value R:250 G:250 B:210 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.LightGray Property
Gets a system-defined color with the value R:211 G:211 B:211 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color LightGray { get; }
Property Value
A system-defined color with the value R:211 G:211 B:211 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.LightGreen Property
Gets a system-defined color with the value R:144 G:238 B:144 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color LightGreen { get; }
Property Value
A system-defined color with the value R:144 G:238 B:144 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.LightPink Property
Gets a system-defined color with the value R:255 G:182 B:193 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color LightPink { get; }
Property Value
A system-defined color with the value R:255 G:182 B:193 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.LightSalmon Property
Gets a system-defined color with the value R:255 G:160 B:122 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color LightSalmon { get; }
Property Value
A system-defined color with the value R:255 G:160 B:122 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.LightSeaGreen Property
Gets a system-defined color with the value R:32 G:178 B:170 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color LightSeaGreen { get; }
Property Value
A system-defined color with the value R:32 G:178 B:170 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.LightSkyBlue Property
Gets a system-defined color with the value R:135 G:206 B:250 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color LightSkyBlue { get; }
Property Value
A system-defined color with the value R:135 G:206 B:250 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.LightSlateGray Property
Gets a system-defined color with the value R:119 G:136 B:153 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color LightSlateGray { get; }
Property Value
A system-defined color with the value R:119 G:136 B:153 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.LightSteelBlue Property
Gets a system-defined color with the value R:176 G:196 B:222 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color LightSteelBlue { get; }
Property Value
A system-defined color with the value R:176 G:196 B:222 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.LightYellow Property
Gets a system-defined color with the value R:255 G:255 B:224 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color LightYellow { get; }
Property Value
A system-defined color with the value R:255 G:255 B:224 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Lime Property
Gets a system-defined color with the value R:0 G:255 B:0 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Lime { get; }
Property Value
A system-defined color with the value R:0 G:255 B:0 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.LimeGreen Property
Gets a system-defined color with the value R:50 G:205 B:50 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color LimeGreen { get; }
Property Value
A system-defined color with the value R:50 G:205 B:50 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Linen Property
Gets a system-defined color with the value R:250 G:240 B:230 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Linen { get; }
Property Value
A system-defined color with the value R:250 G:240 B:230 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Magenta Property
Gets a system-defined color with the value R:255 G:0 B:255 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Magenta { get; }
Property Value
A system-defined color with the value R:255 G:0 B:255 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Maroon Property
Gets a system-defined color with the value R:128 G:0 B:0 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Maroon { get; }
Property Value
A system-defined color with the value R:128 G:0 B:0 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.MediumAquamarine Property
Gets a system-defined color with the value R:102 G:205 B:170 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color MediumAquamarine { get; }
Property Value
A system-defined color with the value R:102 G:205 B:170 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.MediumBlue Property
Gets a system-defined color with the value R:0 G:0 B:205 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color MediumBlue { get; }
Property Value
A system-defined color with the value R:0 G:0 B:205 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.MediumOrchid Property
Gets a system-defined color with the value R:186 G:85 B:211 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color MediumOrchid { get; }
Property Value
A system-defined color with the value R:186 G:85 B:211 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.MediumPurple Property
Gets a system-defined color with the value R:147 G:112 B:219 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color MediumPurple { get; }
Property Value
A system-defined color with the value R:147 G:112 B:219 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.MediumSeaGreen Property
Gets a system-defined color with the value R:60 G:179 B:113 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color MediumSeaGreen { get; }
Property Value
A system-defined color with the value R:60 G:179 B:113 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.MediumSlateBlue Property
Gets a system-defined color with the value R:123 G:104 B:238 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color MediumSlateBlue { get; }
Property Value
A system-defined color with the value R:123 G:104 B:238 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.MediumSpringGreen Property
Gets a system-defined color with the value R:0 G:250 B:154 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color MediumSpringGreen { get; }
Property Value
A system-defined color with the value R:0 G:250 B:154 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.MediumTurquoise Property
Gets a system-defined color with the value R:72 G:209 B:204 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color MediumTurquoise { get; }
Property Value
A system-defined color with the value R:72 G:209 B:204 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.MediumVioletRed Property
Gets a system-defined color with the value R:199 G:21 B:133 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color MediumVioletRed { get; }
Property Value
A system-defined color with the value R:199 G:21 B:133 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.MidnightBlue Property
Gets a system-defined color with the value R:25 G:25 B:112 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color MidnightBlue { get; }
Property Value
A system-defined color with the value R:25 G:25 B:112 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.MintCream Property
Gets a system-defined color with the value R:245 G:255 B:250 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color MintCream { get; }
Property Value
A system-defined color with the value R:245 G:255 B:250 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.MistyRose Property
Gets a system-defined color with the value R:255 G:228 B:225 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color MistyRose { get; }
Property Value
A system-defined color with the value R:255 G:228 B:225 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Moccasin Property
Gets a system-defined color with the value R:255 G:228 B:181 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Moccasin { get; }
Property Value
A system-defined color with the value R:255 G:228 B:181 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.NavajoWhite Property
Gets a system-defined color with the value R:255 G:222 B:173 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color NavajoWhite { get; }
Property Value
A system-defined color with the value R:255 G:222 B:173 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Navy Property
Gets a system-defined color R:0 G:0 B:128 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Navy { get; }
Property Value
A system-defined color R:0 G:0 B:128 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.OldLace Property
Gets a system-defined color with the value R:253 G:245 B:230 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color OldLace { get; }
Property Value
A system-defined color with the value R:253 G:245 B:230 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Olive Property
Gets a system-defined color with the value R:128 G:128 B:0 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Olive { get; }
Property Value
A system-defined color with the value R:128 G:128 B:0 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.OliveDrab Property
Gets a system-defined color with the value R:107 G:142 B:35 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color OliveDrab { get; }
Property Value
A system-defined color with the value R:107 G:142 B:35 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Orange Property
Gets a system-defined color with the value R:255 G:165 B:0 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Orange { get; }
Property Value
A system-defined color with the value R:255 G:165 B:0 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.OrangeRed Property
Gets a system-defined color with the value R:255 G:69 B:0 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color OrangeRed { get; }
Property Value
A system-defined color with the value R:255 G:69 B:0 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Orchid Property
Gets a system-defined color with the value R:218 G:112 B:214 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Orchid { get; }
Property Value
A system-defined color with the value R:218 G:112 B:214 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.PackedValue Property
Gets the current color as a packed value.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[CLSCompliantAttribute(false)]
public UInt32 PackedValue { get; set; }
Property Value
The current color.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.PaleGoldenrod Property
Gets a system-defined color with the value R:238 G:232 B:170 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color PaleGoldenrod { get; }
Property Value
A system-defined color with the value R:238 G:232 B:170 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.PaleGreen Property
Gets a system-defined color with the value R:152 G:251 B:152 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color PaleGreen { get; }
Property Value
A system-defined color with the value R:152 G:251 B:152 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.PaleTurquoise Property
Gets a system-defined color with the value R:175 G:238 B:238 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color PaleTurquoise { get; }
Property Value
A system-defined color with the value R:175 G:238 B:238 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.PaleVioletRed Property
Gets a system-defined color with the value R:219 G:112 B:147 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color PaleVioletRed { get; }
Property Value
A system-defined color with the value R:219 G:112 B:147 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.PapayaWhip Property
Gets a system-defined color with the value R:255 G:239 B:213 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color PapayaWhip { get; }
Property Value
A system-defined color with the value R:255 G:239 B:213 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.PeachPuff Property
Gets a system-defined color with the value R:255 G:218 B:185 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color PeachPuff { get; }
Property Value
A system-defined color with the value R:255 G:218 B:185 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Peru Property
Gets a system-defined color with the value R:205 G:133 B:63 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Peru { get; }
Property Value
A system-defined color with the value R:205 G:133 B:63 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Pink Property
Gets a system-defined color with the value R:255 G:192 B:203 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Pink { get; }
Property Value
A system-defined color with the value R:255 G:192 B:203 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Plum Property
Gets a system-defined color with the value R:221 G:160 B:221 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Plum { get; }
Property Value
A system-defined color with the value R:221 G:160 B:221 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.PowderBlue Property
Gets a system-defined color with the value R:176 G:224 B:230 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color PowderBlue { get; }
Property Value
A system-defined color with the value R:176 G:224 B:230 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Purple Property
Gets a system-defined color with the value R:128 G:0 B:128 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Purple { get; }
Property Value
A system-defined color with the value R:128 G:0 B:128 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.R Property
Gets the red component value of this Color.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public byte R { get; }
Property Value
The red component value of this Color.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Red Property
Gets a system-defined color with the value R:255 G:0 B:0 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Red { get; }
Property Value
A system-defined color with the value R:255 G:0 B:0 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.RosyBrown Property
Gets a system-defined color with the value R:188 G:143 B:143 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color RosyBrown { get; }
Property Value
A system-defined color with the value R:188 G:143 B:143 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.RoyalBlue Property
Gets a system-defined color with the value R:65 G:105 B:225 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color RoyalBlue { get; }
Property Value
A system-defined color with the value R:65 G:105 B:225 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.SaddleBrown Property
Gets a system-defined color with the value R:139 G:69 B:19 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color SaddleBrown { get; }
Property Value
A system-defined color with the value R:139 G:69 B:19 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Salmon Property
Gets a system-defined color with the value R:250 G:128 B:114 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Salmon { get; }
Property Value
A system-defined color with the value R:250 G:128 B:114 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.SandyBrown Property
Gets a system-defined color with the value R:244 G:164 B:96 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color SandyBrown { get; }
Property Value
A system-defined color with the value R:244 G:164 B:96 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.SeaGreen Property
Gets a system-defined color with the value R:46 G:139 B:87 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color SeaGreen { get; }
Property Value
A system-defined color with the value R:46 G:139 B:87 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.SeaShell Property
Gets a system-defined color with the value R:255 G:245 B:238 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color SeaShell { get; }
Property Value
A system-defined color with the value R:255 G:245 B:238 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Sienna Property
Gets a system-defined color with the value R:160 G:82 B:45 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Sienna { get; }
Property Value
A system-defined color with the value R:160 G:82 B:45 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Silver Property
Gets a system-defined color with the value R:192 G:192 B:192 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Silver { get; }
Property Value
A system-defined color with the value R:192 G:192 B:192 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.SkyBlue Property
Gets a system-defined color with the value R:135 G:206 B:235 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color SkyBlue { get; }
Property Value
A system-defined color with the value R:135 G:206 B:235 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.SlateBlue Property
Gets a system-defined color with the value R:106 G:90 B:205 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color SlateBlue { get; }
Property Value
A system-defined color with the value R:106 G:90 B:205 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.SlateGray Property
Gets a system-defined color with the value R:112 G:128 B:144 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color SlateGray { get; }
Property Value
A system-defined color with the value R:112 G:128 B:144 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Snow Property
Gets a system-defined color with the value R:255 G:250 B:250 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Snow { get; }
Property Value
A system-defined color with the value R:255 G:250 B:250 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.SpringGreen Property
Gets a system-defined color with the value R:0 G:255 B:127 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color SpringGreen { get; }
Property Value
A system-defined color with the value R:0 G:255 B:127 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.SteelBlue Property
Gets a system-defined color with the value R:70 G:130 B:180 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color SteelBlue { get; }
Property Value
A system-defined color with the value R:70 G:130 B:180 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Tan Property
Gets a system-defined color with the value R:210 G:180 B:140 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Tan { get; }
Property Value
A system-defined color with the value R:210 G:180 B:140 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Teal Property
Gets a system-defined color with the value R:0 G:128 B:128 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Teal { get; }
Property Value
A system-defined color with the value R:0 G:128 B:128 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Thistle Property
Gets a system-defined color with the value R:216 G:191 B:216 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Thistle { get; }
Property Value
A system-defined color with the value R:216 G:191 B:216 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Tomato Property
Gets a system-defined color with the value R:255 G:99 B:71 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Tomato { get; }
Property Value
A system-defined color with the value R:255 G:99 B:71 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.TransparentBlack Property
Gets a system-defined color with the value R:0 G:0 B:0 A:0.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color TransparentBlack { get; }
Property Value
A system-defined color with the value R:0 G:0 B:0 A:0.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.TransparentWhite Property
Gets a system-defined color with the value R:255 G:255 B:255 A:0.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color TransparentWhite { get; }
Property Value
A system-defined color with the value R:255 G:255 B:255 A:0.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Turquoise Property
Gets a system-defined color with the value R:64 G:224 B:208 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Turquoise { get; }
Property Value
A system-defined color with the value R:64 G:224 B:208 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Violet Property
Gets a system-defined color with the value R:238 G:130 B:238 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Violet { get; }
Property Value
A system-defined color with the value R:238 G:130 B:238 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Wheat Property
Gets a system-defined color with the value R:245 G:222 B:179 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Wheat { get; }
Property Value
A system-defined color with the value R:245 G:222 B:179 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.White Property
Gets a system-defined color with the value R:255 G:255 B:255 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color White { get; }
Property Value
A system-defined color with the value R:255 G:255 B:255 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.WhiteSmoke Property
Gets a system-defined color with the value R:245 G:245 B:245 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color WhiteSmoke { get; }
Property Value
A system-defined color with the value R:245 G:245 B:245 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.Yellow Property
Gets a system-defined color with the value R:255 G:255 B:0 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color Yellow { get; }
Property Value
A system-defined color with the value R:255 G:255 B:0 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Color.YellowGreen Property
Gets a system-defined color with the value R:154 G:205 B:50 A:255.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static Color YellowGreen { get; }
Property Value
A system-defined color with the value R:154 G:205 B:50 A:255.
See Also
Reference
Color Structure
Color Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ColorWriteChannels Enumeration
Defines the color channels that can be chosen for a per-channel write to a render target color buffer.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[FlagsAttribute]
public enum ColorWriteChannels
Members
Member name Description
All All buffer channels.
Alpha Alpha channel of a buffer.
Blue Blue channel of a buffer.
Green Green channel of a buffer.
None No channel selected.
Red Red channel of a buffer.
See Also
Reference
RenderState.ColorWriteChannels Property
RenderState.ColorWriteChannels1 Property
RenderState.ColorWriteChannels2 Property
RenderState.ColorWriteChannels3 Property
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompareFunction Enumeration
Defines comparison functions that can be chosen for alpha, stencil, or depth-buffer tests.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum CompareFunction
Members
Member name Description
Always Always pass the test.
Equal Accept the new pixel if its value is equal to the value of the current pixel.
Greater Accept the new pixel if its value is greater than the value of the current pixel.
GreaterEqual Accept the new pixel if its value is greater than or equal to the value of the current pixel.
Less Accept the new pixel if its value is less than the value of the current pixel.
LessEqual Accept the new pixel if its value is less than or equal to the value of the current pixel.
Never Always fail the test.
NotEqual Accept the new pixel if its value does not equal the value of the current pixel.
See Also
Reference
AlphaFunction
CounterClockwiseStencilFunction
DepthBufferFunction
StencilFunction
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompilationFailedException Class
The exception that is thrown if the compilation of an effect fails.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public sealed class CompilationFailedException : ExternalException
See Also
Reference
CompilationFailedException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompilationFailedException Members
The following tables list the members exposed by the CompilationFailedException type.
Public Constructors
Name Description
CompilationFailedException Overloaded. Initializes a new instance of the CompilationFailedException class.
Public Properties
Name Description
Data (Inherited from Exception.)
ErrorCode (Inherited from ExternalException.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
CompilationFailedException Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
CompilationFailedException Constructor
Initializes a new instance of the CompilationFailedException class.
Overload List
Name Description
CompilationFailedException () Initializes a new instance of this class.
CompilationFailedException (String) Initializes a new instance of this class with a specified error message.
CompilationFailedException (String, Exception) Initializes a new instance of the CompilationFailedException class with a specifi
ed error message and a reference to the inner exception that is the cause of this
exception. .
See Also
Reference
CompilationFailedException Class
CompilationFailedException Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
CompilationFailedException Constructor ()
Initializes a new instance of this class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public CompilationFailedException ()
See Also
Reference
CompilationFailedException Class
CompilationFailedException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
message
A message that describes the error.
Remarks
The content of the message parameter is intended to be understood by humans. The caller of this constructor is required to
ensure that this string has been localized for the current system culture.
The following table shows the initial property values for an instance of CompilationFailedException.
Property Value
InnerException A null reference.
Message The localized error message string.
See Also
Reference
CompilationFailedException Class
CompilationFailedException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
message
A message that describes the error.
inner
The exception that is the cause of the current exception. If the inner parameter is not a null reference, the current exception is
raised in a catch block that handles the inner exception.
Remarks
The content of the message parameter is intended to be understood by humans. The caller of this constructor is required to
ensure that this string has been localized for the current system culture.
An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in
the InnerException property. The InnerException property returns the same value that is passed into the constructor, or a null
reference if the InnerException property does not supply the inner exception value to the constructor.
The following table shows the initial property values for an instance of CompilationFailedException.
Property Value
InnerException A null reference.
Message The localized error message string.
See Also
Reference
CompilationFailedException Class
CompilationFailedException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompilationFailedException Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
CompilationFailedException Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
CompilationFailedException Properties
Public Properties
Name Description
Data (Inherited from Exception.)
ErrorCode (Inherited from ExternalException.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
See Also
Reference
CompilationFailedException Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
CompiledEffect Structure
Represents a compiled Effect.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public struct CompiledEffect
See Also
Reference
CompiledEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompiledEffect Members
The following tables list the members exposed by the CompiledEffect type.
Public Constructors
Name Description
CompiledEffect Creates a new instance of the CompiledEffect class.
Public Properties
Name Description
ErrorsAndWarnings Gets any errors and warnings generated by compiling the effect.
Success Indicates whether the effect was compiled successfully.
Public Methods
Name Description
Equals (Inherited from Object.)
GetEffectCode Gets the compiled byte code for this shader.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
CompiledEffect Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
CompiledEffect Constructor
Creates a new instance of the CompiledEffect class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public CompiledEffect (
byte[] compiledEffectCode,
string errors
)
Parameters
compiledEffectCode
The compiled effect code.
errors
A string to receive compilation errors, if any.
See Also
Reference
Effect.CompileEffectFromFile Method
Effect.CompileEffectFromSource Method
CompiledEffect Structure
CompiledEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompiledEffect Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetEffectCode Gets the compiled byte code for this shader.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
CompiledEffect Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
CompiledEffect.GetEffectCode Method
Gets the compiled byte code for this shader.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public byte[] GetEffectCode ()
Return Value
The compiled bytecode.
See Also
Reference
CompiledEffect Structure
CompiledEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompiledEffect.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
CompiledEffect Structure
CompiledEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompiledEffect Properties
Public Properties
Name Description
ErrorsAndWarnings Gets any errors and warnings generated by compiling the effect.
Success Indicates whether the effect was compiled successfully.
See Also
Reference
CompiledEffect Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
CompiledEffect.ErrorsAndWarnings Property
Gets any errors and warnings generated by compiling the effect.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string ErrorsAndWarnings { get; }
Property Value
A string containing errors and warnings from compiling the effect.
See Also
Reference
CompiledEffect Structure
CompiledEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompiledEffect.Success Property
Indicates whether the effect was compiled successfully.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool Success { get; }
Property Value
true if the effect was compiled successfully; false otherwise.
See Also
Reference
CompiledEffect Structure
CompiledEffect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompiledShader Structure
Represents a compiled shader.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public struct CompiledShader
See Also
Reference
CompiledShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompiledShader Members
The following tables list the members exposed by the CompiledShader type.
Public Constructors
Name Description
CompiledShader Initializes a new instance of the CompiledShader class.
Public Properties
Name Description
ErrorsAndWarnings Gets the first compile error message that occurred.
ShaderSize Gets the size of the shader byte code, in bytes.
ShaderVersion Gets the shader version of the compiled shader.
Success Returns a value indicating whether the shader compilation was successful.
Public Methods
Name Description
Equals (Inherited from Object.)
GetInputSemantics Gets the semantics for the shader inputs. Use this method to determine the input vertex format.
GetOutputSemantics Gets the semantics for all shader output elements.
GetSamplers Gets the sampler names referenced in a shader.
GetShaderCode Gets the compiled shader code.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Returns a String that represents the current CompiledShader.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
CompiledShader Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
CompiledShader Constructor
Initializes a new instance of the CompiledShader class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public CompiledShader (
byte[] compiledShaderCode,
string errors
)
Parameters
compiledShaderCode
The compiled shader to encapsulate.
errors
String containing at least the first compile error message that occurred. This includes effect compiler errors and high-level
language compile errors.
See Also
Reference
CompiledShader Structure
CompiledShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompiledShader Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetInputSemantics Gets the semantics for the shader inputs. Use this method to determine the input vertex format.
GetOutputSemantics Gets the semantics for all shader output elements.
GetSamplers Gets the sampler names referenced in a shader.
GetShaderCode Gets the compiled shader code.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Returns a String that represents the current CompiledShader.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
CompiledShader Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
CompiledShader.GetInputSemantics Method
Gets the semantics for the shader inputs. Use this method to determine the input vertex format.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ShaderSemantic[] GetInputSemantics ()
Return Value
An array of shader semantics.
See Also
Reference
CompiledShader Structure
CompiledShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompiledShader.GetOutputSemantics Method
Gets the semantics for all shader output elements.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ShaderSemantic[] GetOutputSemantics ()
Return Value
An array of shader semantics.
See Also
Reference
CompiledShader Structure
CompiledShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompiledShader.GetSamplers Method
Gets the sampler names referenced in a shader.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string[] GetSamplers ()
Return Value
An array of sampler names.
See Also
Reference
CompiledShader Structure
CompiledShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompiledShader.GetShaderCode Method
Gets the compiled shader code.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public byte[] GetShaderCode ()
Return Value
The compiled shader code.
See Also
Reference
CompiledShader Structure
CompiledShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompiledShader.ToString Method
Returns a String that represents the current CompiledShader.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
A String that represents the current CompiledShader.
See Also
Reference
CompiledShader Structure
CompiledShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompiledShader Properties
Public Properties
Name Description
ErrorsAndWarnings Gets the first compile error message that occurred.
ShaderSize Gets the size of the shader byte code, in bytes.
ShaderVersion Gets the shader version of the compiled shader.
Success Returns a value indicating whether the shader compilation was successful.
See Also
Reference
CompiledShader Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
CompiledShader.ErrorsAndWarnings Property
Gets the first compile error message that occurred.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string ErrorsAndWarnings { get; }
Property Value
The first compile error message that occurred. This includes effect compiler errors and high-level language compile errors.
See Also
Reference
CompiledShader Structure
CompiledShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompiledShader.ShaderSize Property
Gets the size of the shader byte code, in bytes.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int ShaderSize { get; }
Property Value
The size of the shader byte code, in bytes.
See Also
Reference
CompiledShader Structure
CompiledShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompiledShader.ShaderVersion Property
Gets the shader version of the compiled shader.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Version ShaderVersion { get; }
Property Value
The shader version of the compiled shader.
See Also
Reference
CompiledShader Structure
CompiledShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompiledShader.Success Property
Returns a value indicating whether the shader compilation was successful.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool Success { get; }
Property Value
true if the shader compilation succeeds; false otherwise.
See Also
Reference
CompiledShader Structure
CompiledShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompilerIncludeHandler Class
The abstract base class for custom compiler include file handlers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public abstract class CompilerIncludeHandler : IDisposable
See Also
Reference
CompilerIncludeHandler Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompilerIncludeHandler Members
The following tables list the members exposed by the CompilerIncludeHandler type.
Public Constructors
Name Description
CompilerIncludeHandler Initializes a new instance of this class.
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
Open Returns a Stream containing include data from a specified file.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
See Also
Reference
CompilerIncludeHandler Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
CompilerIncludeHandler Constructor
Initializes a new instance of this class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public CompilerIncludeHandler ()
See Also
Reference
CompilerIncludeHandler Class
CompilerIncludeHandler Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompilerIncludeHandler Methods
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
Open Returns a Stream containing include data from a specified file.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
See Also
Reference
CompilerIncludeHandler Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
CompilerIncludeHandler.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
CompilerIncludeHandler.Dispose () Immediately releases the unmanaged resources used by this object.
CompilerIncludeHandler.Dispose (Boolean) Immediately releases the unmanaged resources used by this object.
See Also
Reference
CompilerIncludeHandler Class
CompilerIncludeHandler Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
CompilerIncludeHandler.Dispose Method ()
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
See Also
Reference
CompilerIncludeHandler Class
CompilerIncludeHandler Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
[MarshalAsAttribute(U1)] This parameter marshals as an unsigned byte.
See Also
Reference
CompilerIncludeHandler Class
CompilerIncludeHandler Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompilerIncludeHandler.Finalize Method
Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the
object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void Finalize ()
See Also
Reference
CompilerIncludeHandler Class
CompilerIncludeHandler Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompilerIncludeHandler.Open Method
Returns a Stream containing include data from a specified file.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public abstract Stream Open (
CompilerIncludeHandlerType includeType,
string filename
)
Parameters
includeType
A CompilerIncludeHandlerType indicating whether the file is a local or system resource.
filename
The file name of the file to open.
Return Value
A Stream of compiler include data.
See Also
Reference
CompilerIncludeHandler Class
CompilerIncludeHandler Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompilerIncludeHandlerType Enumeration
Identifies an include file as a local or system resource.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum CompilerIncludeHandlerType
Members
Member name Description
Local A local resource.
System A system resource.
See Also
Reference
CompilerIncludeHandler.Open Method
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompilerMacro Structure
Represents a compiler macro.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public struct CompilerMacro
See Also
Reference
CompilerMacro Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompilerMacro Members
The following tables list the members exposed by the CompilerMacro type.
Public Properties
Name Description
Definition Gets or sets the macro definition.
Name Gets or sets the macro name.
Public Methods
Name Description
Equals (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
CompilerMacro Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
CompilerMacro Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
CompilerMacro Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
CompilerMacro.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
CompilerMacro Structure
CompilerMacro Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompilerMacro Properties
Public Properties
Name Description
Definition Gets or sets the macro definition.
Name Gets or sets the macro name.
See Also
Reference
CompilerMacro Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
CompilerMacro.Definition Property
Gets or sets the macro definition.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Definition { get; set; }
Property Value
The definition of the macro.
See Also
Reference
CompilerMacro Structure
CompilerMacro Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompilerMacro.Name Property
Gets or sets the macro name.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Name { get; set; }
Property Value
The name of the macro.
See Also
Reference
CompilerMacro Structure
CompilerMacro Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CompilerOptions Enumeration
Defines optimization options that may be chosen for shader and effect code compilation.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[FlagsAttribute]
public enum CompilerOptions
Members
Member name Description
AvoidFlowCont Hints to the compiler to avoid using flow-control instructions.
rol
Debug Inserts debug file name, line numbers, and type and symbol information during shader compile.
ForcePixelShad Forces the compiler to compile against the next highest available software target for pixel shaders. This flag
erSoftwareNoO also turns optimizations off and debugging on.
ptimizations
ForceVertexSha Forces the compiler to compile against the next highest available software target for vertex shaders. This fla
derSoftwareNo g also turns optimizations off and debugging on.
Optimizations
None No options specified.
NoPreShader Disables preshaders. The compiler will not pull out static expressions for evaluation on the host CPU. Additi
onally, the compiler will not loft any expressions when compiling stand-alone functions.
NotCloneable Indicates the effect will be non-cloneable and will not contain any shader binary data. Setting this flag reduc
es effect memory usage by about 50 percent because it eliminates the need for the effect system to keep a
copy of the shaders in memory.
PackMatrixCol Unless explicitly specified, matrices will be packed in column major order (each vector will be in a single col
umnMajor umn) when passed to and from the shader. This is generally more efficient because it allows vector-matrix
multiplication to be performed using a series of dot products.
PackMatrixRow Unless explicitly specified, matrices will be packed in row major order (each vector will be in a single row) w
Major hen passed to or from the shader.
PartialPrecision Forces all computations in the resulting shader to occur at partial precision. This may result in faster evaluat
ion of shaders on some hardware.
PreferFlowCont Hints to the compiler to prefer using flow-control instructions.
rol
SkipOptimizati Instructs the compiler to skip optimization steps during code generation. Unless you are trying to isolate a
on problem in your code and you suspect the compiler, using this option is not recommended.
SkipValidation Do not validate the generated code against known capabilities and constraints. This option is recommended
only when compiling shaders that are known to work (that is, shaders that have compiled before without th
is option). Shaders are always validated by the runtime before they are set to the device.
See Also
Reference
Effect Constructor
Effect.CompileEffectFromFile Method
Effect.CompileEffectFromSource Method
ShaderCompiler.AssembleFromFile Method
ShaderCompiler.AssembleFromSource Method
ShaderCompiler.CompileFromFile Method
ShaderCompiler.CompileFromSource Method
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CubeMapFace Enumeration
Defines the faces of a cube map in the TextureCube class type.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum CubeMapFace
Members
Member name Description
NegativeX Negative x-face of the cube map.
NegativeY Negative y-face of the cube map.
NegativeZ Negative z-face of the cube map.
PositiveX Positive x-face of the cube map.
PositiveY Positive y-face of the cube map.
PositiveZ Positive z-face of the cube map.
See Also
Reference
TextureCube.GetData Method
TextureCube.SetData Method
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
CullMode Enumeration
Defines winding orders that may be used to identify back faces for culling.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum CullMode
Members
Member name Description
CullClockwiseFace Cull back faces with clockwise vertices.
CullCounterClockwiseFace Cull back faces with counterclockwise vertices.
None Do not cull back faces.
See Also
Reference
RenderState.CullMode Property
RenderState.TwoSidedStencilMode Property
GraphicsDeviceCapabilities.PrimitiveCaps.SupportsCullClockwiseFace Property
GraphicsDeviceCapabilities.PrimitiveCaps.SupportsCullCounterClockwiseFace Property
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DepthFormat Enumeration
Defines the format of data in a depth buffer.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum DepthFormat
Members
Member name Description
Depth15Stencil1 A 16-bit depth-buffer bit depth in which 15 bits are reserved for the depth channel and 1 bit is reserved
for the stencil channel.
Depth16 A 16-bit depth-buffer bit depth.
Depth24 A 32-bit depth-buffer bit depth that uses 24 bits for the depth channel.
Depth24Stencil4 A 32-bit depth-buffer bit depth that uses 24 bits for the depth channel and 4 bits for the stencil channel.
Depth24Stencil8 A non-lockable format that contains 24 bits of depth (in a 24-bit floating-point format − 20E4) and 8 bit
s of stencil.
Depth24Stencil8Si A 32-bit depth-buffer bit depth that uses 24 bits for the depth channel and 8 bits for the stencil channel.
ngle
Depth32 a 32-bit depth-buffer bit depth.
Unknown Format is unknown.
RemarksAll depth-stencil formats except Depth16Lockable indicate no particular bit ordering per pixel, and the driver is
allowed to consume more than the indicated number of bits per depth channel (but not stencil channel).
See Also
Concepts
What Is a Depth Buffer?
What Is a Stencil Buffer?
Tasks
How To: Create a Depth Texture
Reference
CheckDepthStencilMatch
CheckDeviceFormat
AutoDepthStencilFormat
PresentOptions
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DepthStencilBuffer Class
Queries and prepares depth stencil buffers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class DepthStencilBuffer : IDisposable
Remarks
A depth stencil buffer is where depth and stencil data are kept for a render target. The depth buffer is used to determine which
3D objects appear behind other 3D objects; the stencil buffer is used for special effects. Depth stencil buffers are often created
at the same time render targets are created. Depth stencil buffers must be recreated when the device is reset. The
DepthStencilBuffer property on GraphicsDevice points to the current DepthStencilBuffer.
To use a DepthStencilBuffer, you must:
1. Create the DepthStencilBuffer.
C#
shadowDepthBuffer = GfxComponent.CreateDepthStencil(shadowRenderTarget,
DepthFormat.Depth24Stencil8Single);
C#
public static DepthStencilBuffer CreateDepthStencil(RenderTarget2D target)
{
return new DepthStencilBuffer(target.GraphicsDevice, target.Width,
target.Height, target.GraphicsDevice.DepthStencilBuffer.Format,
target.MultiSampleType, target.MultiSampleQuality);
}
public static DepthStencilBuffer CreateDepthStencil(RenderTarget2D target, DepthFormat
depth)
{
if (GraphicsAdapter.DefaultAdapter.CheckDepthStencilMatch(DeviceType.Hardware,
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Format, target.Format,
depth))
{
return new DepthStencilBuffer(target.GraphicsDevice, target.Width,
target.Height, depth, target.MultiSampleType, target.MultiSampleQuality);
}
else
return CreateDepthStencil(target);
}
2. Set the DepthStencilBuffer using DepthStencilBuffer. It is a good idea to cache the current DepthStencilBuffer
beforehand.
C#
// Cache the current depth buffer
DepthStencilBuffer old = GraphicsDevice.DepthStencilBuffer;
// Set our custom depth buffer
GraphicsDevice.DepthStencilBuffer = shadowDepthBuffer;
Custom depth stencil buffers are normally used in conjunction with a custom RenderTarget. How To: Create a Depth Texture
has an example of this.
See Also
Concepts
What Is a Depth Buffer?
What Is a Stencil Buffer?
Tasks
How To: Load Content
How To: Draw a Shadow
How To: Create a Depth Texture
How To: Implement Shadow Mapping
Reference
DepthStencilBuffer
RenderTarget
GraphicsDeviceManager.DeviceReset Event
DepthStencilBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DepthStencilBuffer Members
The following tables list the members exposed by the DepthStencilBuffer type.
Public Constructors
Name Description
DepthStencilBuffer Overloaded. Initializes a new instance of the DepthStencilBuffer class.
Public Properties
Name Description
Format Gets the data format of this depth stencil buffer.
GraphicsDevice Gets the graphics device associated with this depth stencil buffer.
Height Gets the height, in pixels, of the surface.
IsContentLost Determines if the buffer data has been lost due to a lost device event.
IsDisposed Gets a value that indicates whether the object is disposed.
MultiSampleQuality Gets the number of quality stops available for a given multisample type.
MultiSampleType Gets the levels of full-scene multisampling that the device can apply.
Name Gets the name of this depth stencil buffer.
Tag Gets the resource tag for this depth stencil buffer.
Width Returns the width, in pixels, of this DepthStencilBuffer.
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_ContentLost Occurs when content is about to be lost on a GraphicsDevice.
raise_Disposing Raises the Disposing event when called from within a derived class.
Public Events
Name Description
ContentLost Occurs when resources are lost (for example, when the current device is lost).
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micr
osoft .NET common language runtime (CLR).
See Also
Reference
DepthStencilBuffer Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DepthStencilBuffer Constructor
Initializes a new instance of the DepthStencilBuffer class.
Overload List
Name Description
DepthStencilBuffer (GraphicsDevice, Int32, Int32, DepthFormat) Initializes a new instance of the
DepthStencilBuffer class.
DepthStencilBuffer (GraphicsDevice, Int32, Int32, DepthFormat, MultiSampleType, Int32) Initializes a new instance of the
DepthStencilBuffer class, specifying th
e multisample type and quality.
See Also
Reference
DepthStencilBuffer Class
DepthStencilBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device that will display the depth stencil buffer.
width
Width, in pixels, of the depth stencil buffer. You can use graphicsDevice.PresentationParameters.BackBufferWidth to
get the current screen width.
height
Height, in pixels, of the depth stencil buffer. You can use graphicsDevice.PresentationParameters.BackBufferHeight to
get the current screen height.
format
The format of the data to be placed in this depth stencil buffer. Use CheckDepthStencilMatch to determine if a particular
depth format is usable in a render target.
Exceptions
Exception type Condition
ArgumentNullException
graphicsDevice is null.
ArgumentOutOfRangeException width and height are less than or equal to zero. width and height must be greater than zero.
ArgumentException
One of the following conditions is true:
The device does not support creating a depth buffer of the given format.
format is DepthFormat.Unknown. Textures cannot be created using
DepthFormat.Unknown.
width is larger than MaxTextureWidth.
height is larger than MaxTextureHeight.
InvalidOperationException
Unable to create this DepthStencilBuffer resource.
Example
C#
shadowDepthBuffer = GfxComponent.CreateDepthStencil(shadowRenderTarget,
DepthFormat.Depth24Stencil8Single);
C#
public static DepthStencilBuffer CreateDepthStencil(RenderTarget2D target)
{
return new DepthStencilBuffer(target.GraphicsDevice, target.Width,
target.Height, target.GraphicsDevice.DepthStencilBuffer.Format,
target.MultiSampleType, target.MultiSampleQuality);
}
public static DepthStencilBuffer CreateDepthStencil(RenderTarget2D target, DepthFormat dept
h)
{
if (GraphicsAdapter.DefaultAdapter.CheckDepthStencilMatch(DeviceType.Hardware,
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Format, target.Format,
depth))
{
return new DepthStencilBuffer(target.GraphicsDevice, target.Width,
target.Height, depth, target.MultiSampleType, target.MultiSampleQuality);
}
else
return CreateDepthStencil(target);
}
See Also
Tasks
How To: Create a Depth Texture
How To: Implement Shadow Mapping
Reference
CheckDepthStencilMatch
DepthStencilBuffer Class
DepthStencilBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device that will display the depth stencil buffer.
width
Width, in pixels, of the depth stencil buffer. You can use graphicsDevice.PresentationParameters.BackBufferWidth to
get the current screen width.
height
Height, in pixels, of the depth stencil buffer. You can use graphicsDevice.PresentationParameters.BackBufferHeight to
get the current screen height.
format
The format of the data to be placed in this depth stencil buffer. Use CheckDepthStencilMatch to determine if a particular
depth format is usable in a render target.
multiSampleType
The levels of full-scene multisampling that the device can apply. You can use
graphicsDevice.PresentationParameters.MultiSampleType to get the MultiSampleType of the back buffer.
multiSampleQuality
The number of quality stops available for a given multisample type. You can use
graphicsDevice.PresentationParameters.MultiSampleQuality to get the multisample quality of the back buffer.
Exceptions
Exception type Condition
ArgumentNullException
graphicsDevice is null.
ArgumentOutOfRangeException width and height are less than or equal to zero. width and height must be greater than zero.
ArgumentException
One of the following conditions is true:
The graphics device does not support creating a depth buffer of the given format.
format is DepthFormat.Unknown. Textures cannot be created using
DepthFormat.Unknown.
width is larger than MaxTextureWidth.
height is larger than MaxTextureHeight.
InvalidOperationException
Unable to create this DepthStencilBuffer resource.
Example
C#
shadowDepthBuffer = GfxComponent.CreateDepthStencil(shadowRenderTarget,
DepthFormat.Depth24Stencil8Single);
C#
public static DepthStencilBuffer CreateDepthStencil(RenderTarget2D target)
{
return new DepthStencilBuffer(target.GraphicsDevice, target.Width,
target.Height, target.GraphicsDevice.DepthStencilBuffer.Format,
target.MultiSampleType, target.MultiSampleQuality);
}
public static DepthStencilBuffer CreateDepthStencil(RenderTarget2D target, DepthFormat dept
h)
{
if (GraphicsAdapter.DefaultAdapter.CheckDepthStencilMatch(DeviceType.Hardware,
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Format, target.Format,
depth))
{
return new DepthStencilBuffer(target.GraphicsDevice, target.Width,
target.Height, depth, target.MultiSampleType, target.MultiSampleQuality);
}
else
return CreateDepthStencil(target);
}
See Also
Tasks
How To: Create a Depth Texture
How To: Implement Shadow Mapping
Reference
CheckDepthStencilMatch
DepthStencilBuffer Class
DepthStencilBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DepthStencilBuffer Methods
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_ContentLost Occurs when content is about to be lost on a GraphicsDevice.
raise_Disposing Raises the Disposing event when called from within a derived class.
See Also
Reference
DepthStencilBuffer Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DepthStencilBuffer.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
DepthStencilBuffer.Dispose () Immediately releases the unmanaged resources used by this object.
DepthStencilBuffer.Dispose (Boolean) Releases the unmanaged resources used by this object and optionally releases the mana
ged resources.
See Also
Reference
DepthStencilBuffer Class
DepthStencilBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DepthStencilBuffer.Dispose Method ()
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
See Also
Reference
DepthStencilBuffer Class
DepthStencilBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
Remarks
This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean)
method with the disposing parameter set to true. Finalize invokes Dispose(Boolean) with disposing set to false.
When the disposing parameter is true, this method releases all resources held by any managed objects that this
DepthStencilBuffer references. This method invokes the Dispose method of each referenced object.
Note
Notes to Inheritors
Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects
disposed of in an earlier call to Dispose.
See Also
Reference
DepthStencilBuffer Class
DepthStencilBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DepthStencilBuffer.Finalize Method
Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the
object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void Finalize ()
RemarksThis method overrides Finalize. Application code should not call this method; an object's Finalize method is
automatically invoked during garbage collection, unless a call to the SuppressFinalize method has disabled finalization by the
garbage collector.
See Also
Reference
DepthStencilBuffer Class
DepthStencilBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DepthStencilBuffer.raise_ContentLost Method
Occurs when content is about to be lost on a GraphicsDevice.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected virtual void raise_ContentLost (
Object value0,
EventArgs value1
)
Parameters
value0
The source of this event.
value1
The event arguments that are associated with the action that raised the event.
See Also
Reference
DepthStencilBuffer Class
DepthStencilBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DepthStencilBuffer.raise_Disposing Method
Raises the Disposing event when called from within a derived class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected void raise_Disposing (
Object value0,
EventArgs value1
)
Parameters
value0
Invoking object reference; should be this object.
value1
Arguments to pass to the event handler.
See Also
Reference
DepthStencilBuffer Class
DepthStencilBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DepthStencilBuffer Properties
Public Properties
Name Description
Format Gets the data format of this depth stencil buffer.
GraphicsDevice Gets the graphics device associated with this depth stencil buffer.
Height Gets the height, in pixels, of the surface.
IsContentLost Determines if the buffer data has been lost due to a lost device event.
IsDisposed Gets a value that indicates whether the object is disposed.
MultiSampleQuality Gets the number of quality stops available for a given multisample type.
MultiSampleType Gets the levels of full-scene multisampling that the device can apply.
Name Gets the name of this depth stencil buffer.
Tag Gets the resource tag for this depth stencil buffer.
Width Returns the width, in pixels, of this DepthStencilBuffer.
See Also
Reference
DepthStencilBuffer Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DepthStencilBuffer.Format Property
Gets the data format of this depth stencil buffer.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public DepthFormat Format { get; }
Property Value
The data format of this depth stencil buffer.
See Also
Reference
DepthStencilBuffer Class
DepthStencilBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DepthStencilBuffer.GraphicsDevice Property
Gets the graphics device associated with this depth stencil buffer.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GraphicsDevice GraphicsDevice { get; }
Property Value
The graphics device associated with this depth stencil buffer.
See Also
Reference
DepthStencilBuffer Class
DepthStencilBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DepthStencilBuffer.Height Property
Gets the height, in pixels, of the surface.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Height { get; }
Property Value
The height, in pixels, of the surface.
See Also
Reference
DepthStencilBuffer Class
DepthStencilBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DepthStencilBuffer.IsContentLost Property
Determines if the buffer data has been lost due to a lost device event.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public virtual bool IsContentLost { get; }
Property Value
true if the content was lost; false otherwise.
See Also
Reference
DepthStencilBuffer Class
DepthStencilBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DepthStencilBuffer.IsDisposed Property
Gets a value that indicates whether the object is disposed.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsDisposed { get; }
Property Value
true if the object is disposed. false if the object is not disposed.
See Also
Reference
DepthStencilBuffer Class
DepthStencilBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DepthStencilBuffer.MultiSampleQuality Property
Gets the number of quality stops available for a given multisample type.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int MultiSampleQuality { get; }
Property Value
The number of quality stops available for a given multisample type.
See Also
Reference
DepthStencilBuffer Class
DepthStencilBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DepthStencilBuffer.MultiSampleType Property
Gets the levels of full-scene multisampling that the device can apply.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public MultiSampleType MultiSampleType { get; }
Property Value
The levels of full-scene multisampling that the device can apply.
See Also
Reference
DepthStencilBuffer Class
DepthStencilBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DepthStencilBuffer.Name Property
Gets the name of this depth stencil buffer.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Name { get; set; }
Property Value
The name of this depth stencil buffer.
See Also
Reference
DepthStencilBuffer Class
DepthStencilBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DepthStencilBuffer.Tag Property
Gets the resource tag for this depth stencil buffer.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Object Tag { get; set; }
Property Value
The resource tag for this depth stencil buffer.
See Also
Reference
DepthStencilBuffer Class
DepthStencilBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DepthStencilBuffer.Width Property
Returns the width, in pixels, of this DepthStencilBuffer.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Width { get; }
Property Value
The width, in pixels, of this DepthStencilBuffer.
See Also
Reference
DepthStencilBuffer Class
DepthStencilBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DepthStencilBuffer Events
Public Events
Name Description
ContentLost Occurs when resources are lost (for example, when the current device is lost).
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micr
osoft .NET common language runtime (CLR).
See Also
Reference
DepthStencilBuffer Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DepthStencilBuffer.ContentLost Event
Occurs when resources are lost (for example, when the current device is lost).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public virtual event EventHandler ContentLost
See Also
Reference
DepthStencilBuffer Class
DepthStencilBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DepthStencilBuffer.Disposing Event
Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET
common language runtime (CLR).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public event EventHandler Disposing
See Also
Reference
DepthStencilBuffer Class
DepthStencilBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DeviceLostException Class
The exception that is thrown when the device has been lost but cannot be reset at this time. Therefore, rendering is not
possible.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public sealed class DeviceLostException : ExternalException
See Also
Reference
DeviceLostException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DeviceLostException Members
The following tables list the members exposed by the DeviceLostException type.
Public Constructors
Name Description
DeviceLostException Overloaded. Initializes a new instance of this class.
Public Properties
Name Description
Data (Inherited from Exception.)
ErrorCode (Inherited from ExternalException.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
DeviceLostException Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DeviceLostException Constructor
Initializes a new instance of this class.
Overload List
Name Description
DeviceLostException () Initializes a new instance of this class.
DeviceLostException (String) Initializes a new instance of this class with a specified error message.
DeviceLostException (String, Exception) Initializes a new instance of this class with a specified error message and a reference to
the inner exception that is the cause of this exception.
See Also
Reference
DeviceLostException Class
DeviceLostException Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DeviceLostException Constructor ()
Initializes a new instance of this class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public DeviceLostException ()
Remarks
This constructor initializes the Message property of the new instance to a system-supplied message that describes the error,
such as "The device has been lost but cannot be reset at this time." This message takes into account the current system culture.
The following table shows the initial property values for an instance of DeviceLostException.
Property Value
InnerException A null reference.
Message The localized error message string.
See Also
Reference
DeviceLostException Class
DeviceLostException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
message
A message that describes the error.
Remarks
The content of the message parameter is intended to be understood by humans. The caller of this constructor is required to
ensure that this string has been localized for the current system culture.
The following table shows the initial property values for an instance of DeviceLostException.
Property Value
InnerException A null reference.
Message The localized error message string.
See Also
Reference
DeviceLostException Class
DeviceLostException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
message
A message that describes the error.
inner
The exception that is the cause of the current exception. If the inner parameter is not a null reference, the current exception is
raised in a catch block that handles the inner exception.
Remarks
The content of the message parameter is intended to be understood by humans. The caller of this constructor is required to
ensure that this string has been localized for the current system culture.
An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in
the InnerException property. The InnerException property returns the same value that is passed into the constructor, or a null
reference if the InnerException property does not supply the inner exception value to the constructor.
The following table shows the initial property values for an instance of DeviceLostException.
Property Value
InnerException A null reference.
Message The localized error message string.
See Also
Reference
DeviceLostException Class
DeviceLostException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DeviceLostException Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
DeviceLostException Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DeviceLostException Properties
Public Properties
Name Description
Data (Inherited from Exception.)
ErrorCode (Inherited from ExternalException.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
See Also
Reference
DeviceLostException Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DeviceNotResetException Class
The exception that is thrown when the device has been lost but can be reset at this time.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public sealed class DeviceNotResetException : ExternalException
See Also
Reference
DeviceNotResetException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DeviceNotResetException Members
The following tables list the members exposed by the DeviceNotResetException type.
Public Constructors
Name Description
DeviceNotResetException Overloaded. Initializes a new instance of this class.
Public Properties
Name Description
Data (Inherited from Exception.)
ErrorCode (Inherited from ExternalException.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
DeviceNotResetException Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DeviceNotResetException Constructor
Initializes a new instance of this class.
Overload List
Name Description
DeviceNotResetException () Initializes a new instance of this class.
DeviceNotResetException (String) Initializes a new instance of this class with a specified error message.
DeviceNotResetException (String, Exception) Initializes a new instance of this class with a specified error message and a refere
nce to the inner exception that is the cause of this exception.
See Also
Reference
DeviceNotResetException Class
DeviceNotResetException Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DeviceNotResetException Constructor ()
Initializes a new instance of this class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public DeviceNotResetException ()
Remarks
This constructor initializes the Message property of the new instance to a system-supplied message that describes the error,
such as "The device has been lost but can be reset at this time." This message takes into account the current system culture.
The following table shows the initial property values for an instance of DeviceNotResetException.
Property Value
InnerException A null reference.
Message The localized error message string.
See Also
Reference
DeviceNotResetException Class
DeviceNotResetException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
message
A message that describes the error.
Remarks
The content of the message parameter is intended to be understood by humans. The caller of this constructor is required to
ensure that this string has been localized for the current system culture.
The following table shows the initial property values for an instance of DeviceNotResetException.
Property Value
InnerException A null reference.
Message The localized error message string.
See Also
Reference
DeviceNotResetException Class
DeviceNotResetException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
message
A message that describes the error.
inner
The exception that is the cause of the current exception. If the inner parameter is not a null reference, the current exception is
raised in a catch block that handles the inner exception.
Remarks
The content of the message parameter is intended to be understood by humans. The caller of this constructor is required to
ensure that this string has been localized for the current system culture.
An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in
the InnerException property. The InnerException property returns the same value that is passed into the constructor, or a null
reference if the InnerException property does not supply the inner exception value to the constructor.
The following table shows the initial property values for an instance of DeviceNotResetException.
Property Value
InnerException A null reference.
Message The localized error message string.
See Also
Reference
DeviceNotResetException Class
DeviceNotResetException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DeviceNotResetException Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
DeviceNotResetException Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DeviceNotResetException Properties
Public Properties
Name Description
Data (Inherited from Exception.)
ErrorCode (Inherited from ExternalException.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
See Also
Reference
DeviceNotResetException Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DeviceNotSupportedException Class
The exception that is thrown when the graphics device does not support the requested capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public sealed class DeviceNotSupportedException : ExternalException
See Also
Reference
DeviceNotSupportedException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DeviceNotSupportedException Members
The following tables list the members exposed by the DeviceNotSupportedException type.
Public Constructors
Name Description
DeviceNotSupportedException Overloaded. Initializes a new instance of the DeviceNotSupportedException class.
Public Properties
Name Description
Data (Inherited from Exception.)
ErrorCode (Inherited from ExternalException.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
DeviceNotSupportedException Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DeviceNotSupportedException Constructor
Initializes a new instance of the DeviceNotSupportedException class.
Overload List
Name Description
DeviceNotSupportedException () Initializes a new instance of the DeviceNotSupportedException class.
DeviceNotSupportedException (String) Initializes a new instance of the DeviceNotSupportedException class with a s
pecified error message.
DeviceNotSupportedException (String, Exception) Initializes a new instance of the DeviceNotSupportedException class with a s
pecified error message and a reference to the inner exception that is the cau
se of this exception.
See Also
Reference
DeviceNotSupportedException Class
DeviceNotSupportedException Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DeviceNotSupportedException Constructor ()
Initializes a new instance of the DeviceNotSupportedException class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public DeviceNotSupportedException ()
Remarks
The content of the message parameter is intended to be understood by humans. The caller of this constructor is required to
ensure that this string has been localized for the current system culture.
The following table shows the initial property values for an instance of DeviceNotSupportedException.
Property Value
InnerException A null reference.
Message The localized error message string.
See Also
Reference
DeviceNotSupportedException Class
DeviceNotSupportedException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
message
A message that describes the error.
Remarks
The content of the message parameter is intended to be understood by humans. The caller of this constructor is required to
ensure that this string has been localized for the current system culture.
The following table shows the initial property values for an instance of DeviceNotSupportedException.
Property Value
InnerException A null reference.
Message The localized error message string.
See Also
Reference
DeviceNotSupportedException Class
DeviceNotSupportedException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
message
A message that describes the error.
inner
The exception that is the cause of the current exception. If the inner parameter is not a null reference, the current exception is
raised in a catch block that handles the inner exception.
Remarks
The content of the message parameter is intended to be understood by humans. The caller of this constructor is required to
ensure that this string has been localized for the current system culture.
The following table shows the initial property values for an instance of DeviceNotSupportedException.
Property Value
InnerException A null reference.
Message The localized error message string.
See Also
Reference
DeviceNotSupportedException Class
DeviceNotSupportedException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DeviceNotSupportedException Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
DeviceNotSupportedException Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DeviceNotSupportedException Properties
Public Properties
Name Description
Data (Inherited from Exception.)
ErrorCode (Inherited from ExternalException.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
See Also
Reference
DeviceNotSupportedException Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DeviceStillDrawingException Class
The error that is thrown when the device is still drawing.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public sealed class DeviceStillDrawingException : ExternalException
See Also
Reference
DeviceStillDrawingException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DeviceStillDrawingException Members
The following tables list the members exposed by the DeviceStillDrawingException type.
Public Constructors
Name Description
DeviceStillDrawingException Overloaded. Initializes a new instance of this class.
Public Properties
Name Description
Data (Inherited from Exception.)
ErrorCode (Inherited from ExternalException.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
DeviceStillDrawingException Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DeviceStillDrawingException Constructor
Initializes a new instance of this class.
Overload List
Name Description
DeviceStillDrawingException () Initializes a new instance of this class.
DeviceStillDrawingException (String) Initializes a new instance of this class with a specified error message.
DeviceStillDrawingException (String, Exception) Initializes a new instance of this class with a specified error message and a refe
rence to the inner exception that is the cause of this exception.
See Also
Reference
DeviceStillDrawingException Class
DeviceStillDrawingException Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DeviceStillDrawingException Constructor ()
Initializes a new instance of this class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public DeviceStillDrawingException ()
Remarks
This constructor initializes the Message property of the new instance to a system-supplied message that describes the error,
such as "The device has been lost but cannot be reset at this time." This message takes into account the current system culture.
The following table shows the initial property values for an instance of DeviceStillDrawingException.
Property Value
InnerException A null reference.
Message The localized error message string.
See Also
Reference
DeviceStillDrawingException Class
DeviceStillDrawingException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
message
A message that describes the error.
Remarks
The content of the message parameter is intended to be understood by humans. The caller of this constructor is required to
ensure that this string has been localized for the current system culture.
The following table shows the initial property values for an instance of DeviceStillDrawingException.
Property Value
InnerException A null reference.
Message The localized error message string.
See Also
Reference
DeviceStillDrawingException Class
DeviceStillDrawingException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
message
A message that describes the error.
inner
The exception that is the cause of the current exception. If the inner parameter is not a null reference, the current exception is
raised in a catch block that handles the inner exception.
Remarks
The content of the message parameter is intended to be understood by humans. The caller of this constructor is required to
ensure that this string has been localized for the current system culture.
An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in
the InnerException property. The InnerException property returns the same value that is passed into the constructor, or a null
reference if the InnerException property does not supply the inner exception value to the constructor.
The following table shows the initial property values for an instance of DeviceStillDrawingException.
Property Value
InnerException A null reference.
Message The localized error message string.
See Also
Reference
DeviceStillDrawingException Class
DeviceStillDrawingException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DeviceStillDrawingException Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
DeviceStillDrawingException Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DeviceStillDrawingException Properties
Public Properties
Name Description
Data (Inherited from Exception.)
ErrorCode (Inherited from ExternalException.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
See Also
Reference
DeviceStillDrawingException Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DeviceType Enumeration
Specifies the type of device driver.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum DeviceType
Members
Member name Description
Hardware A hardware device. Using the flag to get direct access to the video hardware.
NullReference A null device. This is a reference device that can do everything except render a scene.
Reference A reference device. Use this flag to create a software emulated device.
See Also
Reference
GraphicsAdapter.CheckDepthStencilMatch Method
GraphicsAdapter.CheckDeviceFormat Method
GraphicsAdapter.CheckDeviceFormatConversion Method
GraphicsAdapter.CheckDeviceMultiSampleType Method
GraphicsAdapter.CheckDeviceType Method
GraphicsAdapter.GetCapabilities Method
GraphicsAdapter.IsDeviceTypeAvailable Method
GraphicsDevice Constructor
GraphicsDeviceCapabilities.DeviceType Property
GraphicsDeviceCreationParameters Constructor
GraphicsDeviceCreationParameters.DeviceType Property
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DisplayMode Structure
Describes the display mode.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public struct DisplayMode
See Also
Concepts
Displays, Client Bounds, Viewports, and Back Buffers
Reference
DisplayMode
DisplayMode Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DisplayMode Members
The following tables list the members exposed by the DisplayMode type.
Public Properties
Name Description
AspectRatio Gets the aspect ratio used by the graphics device.
Format Gets a value indicating the surface format of the display mode.
Height Gets a value indicating the screen height, in pixels.
RefreshRate Gets a value indicating the refresh rate. The value of 0 indicates an adapter default.
Width Gets a value indicating the screen width, in pixels.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Compares two objects to determine whether they are the same.
op_Inequality Compares two objects to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
DisplayMode Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DisplayMode Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Compares two objects to determine whether they are the same.
op_Inequality Compares two objects to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
DisplayMode Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DisplayMode.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
DisplayMode.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
DisplayMode.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
DisplayMode Structure
DisplayMode Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
obj
The Object to compare with the current DisplayMode.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
DisplayMode Structure
DisplayMode Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DisplayMode.GetHashCode Method
Gets the hash code for this instance.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for this object.
See Also
Reference
DisplayMode Structure
DisplayMode Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DisplayMode.op_Equality Method
Compares two objects to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
DisplayMode left,
DisplayMode right
)
Parameters
left
Object to the left of the equality operator.
right
Object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
DisplayMode Structure
DisplayMode Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DisplayMode.op_Inequality Method
Compares two objects to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
DisplayMode left,
DisplayMode right
)
Parameters
left
The object to the left of the inequality operator.
right
The object to the right of the inequality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
DisplayMode Structure
DisplayMode Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DisplayMode.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
DisplayMode Structure
DisplayMode Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DisplayMode Properties
Public Properties
Name Description
AspectRatio Gets the aspect ratio used by the graphics device.
Format Gets a value indicating the surface format of the display mode.
Height Gets a value indicating the screen height, in pixels.
RefreshRate Gets a value indicating the refresh rate. The value of 0 indicates an adapter default.
Width Gets a value indicating the screen width, in pixels.
See Also
Reference
DisplayMode Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DisplayMode.AspectRatio Property
Gets the aspect ratio used by the graphics device.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float AspectRatio { get; }
Property Value
Aspect ratio of the viewport.
See Also
Reference
DisplayMode Structure
DisplayMode Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DisplayMode.Format Property
Gets a value indicating the surface format of the display mode.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public SurfaceFormat Format { get; }
Property Value
The surface format of the display mode.
See Also
Reference
DisplayMode Structure
DisplayMode Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DisplayMode.Height Property
Gets a value indicating the screen height, in pixels.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Height { get; }
Property Value
Screen height, in pixels.
See Also
Concepts
Displays, Client Bounds, Viewports, and Back Buffers
Reference
DisplayMode Structure
DisplayMode Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DisplayMode.RefreshRate Property
Gets a value indicating the refresh rate. The value of 0 indicates an adapter default.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int RefreshRate { get; }
Property Value
Refresh rate. The value of 0 indicates an adapter default.
See Also
Reference
DisplayMode Structure
DisplayMode Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DisplayMode.Width Property
Gets a value indicating the screen width, in pixels.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Width { get; }
Property Value
Screen width, in pixels.
See Also
Concepts
Displays, Client Bounds, Viewports, and Back Buffers
Reference
DisplayMode Structure
DisplayMode Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DisplayModeCollection Structure
Manipulates a collection of DisplayMode structures.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct DisplayModeCollection : IEnumerable<DisplayMode>
See Also
Reference
DisplayModeCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DisplayModeCollection Members
The following tables list the members exposed by the DisplayModeCollection type.
Public Properties
Name Description
Item Retrieves the DisplayMode structure with the specified format.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetEnumerator Gets an enumerator that can iterate through the DisplayModeCollection.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Compares two objects to determine whether they are the same.
op_Inequality Compares two objects to determine whether they are different.
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
DisplayModeCollection Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DisplayModeCollection Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetEnumerator Gets an enumerator that can iterate through the DisplayModeCollection.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Compares two objects to determine whether they are the same.
op_Inequality Compares two objects to determine whether they are different.
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
DisplayModeCollection Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DisplayModeCollection.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
DisplayModeCollection.Equals (Object) Returns a value that indicates whether the current instance is equal to a specifie
d object.
DisplayModeCollection.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
DisplayModeCollection Structure
DisplayModeCollection Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
obj
The Object to compare with the current DisplayModeCollection.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
DisplayModeCollection Structure
DisplayModeCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DisplayModeCollection.GetEnumerator Method
Gets an enumerator that can iterate through the DisplayModeCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public IEnumerator<DisplayMode> GetEnumerator ()
Return Value
Enumerator that can iterate through the DisplayModeCollection.
See Also
Reference
DisplayModeCollection Structure
DisplayModeCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DisplayModeCollection.GetHashCode Method
Gets the hash code for this instance.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for this object.
See Also
Reference
DisplayModeCollection Structure
DisplayModeCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DisplayModeCollection.op_Equality Method
Compares two objects to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
DisplayModeCollection l,
DisplayModeCollection r
)
Parameters
l
Object to the left of the equality operator.
r
Object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
DisplayModeCollection Structure
DisplayModeCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DisplayModeCollection.op_Inequality Method
Compares two objects to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
DisplayModeCollection l,
DisplayModeCollection r
)
Parameters
l
The object to the left of the inequality operator.
r
The object to the right of the inequality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
DisplayModeCollection Structure
DisplayModeCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DisplayModeCollection Properties
Public Properties
Name Description
Item Retrieves the DisplayMode structure with the specified format.
See Also
Reference
DisplayModeCollection Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DisplayModeCollection.Item Property
Retrieves the DisplayMode structure with the specified format.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public IEnumerable<DisplayMode> this [
SurfaceFormat format
] { get; }
Property Value
The DisplayMode.
See Also
Reference
DisplayModeCollection Structure
DisplayModeCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DriverInternalErrorException Class
The exception that is thrown when an internal driver error occurs. Applications should destroy and recreate the device when
receiving this error.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public sealed class DriverInternalErrorException : ExternalException
See Also
Reference
DriverInternalErrorException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DriverInternalErrorException Members
The following tables list the members exposed by the DriverInternalErrorException type.
Public Constructors
Name Description
DriverInternalErrorException Overloaded. Initializes a new instance of this class.
Public Properties
Name Description
Data (Inherited from Exception.)
ErrorCode (Inherited from ExternalException.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
DriverInternalErrorException Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DriverInternalErrorException Constructor
Initializes a new instance of this class.
Overload List
Name Description
DriverInternalErrorException () Initializes a new instance of this class.
DriverInternalErrorException (String) Initializes a new instance of this class with a specified error message.
DriverInternalErrorException (String, Exception) Initializes a new instance of this class with a specified error message and a refe
rence to the inner exception that is the cause of this exception.
See Also
Reference
DriverInternalErrorException Class
DriverInternalErrorException Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DriverInternalErrorException Constructor ()
Initializes a new instance of this class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public DriverInternalErrorException ()
Remarks
This constructor initializes the Message property of the new instance to a system-supplied message that describes the error,
such as "Internal driver error." This message takes into account the current system culture.
The following table shows the initial property values for an instance of DriverInternalErrorException.
Property Value
InnerException A null reference.
Message The localized error message string.
See Also
Reference
DriverInternalErrorException Class
DriverInternalErrorException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
message
A message that describes the error.
Remarks
The content of the message parameter is intended to be understood by humans. The caller of this constructor is required to
ensure that this string has been localized for the current system culture.
The following table shows the initial property values for an instance of DriverInternalErrorException.
Property Value
InnerException A null reference.
Message The localized error message string.
See Also
Reference
DriverInternalErrorException Class
DriverInternalErrorException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
message
A message that describes the error.
inner
The exception that is the cause of the current exception. If the inner parameter is not a null reference, the current exception is
raised in a catch block that handles the inner exception.
Remarks
The content of the message parameter is intended to be understood by humans. The caller of this constructor is required to
ensure that this string has been localized for the current system culture.
An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in
the InnerException property. The InnerException property returns the same value that is passed into the constructor, or a null
reference if the InnerException property does not supply the inner exception value to the constructor.
The following table shows the initial property values for an instance of DriverInternalErrorException.
Property Value
InnerException A null reference.
Message The localized error message string.
See Also
Reference
DriverInternalErrorException Class
DriverInternalErrorException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DriverInternalErrorException Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
DriverInternalErrorException Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DriverInternalErrorException Properties
Public Properties
Name Description
Data (Inherited from Exception.)
ErrorCode (Inherited from ExternalException.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
See Also
Reference
DriverInternalErrorException Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DynamicIndexBuffer Class
Describes the rendering order of the vertices in a vertex buffer. Use DynamicIndexBuffer for storing indices for dynamic
vertices and IndexBuffer for indices of non-dynamic arrays.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class DynamicIndexBuffer : IndexBuffer, IGraphicsResource, IDynamicGraphicsResource
Remarks
For more information on drawing with dynamic buffers, see DynamicVertexBuffer Class.
See Also
Tasks
How To: Draw Points, Lines, and Other 3D Primitives
Reference
DynamicIndexBuffer Members
Indices
DrawUserIndexedPrimitives
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DynamicIndexBuffer Members
The following tables list the members exposed by the DynamicIndexBuffer type.
Public Constructors
Name Description
DynamicIndexBuffer Overloaded. Initializes a new instance of DynamicIndexBuffer.
Public Properties
Name Description
BufferUsage (Inherited from IndexBuffer.)
GraphicsDevice (Inherited from GraphicsResource.)
IndexElementSize (Inherited from IndexBuffer.)
IsContentLost Determines if the index buffer data has been lost due to a lost device event.
IsDisposed (Inherited from GraphicsResource.)
Name (Inherited from GraphicsResource.)
Priority (Inherited from GraphicsResource.)
ResourceType (Inherited from GraphicsResource.)
SizeInBytes (Inherited from IndexBuffer.)
Tag (Inherited from GraphicsResource.)
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetData (Inherited from IndexBuffer.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
SetData Overloaded. Copies array data to the index buffer.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_ContentLost Occurs after content is lost from a graphics device failure, allowing an application to re-create all resourc
es.
raise_Disposing (Inherited from GraphicsResource.)
Public Events
Name Description
ContentLost Occurs when resources are lost due to a lost device event.
Disposing (Inherited from GraphicsResource.)
See Also
Reference
DynamicIndexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DynamicIndexBuffer Constructor
Initializes a new instance of DynamicIndexBuffer.
Overload List
Name Description
DynamicIndexBuffer (GraphicsDevice, Int32, BufferUsage, IndexElementSize) Initializes a new instance of DynamicIndexBuffe
r with the specified parameters.
DynamicIndexBuffer (GraphicsDevice, Type, Int32, BufferUsage) Initializes a new instance of DynamicIndexBuffe
r with the specified parameters.
See Also
Reference
DynamicIndexBuffer Class
DynamicIndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
graphicsDevice
The associated graphics device of the index buffer.
sizeInBytes
The size, in bytes, of the index buffer.
usage
A set of options identifying the behaviors of this index buffer resource.
elementSize
The size, in bits, of an index element.
Exceptions
Exception type Condition
ArgumentNullException graphicsDevice is null.
ArgumentOutOfRangeException One of the following conditions is true:
The elementSize parameter is invalid. Index buffers can only be created for indices whic
h are sixteen or thirty-two bits in length.
The sizeInBytes parameter is invalid. The resource size must be greater than zero.
The sizeInBytes parameter is invalid. The total size of the index buffer must be an even
multiple of the index element size (either 16 or 32 bits).
InvalidOperationException This resource could not be created.
See Also
Reference
DynamicIndexBuffer Class
DynamicIndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The associated graphics device of the index buffer.
indexType
Type to use for index values.
elementCount
Number of indices in the buffer.
usage
A set of options identifying the behaviors of this index buffer resource.
Exceptions
Exception type Condition
ArgumentNullException graphicsDevice is null.
ArgumentOutOfRangeException The elementCount parameter is invalid. It must be greater than zero zie, and the index must b
e sixteen or thirty-two bits in length. Index buffers can only be created for indices which are si
xteen or thirty-two bits in length.
InvalidOperationException This resource could not be created.
See Also
Reference
DynamicIndexBuffer Class
DynamicIndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DynamicIndexBuffer Methods
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetData (Inherited from IndexBuffer.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
SetData Overloaded. Copies array data to the index buffer.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_ContentLost Occurs after content is lost from a graphics device failure, allowing an application to re-create all resourc
es.
raise_Disposing (Inherited from GraphicsResource.)
See Also
Reference
DynamicIndexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DynamicIndexBuffer.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
DynamicIndexBuffer.Dispose (Boolean) Immediately releases the unmanaged resources used by this object.
DynamicIndexBuffer.Dispose () (Inherited from GraphicsResource.)
See Also
Reference
DynamicIndexBuffer Class
DynamicIndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
See Also
Reference
DynamicIndexBuffer Class
DynamicIndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DynamicIndexBuffer.Finalize Method
Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the
object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void Finalize ()
See Also
Reference
DynamicIndexBuffer Class
DynamicIndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DynamicIndexBuffer.raise_ContentLost Method
Occurs after content is lost from a graphics device failure, allowing an application to re-create all resources.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected virtual void raise_ContentLost (
Object value0,
EventArgs value1
)
Parameters
value0
The source of this event.
value1
The event arguments that are associated with the action that raised the event.
See Also
Reference
DynamicIndexBuffer Class
DynamicIndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DynamicIndexBuffer.SetData Method
Copies array data to the index buffer.
Overload List
Name Description
DynamicIndexBuffer.SetData (Int32, T[], Int32, Int32, SetDataOptions) Copies array data to the index buffer.
DynamicIndexBuffer.SetData (T[], Int32, Int32, SetDataOptions) Copies array data to the index buffer.
DynamicIndexBuffer.SetData (Int32, T, Int32, Int32) (Inherited from IndexBuffer.)
DynamicIndexBuffer.SetData (T) (Inherited from IndexBuffer.)
DynamicIndexBuffer.SetData (T, Int32, Int32) (Inherited from IndexBuffer.)
See Also
Reference
DynamicIndexBuffer Class
DynamicIndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Type Parameters
T
The type of the elements in the array.
Parameters
offsetInBytes
Number of bytes into the index buffer where copying will start.
data
The array of data to copy.
startIndex
The index of the element in the array at which to start copying.
elementCount
The number of elements to copy.
options
Specifies whether existing data in the buffer will be kept after this operation. Discard is not valid on Xbox 360, but dynamic
geometry may be rendered on the Xbox 360 by using DrawUserIndexedPrimitives instead of setting the data for the index
buffer.
Remarks An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or
SetData methods) a resource that is currently set on a graphics device.
See Also
Reference
DynamicIndexBuffer Class
DynamicIndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of the elements in the array.
Parameters
data
The array of data to copy.
startIndex
The index of the element in the array at which to start copying.
elementCount
The number of elements to copy.
options
Specifies whether existing data in the buffer will be kept after this operation. Discard is not valid on Xbox 360, but dynamic
geometry may be rendered on the Xbox 360 by using DrawUserIndexedPrimitives instead of setting the data for the index
buffer.
Remarks An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or
SetData methods) a resource that is currently set on a graphics device.
See Also
Reference
DynamicIndexBuffer Class
DynamicIndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DynamicIndexBuffer Properties
Public Properties
Name Description
BufferUsage (Inherited from IndexBuffer.)
GraphicsDevice (Inherited from GraphicsResource.)
IndexElementSize (Inherited from IndexBuffer.)
IsContentLost Determines if the index buffer data has been lost due to a lost device event.
IsDisposed (Inherited from GraphicsResource.)
Name (Inherited from GraphicsResource.)
Priority (Inherited from GraphicsResource.)
ResourceType (Inherited from GraphicsResource.)
SizeInBytes (Inherited from IndexBuffer.)
Tag (Inherited from GraphicsResource.)
See Also
Reference
DynamicIndexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DynamicIndexBuffer.IsContentLost Property
Determines if the index buffer data has been lost due to a lost device event.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public virtual bool IsContentLost { get; }
Property Value
true if the content was lost; false otherwise.
See Also
Reference
DynamicIndexBuffer Class
DynamicIndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DynamicIndexBuffer Events
Public Events
Name Description
ContentLost Occurs when resources are lost due to a lost device event.
Disposing (Inherited from GraphicsResource.)
See Also
Reference
DynamicIndexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DynamicIndexBuffer.ContentLost Event
Occurs when resources are lost due to a lost device event.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public virtual event EventHandler ContentLost
Remarks
When this event is fired, the IsContentLost property, of the index buffer, is set to true.
See Also
Reference
DynamicIndexBuffer Class
DynamicIndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DynamicVertexBuffer Class
Represents a list of 3D vertices to be streamed to the graphics device. Use DynamicVertexBuffer for dynamic vertex arrays
and VertexBuffer for non-dynamic vertex arrays.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class DynamicVertexBuffer : VertexBuffer, IGraphicsResource, IDynamicGraphicsResourc
e
Remarks
In situations where your game frequently modifies a vertex buffer, it is recommended that the buffer be instantiated or derived
from DynamicVertexBuffer instead of the VertexBuffer class. DynamicVertexBuffer is optimized for frequent vertex data
modification. However, to fully maximize the benefits of this class, your data must be restored after any occurrence of a
ContentLost event. This event is fired whenever the related graphics device is lost. After resetting the graphics device and
restoring any static resources, the ContentLost event handler is then called. Calling SetData inside this handler restores any
dynamic resource data.
You can declare the event handler after constructing your dynamic vertex buffer. For example, the following code sample first
constructs a dynamic vertex buffer (called vertexBuffer), declares a ContentLost event handler (called
vertexBuffer_ContentLost). The final step initializes the data with a call to SetData. This is necessary for correct restoration of
any existing particles after a lost device event.
vertexBuffer = new DynamicVertexBuffer(GraphicsDevice, size, BufferUsage.Points);
vertexBuffer.ContentLost += new EventHandler(vertexBuffer_ContentLost);
vertexBuffer.SetData(particles);
See Also
Reference
DynamicVertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DynamicVertexBuffer Members
The following tables list the members exposed by the DynamicVertexBuffer type.
Public Constructors
Name Description
DynamicVertexBuffer Overloaded. Initializes a new instance of DynamicVertexBuffer.
Public Properties
Name Description
BufferUsage (Inherited from VertexBuffer.)
GraphicsDevice (Inherited from GraphicsResource.)
IsContentLost Determines if the index buffer data has been lost due to a lost device event.
IsDisposed (Inherited from GraphicsResource.)
Name (Inherited from GraphicsResource.)
Priority (Inherited from GraphicsResource.)
ResourceType (Inherited from GraphicsResource.)
SizeInBytes (Inherited from VertexBuffer.)
Tag (Inherited from GraphicsResource.)
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetData (Inherited from VertexBuffer.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
SetData Overloaded. Copies array data to the vertex buffer.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_ContentLost Occurs after content is lost from a graphics device failure, allowing an application to re-create all resourc
es.
raise_Disposing (Inherited from GraphicsResource.)
Public Events
Name Description
ContentLost Occurs when resources are lost due to a lost device event.
Disposing (Inherited from GraphicsResource.)
See Also
Reference
DynamicVertexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DynamicVertexBuffer Constructor
Initializes a new instance of DynamicVertexBuffer.
Overload List
Name Description
DynamicVertexBuffer (GraphicsDevice, Int32, BufferUsage) Initializes a new instance of DynamicVertexBuffer with the
specified parameters.
DynamicVertexBuffer (GraphicsDevice, Type, Int32, BufferUsage) Initializes a new instance of DynamicVertexBuffer with the
specified parameters.
See Also
Reference
DynamicVertexBuffer Class
DynamicVertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to associate with this vertex buffer.
sizeInBytes
The number of bytes to allocate for this vertex buffer resource.
usage
A set of options identifying the behaviors of this vertex buffer resource. It is good practice to match the usage parameter with
the createOptions parameter in the GraphicsDevice constructor.
Exceptions
Exception type Condition
ArgumentNullException The graphicsDevice must not be null when creating new resources.
ArgumentOutOfRangeException sizeInBytes must be greater than zero.
InvalidOperationException This resource could not be created.
See Also
Reference
DynamicVertexBuffer Class
DynamicVertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to associate with this vertex buffer.
vertexType
The type of vertices in this vertex buffer.
elementCount
The number of elements in this vertex buffer.
usage
A set of options identifying the behaviors of this vertex buffer resource. It is good practice to match the usage parameter with
the createOptions parameter in the GraphicsDevice constructor.
Exceptions
Exception type Condition
ArgumentNullException The graphicsDevice must not be null when creating new resources.
ArgumentOutOfRangeException elementCount must be greater than zero.
InvalidOperationException This resource could not be created.
See Also
Reference
DynamicVertexBuffer Class
DynamicVertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DynamicVertexBuffer Methods
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetData (Inherited from VertexBuffer.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
SetData Overloaded. Copies array data to the vertex buffer.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_ContentLost Occurs after content is lost from a graphics device failure, allowing an application to re-create all resourc
es.
raise_Disposing (Inherited from GraphicsResource.)
See Also
Reference
DynamicVertexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DynamicVertexBuffer.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
DynamicVertexBuffer.Dispose (Boolean) Immediately releases the unmanaged resources used by this object.
DynamicVertexBuffer.Dispose () (Inherited from GraphicsResource.)
See Also
Reference
DynamicVertexBuffer Class
DynamicVertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
See Also
Reference
DynamicVertexBuffer Class
DynamicVertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DynamicVertexBuffer.Finalize Method
Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the
object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void Finalize ()
See Also
Reference
DynamicVertexBuffer Class
DynamicVertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DynamicVertexBuffer.raise_ContentLost Method
Occurs after content is lost from a graphics device failure, allowing an application to re-create all resources.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected virtual void raise_ContentLost (
Object value0,
EventArgs value1
)
Parameters
value0
The source of this event.
value1
The event arguments that are associated with the action that raised the event.
See Also
Reference
DynamicVertexBuffer Class
DynamicVertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DynamicVertexBuffer.SetData Method
Copies array data to the vertex buffer.
Overload List
Name Description
DynamicVertexBuffer.SetData (Int32, T[], Int32, Int32, Int32, SetDataOptions) Copies array data to the vertex buffer.
DynamicVertexBuffer.SetData (T[], Int32, Int32, SetDataOptions) Copies array data to the vertex buffer.
DynamicVertexBuffer.SetData (Int32, T, Int32, Int32, Int32) (Inherited from VertexBuffer.)
DynamicVertexBuffer.SetData (T) (Inherited from VertexBuffer.)
DynamicVertexBuffer.SetData (T, Int32, Int32) (Inherited from VertexBuffer.)
See Also
Reference
DynamicVertexBuffer Class
DynamicVertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Type Parameters
T
The type of the elements in the array.
Parameters
offsetInBytes
Number of bytes into the index buffer where copying will start.
data
The array of data to copy.
startIndex
The index of the element in the array at which to start copying.
elementCount
The number of elements to copy.
vertexStride
The size, in bytes, of the elements in the vertex buffer.
options
Specifies whether existing data in the buffer will be kept after this operation. Discard is not valid on Xbox 360, but dynamic
geometry may be rendered on the Xbox 360 by using DrawUserIndexedPrimitives instead of setting the data for the vertex
buffer.
Remarks An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or
SetData methods) a resource that is currently set on a graphics device.
See Also
Reference
DynamicVertexBuffer Class
DynamicVertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of the elements in the array.
Parameters
data
The array of data to copy.
startIndex
The index of the element in the array at which to start copying.
elementCount
The number of elements to copy.
options
Specifies whether existing data in the buffer will be kept after this operation. Discard is not valid on Xbox 360, but dynamic
geometry may be rendered on the Xbox 360 by using DrawUserIndexedPrimitives instead of setting the data for the vertex
buffer.
Remarks An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or
SetData methods) a resource that is currently set on a graphics device.
See Also
Reference
DynamicVertexBuffer Class
DynamicVertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DynamicVertexBuffer Properties
Public Properties
Name Description
BufferUsage (Inherited from VertexBuffer.)
GraphicsDevice (Inherited from GraphicsResource.)
IsContentLost Determines if the index buffer data has been lost due to a lost device event.
IsDisposed (Inherited from GraphicsResource.)
Name (Inherited from GraphicsResource.)
Priority (Inherited from GraphicsResource.)
ResourceType (Inherited from GraphicsResource.)
SizeInBytes (Inherited from VertexBuffer.)
Tag (Inherited from GraphicsResource.)
See Also
Reference
DynamicVertexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DynamicVertexBuffer.IsContentLost Property
Determines if the index buffer data has been lost due to a lost device event.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public virtual bool IsContentLost { get; }
Property Value
true if the content was lost; false otherwise.
See Also
Reference
DynamicVertexBuffer Class
DynamicVertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
DynamicVertexBuffer Events
Public Events
Name Description
ContentLost Occurs when resources are lost due to a lost device event.
Disposing (Inherited from GraphicsResource.)
See Also
Reference
DynamicVertexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
DynamicVertexBuffer.ContentLost Event
Occurs when resources are lost due to a lost device event.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public virtual event EventHandler ContentLost
When this event is fired, the IsContentLost property, of the vertex buffer, is set to true.
See Also
Reference
DynamicVertexBuffer Class
DynamicVertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Effect Class
Used to set and query effects and choose techniques.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class Effect : IDisposable
See Also
Tasks
How To: Create and Apply Custom Effects
Reference
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Effect Members
The following tables list the members exposed by the Effect type.
Public Constructors
Name Description
Effect Overloaded. Initializes a new instance of this class.
Public Properties
Name Description
Creator Gets the name of the effect creator.
CurrentTechnique Gets or sets the active technique.
EffectPool Gets an EffectPool representing the pool of shared parameters.
Functions Gets a collection of functions that can render the effect.
GraphicsDevice Gets the graphics device that created the effect.
IsDisposed Gets a value that indicates whether the object is disposed.
Parameters Gets a collection of parameters used for this effect.
Techniques Gets a collection of techniques that are defined for this effect.
Public Methods
Name Description
Begin Overloaded. Begins application of the active technique.
Clone Creates a clone of an effect.
CommitChanges Propagates the state change that occurs inside of an active pass to the device before renderin
g.
CompileEffectFromFile Overloaded. Compiles an effect from a file or stream containing the effect source code.
CompileEffectFromSource Compiles an effect from a string containing the effect source code.
Disassemble Overloaded. Disassembles an effect.
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
End Ends the application of the current technique.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_Disposing Raises the Disposing event when called from within a derived class.
raise_Lost Raises an Lost event when called from within a derived class.
raise_Reset Raises an Reset event when called from within a derived class.
Public Events
Name Description
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micro
soft .NET common language runtime (CLR).
Lost Occurs when an object is lost, normally just before a device is reset.
Reset Occurs after the device is reset.
See Also
Reference
Effect Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Effect Constructor
Initializes a new instance of this class.
Overload List
Name Description
Effect (GraphicsDevice, Byte[], CompilerOptions, EffectPool) Initializes a new instance of this class from a compiled effe
ct, specifying the compiled effect as a byte array.
Effect (GraphicsDevice, Effect) Initializes a new instance of this class, specifying the graphi
cs device to associate with this effect and the effect to clon
e.
Effect (GraphicsDevice, Stream, CompilerOptions, EffectPool) Initializes a new instance of this class from a compiled effe
ct, specifying the compiled effect as a stream.
Effect (GraphicsDevice, Stream, Int32, CompilerOptions, EffectPool) Initializes a new instance of this class from a compiled effe
ct, specifying the compiled effect as a stream, as well as the
number of bytes in the stream.
Effect (GraphicsDevice, String, CompilerOptions, EffectPool) Initializes a new instance of this class from a compiled effe
ct, specifying the compiled effect by file name.
Tip
In most cases, it is preferrable to initialize a new instance of an effect using the ContentManager.Load<Effect> method rather
than using the Effect constructors. For an example of initializing an effect with this method, please see
How To: Create and Apply Custom Effects.
See Also
Tasks
How To: Create and Apply Custom Effects
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device that will create the effect.
effectCode
Byte array containing the compiled byte code.
options
Compilation optimization options.
pool
Specifies a pool of resources to share between effects.
Exceptions
Exception type Condition
ArgumentNullException
effectCode or graphicsDevice is null.
InvalidOperationException
One of the following conditions is true:
The code contained in effectCode is not compiled. Creating an effect requires that the shader
code has been compiled.
The code contained in effectCode does not have a size that is a multiple of four bytes. Effect a
nd shader code must have a size that is a multiple of four bytes.
Unable to create the effect resource on the graphics device.
ObjectDisposedException
Effect was called after pool was disposed.
Remarks
Tip
In most cases, it is preferrable to initialize a new instance of an effect using the ContentManager.Load<Effect> method rather
than using the Effect constructors. For an example of initializing an effect with this method, see
How To: Create and Apply Custom Effects.
Obtaining the compiled byte code for effectCode is a two-part process. First, you must compile the effect by using the static
method Effect.CompileEffectFromFile or Effect.CompileEffectFromSource, either of which returns an instance of
CompiledEffect. CompiledEffect.GetEffectCode returns the compiled byte code from the compiled effect.
See Also
Tasks
How To: Create and Apply Custom Effects
Reference
Effect.CompileEffectFromFile Method
Effect.CompileEffectFromSource Method
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device that will create the effect.
cloneSource
The effect to clone.
Exceptions
Exception type Condition
ArgumentNullException cloneSource or graphicsDevice is null.
InvalidOperationException Unable to create the effect resource on the graphics device.
ObjectDisposedException Effect was called after cloneSource was disposed.
Tip
In most cases, it is preferrable to initialize a new instance of an effect using the ContentManager.Load<Effect> method rather
than using the Effect constructors. For an example of initializing an effect by using this method, see
How To: Create and Apply Custom Effects.
See Also
Tasks
How To: Create and Apply Custom Effects
Reference
Effect.CompileEffectFromFile Method
Effect.CompileEffectFromSource Method
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device that will create the effect.
effectCodeFileStream
Stream containing the compiled byte code.
options
Compilation optimization options.
pool
Specifies a pool of resources to share between effects.
Exceptions
Exception type Condition
ArgumentNullException
graphicsDevice is null. The graphics device must not be null when creating new resources.
ObjectDisposedException
Effect was called after pool was disposed.
InvalidOperationException The code contained in effectCodeFileStream is not compiled. Creating an effect requires that t
he shader code has been compiled.
The code contained in effectCodeFileStream does not have a size that is a multiple of four byt
es. Effect and shader code must have a size that is a multiple of four bytes.
Unable to create the effect resource on the graphics device.
Remarks
Tip
In most cases, it is preferrable to initialize a new instance of an effect using the ContentManager.Load<Effect> method rather
than using the Effect constructors. For an example of initializing an effect with this method, see
How To: Create and Apply Custom Effects.
Obtaining the compiled byte code for effectCodeFileStream is a two-part process. First, you must compile the effect by using
the static method Effect.CompileEffectFromFile or Effect.CompileEffectFromSource, either of which returns an instance of
CompiledEffect. CompiledEffect.GetEffectCode returns the compiled byte code from the compiled effect.
See Also
Tasks
How To: Create and Apply Custom Effects
Reference
Effect.CompileEffectFromFile Method
Effect.CompileEffectFromSource Method
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device that will create the effect.
effectCodeFileStream
Stream containing the compiled byte code.
numberBytes
The number of bytes to read from the file.
options
Compilation optimization options.
pool
Specifies a pool of resources to share between effects.
Exceptions
Exception type Condition
ArgumentNullException
graphicsDevice is null. The graphics device must not be null when creating new resources.
InvalidOperationException
One of the following conditions is true:
effectCodeFileStream does not contain enough data to accommodate the number of bytes re
quested by the numberBytes parameter.
The code contained in effectCodeFileStream is not compiled. Creating an effect requires that t
he shader code has been compiled.
The code contained in effectCodeFileStream does not have a size that is a multiple of four byt
es. Effect and shader code must have a size that is a multiple of four bytes.
Unable to create the effect resource on the graphics device.
ObjectDisposedException
Effect was called after pool was disposed.
Remarks
Tip
In most cases, it is preferrable to initialize a new instance of an effect using the ContentManager.Load<Effect> method rather
than using the Effect constructors. For an example of initializing an effect with this method, see
How To: Create and Apply Custom Effects.
Obtaining the compiled byte code for effectCodeFileStream is a two-part process. First, you must compile the effect by using
the static method Effect.CompileEffectFromFile or Effect.CompileEffectFromSource, either of which returns an instance of
CompiledEffect. CompiledEffect.GetEffectCode returns the compiled byte code from the compiled effect.
See Also
Tasks
How To: Create and Apply Custom Effects
Reference
Effect.CompileEffectFromFile Method
Effect.CompileEffectFromSource Method
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device that will create the effect.
effectCodeFile
A file containing a compiled byte code.
options
Compilation optimization options.
pool
Specifies a pool of resources to share between effects.
Exceptions
Exception type Condition
ArgumentNullException graphicsDevice is null. The graphics device must not be null when creating new resources.
ObjectDisposedException Effect was called after pool was disposed.
InvalidOperationException The code contained in effectCodeFile is not compiled. Creating an effect requires that the shad
er code has been compiled.
The code contained in effectCodeFile does not have a size that is a multiple of four bytes. Effec
t and shader code must have a size that is a multiple of four bytes.
Unable to create the effect resource on the graphics device.
Tip
In most cases, it is preferrable to initialize a new instance of an effect using the ContentManager.Load<Effect> method rather
than using the Effect constructors. For an example of initializing an effect with this method, please see
How To: Create and Apply Custom Effects.
Remarks Obtaining the compiled byte code for effectCodeFile is a two-part process. First, the effect must be compiled using
the static methods Effect.CompileEffectFromFile or Effect.CompileEffectFromSource, which returns an instance of
CompiledEffect. CompiledEffect.GetEffectCode returns the compiled byte code from the compiled effect.
See Also
Tasks
How To: Create and Apply Custom Effects
Reference
Effect.CompileEffectFromFile Method
Effect.CompileEffectFromSource Method
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Effect Methods
Public Methods
Name Description
Begin Overloaded. Begins application of the active technique.
Clone Creates a clone of an effect.
CommitChanges Propagates the state change that occurs inside of an active pass to the device before renderin
g.
CompileEffectFromFile Overloaded. Compiles an effect from a file or stream containing the effect source code.
CompileEffectFromSource Compiles an effect from a string containing the effect source code.
Disassemble Overloaded. Disassembles an effect.
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
End Ends the application of the current technique.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_Disposing Raises the Disposing event when called from within a derived class.
raise_Lost Raises an Lost event when called from within a derived class.
raise_Reset Raises an Reset event when called from within a derived class.
See Also
Reference
Effect Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Effect.Begin Method
Begins application of the active technique.
Overload List
Name Description
Effect.Begin () Begins application of the active technique.
Effect.Begin (SaveStateMode) Begins application of the active technique, specifying options for saving state.
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Effect.Begin Method ()
Begins application of the active technique.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Begin ()
Exceptions
Exception type Condition
InvalidOperationException
Begin has been called before calling End after the last call to Begin. Begin cannot be called again u
ntil End has been successfully called.
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
saveStateMode
Options for saving the state prior to application of the technique.
Exceptions
Exception type Condition
InvalidOperationException
Begin has been called before calling End after the last call to Begin. Begin cannot be called again u
ntil End has been successfully called.
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Effect.Clone Method
Creates a clone of an effect.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public virtual Effect Clone (
GraphicsDevice device
)
Parameters
device
The device associated with the effect.
Return Value
The cloned effect.
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Effect.CommitChanges Method
Propagates the state change that occurs inside of an active pass to the device before rendering.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void CommitChanges ()
RemarksIf the application changes any effect state using the Effect class members that modify state inside of an Begin/End
matching pair, the application must call CommitChanges before any of the various DrawPrimitives methods are called to
propagate state changes to the device before rendering. If no state changes occur within an Begin/End matching pair, it is not
necessary to call CommitChanges.
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Effect.CompileEffectFromFile Method
Compiles an effect from a file or stream containing the effect source code.
Overload List
Name De
scri
pti
on
Effect.CompileEffectFromFile (Stream, CompilerMacro[], CompilerIncludeHandler, CompilerOptions, TargetPlatform) Co
mp
iles
an
effe
ct f
ro
ma
stre
am
con
tain
ing
the
effe
ct s
our
ce c
ode
.
Effect.CompileEffectFromFile (Stream, Int32, CompilerMacro[], CompilerIncludeHandler, CompilerOptions, TargetPlatform) Co
mp
iles
an
effe
ct f
ro
ma
stre
am
con
tain
ing
the
effe
ct s
our
ce c
ode
, sp
ecif
yin
gt
he
nu
mb
er
of
byt
es i
nt
he
stre
am.
Effect.CompileEffectFromFile (String, CompilerMacro[], CompilerIncludeHandler, CompilerOptions, TargetPlatform) Co
mp
iles
an
effe
ct f
ro
ma
file
con
tain
ing
the
effe
ct s
our
ce c
ode
.
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
effectFileStream
File stream containing the effect source code.
preprocessorDefines
Describes preprocessor definitions used by an effect object.
includeHandler
User-implemented interface to provide callbacks for #include directives during shader compilation.
options
Compilation optimization options.
platform
The target platform for the compilation.
Return Value
The compiled effect.
Exceptions
Exception type Condition
ArgumentNullException effectFileStream is null. The stream passed into this method cannot be null.
NotSupportedException effectFileStream is not readable. Streams passed into this method must be readable.
EndOfStreamException effectFileStream does not contain enough data to support this call.
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
effectFileStream
File stream containing the effect source code.
numberBytes
The number of bytes in effectFileStream.
preprocessorDefines
Describes preprocessor definitions used by an effect object.
includeHandler
User-implemented interface to provide callbacks for #include directives during shader compilation.
options
Compilation optimization options.
platform
The target platform for the compilation.
Return Value
The compiled effect.
Exceptions
Exception type Condition
ArgumentNullException effectFileStream is null. The stream passed into this method cannot be null.
NotSupportedException effectFileStream is not readable. Streams passed into this method must be readable.
EndOfStreamException effectFileStream does not contain enough data to support this call.
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
effectFile
The name of the file containing the effect source code.
preprocessorDefines
Describes preprocessor definitions used by an effect object.
includeHandler
User-implemented interface to provide callbacks for #include directives during shader compilation.
options
Compilation optimization options.
platform
The target platform for the compilation.
Return Value
The compiled effect.
Exceptions
Exception type Condition
ArgumentException effectFile is a zero-length string, contains only white space, or contains one or more invalid char
acters as defined by InvalidPathChars.
ArgumentNullException effectFile is null.
PathTooLongException The specified path, file name, or both exceed the system-defined maximum length. For example,
on Windows-based platforms, paths must be less than 248 characters, and file names must be l
ess than 260 characters.
DirectoryNotFoundException The specified path is invalid (for example, it is on an unmapped drive).
UnauthorizedAccessException The effectFile parameter specifies a directory, or the caller does not have the required permissio
n to access the file specified by filename.
FileNotFoundException The file specified in effectFile was not found.
NotSupportedException effectFile is in an invalid format.
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Effect.CompileEffectFromSource Method
Compiles an effect from a string containing the effect source code.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static CompiledEffect CompileEffectFromSource (
string effectFileSource,
CompilerMacro[] preprocessorDefines,
CompilerIncludeHandler includeHandler,
CompilerOptions options,
TargetPlatform platform
)
Parameters
effectFileSource
String containing the effect source code.
preprocessorDefines
Describes preprocessor definitions used by an effect object.
includeHandler
User-implemented interface to provide callbacks for #include directives during shader compilation.
options
Compilation optimization options.
platform
The target platform for the compilation.
Return Value
The compiled effect.
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Effect.Disassemble Method
Disassembles an effect.
Overload List
Name Description
Effect.Disassemble (Boolean) Disassembles this effect.
Effect.Disassemble (Effect, Boolean) Disassembles an effect.
Exceptions
Exception type Condition
InsufficientMemoryException Microsoft Direct3D could not allocate sufficient memory to complete the call.
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
enableColorCode
[MarshalAsAttribute(U1)] true to enable color coding to make the disassembly easier to read.
Return Value
A string that contains the effect assembly (ASM).
Exceptions
Exception type Condition
InsufficientMemoryException Microsoft Direct3D could not allocate sufficient memory to complete the call.
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
effect
The effect to disassemble.
enableColorCode
[MarshalAsAttribute(U1)] true to enable color coding to make the disassembly easier to read.
Return Value
A string that contains the effect assembly (ASM).
Exceptions
Exception type Condition
InsufficientMemoryException Microsoft Direct3D could not allocate sufficient memory to complete the call.
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Effect.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
Effect.Dispose () Immediately releases the unmanaged resources used by this object.
Effect.Dispose (Boolean) Releases the unmanaged resources used by the Effect and optionally releases the managed resources.
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Effect.Dispose Method ()
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
Remarks
This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean)
method with the disposing parameter set to true. Finalize invokes Dispose(Boolean) with disposing set to false.
When the disposing parameter is true, this method releases all resources held by any managed objects that this Effect
references. This method invokes the Dispose method of each referenced object.
Note
Notes to Inheritors
Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects
disposed of in an earlier call to Dispose.
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Effect.End Method
Ends the application of the current technique.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void End ()
Exceptions
Exception type Condition
InvalidOperationException
End was called, but Begin has not yet been called. Begin must be called successfully before End can
be called.
See Also
Tasks
How To: Create and Apply Custom Effects
How To: Use BasicEffect
How To: Create Custom Texture Effects
Reference
Effect.Begin Method
Effect.CurrentTechnique Property
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Effect.Finalize Method
Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the
object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void Finalize ()
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Effect.raise_Disposing Method
Raises the Disposing event when called from within a derived class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected void raise_Disposing (
Object value0,
EventArgs value1
)
Parameters
value0
Invoking object reference; should be this object.
value1
Arguments to pass to the event handler.
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Effect.raise_Lost Method
Raises an Lost event when called from within a derived class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected void raise_Lost (
Object value0,
EventArgs value1
)
Parameters
value0
Invoking object reference; should be this object.
value1
Arguments to pass into the event handler.
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Effect.raise_Reset Method
Raises an Reset event when called from within a derived class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected void raise_Reset (
Object value0,
EventArgs value1
)
Parameters
value0
Invoking object reference; should be this object.
value1
Arguments to pass into the event handler.
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Effect.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Effect Properties
Public Properties
Name Description
Creator Gets the name of the effect creator.
CurrentTechnique Gets or sets the active technique.
EffectPool Gets an EffectPool representing the pool of shared parameters.
Functions Gets a collection of functions that can render the effect.
GraphicsDevice Gets the graphics device that created the effect.
IsDisposed Gets a value that indicates whether the object is disposed.
Parameters Gets a collection of parameters used for this effect.
Techniques Gets a collection of techniques that are defined for this effect.
See Also
Reference
Effect Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Effect.Creator Property
Gets the name of the effect creator.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Creator { get; }
Property Value
The name of the effect creator.
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Effect.CurrentTechnique Property
Gets or sets the active technique.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public EffectTechnique CurrentTechnique { get; set; }
Property Value
The current technique.
Exceptions
Exception type Condition
ArgumentNullException
CurrentTechnique is null. CurrentTechnique cannot be null.
Remarks
Note
The BasicEffect class, which is derived from Effect and inherits the Techniques collection, contains only one available techniqu
e to set as the active technique. The active technique applies the settings that have been set as the properties of the
BasicEffect.
Example
uniform extern float4x4 WorldViewProj : WORLDVIEWPROJECTION;
struct VS_OUTPUT
{
float4 position : POSITION;
float4 color : COLOR0;
};
VS_OUTPUT Transform(
float4 Pos : POSITION,
float4 Color : COLOR0 )
{
VS_OUTPUT Out = (VS_OUTPUT)0;
Out.position = mul(Pos, WorldViewProj);
Out.color = Color;
return Out;
}
float4 PixelShader( VS_OUTPUT vsout ) : COLOR
{
return vsout.color;
}
technique TransformTechnique
{
pass P0
{
vertexShader = compile vs_2_0 Transform();
pixelShader = compile ps_1_1 PixelShader();
}
}
See Also
Tasks
How To: Create and Apply Custom Effects
How To: Create Custom Texture Effects
Reference
Effect.Techniques Property
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Effect.EffectPool Property
Gets an EffectPool representing the pool of shared parameters.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public EffectPool EffectPool { get; }
Property Value
The pool of shared parameters.
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Effect.Functions Property
Gets a collection of functions that can render the effect.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public EffectFunctionCollection Functions { get; }
Property Value
Collection of functions that can render the effect.
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Effect.GraphicsDevice Property
Gets the graphics device that created the effect.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GraphicsDevice GraphicsDevice { get; }
Property Value
The graphics device that created the effect.
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Effect.IsDisposed Property
Gets a value that indicates whether the object is disposed.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsDisposed { get; }
Property Value
true if the object is disposed; false otherwise.
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Effect.Parameters Property
Gets a collection of parameters used for this effect.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public EffectParameterCollection Parameters { get; }
Property Value
The collection of parameters used for this effect.
See Also
Tasks
How To: Create and Apply Custom Effects
How To: Create Custom Texture Effects
How To: Use EffectParameters and EffectTechniques
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Effect.Techniques Property
Gets a collection of techniques that are defined for this effect.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public EffectTechniqueCollection Techniques { get; }
Property Value
A collection of techniques that are defined for this effect.
Remarks
Note
The BasicEffect class, which is derived from Effect and inherits the Techniques collection, contains only one available techniqu
e which will apply the settings which have been set as the properties of the BasicEffect.
Example In this example, an effect file is shown that defines a single technique called TransformTechnique.
uniform extern float4x4 WorldViewProj : WORLDVIEWPROJECTION;
struct VS_OUTPUT
{
float4 position : POSITION;
float4 color : COLOR0;
};
VS_OUTPUT Transform(
float4 Pos : POSITION,
float4 Color : COLOR0 )
{
VS_OUTPUT Out = (VS_OUTPUT)0;
return Out;
}
float4 PixelShader( VS_OUTPUT vsout ) : COLOR
{
return vsout.color;
}
technique TransformTechnique
{
pass P0
{
vertexShader = compile vs_2_0 Transform();
pixelShader = compile ps_1_1 PixelShader();
}
}
When this effect file is loaded as an Effect by the ContentManager, this technique may be set as the active technique by setting
CurrentTechnique to effect.Techniques["TransformTechnique"].
See Also
Tasks
How To: Create and Apply Custom Effects
How To: Use EffectParameters and EffectTechniques
Reference
Effect.CurrentTechnique Property
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Effect Events
Public Events
Name Description
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micro
soft .NET common language runtime (CLR).
Lost Occurs when an object is lost, normally just before a device is reset.
Reset Occurs after the device is reset.
See Also
Reference
Effect Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Effect.Disposing Event
Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET
common language runtime (CLR).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public event EventHandler Disposing
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Effect.Lost Event
Occurs when an object is lost, normally just before a device is reset.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public event EventHandler Lost
Example
To add an event handler that listens for a Lost event, use the following C# code.
C#
effect.Lost += new System.EventHandler( this.LostEventHandler );
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Effect.Reset Event
Occurs after the device is reset.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public event EventHandler Reset
Example
To add an event handler that listens for a Reset event, use the following C# code.
C#
effect.Reset += new System.EventHandler( this.ResetEventHandler );
See Also
Reference
Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectAnnotation Class
Represents an annotation to an EffectParameter.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class EffectAnnotation
See Also
Reference
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectAnnotation Members
The following tables list the members exposed by the EffectAnnotation type.
Public Properties
Name Description
ColumnCount Gets the number of columns in this effect annotation.
Name Gets the name of the effect annotation.
ParameterClass Gets the parameter class of this effect annotation.
ParameterType Gets the parameter type of this effect annotation.
RowCount Gets the row count of this effect annotation.
Semantic Gets the semantic of this effect annotation.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
GetValueBoolean Gets the value of the EffectAnnotation as a Boolean.
GetValueInt32 Gets the value of the EffectAnnotation as a Int32.
GetValueMatrix Gets the value of the EffectAnnotation as a Int32.
GetValueSingle Gets the value of the EffectAnnotation as a Single.
GetValueString Gets the value of the EffectAnnotation as a String.
GetValueVector2 Gets the value of the EffectAnnotation as a Vector2.
GetValueVector3 Gets the value of the EffectAnnotation as a Vector3.
GetValueVector4 Gets the value of the EffectAnnotation as a Vector4.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
EffectAnnotation Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectAnnotation Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
GetValueBoolean Gets the value of the EffectAnnotation as a Boolean.
GetValueInt32 Gets the value of the EffectAnnotation as a Int32.
GetValueMatrix Gets the value of the EffectAnnotation as a Int32.
GetValueSingle Gets the value of the EffectAnnotation as a Single.
GetValueString Gets the value of the EffectAnnotation as a String.
GetValueVector2 Gets the value of the EffectAnnotation as a Vector2.
GetValueVector3 Gets the value of the EffectAnnotation as a Vector3.
GetValueVector4 Gets the value of the EffectAnnotation as a Vector4.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
EffectAnnotation Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectAnnotation.GetValueBoolean Method
Gets the value of the EffectAnnotation as a Boolean.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool GetValueBoolean ()
Return Value
The value of the EffectAnnotation as a Boolean.
See Also
Reference
EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectAnnotation.GetValueInt32 Method
Gets the value of the EffectAnnotation as a Int32.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int GetValueInt32 ()
Return Value
The value of the EffectAnnotation as a Int32.
See Also
Reference
EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectAnnotation.GetValueMatrix Method
Gets the value of the EffectAnnotation as a Int32.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Matrix GetValueMatrix ()
Return Value
The value of the EffectAnnotation as a Int32.
See Also
Reference
EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectAnnotation.GetValueSingle Method
Gets the value of the EffectAnnotation as a Single.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float GetValueSingle ()
Return Value
The value of the EffectAnnotation as a Single.
See Also
Reference
EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectAnnotation.GetValueString Method
Gets the value of the EffectAnnotation as a String.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string GetValueString ()
Return Value
The value of the EffectAnnotation as a String.
See Also
Reference
EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectAnnotation.GetValueVector2 Method
Gets the value of the EffectAnnotation as a Vector2.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector2 GetValueVector2 ()
Return Value
The value of the EffectAnnotation as a Vector2.
See Also
Reference
EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectAnnotation.GetValueVector3 Method
Gets the value of the EffectAnnotation as a Vector3.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 GetValueVector3 ()
Return Value
The value of the EffectAnnotation as a Vector3.
See Also
Reference
EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectAnnotation.GetValueVector4 Method
Gets the value of the EffectAnnotation as a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector4 GetValueVector4 ()
Return Value
The value of the EffectAnnotation as a Vector4.
See Also
Reference
EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectAnnotation Properties
Public Properties
Name Description
ColumnCount Gets the number of columns in this effect annotation.
Name Gets the name of the effect annotation.
ParameterClass Gets the parameter class of this effect annotation.
ParameterType Gets the parameter type of this effect annotation.
RowCount Gets the row count of this effect annotation.
Semantic Gets the semantic of this effect annotation.
See Also
Reference
EffectAnnotation Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectAnnotation.ColumnCount Property
Gets the number of columns in this effect annotation.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int ColumnCount { get; }
Property Value
The number of columns in this effect annotation.
See Also
Reference
EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectAnnotation.Name Property
Gets the name of the effect annotation.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Name { get; }
Property Value
The name of the effect annotation.
See Also
Reference
EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectAnnotation.ParameterClass Property
Gets the parameter class of this effect annotation.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public EffectParameterClass ParameterClass { get; }
Property Value
The parameter class of this effect annotation.
See Also
Reference
EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectAnnotation.ParameterType Property
Gets the parameter type of this effect annotation.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public EffectParameterType ParameterType { get; }
Property Value
The parameter type of this effect annotation.
See Also
Reference
EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectAnnotation.RowCount Property
Gets the row count of this effect annotation.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int RowCount { get; }
Property Value
The row count of this effect annotation.
See Also
Reference
EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectAnnotation.Semantic Property
Gets the semantic of this effect annotation.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Semantic { get; }
Property Value
The semantic of this effect annotation.
See Also
Reference
EffectAnnotation Class
EffectAnnotation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectAnnotationCollection Class
Manipulates a collection of EffectAnnotation objects.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class EffectAnnotationCollection : IEnumerable<EffectAnnotation>
See Also
Reference
EffectAnnotationCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectAnnotationCollection Members
The following tables list the members exposed by the EffectAnnotationCollection type.
Public Properties
Name Description
Count Gets the number of EffectAnnotation objects in this EffectAnnotationCollection.
Item Overloaded. Gets an EffectAnnotation object.
Public Methods
Name Description
Equals (Inherited from Object.)
GetEnumerator Returns an enumerator that can iterate through the EffectAnnotationCollection.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
EffectAnnotationCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectAnnotationCollection Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetEnumerator Returns an enumerator that can iterate through the EffectAnnotationCollection.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
EffectAnnotationCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectAnnotationCollection.GetEnumerator Method
Returns an enumerator that can iterate through the EffectAnnotationCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public IEnumerator<EffectAnnotation> GetEnumerator ()
Return Value
The iterator.
See Also
Reference
EffectAnnotationCollection Class
EffectAnnotationCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectAnnotationCollection Properties
Public Properties
Name Description
Count Gets the number of EffectAnnotation objects in this EffectAnnotationCollection.
Item Overloaded. Gets an EffectAnnotation object.
See Also
Reference
EffectAnnotationCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectAnnotationCollection.Count Property
Gets the number of EffectAnnotation objects in this EffectAnnotationCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Count { get; }
Property Value
The number of EffectAnnotation objects in this EffectAnnotationCollection.
See Also
Reference
EffectAnnotationCollection Class
EffectAnnotationCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectAnnotationCollection.Item Property
Gets an EffectAnnotation object.
Overload List
Name Description
EffectAnnotationCollection.Item (Int32) Gets a specific EffectAnnotation object by using an index value.
EffectAnnotationCollection.Item (String) Gets a specific EffectAnnotation object by using a name.
See Also
Reference
EffectAnnotationCollection Class
EffectAnnotationCollection Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Property Value
The EffectAnnotation object at index index.
See Also
Reference
EffectAnnotationCollection Class
EffectAnnotationCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Property Value
The EffectAnnotation object named name.
See Also
Reference
EffectAnnotationCollection Class
EffectAnnotationCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectFunction Class
Represents a function on an Effect.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class EffectFunction
See Also
Reference
EffectFunction Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectFunction Members
The following tables list the members exposed by the EffectFunction type.
Public Properties
Name Description
Name Gets the name of the function.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
EffectFunction Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectFunction Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
EffectFunction Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectFunction Properties
Public Properties
Name Description
Name Gets the name of the function.
See Also
Reference
EffectFunction Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectFunction.Name Property
Gets the name of the function.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Name { get; }
Property Value
The name of the function.
See Also
Reference
EffectFunction Class
EffectFunction Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectFunctionCollection Class
Manipulates a collection of EffectFunction objects.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class EffectFunctionCollection : IEnumerable<EffectFunction>
See Also
Reference
EffectFunctionCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectFunctionCollection Members
The following tables list the members exposed by the EffectFunctionCollection type.
Public Properties
Name Description
Count Gets the number of EffectFunction objects in this EffectFunctionCollection.
Item Overloaded. Gets an EffectAnnotation object.
Public Methods
Name Description
Equals (Inherited from Object.)
GetEnumerator Returns an enumerator that can iterate through the EffectFunctionCollection.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
EffectFunctionCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectFunctionCollection Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetEnumerator Returns an enumerator that can iterate through the EffectFunctionCollection.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
EffectFunctionCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectFunctionCollection.GetEnumerator Method
Returns an enumerator that can iterate through the EffectFunctionCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public IEnumerator<EffectFunction> GetEnumerator ()
Return Value
The iterator.
See Also
Reference
EffectFunctionCollection Class
EffectFunctionCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectFunctionCollection Properties
Public Properties
Name Description
Count Gets the number of EffectFunction objects in this EffectFunctionCollection.
Item Overloaded. Gets an EffectAnnotation object.
See Also
Reference
EffectFunctionCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectFunctionCollection.Count Property
Gets the number of EffectFunction objects in this EffectFunctionCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Count { get; }
Property Value
The number of EffectFunction objects in this EffectFunctionCollection.
See Also
Reference
EffectFunctionCollection Class
EffectFunctionCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectFunctionCollection.Item Property
Gets an EffectAnnotation object.
Overload List
Name Description
EffectFunctionCollection.Item (Int32) Gets a specific EffectFunction object by using an index value.
EffectFunctionCollection.Item (String) Gets a specific EffectFunction object by using a name.
See Also
Reference
EffectFunctionCollection Class
EffectFunctionCollection Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Property Value
The EffectFunction object at index index.
See Also
Reference
EffectFunctionCollection Class
EffectFunctionCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Property Value
The EffectFunction object named name.
See Also
Reference
EffectFunctionCollection Class
EffectFunctionCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter Class
Represents an Effect parameter.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class EffectParameter
Remarks Creating and assigning a EffectParameter instance for each technique in your Effect is significantly faster than using
the Parameters indexed property on Effect.
Example
To use a EffectParameter you must:
1. Create a EffectParameter for each parameter in your Effect that you will be setting in Draw or Update.
C#
public EffectParameter mWorld;
public EffectParameter mCameraView;
public EffectParameter CameraPos;
public EffectParameter mCameraProj;
See Also
Tasks
How To: Use EffectParameters and EffectTechniques
Reference
EffectParameter Members
Effect.Parameters
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter Members
The following tables list the members exposed by the EffectParameter type.
Public Properties
Name Description
Annotations Gets the collection of EffectAnnotation objects for this parameter.
ColumnCount Gets the number of columns in the parameter description.
Elements Gets the collection of effect parameters.
Name Gets the name of the parameter.
ParameterClass Gets the class of the parameter.
ParameterType Gets the type of the parameter.
RowCount Gets the number of rows in the parameter description.
Semantic Gets the semantic meaning, or usage, of the parameter.
StructureMembers Gets the collection of structure members.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
GetValueBoolean Gets the value of the EffectParameter as a Boolean.
GetValueBooleanArray Gets the value of the EffectParameter as an array of Boolean.
GetValueInt32 Gets the value of the EffectParameter as an Int32.
GetValueInt32Array Gets the value of the EffectParameter as an array of Int32.
GetValueMatrix Gets the value of the EffectParameter as a Matrix.
GetValueMatrixArray Gets the value of the EffectParameter as an array of Matrix.
GetValueMatrixTranspose Gets the value of the EffectParameter as a Matrix transpose.
GetValueMatrixTransposeArray Gets the value of the EffectParameter as an array of Matrix transpose.
GetValueQuaternion Gets the value of the EffectParameter as a Quaternion.
GetValueQuaternionArray Gets the value of the EffectParameter as an array of Quaternion.
GetValueSingle Gets the value of the EffectParameter as a Single.
GetValueSingleArray Gets the value of the EffectParameter as an array of Single.
GetValueString Gets the value of the EffectParameter as an String.
GetValueTexture2D Gets the value of the EffectParameter as a Texture2D.
GetValueTexture3D Gets the value of the EffectParameter as a Texture3D.
GetValueTextureCube Gets the value of the EffectParameter as a TextureCube.
GetValueVector2 Gets the value of the EffectParameter as a Vector2.
GetValueVector2Array Gets the value of the EffectParameter as an array of Vector2.
GetValueVector3 Gets the value of the EffectParameter as a Vector3.
GetValueVector3Array Gets the value of the EffectParameter as an array of Vector3.
GetValueVector4 Gets the value of the EffectParameter as a Vector4.
GetValueVector4Array Gets the value of the EffectParameter as an array of Vector4.
ReferenceEquals (Inherited from Object.)
SetArrayRange Sets the range of an array to pass to the device.
SetValue Overloaded. Sets the value of the EffectParameter.
SetValueTranspose Overloaded. Sets the value of the EffectParameter.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
EffectParameter Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectParameter Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
GetValueBoolean Gets the value of the EffectParameter as a Boolean.
GetValueBooleanArray Gets the value of the EffectParameter as an array of Boolean.
GetValueInt32 Gets the value of the EffectParameter as an Int32.
GetValueInt32Array Gets the value of the EffectParameter as an array of Int32.
GetValueMatrix Gets the value of the EffectParameter as a Matrix.
GetValueMatrixArray Gets the value of the EffectParameter as an array of Matrix.
GetValueMatrixTranspose Gets the value of the EffectParameter as a Matrix transpose.
GetValueMatrixTransposeArray Gets the value of the EffectParameter as an array of Matrix transpose.
GetValueQuaternion Gets the value of the EffectParameter as a Quaternion.
GetValueQuaternionArray Gets the value of the EffectParameter as an array of Quaternion.
GetValueSingle Gets the value of the EffectParameter as a Single.
GetValueSingleArray Gets the value of the EffectParameter as an array of Single.
GetValueString Gets the value of the EffectParameter as an String.
GetValueTexture2D Gets the value of the EffectParameter as a Texture2D.
GetValueTexture3D Gets the value of the EffectParameter as a Texture3D.
GetValueTextureCube Gets the value of the EffectParameter as a TextureCube.
GetValueVector2 Gets the value of the EffectParameter as a Vector2.
GetValueVector2Array Gets the value of the EffectParameter as an array of Vector2.
GetValueVector3 Gets the value of the EffectParameter as a Vector3.
GetValueVector3Array Gets the value of the EffectParameter as an array of Vector3.
GetValueVector4 Gets the value of the EffectParameter as a Vector4.
GetValueVector4Array Gets the value of the EffectParameter as an array of Vector4.
ReferenceEquals (Inherited from Object.)
SetArrayRange Sets the range of an array to pass to the device.
SetValue Overloaded. Sets the value of the EffectParameter.
SetValueTranspose Overloaded. Sets the value of the EffectParameter.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
EffectParameter Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectParameter.GetValueBoolean Method
Gets the value of the EffectParameter as a Boolean.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool GetValueBoolean ()
Return Value
The value of the EffectParameter as a Boolean.
Exceptions
Exception type Condition
InvalidCastException Unable to cast this EffectParameter to type Boolean.
Remarks
Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.GetValueBooleanArray Method
Gets the value of the EffectParameter as an array of Boolean.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool[] GetValueBooleanArray (
int count
)
Parameters
count
The number of elements in the array.
Return Value
The value of the EffectParameter as an array of Boolean.
Exceptions
Exception type Condition
ArgumentOutOfRangeException When attempting to call GetValueBooleanArray which returns an array, you must request t
hat at least one member be returned.
Remarks
Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.GetValueInt32 Method
Gets the value of the EffectParameter as an Int32.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int GetValueInt32 ()
Return Value
Gets the value of the EffectParameter as an Int32.
Exceptions
Exception type Condition
InvalidCastException Unable to cast this EffectParameter to type Int32.
Remarks
Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.GetValueInt32Array Method
Gets the value of the EffectParameter as an array of Int32.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int[] GetValueInt32Array (
int count
)
Parameters
count
The number of elements in the array.
Return Value
The value of the EffectParameter as an array of Int32.
Exceptions
Exception type Condition
ArgumentOutOfRangeException When attempting to call GetValueInt32Array which returns an array, you must request that
at least one member be returned.
Remarks
Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.GetValueMatrix Method
Gets the value of the EffectParameter as a Matrix.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Matrix GetValueMatrix ()
Return Value
The value of the EffectParameter as a Matrix.
Exceptions
Exception type Condition
InvalidCastException Unable to cast this EffectParameter to type Matrix.
Remarks
Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.GetValueMatrixArray Method
Gets the value of the EffectParameter as an array of Matrix.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Matrix[] GetValueMatrixArray (
int count
)
Parameters
count
The number of elements in the array.
Return Value
The value of the EffectParameter as an array of Matrix.
Exceptions
Exception type Condition
ArgumentOutOfRangeException When attempting to call GetValueMatrixArray which returns an array, you must request tha
t at least one member be returned.
InvalidCastException Unable to cast this EffectParameter to an array of type Matrix.
Remarks
Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.GetValueMatrixTranspose Method
Gets the value of the EffectParameter as a Matrix transpose.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Matrix GetValueMatrixTranspose ()
Return Value
The value of the EffectParameter as a Matrix transpose.
Exceptions
Exception type Condition
InvalidCastException Unable to cast this EffectParameter to type Matrix.
Remarks
Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.GetValueMatrixTransposeArray Method
Gets the value of the EffectParameter as an array of Matrix transpose.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Matrix[] GetValueMatrixTransposeArray (
int count
)
Parameters
count
The number of elements in the array.
Return Value
The value of the EffectParameter as an array of Matrix transpose.
Exceptions
Exception type Condition
ArgumentOutOfRangeException count is less than or equal to zero. count must be greater than our equal to one.
InvalidCastException Unable to cast this EffectParameter to an array of type Matrix.
Remarks
Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.GetValueQuaternion Method
Gets the value of the EffectParameter as a Quaternion.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Quaternion GetValueQuaternion ()
Return Value
The value of the EffectParameter as a Quaternion.
Exceptions
Exception type Condition
InvalidCastException Unable to cast this EffectParameter to type Quaternion.
Remarks
Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.GetValueQuaternionArray Method
Gets the value of the EffectParameter as an array of Quaternion.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Quaternion[] GetValueQuaternionArray (
int count
)
Parameters
count
The number of elements in the array.
Return Value
The value of the EffectParameter as an array of Quaternion.
Exceptions
Exception type Condition
ArgumentOutOfRangeException count is less than or equal to zero. count must be greater than or equal to one.
InvalidCastException Unable to cast this EffectParameter to an array of type Quaternion.
Remarks
Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.GetValueSingle Method
Gets the value of the EffectParameter as a Single.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float GetValueSingle ()
Return Value
The value of the EffectParameter as a Single.
Exceptions
Exception type Condition
InvalidCastException Unable to cast this EffectParameter to type Single.
Remarks
Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.GetValueSingleArray Method
Gets the value of the EffectParameter as an array of Single.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float[] GetValueSingleArray (
int count
)
Parameters
count
The number of elements in the array.
Return Value
The value of the EffectParameter as an array of Single.
Exceptions
Exception type Condition
ArgumentOutOfRangeException count is less than or equal to zero. count must be greater than or equal to one.
InvalidCastException Unable to cast this EffectParameter to an array of type Single.
Remarks
Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.GetValueString Method
Gets the value of the EffectParameter as an String.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string GetValueString ()
Return Value
The value of the EffectParameter as an String.
Exceptions
Exception type Condition
InvalidCastException Unable to cast this EffectParameter to type String.
Remarks
Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.GetValueTexture2D Method
Gets the value of the EffectParameter as a Texture2D.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Texture2D GetValueTexture2D ()
Return Value
The value of the EffectParameter as a Texture2D.
Exceptions
Exception type Condition
InvalidOperationException The resource is not of type ResourceType.Texture2D.
InvalidCastException Unable to cast this EffectParameter to type Texture2D.
Remarks
Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.GetValueTexture3D Method
Gets the value of the EffectParameter as a Texture3D.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Texture3D GetValueTexture3D ()
Return Value
The value of the EffectParameter as a Texture3D.
Exceptions
Exception type Condition
InvalidOperationException The resource is not of type ResourceType.Texture3D.
InvalidCastException Unable to cast this EffectParameter to type Texture3D.
Remarks
Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.GetValueTextureCube Method
Gets the value of the EffectParameter as a TextureCube.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureCube GetValueTextureCube ()
Return Value
The value of the EffectParameter as a TextureCube.
Exceptions
Exception type Condition
InvalidOperationException The resource is not of type ResourceType.TextureCube.
InvalidCastException Unable to cast this EffectParameter to type TextureCube.
Remarks
Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.GetValueVector2 Method
Gets the value of the EffectParameter as a Vector2.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector2 GetValueVector2 ()
Return Value
The value of the EffectParameter as a Vector2.
Exceptions
Exception type Condition
InvalidCastException Unable to cast this EffectParameter to an object of type Vector2.
Remarks
Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.GetValueVector2Array Method
Gets the value of the EffectParameter as an array of Vector2.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector2[] GetValueVector2Array (
int count
)
Parameters
count
The number of elements in the array.
Return Value
The value of the EffectParameter as an array of Vector2.
Exceptions
Exception type Condition
ArgumentOutOfRangeException count is less than or equal to zero. count must be greater than or equal to one.
InvalidCastException Unable to cast this EffectParameter to an array of type Vector2.
Remarks
Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.GetValueVector3 Method
Gets the value of the EffectParameter as a Vector3.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 GetValueVector3 ()
Return Value
The value of the EffectParameter as a Vector3.
Exceptions
Exception type Condition
InvalidCastException Unable to cast this EffectParameter to an object of type Vector3.
Remarks
Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.GetValueVector3Array Method
Gets the value of the EffectParameter as an array of Vector3.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3[] GetValueVector3Array (
int count
)
Parameters
count
The number of elements in the array.
Return Value
The value of the EffectParameter as an array of Vector3.
Exceptions
Exception type Condition
ArgumentOutOfRangeException count is less than or equal to zero. count must be greater than or equal to one.
InvalidCastException Unable to cast this EffectParameter to an array of type Vector3.
Remarks
Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.GetValueVector4 Method
Gets the value of the EffectParameter as a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector4 GetValueVector4 ()
Return Value
The value of the EffectParameter as a Vector4.
Exceptions
Exception type Condition
InvalidCastException Unable to cast this EffectParameter to type Vector4.
Remarks
Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.GetValueVector4Array Method
Gets the value of the EffectParameter as an array of Vector4.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector4[] GetValueVector4Array (
int count
)
Parameters
count
The number of elements in the array.
Return Value
The value of the EffectParameter as an array of Vector4.
Exceptions
Exception type Condition
ArgumentOutOfRangeException count is less than or equal to zero. count must be greater than or equal to one.
InvalidCastException Unable to cast this EffectParameter to an array of type Vector4.
Remarks
Getting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.SetArrayRange Method
Sets the range of an array to pass to the device.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void SetArrayRange (
int start,
int end
)
Parameters
start
The start index.
end
The stop index.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.SetValue Method
Sets the value of the EffectParameter.
Overload List
Name Description
EffectParameter.SetValue (Boolean) Sets the value of the EffectParameter.
EffectParameter.SetValue (Boolean[]) Sets the value of the EffectParameter.
EffectParameter.SetValue (Int32) Sets the value of the EffectParameter.
EffectParameter.SetValue (Int32[]) Sets the value of the EffectParameter.
EffectParameter.SetValue (Matrix) Sets the value of the EffectParameter.
EffectParameter.SetValue (Matrix[]) Sets the value of the EffectParameter.
EffectParameter.SetValue (Quaternion) Sets the value of the EffectParameter.
EffectParameter.SetValue (Quaternion[]) Sets the value of the EffectParameter.
EffectParameter.SetValue (Single) Sets the value of the EffectParameter.
EffectParameter.SetValue (Single[]) Sets the value of the EffectParameter.
EffectParameter.SetValue (String) Sets the value of the EffectParameter.
EffectParameter.SetValue (Texture) Sets the value of the EffectParameter.
EffectParameter.SetValue (Vector2) Sets the value of the EffectParameter.
EffectParameter.SetValue (Vector2[]) Sets the value of the EffectParameter.
EffectParameter.SetValue (Vector3) Sets the value of the EffectParameter.
EffectParameter.SetValue (Vector3[]) Sets the value of the EffectParameter.
EffectParameter.SetValue (Vector4) Sets the value of the EffectParameter.
EffectParameter.SetValue (Vector4[]) Sets the value of the EffectParameter.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Tasks
How To: Create and Apply Custom Effects
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
value
[MarshalAsAttribute(U1)] The value to assign to the EffectParameter.
Exceptions
Exception type Condition
InvalidCastException Unable to cast this EffectParameter to type Boolean.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The value to assign to the EffectParameter.
Exceptions
Exception type Condition
InvalidCastException Unable to cast this EffectParameter to an array of type Boolean.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The value to assign to the EffectParameter.
Exceptions
Exception type Condition
InvalidCastException Unable to cast this EffectParameter to type Int32.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The value to assign to the EffectParameter.
Exceptions
Exception type Condition
InvalidCastException Unable to cast this EffectParameter to an arry of type Int32.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The value to assign to the EffectParameter.
Exceptions
Exception type Condition
InvalidCastException Unable to cast this EffectParameter to type Matrix.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The value to assign to the EffectParameter.
Exceptions
Exception type Condition
InvalidCastException Unable to cast this EffectParameter to an array of type Matrix.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The value to assign to the EffectParameter.
Exceptions
Exception type Condition
InvalidCastException Unable to cast this EffectParameter to type Quaternion.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The value to assign to the EffectParameter.
Exceptions
Exception type Condition
InvalidCastException Unable to cast this EffectParameter to an array of type Quaternion.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The value to assign to the EffectParameter.
Exceptions
Exception type Condition
InvalidCastException Unable to cast this EffectParameter to type Single.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The value to assign to the EffectParameter.
Exceptions
Exception type Condition
InvalidCastException Unable to cast this EffectParameter to an array of type Single.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The value to assign to the EffectParameter.
Exceptions
Exception type Condition
InvalidCastException Unable to cast this EffectParameter to type String.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The value to assign to the EffectParameter.
Exceptions
Exception type Condition
ObjectDisposedException SetValue was called after value was disposed.
InvalidCastException Unable to cast this EffectParameter to type Texture.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The value to assign to the EffectParameter.
Exceptions
Exception type Condition
InvalidCastException Unable to cast this EffectParameter to type Vector2.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The value to assign to the EffectParameter.
Exceptions
Exception type Condition
InvalidCastException Unable to cast this EffectParameter to an array of type Vector2.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The value to assign to the EffectParameter.
Exceptions
Exception type Condition
InvalidCastException Unable to cast this EffectParameter to type Vector3.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The value to assign to the EffectParameter.
Exceptions
Exception type Condition
InvalidCastException Unable to cast this EffectParameter to an array of type Vector3.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The value to assign to the EffectParameter.
Exceptions
Exception type Condition
InvalidCastException Unable to cast this EffectParameter to type Vector4.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The value to assign to the EffectParameter.
Exceptions
Exception type Condition
InvalidCastException Unable to cast this EffectParameter to an array of type Vector4.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.SetValueTranspose Method
Sets the value of the EffectParameter.
Overload List
Name Description
EffectParameter.SetValueTranspose (Matrix) Sets the value of the EffectParameter to the transpose of a Matrix.
EffectParameter.SetValueTranspose (Matrix[]) Sets the value of the EffectParameter to the transpose of a Matrix.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
value
The value.
Exceptions
Exception type Condition
InvalidCastException This EffectParameter is not a matrix of the correct size to contain the transpose of the matrix specified in v
alue.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
value
The value.
Exceptions
Exception type Condition
InvalidCastException This EffectParameter is not a matrix of the correct size to contain the transpose of the matrix specified in v
alue.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter Properties
Public Properties
Name Description
Annotations Gets the collection of EffectAnnotation objects for this parameter.
ColumnCount Gets the number of columns in the parameter description.
Elements Gets the collection of effect parameters.
Name Gets the name of the parameter.
ParameterClass Gets the class of the parameter.
ParameterType Gets the type of the parameter.
RowCount Gets the number of rows in the parameter description.
Semantic Gets the semantic meaning, or usage, of the parameter.
StructureMembers Gets the collection of structure members.
See Also
Reference
EffectParameter Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectParameter.Annotations Property
Gets the collection of EffectAnnotation objects for this parameter.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public EffectAnnotationCollection Annotations { get; }
Property Value
The collection of EffectAnnotation objects.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.ColumnCount Property
Gets the number of columns in the parameter description.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int ColumnCount { get; }
Property Value
The number of columns in the parameter description.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.Elements Property
Gets the collection of effect parameters.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public EffectParameterCollection Elements { get; }
Property Value
The collection of effect parameters.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.Name Property
Gets the name of the parameter.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Name { get; }
Property Value
The name of the parameter.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.ParameterClass Property
Gets the class of the parameter.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public EffectParameterClass ParameterClass { get; }
Property Value
The parameter class.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.ParameterType Property
Gets the type of the parameter.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public EffectParameterType ParameterType { get; }
Property Value
The parameter type.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.RowCount Property
Gets the number of rows in the parameter description.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int RowCount { get; }
Property Value
The number of rows in the parameter description.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.Semantic Property
Gets the semantic meaning, or usage, of the parameter.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Semantic { get; }
Property Value
The semantic meaning of the parameter.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameter.StructureMembers Property
Gets the collection of structure members.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public EffectParameterCollection StructureMembers { get; }
Property Value
The collection of structure members.
See Also
Reference
EffectParameter Class
EffectParameter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameterBlock Class
Represents an EffectParameter state block.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class EffectParameterBlock : IDisposable
See Also
Reference
EffectParameterBlock Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameterBlock Members
The following tables list the members exposed by the EffectParameterBlock type.
Public Constructors
Name Description
EffectParameterBlock Initializes a new instance of the EffectParameterBlock class.
Public Methods
Name Description
Apply Applies the parameter changes in the EffectParameterBlock to the current effect state.
Begin Begins capturing parameter state changes from the parent Effect.
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
End Stops capturing state changes from the parent Effect.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
See Also
Reference
EffectParameterBlock Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectParameterBlock Constructor
Initializes a new instance of the EffectParameterBlock class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public EffectParameterBlock (
Effect parent
)
Parameters
parent
The Effect used to generate the EffectParameterBlock.
See Also
Reference
EffectParameterBlock Class
EffectParameterBlock Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameterBlock Methods
Public Methods
Name Description
Apply Applies the parameter changes in the EffectParameterBlock to the current effect state.
Begin Begins capturing parameter state changes from the parent Effect.
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
End Stops capturing state changes from the parent Effect.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
See Also
Reference
EffectParameterBlock Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectParameterBlock.Apply Method
Applies the parameter changes in the EffectParameterBlock to the current effect state.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Apply ()
See Also
Reference
EffectParameterBlock Class
EffectParameterBlock Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameterBlock.Begin Method
Begins capturing parameter state changes from the parent Effect.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Begin ()
Exceptions
Exception type Condition
InvalidOperationException Begin has been called before calling End after the last call to Begin. Begin cannot be called again u
ntil End has been successfully called.
See Also
Reference
EffectParameterBlock Class
EffectParameterBlock Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameterBlock.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
EffectParameterBlock.Dispose () Immediately releases the unmanaged resources used by this object.
EffectParameterBlock.Dispose (Boolean) Releases the unmanaged resources used by the EffectParameterBlock and optionally r
eleases the managed resources.
See Also
Reference
EffectParameterBlock Class
EffectParameterBlock Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectParameterBlock.Dispose Method ()
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
See Also
Reference
EffectParameterBlock Class
EffectParameterBlock Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
Remarks
This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean)
method with the disposing parameter set to true. Finalize invokes Dispose(Boolean) with disposing set to false.
When the disposing parameter is true, this method releases all resources held by any managed objects that this
EffectParameterBlock references. This method invokes the Dispose method of each referenced object.
Note
Notes to Inheritors
Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects
disposed of in an earlier call to Dispose.
See Also
Reference
EffectParameterBlock Class
EffectParameterBlock Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameterBlock.End Method
Stops capturing state changes from the parent Effect.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void End ()
Exceptions
Exception type Condition
InvalidOperationException End was called, but Begin has not yet been called. Begin must be called successfully before End can
be called.
See Also
Reference
EffectParameterBlock Class
EffectParameterBlock Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameterBlock.Finalize Method
Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the
object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void Finalize ()
See Also
Reference
EffectParameterBlock Class
EffectParameterBlock Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameterClass Enumeration
Defines classes that can be used for effect parameters or shader constants.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum EffectParameterClass
Members
Member name Description
MatrixColumns Constant is a column major matrix.
MatrixRows Constant is a row major matrix.
Object Constant is either a texture, a shader, or a string.
Scalar Constant is a scalar.
Struct Constant is a structure.
Vector Constant is a vector.
See Also
Reference
EffectParameter.ParameterClass Property
ShaderConstant.ParameterClass Property
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameterCollection Class
Manipulates a collection of EffectParameter objects.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class EffectParameterCollection : IEnumerable<EffectParameter>
See Also
Reference
EffectParameterCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameterCollection Members
The following tables list the members exposed by the EffectParameterCollection type.
Public Properties
Name Description
Count Gets the number of EffectParameter objects in this EffectParameterCollection.
Item Overloaded. Gets an EffectParameter object.
Public Methods
Name Description
Equals (Inherited from Object.)
GetEnumerator Returns an enumerator that can iterate through the EffectParameterCollection.
GetHashCode (Inherited from Object.)
GetParameterBySemantic Gets the handle of a top-level parameter or a structure member parameter by looking up its sem
antic with a case-insensitive search.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
EffectParameterCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectParameterCollection Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetEnumerator Returns an enumerator that can iterate through the EffectParameterCollection.
GetHashCode (Inherited from Object.)
GetParameterBySemantic Gets the handle of a top-level parameter or a structure member parameter by looking up its sem
antic with a case-insensitive search.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
EffectParameterCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectParameterCollection.GetEnumerator Method
Returns an enumerator that can iterate through the EffectParameterCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public IEnumerator<EffectParameter> GetEnumerator ()
Return Value
The iterator.
See Also
Reference
EffectParameterCollection Class
EffectParameterCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameterCollection.GetParameterBySemantic Method
Gets the handle of a top-level parameter or a structure member parameter by looking up its semantic with a case-insensitive
search.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public EffectParameter GetParameterBySemantic (
string semantic
)
Parameters
semantic
The name of the semantic to search for.
Return Value
The first parameter that matches the semantic, or null if no matching parameter was found.
Remarks
Getting an effect parameter by semantic is a slow operation. Avoid-high frequency calls.
See Also
Reference
EffectParameterCollection Class
EffectParameterCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameterCollection Properties
Public Properties
Name Description
Count Gets the number of EffectParameter objects in this EffectParameterCollection.
Item Overloaded. Gets an EffectParameter object.
See Also
Reference
EffectParameterCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectParameterCollection.Count Property
Gets the number of EffectParameter objects in this EffectParameterCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Count { get; }
Property Value
The number of EffectParameter objects in this EffectParameterCollection.
See Also
Reference
EffectParameterCollection Class
EffectParameterCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameterCollection.Item Property
Gets an EffectParameter object.
Overload List
Name Description
EffectParameterCollection.Item (Int32) Gets a specific EffectParameter object by using an index value.
EffectParameterCollection.Item (String) Gets a specific EffectParameter by name.
See Also
Reference
EffectParameterCollection Class
EffectParameterCollection Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Property Value
The EffectParameter object at index index.
See Also
Reference
EffectParameterCollection Class
EffectParameterCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Property Value
The EffectParameter object named name.
See Also
Reference
EffectParameterCollection Class
EffectParameterCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectParameterType Enumeration
Defines types that can be used for effect parameters or shader constants.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum EffectParameterType
Members
Member Description
name
Bool Parameter is a Boolean. Any nonzero value passed in will be mapped to 1 (TRUE) before being written into the con
stant table; otherwise, the value will be set to 0 in the constant table.
Int32 Parameter is an integer. Any floating-point values passed in will be rounded off (to zero decimal places) before bei
ng written into the constant table.
PixelSha Parameter is a pixel shader.
der
Sampler Parameter is a sampler.
Sampler Parameter is a 1D sampler.
1D
Sampler Parameter is a 2D sampler.
2D
Sampler Parameter is a 3D sampler.
3D
Sampler Parameter is a cube sampler.
Cube
Single Parameter is a floating-point number.
String Parameter is a string.
Texture Parameter is a texture.
Texture1 Parameter is a 1D texture.
D
Texture2 Parameter is a 2D texture.
D
Texture3 Parameter is a 3D texture.
D
TextureC Parameter is a cube texture.
ube
VertexSh Parameter is a vertex shader.
ader
Void Parameter is a void pointer.
See Also
Reference
EffectParameter.ParameterType Property
ShaderConstant.ParameterType Property
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectPass Class
Represents an effect pass.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class EffectPass
See Also
Reference
EffectPass Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectPass Members
The following tables list the members exposed by the EffectPass type.
Public Properties
Name Description
Annotations Gets the set of EffectAnnotation objects for this EffectPass.
Name Gets the name of this pass.
Public Methods
Name Description
Begin Begins a pass within the active technique.
End Ends a pass within the active technique.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
EffectPass Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectPass Methods
Public Methods
Name Description
Begin Begins a pass within the active technique.
End Ends a pass within the active technique.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
EffectPass Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectPass.Begin Method
Begins a pass within the active technique.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Begin ()
Exceptions
Exception type Condition
InvalidOperationException
Begin has been called before calling End after the last call to Begin. Begin cannot be called again u
ntil End has been successfully called.
Remarks
An application sets one active pass (within one active technique) in the effect system by calling Begin. An application signals
the end of the active pass by calling End. Begin and End must occur in a matching pair, within a matching pair of Effect.Begin
and Effect.End calls.
If the application changes any effect state using any of the Effect methods inside of a Begin/End matching pair, the application
must call CommitChanges to set the update the device with the state changes. If no state changes occur within a Begin and End
matching pair, it is not necessary to call CommitChanges.
See Also
Tasks
How To: Create and Apply Custom Effects
How To: Use BasicEffect
How To: Create Custom Texture Effects
Reference
EffectPass Class
EffectPass Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectPass.End Method
Ends a pass within the active technique.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void End ()
Exceptions
Exception type Condition
InvalidOperationException
End was called, but Begin has not yet been called. Begin must be called successfully before End can
be called.
Remarks
An application signals the end of rendering an active pass by calling End. Each End must be part of a matching pair of Begin
and End calls.
Begin and End must occur in a matching pair, within a matching pair of Effect.Begin and Effect.End calls.
If the application changes any effect state using any of the Effect methods inside of a Begin/End matching pair, the application
must call CommitChanges to set the update the device with the state changes. If no state changes occur within a Begin and End
matching pair, it is not necessary to call CommitChanges.
See Also
Tasks
How To: Create and Apply Custom Effects
How To: Use BasicEffect
How To: Create Custom Texture Effects
Reference
EffectPass Class
EffectPass Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectPass Properties
Public Properties
Name Description
Annotations Gets the set of EffectAnnotation objects for this EffectPass.
Name Gets the name of this pass.
See Also
Reference
EffectPass Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectPass.Annotations Property
Gets the set of EffectAnnotation objects for this EffectPass.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public EffectAnnotationCollection Annotations { get; }
Property Value
The EffectAnnotationCollection containing EffectAnnotation objects for this EffectPass.
See Also
Reference
EffectPass Class
EffectPass Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectPass.Name Property
Gets the name of this pass.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Name { get; }
Property Value
The name of this pass.
See Also
Reference
EffectPass Class
EffectPass Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectPassCollection Class
Manipulates a collection of EffectPass objects.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class EffectPassCollection : IEnumerable<EffectPass>
See Also
Reference
EffectPassCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectPassCollection Members
The following tables list the members exposed by the EffectPassCollection type.
Public Properties
Name Description
Count Gets the number of objects in the collection.
Item Overloaded. Gets an element in the collection.
Public Methods
Name Description
Equals (Inherited from Object.)
GetEnumerator Returns an enumerator that can iterate through the collection.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
EffectPassCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectPassCollection Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetEnumerator Returns an enumerator that can iterate through the collection.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
EffectPassCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectPassCollection.GetEnumerator Method
Returns an enumerator that can iterate through the collection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public IEnumerator<EffectPass> GetEnumerator ()
Return Value
Enumerator that can iterate through the collection.
See Also
Reference
EffectPassCollection Class
EffectPassCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectPassCollection Properties
Public Properties
Name Description
Count Gets the number of objects in the collection.
Item Overloaded. Gets an element in the collection.
See Also
Reference
EffectPassCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectPassCollection.Count Property
Gets the number of objects in the collection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Count { get; }
Property Value
The number of objects in the collection.
See Also
Reference
EffectPassCollection Class
EffectPassCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectPassCollection.Item Property
Gets an element in the collection.
Overload List
Name Description
EffectPassCollection.Item (Int32) Gets a specific element in the collection by using an index value.
EffectPassCollection.Item (String) Gets a specific element in the collection by using a name.
See Also
Reference
EffectPassCollection Class
EffectPassCollection Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Property Value
The object at index index.
See Also
Reference
EffectPassCollection Class
EffectPassCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Property Value
The object named name.
See Also
Reference
EffectPassCollection Class
EffectPassCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectPool Class
Allows applications to share resources between effects.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class EffectPool : IDisposable
See Also
Reference
EffectPool Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectPool Members
The following tables list the members exposed by the EffectPool type.
Public Constructors
Name Description
EffectPool Initializes a new instance of this class.
Public Properties
Name Description
IsDisposed Gets a value that indicates whether the object is disposed.
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_Disposing Raises the Disposing event when called from within a derived class.
Public Events
Name Description
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micro
soft .NET common language runtime.
See Also
Reference
EffectPool Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectPool Constructor
Initializes a new instance of this class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public EffectPool ()
Exceptions
Exception type Condition
InvalidOperationException Unable to create this EffectPool resource on the graphics device.
See Also
Reference
EffectPool Class
EffectPool Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectPool Methods
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_Disposing Raises the Disposing event when called from within a derived class.
See Also
Reference
EffectPool Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectPool.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
EffectPool.Dispose () Immediately releases the unmanaged resources used by this object.
EffectPool.Dispose (Boolean) Immediately releases the unmanaged resources used by this object.
Remarks
Call Dispose when you are finished using the EffectPool. The Dispose method leaves the EffectPool in an unusable state. After
calling Dispose, you must release all references to the EffectPool so the garbage collector can reclaim the memory that the
EffectPool was occupying.
Note
Always call Dispose before you release your last reference to the EffectPool. Otherwise, the resources it is using will not be fr
eed until the garbage collector calls the EffectPool object's Finalize method.
See Also
Reference
EffectPool Class
EffectPool Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectPool.Dispose Method ()
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
Remarks
Call Dispose when you are finished using the EffectPool. The Dispose method leaves the EffectPool in an unusable state. After
calling Dispose, you must release all references to the EffectPool so the garbage collector can reclaim the memory that the
EffectPool was occupying.
Note
Always call Dispose before you release your last reference to the EffectPool. Otherwise, the resources it is using will not be fr
eed until the garbage collector calls the EffectPool object's Finalize method.
See Also
Reference
EffectPool Class
EffectPool Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
Remarks
This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean)
method with the disposing parameter set to true. Finalize invokes Dispose(Boolean) with disposing set to false.
When the disposing parameter is true, this method releases all resources held by any managed objects that this EffectPool
references. This method invokes the Dispose method of each referenced object.
Note
Notes to Inheritors
Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects
disposed of in an earlier call to Dispose.
See Also
Reference
EffectPool Class
EffectPool Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectPool.Finalize Method
Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the
object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void Finalize ()
Remarks
This method overrides System.Object.Finalize. Application code should not call this method; an object's Finalize method is
automatically invoked during garbage collection, unless a call to the GC.SuppressFinalize method has disabled finalization by
the garbage collector.
See Also
Reference
EffectPool Class
EffectPool Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectPool.raise_Disposing Method
Raises the Disposing event when called from within a derived class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected void raise_Disposing (
Object value0,
EventArgs value1
)
Parameters
value0
Invoking object reference; should be this object.
value1
Arguments to pass to the event handler.
See Also
Reference
EffectPool Class
EffectPool Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectPool.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
EffectPool Class
EffectPool Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectPool Properties
Public Properties
Name Description
IsDisposed Gets a value that indicates whether the object is disposed.
See Also
Reference
EffectPool Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectPool.IsDisposed Property
Gets a value that indicates whether the object is disposed.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsDisposed { get; }
Property Value
true if the object is disposed; false otherwise.
See Also
Reference
EffectPool Class
EffectPool Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectPool Events
Public Events
Name Description
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micro
soft .NET common language runtime.
See Also
Reference
EffectPool Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectPool.Disposing Event
Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET
common language runtime.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public event EventHandler Disposing
See Also
Reference
EffectPool Class
EffectPool Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectTechnique Class
Represents an effect technique.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class EffectTechnique
RemarksCreating and assigning a EffectTechnique instance for each technique in your Effect is significantly faster than using
the Techniques indexed property on Effect.
Example
To use a EffectTechnique you must:
1. Create a EffectTechnique for each technique in your Effect.
C#
public EffectTechnique texture;
public EffectTechnique shadows;
public EffectTechnique shadowMap;
See Also
Tasks
How To: Use EffectParameters and EffectTechniques
Reference
EffectTechnique Members
Effect.Techniques
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectTechnique Members
The following tables list the members exposed by the EffectTechnique type.
Public Properties
Name Description
Annotations Gets the EffectAnnotation objects associated with this technique.
Name Gets the name of this technique.
Passes Gets the number of passes this rendering technique requires.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
IsParameterUsed Determines whether a given EffectParameter is used by this technique.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Validate Validates this technique.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
EffectTechnique Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectTechnique Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
IsParameterUsed Determines whether a given EffectParameter is used by this technique.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Validate Validates this technique.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
EffectTechnique Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectTechnique.IsParameterUsed Method
Determines whether a given EffectParameter is used by this technique.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsParameterUsed (
EffectParameter parameter
)
Parameters
parameter
The effect parameter to check.
Return Value
true if the parameter is used by this technique; false otherwise.
Exceptions
Exception type Condition
ArgumentNullException parameter is null.
See Also
Reference
EffectTechnique Class
EffectTechnique Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectTechnique.Validate Method
Validates this technique.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool Validate ()
Return Value
true if the technique is valid; false otherwise.
See Also
Reference
EffectTechnique Class
EffectTechnique Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectTechnique Properties
Public Properties
Name Description
Annotations Gets the EffectAnnotation objects associated with this technique.
Name Gets the name of this technique.
Passes Gets the number of passes this rendering technique requires.
See Also
Reference
EffectTechnique Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectTechnique.Annotations Property
Gets the EffectAnnotation objects associated with this technique.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public EffectAnnotationCollection Annotations { get; }
Property Value
The EffectAnnotation objects associated with this technique.
See Also
Reference
EffectTechnique Class
EffectTechnique Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectTechnique.Name Property
Gets the name of this technique.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Name { get; }
Property Value
The name of this technique.
See Also
Reference
EffectTechnique Class
EffectTechnique Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectTechnique.Passes Property
Gets the number of passes this rendering technique requires.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public EffectPassCollection Passes { get; }
Property Value
The number of passes this rendering technique requires.
Remarks
Some video cards can render two textures in a single pass. However, if a card does not have this capability, it is often possible
to render the same effect in two passes, using one texture for each pass.
See Also
Reference
EffectTechnique Class
EffectTechnique Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectTechniqueCollection Class
Manipulates a collection of EffectTechnique objects.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class EffectTechniqueCollection : IEnumerable<EffectTechnique>
See Also
Reference
EffectTechniqueCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectTechniqueCollection Members
The following tables list the members exposed by the EffectTechniqueCollection type.
Public Properties
Name Description
Count Gets the number of objects in the collection.
Item Overloaded. Gets an element in the collection.
Public Methods
Name Description
Equals (Inherited from Object.)
GetEnumerator Returns an enumerator that can iterate through the collection.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
GetValidTechniques Returns all of the valid techniques in this collection.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
EffectTechniqueCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectTechniqueCollection Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetEnumerator Returns an enumerator that can iterate through the collection.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
GetValidTechniques Returns all of the valid techniques in this collection.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
EffectTechniqueCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectTechniqueCollection.GetEnumerator Method
Returns an enumerator that can iterate through the collection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public IEnumerator<EffectTechnique> GetEnumerator ()
Return Value
Enumerator for the effect technique collection.
See Also
Reference
EffectTechniqueCollection Class
EffectTechniqueCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectTechniqueCollection.GetValidTechniques Method
Returns all of the valid techniques in this collection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public IEnumerable<EffectTechnique> GetValidTechniques ()
Return Value
An enumeration of all the valid techniques in this collection.
See Also
Reference
EffectTechniqueCollection Class
EffectTechniqueCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectTechniqueCollection Properties
Public Properties
Name Description
Count Gets the number of objects in the collection.
Item Overloaded. Gets an element in the collection.
See Also
Reference
EffectTechniqueCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
EffectTechniqueCollection.Count Property
Gets the number of objects in the collection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Count { get; }
Property Value
The number of objects in the collection.
See Also
Reference
EffectTechniqueCollection Class
EffectTechniqueCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
EffectTechniqueCollection.Item Property
Gets an element in the collection.
Overload List
Name Description
EffectTechniqueCollection.Item (Int32) Gets a specific element in the collection by using an index value.
EffectTechniqueCollection.Item (String) Gets a specific element in the collection by using a name.
See Also
Reference
EffectTechniqueCollection Class
EffectTechniqueCollection Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Property Value
The object at index index.
See Also
Reference
EffectTechniqueCollection Class
EffectTechniqueCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Property Value
The object named name.
See Also
Reference
EffectTechniqueCollection Class
EffectTechniqueCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
FillMode Enumeration
Describes options for filling the vertices and lines that define a primitive.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum FillMode
Members
Member name Description
Point Draw a point at each vertex.
Solid Draw solid faces for each primitive.
WireFrame Draw lines connecting the vertices that define a primitive face.
See Also
Reference
RenderState.FillMode Property
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
FilterOptions Enumeration
Defines modes describing how to filter an image or mipmap when it is minified or magnified to fit a set of vertices.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[FlagsAttribute]
public enum FilterOptions
Members
Me Description
mbe
r na
me
Box Each pixel is computed by averaging a 2×2(×2) box of pixels from the source image. This filter works only when the di
mensions of the destination are half those of the source, as is the case with mipmaps.
Dith Resulting image must be dithered using a 4×4 ordered dither algorithm. This happens when converting from one form
er at to another.
Dith Do diffuse dithering on the image when changing from one format to another.
erDif
fusio
n
Line Bilinear interpolation filtering is used as a texture magnification or minification filter. A weighted average of a 2×2 area
ar of texels surrounding the desired pixel is used. The texture filter to use between mipmap levels is trilinear mipmap inter
polation. The rasterizer interpolates pixel color in a linear manner, using the texels of the two nearest textures.
Mirr Same as specifying the MirrorU, MirrorV, and MirrorW flags. This flag is always used internally for this function.
or
Mirr Pixels off the edge of the texture on the u-axis should be mirrored, not wrapped.
orU
Mirr Pixels off the edge of the texture on the v-axis should be mirrored, not wrapped.
orV
Mirr Pixels off the edge of the texture on the w-axis should be mirrored, not wrapped.
orW
Non Mipmapping disabled. The rasterizer uses the magnification filter instead.
e
Poin Each destination pixel is computed by sampling the nearest pixel from the source image.
t
Srgb Same as specifying SrgbIn | SrgbOut.
Srgb Input data is in sRGB (gamma 2.2) color space.
In
Srgb Output data is in sRGB (gamma 2.2) color space.
Out
Tria Each pixel in the source image contributes equally to the destination image. This is the slowest of the filters.
ngle
RemarksEach valid filter must contain exactly one of the following flags: None, Point, Linear, Triangle, or Box. In addition,
the bitwise OR operator can be used to specify zero or more of the following optional flags with a valid filter: MirrorU,
MirrorV, MirrorW, Mirror, or Dither.
See Also
Reference
TextureCreationParameters Constructor
TextureCreationParameters.Filter Property
TextureCreationParameters.MipFilter Property
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
FogMode Enumeration
Defines constants that describe the fog mode.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum FogMode
Members
Member name Description
Exponent
Fog effect intensifies in a linear manner between the start and end points, according to the following form
ula.
ExponentSquare
d Fog effect intensifies exponentially with the square of the distance, according to the following formula.
Linear
Fog effect intensifies exponentially, according to the following formula.
GammaRamp Class
Contains red, green, and blue ramp data.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class GammaRamp : IDisposable
See Also
Reference
GammaRamp Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GammaRamp Members
The following tables list the members exposed by the GammaRamp type.
Public Constructors
Name Description
GammaRamp Initializes a new instance of this class.
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetBlue Retrieves the blue component of the gamma ramp.
GetGreen Retrieves the green component of the gamma ramp.
GetHashCode (Inherited from Object.)
GetRed Retrieves the red component of the gamma ramp.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
SetBlue Sets the blue component of the gamma ramp.
SetGreen Sets the green component of the gamma ramp.
SetRed Sets the red component of the gamma ramp.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
See Also
Reference
GammaRamp Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GammaRamp Constructor
Initializes a new instance of this class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GammaRamp ()
See Also
Reference
GammaRamp Class
GammaRamp Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GammaRamp Methods
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetBlue Retrieves the blue component of the gamma ramp.
GetGreen Retrieves the green component of the gamma ramp.
GetHashCode (Inherited from Object.)
GetRed Retrieves the red component of the gamma ramp.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
SetBlue Sets the blue component of the gamma ramp.
SetGreen Sets the green component of the gamma ramp.
SetRed Sets the red component of the gamma ramp.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
See Also
Reference
GammaRamp Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GammaRamp.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
GammaRamp.Dispose () Immediately releases the unmanaged resources used by this object.
GammaRamp.Dispose (Boolean) Immediately releases the unmanaged resources used by this object.
Remarks
Call Dispose when you are finished using the GammaRamp. The Dispose method leaves the GammaRamp in an unusable
state. After calling Dispose, you must release all references to the GammaRamp so the garbage collector can reclaim the
memory that the GammaRamp was occupying.
Note
Always call Dispose before you release your last reference to the GammaRamp. Otherwise, the resources it is using will not b
e freed until the garbage collector calls the GammaRamp object's Finalize method.
See Also
Reference
GammaRamp Class
GammaRamp Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GammaRamp.Dispose Method ()
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
Remarks
Call Dispose when you are finished using the GammaRamp. The Dispose method leaves the GammaRamp in an unusable
state. After calling Dispose, you must release all references to the GammaRamp so the garbage collector can reclaim the
memory that the GammaRamp was occupying.
Note
Always call Dispose before you release your last reference to the GammaRamp. Otherwise, the resources it is using will not b
e freed until the garbage collector calls the GammaRamp object's Finalize method.
See Also
Reference
GammaRamp Class
GammaRamp Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
disposing
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
Remarks
This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean)
method with the disposing parameter set to true. Finalize invokes Dispose(Boolean) with disposing set to false.
When the disposing parameter is true, this method releases all resources held by any managed objects that this GammaRamp
references. This method invokes the Dispose method of each referenced object.
Note
Notes to Inheritors
Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects
disposed of in an earlier call to Dispose.
See Also
Reference
GammaRamp Class
GammaRamp Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GammaRamp.Finalize Method
Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the
object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void Finalize ()
See Also
Reference
GammaRamp Class
GammaRamp Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GammaRamp.GetBlue Method
Retrieves the blue component of the gamma ramp.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public short[] GetBlue ()
Return Value
A 256-element integer array that represents the blue component.
See Also
Reference
GammaRamp Class
GammaRamp Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GammaRamp.GetGreen Method
Retrieves the green component of the gamma ramp.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public short[] GetGreen ()
Return Value
A 256-element integer array that represents the green component.
See Also
Reference
GammaRamp Class
GammaRamp Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GammaRamp.GetRed Method
Retrieves the red component of the gamma ramp.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public short[] GetRed ()
Return Value
A 256-element integer array that represents the red component.
See Also
Reference
GammaRamp Class
GammaRamp Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GammaRamp.SetBlue Method
Sets the blue component of the gamma ramp.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void SetBlue (
short[] value
)
Parameters
value
A 256-element integer array that represents the blue component.
Exceptions
Exception type Condition
ArgumentException The value parameter is not a 256-element integer array. The arrays used in gamma ramps must have a len
gth of 256.
See Also
Reference
GammaRamp Class
GammaRamp Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GammaRamp.SetGreen Method
Sets the green component of the gamma ramp.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void SetGreen (
short[] value
)
Parameters
value
A 256-element integer array that represents the green component.
Exceptions
Exception type Condition
ArgumentException The value parameter is not a 256-element integer array. The arrays used in gamma ramps must have a len
gth of 256.
See Also
Reference
GammaRamp Class
GammaRamp Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GammaRamp.SetRed Method
Sets the red component of the gamma ramp.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void SetRed (
short[] value
)
Parameters
value
A 256-element integer array that represents the red component.
Exceptions
Exception type Condition
ArgumentException The value parameter is not a 256-element integer array. The arrays used in gamma ramps must have a len
gth of 256.
See Also
Reference
GammaRamp Class
GammaRamp Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter Class
Provides methods to retrieve and manipulate graphics adapters.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class GraphicsAdapter : IDisposable
See Also
Reference
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter Members
The following tables list the members exposed by the GraphicsAdapter type.
Public Properties
Name Description
Adapters Collection of available adapters on the system.
CurrentDisplayMode Gets the current display mode.
DefaultAdapter Gets the default adapter.
Description Retrieves a string used for presentation to the user.
DeviceId Retrieves a value that is used to help identify a particular chip set.
DeviceIdentifier Retrieves a globally unique identifier (GUID) object that can be used to check changes in the driv
er and chip set.
DeviceName Retrieves a string that contains the device name for a Microsoft Windows Graphics Device Interf
ace (GDI).
DriverDll Retrieves a string that is used to present the driver name to the user.
DriverVersion Retrieves a value that identifies the version of the Microsoft Direct3D driver.
IsDefaultAdapter Determines if this instance of GraphicsAdapter is the default adapter.
IsWideScreen Determines if the graphics adapter is in widescreen mode.
MonitorHandle Retrieves the handle of the monitor associated with the Microsoft Direct3D object.
Revision Retrieves a value used to help identify the revision level of a particular chip set.
SubSystemId Retrieves a value used to identify the subsystem.
SupportedDisplayModes Returns a collection of supported display modes for the current adapter.
VendorId Retrieves a value used to identify the manufacturer.
Public Methods
Name Description
CheckDepthStencilMatch Tests whether a depth stencil format is compatible with a render target format in a particul
ar display mode.
CheckDeviceFormat Overloaded. Determines whether a surface or depth buffer format is available as a specifie
d resource type and can be used as a texture, depth-stencil buffer, render target, or any co
mbination of the three, on a device representing the current adapter.
CheckDeviceFormatConversion Tests a device to determine whether it supports conversion from one display format to ano
ther.
CheckDeviceMultiSampleType Overloaded. Verifies whether a multisample technique is available on a specified device.
CheckDeviceType Determines whether a hardware-accelerated device type can be used on the current adapte
r.
Dispose Overloaded. Releases all resources used by the GraphicsAdapter class.
Equals Overloaded. Determines whether two instances of GraphicsAdapter are equal.
GetCapabilities Returns the capabilities of a device.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
IsDeviceTypeAvailable Determines whether a requested device type is available.
op_Equality Compares two objects to determine whether they are the same.
op_Inequality Compares two objects to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsAdapter Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsAdapter Methods
Public Methods
Name Description
CheckDepthStencilMatch Tests whether a depth stencil format is compatible with a render target format in a particul
ar display mode.
CheckDeviceFormat Overloaded. Determines whether a surface or depth buffer format is available as a specifie
d resource type and can be used as a texture, depth-stencil buffer, render target, or any co
mbination of the three, on a device representing the current adapter.
CheckDeviceFormatConversion Tests a device to determine whether it supports conversion from one display format to ano
ther.
CheckDeviceMultiSampleType Overloaded. Verifies whether a multisample technique is available on a specified device.
CheckDeviceType Determines whether a hardware-accelerated device type can be used on the current adapte
r.
Dispose Overloaded. Releases all resources used by the GraphicsAdapter class.
Equals Overloaded. Determines whether two instances of GraphicsAdapter are equal.
GetCapabilities Returns the capabilities of a device.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
IsDeviceTypeAvailable Determines whether a requested device type is available.
op_Equality Compares two objects to determine whether they are the same.
op_Inequality Compares two objects to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsAdapter Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsAdapter.CheckDepthStencilMatch Method
Tests whether a depth stencil format is compatible with a render target format in a particular display mode.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool CheckDepthStencilMatch (
DeviceType deviceType,
SurfaceFormat adapterFormat,
SurfaceFormat renderTargetFormat,
DepthFormat depthStencilFormat
)
Parameters
deviceType
The device type.
adapterFormat
The format of the display mode into which the adapter will be placed.
renderTargetFormat
The format of the render-target surface to be tested.
depthStencilFormat
The format of the depth stencil surface to be tested.
Return Value
true if the format is compatible; false otherwise.
Exceptions
Exception type Condition
DeviceNotSupportedException (Xbox 360) Hardware is the only device type supported on this platform.
InvalidOperationException An error has occurred.
Remarks
CheckDepthStencilMatch enables applications to work with hardware that requires that certain depth formats work only
with certain render target formats.
Note
The following surface formats are not supported on the Xbox 360 platform for any ResourceType, including textures:
SurfaceFormat.Bgr24
SurfaceFormat.Bgra2338
SurfaceFormat.Bgr233
SurfaceFormat.NormalizedByte2Computed
SurfaceFormat.LuminanceAlpha8
SurfaceFormat.Palette8
SurfaceFormat.PaletteAlpha16
SurfaceFormat.Multi2Bgra32
SurfaceFormat.Depth15Stencil1
SurfaceFormat.Depth24Stencil4
Example
C#
public static DepthStencilBuffer CreateDepthStencil(RenderTarget2D target)
{
return new DepthStencilBuffer(target.GraphicsDevice, target.Width,
target.Height, target.GraphicsDevice.DepthStencilBuffer.Format,
target.MultiSampleType, target.MultiSampleQuality);
}
public static DepthStencilBuffer CreateDepthStencil(RenderTarget2D target, DepthFormat dept
h)
{
if (GraphicsAdapter.DefaultAdapter.CheckDepthStencilMatch(DeviceType.Hardware,
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Format, target.Format,
depth))
{
return new DepthStencilBuffer(target.GraphicsDevice, target.Width,
target.Height, depth, target.MultiSampleType, target.MultiSampleQuality);
}
else
return CreateDepthStencil(target);
}
See Also
Concepts
Xbox 360 Surface Formats
What Is a Depth Buffer?
What Is a Stencil Buffer?
What Is a Render Target?
Tasks
How To: Create a Depth Texture
Reference
DepthStencilBuffer
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.CheckDeviceFormat Method
Determines whether a surface or depth buffer format is available as a specified resource type and can be used as a texture,
depth-stencil buffer, render target, or any combination of the three, on a device representing the current adapter.
Overload List
Name D
e
s
cr
i
p
ti
o
n
GraphicsAdapter.CheckDeviceFormat (DeviceType, SurfaceFormat, TextureUsage, QueryUsages, ResourceType, DepthFormat) V
er
ifi
e
s
w
h
et
h
er
a
d
e
pt
h
b
uf
fe
r
fo
r
m
at
is
a
v
ai
la
bl
e
a
s
a
s
p
e
ci
fi
e
d
re
s
o
u
rc
e
ty
p
p
e
a
n
d
c
a
n
b
e
u
s
e
d
a
s
a
te
xt
u
re
,
d
e
pt
h
-s
te
n
ci
l
b
uf
fe
r,
re
n
d
er
ta
r
g
et
,
o
r
a
n
y
c
o
m
bi
n
at
io
n
of
th
e
th
re
e,
e,
o
n
a
d
e
vi
c
e
re
p
re
s
e
nt
in
g
th
e
c
u
rr
e
nt
a
d
a
pt
er
.
GraphicsAdapter.CheckDeviceFormat (DeviceType, SurfaceFormat, TextureUsage, QueryUsages, ResourceType, SurfaceFormat) V
er
ifi
e
s
w
h
et
h
er
a
s
u
rf
a
c
e
b
uf
fe
r
fo
r
m
at
is
a
v
ai
la
bl
e
a
s
s
a
s
p
e
ci
fi
e
d
re
s
o
u
rc
e
ty
p
e
a
n
d
c
a
n
b
e
u
s
e
d
a
s
a
te
xt
u
re
,
d
e
pt
h
-s
te
n
ci
l
b
uf
fe
r,
re
n
d
er
ta
r
g
et
,
o
r
a
n
n
y
c
o
m
bi
n
at
io
n
of
th
e
th
re
e
o
n
a
d
e
vi
c
e
re
p
re
s
e
nt
in
g
th
e
c
u
rr
e
nt
a
d
a
pt
er
.
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
deviceType
The type of device to check.
adapterFormat
The format of the display mode into which the adapter will be placed.
usage
A set of options identifying the behaviors of this surface resource.
queryUsages
The type of query to issue.
resourceType
A resource type requested for use with the queried format.
checkFormat
The format of the depth buffer surface identified by usage.
Return Value
true if the surface format is available as the specified resource and format type; false otherwise.
Exceptions
Exception type Condition
DeviceNotSupportedException (Xbox 360) Hardware is the only device type supported on this platform.
Remarks
Note
The following surface formats are not supported on the Xbox 360 platform for any ResourceType, including textures:
SurfaceFormat.Bgr24
SurfaceFormat.Bgra2338
SurfaceFormat.Bgr233
SurfaceFormat.NormalizedByte2Computed
SurfaceFormat.LuminanceAlpha8
SurfaceFormat.Palette8
SurfaceFormat.PaletteAlpha16
SurfaceFormat.Multi2Bgra32
SurfaceFormat.Depth15Stencil1
SurfaceFormat.Depth24Stencil4
Example
C#
public static RenderTarget2D CreateRenderTarget(GraphicsDevice device, int numberLevels,
SurfaceFormat surface)
{
if (!GraphicsAdapter.DefaultAdapter.CheckDeviceFormat(DeviceType.Hardware,
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Format, TextureUsage.None,
QueryUsages.None, ResourceType.RenderTarget, surface))
{
// Fall back to current display format
surface = device.DisplayMode.Format;
}
return new RenderTarget2D(device,
device.PresentationParameters.BackBufferWidth,
device.PresentationParameters.BackBufferHeight,
numberLevels, surface,
device.PresentationParameters.MultiSampleType,
device.PresentationParameters.MultiSampleQuality);
}
See Also
Concepts
Xbox 360 Surface Formats
How To: Create a Depth Texture
Reference
RenderTarget2D
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
deviceType
The type of device to check.
adapterFormat
The format of the display mode into which the adapter will be placed.
usage
A set of options identifying the behaviors of this surface resource.
queryUsages
The type of query to issue.
resourceType
A resource type requested for use with the queried format.
checkFormat
The format of the surface identified by usage.
Return Value
true if the surface format is available as the specified resource and format type; false otherwise.
Exceptions
Exception type Condition
DeviceNotSupportedException (Xbox 360) Hardware is the only device type supported on this platform.
InvalidOperationException An error has occurred.
Remarks
Note
The following surface formats are not supported on the Xbox 360 platform for any ResourceType, including textures:
SurfaceFormat.Bgr24
SurfaceFormat.Bgra2338
SurfaceFormat.Bgr233
SurfaceFormat.NormalizedByte2Computed
SurfaceFormat.LuminanceAlpha8
SurfaceFormat.Palette8
SurfaceFormat.PaletteAlpha16
SurfaceFormat.Multi2Bgra32
SurfaceFormat.Depth15Stencil1
SurfaceFormat.Depth24Stencil4
Example
C#
public static RenderTarget2D CreateRenderTarget(GraphicsDevice device, int numberLevels,
SurfaceFormat surface)
{
if (!GraphicsAdapter.DefaultAdapter.CheckDeviceFormat(DeviceType.Hardware,
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Format, TextureUsage.None,
QueryUsages.None, ResourceType.RenderTarget, surface))
{
// Fall back to current display format
surface = device.DisplayMode.Format;
}
return new RenderTarget2D(device,
device.PresentationParameters.BackBufferWidth,
device.PresentationParameters.BackBufferHeight,
numberLevels, surface,
device.PresentationParameters.MultiSampleType,
device.PresentationParameters.MultiSampleQuality);
}
See Also
Concepts
Xbox 360 Surface Formats
How To: Create a Depth Texture
Reference
RenderTarget2D
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.CheckDeviceFormatConversion Method
Tests a device to determine whether it supports conversion from one display format to another.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool CheckDeviceFormatConversion (
DeviceType deviceType,
SurfaceFormat sourceFormat,
SurfaceFormat targetFormat
)
Parameters
deviceType
Type of device to check.
sourceFormat
Source adapter format.
targetFormat
Target adapter format.
Return Value
true if the method succeeds; false if it fails.
Exceptions
Exception type Condition
DeviceNotSupportedException (Xbox 360) Hardware is the only device type supported on this platform.
InvalidOperationException An error has occurred.
Remarks
Using CheckDeviceFormatConversion to test for compatibility between a back buffer and the display format returns
appropriate values. This means that the call reflects device capabilities. If the device cannot render to the requested back buffer
format, the call still returns false. If the device can render to the format but cannot perform the color-converting presentation,
the return value is also false. Applications can discover hardware support for the presentation itself by calling
CheckDeviceFormatConversion. No software emulation for the color-converting presentation itself is offered.
Color conversion is restricted to certain source and target formats. The source format must be a four-character code (FOURCC)
format or a valid back-buffer format, and the target format must be one of the following unsigned formats.
SurfaceFormat.Bgr555 SurfaceFormat.Bgra5551 SurfaceFormat.Bgr565
SurfaceFormat.Bgr24 SurfaceFormat.Bgr32 SurfaceFormat.Color
SurfaceFormat.Bgra1010102 SurfaceFormat.Rgba64 SurfaceFormat.Rgba1010102
SurfaceFormat.Rgba32 SurfaceFormat.Rgb32 SurfaceFormat.HalfVector4
SurfaceFormat.Vector4
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.CheckDeviceMultiSampleType Method
Verifies whether a multisample technique is available on a specified device.
Overload List
Name Description
GraphicsAdapter.CheckDeviceMultiSampleType (DeviceType, SurfaceFormat, Boolean, MultiSampleType) Verifies wheth
er a multisamp
le technique is
available on a
specified game
machine.
GraphicsAdapter.CheckDeviceMultiSampleType (DeviceType, SurfaceFormat, Boolean, MultiSampleType, Int32) Verifies wheth
er a multisamp
le technique is
available on a
specified game
machine, optio
nally returning
the number of
quality stops a
vailable for the
specified techn
ique.
RemarksThis method is intended for use with both render-target and depth-stencil surfaces because they must be created
multisampled to be used together.
See Also
Concepts
What Is Antialiasing?
Tasks
How To: Enable Antialiasing (Multisampling)
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsAdapter.CheckDeviceMultiSampleType Method
(DeviceType, SurfaceFormat, Boolean, MultiSampleType)
Verifies whether a multisample technique is available on a specified game machine.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool CheckDeviceMultiSampleType (
DeviceType deviceType,
SurfaceFormat surfaceFormat,
bool isFullScreen,
MultiSampleType sampleType
)
Parameters
deviceType
The type of device to check.
surfaceFormat
The format of the surface to be multisampled.
isFullScreen
[MarshalAsAttribute(U1)] true to inquire about windowed multisampling; false to inquire about full-screen multisampling.
sampleType
The multisampling technique to test.
Return Value
true if the technique is available; false otherwise.
Exceptions
Exception type Condition
DeviceNotSupportedException (Xbox 360) Hardware is the only device type supported on this platform.
Example
Call CheckDeviceMultiSampleType in your PreparingDeviceSettings handler.
C#
int quality = 0;
GraphicsAdapter adapter = e.GraphicsDeviceInformation.Adapter;
SurfaceFormat format = adapter.CurrentDisplayMode.Format;
// Check for 4xAA
if (adapter.CheckDeviceMultiSampleType(DeviceType.Hardware, format,
false, MultiSampleType.FourSamples, out quality))
{
// even if a greater quality is returned, we only want quality 1
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleQuality = 1;
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleType =
MultiSampleType.FourSamples;
}
// Check for 2xAA
else if (adapter.CheckDeviceMultiSampleType(DeviceType.Hardware, format,
false, MultiSampleType.TwoSamples, out quality))
{
// even if a greater quality is returned, we only want quality 1
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleQuality = 1;
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleType =
MultiSampleType.TwoSamples;
}
return;
}
See Also
Concepts
What Is Antialiasing?
Tasks
How To: Enable Antialiasing (Multisampling)
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.CheckDeviceMultiSampleType Method
(DeviceType, SurfaceFormat, Boolean, MultiSampleType, Int32)
Verifies whether a multisample technique is available on a specified game machine, optionally returning the number of quality
stops available for the specified technique.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool CheckDeviceMultiSampleType (
DeviceType deviceType,
SurfaceFormat surfaceFormat,
bool isFullScreen,
MultiSampleType sampleType,
out int qualityLevels
)
Parameters
deviceType
The type of device to check.
surfaceFormat
The format of the surface to be multisampled.
isFullScreen
[MarshalAsAttribute(U1)] true to inquire about windowed multisampling; false to inquire about full-screen multisampling.
sampleType
The multisampling technique to test.
qualityLevels
[OutAttribute] Number of quality stops available for a given multisample type; can be null if it is not necessary to return the
values.
Return Value
true if the technique is available; false otherwise.
Exceptions
Exception type Condition
DeviceNotSupportedException (Xbox 360) Hardware is the only device type supported on this platform.
InvalidOperationException An error has occurred.
Example
Call CheckDeviceMultiSampleType in your PreparingDeviceSettings handler.
C#
int quality = 0;
GraphicsAdapter adapter = e.GraphicsDeviceInformation.Adapter;
SurfaceFormat format = adapter.CurrentDisplayMode.Format;
// Check for 4xAA
if (adapter.CheckDeviceMultiSampleType(DeviceType.Hardware, format,
false, MultiSampleType.FourSamples, out quality))
{
// even if a greater quality is returned, we only want quality 1
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleQuality = 1;
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleType =
MultiSampleType.FourSamples;
}
// Check for 2xAA
else if (adapter.CheckDeviceMultiSampleType(DeviceType.Hardware, format,
false, MultiSampleType.TwoSamples, out quality))
{
// even if a greater quality is returned, we only want quality 1
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleQuality = 1;
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleType =
MultiSampleType.TwoSamples;
}
return;
}
See Also
Concepts
What Is Antialiasing?
Tasks
How To: Enable Antialiasing (Multisampling)
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.CheckDeviceType Method
Determines whether a hardware-accelerated device type can be used on the current adapter.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool CheckDeviceType (
DeviceType deviceType,
SurfaceFormat displayFormat,
SurfaceFormat backBufferFormat,
bool isFullScreen
)
Parameters
deviceType
The type of device to check.
displayFormat
The format of the adapter display mode for which the device type is being checked. For example, some devices operate only
in modes of 16 bits per pixel.
backBufferFormat
Format of the back buffer. This value must be one of the render target formats. DisplayMode can be used to obtain the
current format.
For windowed applications, the back-buffer format does not need to match the display-mode format if the hardware
supports color conversion. The set of possible back-buffer formats is constrained, but the runtime allows any valid back-
buffer format to be presented to any desktop format. Additionally, the device must be operable in desktop mode because
devices typically do not operate in modes of 8 bits per pixel.
Full-screen applications cannot perform color conversion.
SurfaceFormat.Unknown is allowed for windowed mode.
isFullScreen
[MarshalAsAttribute(U1)] true if the device type will be used in windowed mode; false if the device type will be used in full-
screen mode.
Return Value
true if the method succeeds and the device can be used on this adapter; false if the method fails. If the method fails, you may
check the result code returned by Manager.CheckDeviceTypeResult to determine the specific reason.
Exceptions
Exception type Condition
DeviceNotSupportedException (Xbox 360) Hardware is the only device type supported on this platform.
InvalidOperationException An error has occurred.
Remarks
A hardware abstraction layer (HAL) device type requires hardware acceleration. Applications can use CheckDeviceType to
determine whether the hardware and drivers necessary to support a HAL device are present.
Full-screen applications should not specify a displayFormat that contains an alpha channel; doing so results in a failed call.
Note that an alpha channel can be present in the back buffer, but the two display formats must be identical in all other
respects. For example, if displayFormat = SurfaceFormat.Bgr555, valid values for backBufferFormat include
SurfaceFormat.Bgr555 and SurfaceFormat.Bgra5551, but exclude SurfaceFormat.Bgr565.
Using CheckDeviceType to test for compatibility between a back buffer that differs from the display format returns
appropriate values. This means that the call reflects device capabilities. No software emulation for the color-converting
presentation itself is offered.
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.Dispose Method
Releases all resources used by the GraphicsAdapter class.
Overload List
Name Description
GraphicsAdapter.Dispose () Releases all resources used by the GraphicsAdapter class.
GraphicsAdapter.Dispose (Boolean) Releases all resources used by the GraphicsAdapter class.
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsAdapter.Dispose Method ()
Releases all resources used by the GraphicsAdapter class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
Remarks
Call Dispose when you are finished using the GraphicsAdapter. The Dispose method leaves the GraphicsAdapter in an
unusable state. After calling Dispose, you must release all references to the GraphicsAdapter so the garbage collector can
reclaim the memory that the GraphicsAdapter was occupying.
Note
Always call Dispose before you release your last reference to the GraphicsAdapter. Otherwise, the resources it is using will no
t be freed until the garbage collector calls the GraphicsAdapter object's Finalize method.
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.Equals Method
Determines whether two instances of GraphicsAdapter are equal.
Overload List
Name Description
GraphicsAdapter.Equals (Object) Determines whether the specified Object is equal to the GraphicsAdapter.
GraphicsAdapter.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
obj
The Object to compare with the current GraphicsAdapter.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.Finalize Method
Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the
object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void Finalize ()
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.GetCapabilities Method
Returns the capabilities of a device.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GraphicsDeviceCapabilities GetCapabilities (
DeviceType deviceType
)
Parameters
deviceType
The device to query.
Return Value
The capabilities of the specified device.
Exceptions
Exception type Condition
DeviceNotSupportedException (Xbox 360) Hardware is the only device type supported on this platform.
See Also
Tasks
How To: Check for Shader Model 2.0 Support
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.GetHashCode Method
Gets the hash code for this instance.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for this object.
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.IsDeviceTypeAvailable Method
Determines whether a requested device type is available.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsDeviceTypeAvailable (
DeviceType deviceType
)
Parameters
deviceType
The device type to request.
Return Value
true if the requested device type is available; false otherwise.
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.op_Equality Method
Compares two objects to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
GraphicsAdapter l,
GraphicsAdapter r
)
Parameters
l
The object to the left of the equality operator.
r
The object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.op_Inequality Method
Compares two objects to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
GraphicsAdapter l,
GraphicsAdapter r
)
Parameters
l
The object to the left of the inequality operator.
r
The object to the right of the inequality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter Properties
Public Properties
Name Description
Adapters Collection of available adapters on the system.
CurrentDisplayMode Gets the current display mode.
DefaultAdapter Gets the default adapter.
Description Retrieves a string used for presentation to the user.
DeviceId Retrieves a value that is used to help identify a particular chip set.
DeviceIdentifier Retrieves a globally unique identifier (GUID) object that can be used to check changes in the driv
er and chip set.
DeviceName Retrieves a string that contains the device name for a Microsoft Windows Graphics Device Interf
ace (GDI).
DriverDll Retrieves a string that is used to present the driver name to the user.
DriverVersion Retrieves a value that identifies the version of the Microsoft Direct3D driver.
IsDefaultAdapter Determines if this instance of GraphicsAdapter is the default adapter.
IsWideScreen Determines if the graphics adapter is in widescreen mode.
MonitorHandle Retrieves the handle of the monitor associated with the Microsoft Direct3D object.
Revision Retrieves a value used to help identify the revision level of a particular chip set.
SubSystemId Retrieves a value used to identify the subsystem.
SupportedDisplayModes Returns a collection of supported display modes for the current adapter.
VendorId Retrieves a value used to identify the manufacturer.
See Also
Reference
GraphicsAdapter Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsAdapter.Adapters Property
Collection of available adapters on the system.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static ReadOnlyCollection<GraphicsAdapter> Adapters { get; }
Property Value
The collection of adapters.
See Also
Tasks
How To: Check for Shader Model 2.0 Support
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.CurrentDisplayMode Property
Gets the current display mode.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public DisplayMode CurrentDisplayMode { get; }
Property Value
The current display mode.
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.DefaultAdapter Property
Gets the default adapter.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static GraphicsAdapter DefaultAdapter { get; }
Property Value
The default adapter.
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.Description Property
Retrieves a string used for presentation to the user.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Description { get; }
Property Value
Description of the adapter.
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.DeviceId Property
Retrieves a value that is used to help identify a particular chip set.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int DeviceId { get; }
Property Value
Value that helps identify the chip set. The returned value may be zero if it is unknown.
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.DeviceIdentifier Property
Retrieves a globally unique identifier (GUID) object that can be used to check changes in the driver and chip set.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Guid DeviceIdentifier { get; }
Property Value
A unique identifier for the driver and chip set pair.
Remarks Use this member to track changes to the driver and chip set to generate a new profile for the graphics subsystem. It
also can be used to identify problematic drivers.
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.DeviceName Property
Retrieves a string that contains the device name for a Microsoft Windows Graphics Device Interface (GDI).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string DeviceName { get; }
Property Value
The name of the device.
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.DriverDll Property
Retrieves a string that is used to present the driver name to the user.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string DriverDll { get; }
Property Value
The driver name
RemarksThis member should not be used to identify particular drivers, because many different strings might be associated
with the same device and driver from different vendors.
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.DriverVersion Property
Retrieves a value that identifies the version of the Microsoft Direct3D driver.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Version DriverVersion { get; }
Property Value
The driver version.
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.IsDefaultAdapter Property
Determines if this instance of GraphicsAdapter is the default adapter.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsDefaultAdapter { get; }
Property Value
true if this instance of GraphicsAdapter is the default adapter, false otherwise.
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.IsWideScreen Property
Determines if the graphics adapter is in widescreen mode.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsWideScreen { get; }
Property Value
true if the graphics adapter is in widescreen mode; false otherwise.
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.MonitorHandle Property
Retrieves the handle of the monitor associated with the Microsoft Direct3D object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public IntPtr MonitorHandle { get; }
Property Value
The handle of the monitor.
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.Revision Property
Retrieves a value used to help identify the revision level of a particular chip set.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Revision { get; }
Property Value
Value used to help identify the revision level of the chip set. This value may be zero if it is unknown.
Remarks The VendorId, DeviceId, SubSystemId, and Revision members can be used in tandem to identify particular chip sets.
However, these members should be used with caution.
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.SubSystemId Property
Retrieves a value used to identify the subsystem.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int SubSystemId { get; }
Property Value
Value used to identify the subsystem, typically the particular board. This value may be zero if it is unknown.
Remarks The VendorId, DeviceId, SubSystemId, and Revision members can be used in tandem to identify particular chip sets.
However, these members should be used with caution.
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.SupportedDisplayModes Property
Returns a collection of supported display modes for the current adapter.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public DisplayModeCollection SupportedDisplayModes { get; }
Property Value
The supported display modes for the adapter.
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsAdapter.VendorId Property
Retrieves a value used to identify the manufacturer.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int VendorId { get; }
Property Value
Value used to identify the manufacturer. This value may be zero if it is unknown.
RemarksThe VendorId, DeviceId, SubSystemId, and Revision members can be used in tandem to identify particular chip sets.
However, these members should be used with caution.
See Also
Reference
GraphicsAdapter Class
GraphicsAdapter Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice Class
Performs primitive-based rendering, creates resources, handles system-level variables, adjusts gamma ramp levels, and
creates shaders.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class GraphicsDevice : IDisposable
See Also
Reference
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice Members
The following tables list the members exposed by the GraphicsDevice type.
Public Constructors
Name Description
GraphicsDevice Creates a new instance of GraphicsDevice
Public Properties
Name Description
ClipPlanes Retrieves the clipping planes of the current GraphicsDevice.
CreationParameters Retrieves the creation parameters of the GraphicsDevice.
DepthStencilBuffer Gets or sets the depth stencil surface of this GraphicsDevice.
DisplayMode Retrieves the display mode's spatial resolution, color resolution, and refresh frequency.
DriverLevel Returns the driver level.
GraphicsDeviceCapabilities Gets the capabilities of the graphics device.
GraphicsDeviceStatus Retrieves the status of the device
Indices Gets or sets index data.
IsDisposed Gets a value that indicates whether the object is disposed.
PixelShader Gets or sets the current pixel shader.
PresentationParameters Gets the presentation parameters associated with this graphics device.
RasterStatus Retrieves information that describes the raster of the monitor on which the swap chain is prese
nted.
RenderState Retrieves a render-state value for a GraphicsDevice.
SamplerStates Retrieves a collection of SamplerState objects for the current GraphicsDevice.
ScissorRectangle Gets or sets the rectangle used for scissor testing.
SoftwareVertexProcessing Gets or sets the vertex processing mode.
Textures Returns the collection of textures that have been assigned to the texture stages of the device.
VertexDeclaration Gets or sets a vertex shader declaration.
VertexSamplerStates Gets the collection of vertex sampler states.
VertexShader Gets or sets the current vertex shader.
VertexTextures Gets the collection of vertex textures that support texture lookup in the vertex shader using the t
exldl - vs texture load statement. The vertex engine contains four texture sampler stages.
Vertices Gets the vertex stream collection.
Viewport Gets or sets a viewport identifying the portion of the render target to receive draw calls.
Public Methods
Name Description
Clear Overloaded. Clears the viewport depth buffer, and erases the stencil buffer.
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
DrawIndexedPrimitives Renders the specified geometric primitive, based on indexing into an array of ve
rtices.
DrawPrimitives Renders a sequence of non-indexed geometric primitives of the specified type fr
om the current set of data input streams.
DrawUserIndexedPrimitives Overloaded. Renders the specified geometric primitive with data specified by th
e user.
DrawUserPrimitives Renders the given geometric primitive with data specified by the user.
Equals (Inherited from Object.)
EvictManagedResources Evicts all managed resources, including Microsoft Direct3D resources and those
that are driver managed.
GetGammaRamp Gets the gamma correction ramp.
GetHashCode (Inherited from Object.)
GetPixelShaderBooleanConstant Gets an array of Boolean values from the pixel shader constant Boolean register
s.
GetPixelShaderInt32Constant Gets an array of Int32 values from the pixel shader constant integer registers.
GetPixelShaderMatrixArrayConstant Gets an array of Matrix values from the pixel shader constant float registers.
GetPixelShaderMatrixConstant Gets a Matrix value from the pixel shader constant float registers.
GetPixelShaderQuaternionArrayConstant Gets an array of Quaternion values from the pixel shader constant float registers
.
GetPixelShaderQuaternionConstant Gets a Quaternion value from the pixel shader constant float registers.
GetPixelShaderSingleConstant Gets an array of Single values from the pixel shader constant float registers.
GetPixelShaderVector2ArrayConstant Gets an array of Vector2 values from the pixel shader constant float registers.
GetPixelShaderVector2Constant Gets a Vector2 value from the pixel shader constant float registers.
GetPixelShaderVector3ArrayConstant Gets an array of Vector3 values from the pixel shader constant float registers.
GetPixelShaderVector3Constant Gets a Vector3 value from the pixel shader constant float registers.
GetPixelShaderVector4ArrayConstant Gets an array of Vector4 values from the pixel shader constant float registers.
GetPixelShaderVector4Constant Gets a Vector4 value from the pixel shader constant float registers.
GetRenderTarget Gets a render target surface.
GetType (Inherited from Object.)
GetVertexShaderBooleanConstant Gets an array of Boolean values from the vertex shader constant Boolean registe
rs.
GetVertexShaderInt32Constant Gets an array of Int32 values from the vertex shader constant integer registers.
GetVertexShaderMatrixArrayConstant Gets an array of Matrix values from the vertex shader constant float registers.
GetVertexShaderMatrixConstant Gets a Matrix value from the vertex shader constant float registers.
GetVertexShaderQuaternionArrayConstant Gets an array of Quaternion values from the vertex shader constant float registe
rs.
GetVertexShaderQuaternionConstant Gets a Quaternion value from the vertex shader constant float registers.
GetVertexShaderSingleConstant Gets an array of Single values from the vertex shader constant float registers.
GetVertexShaderVector2ArrayConstant Gets an array of Vector2 values from the vertex shader constant float registers.
GetVertexShaderVector2Constant Gets a Vector2 value from the vertex shader constant float registers.
GetVertexShaderVector3ArrayConstant Gets an array of Vector3 values from the vertex shader constant float registers.
GetVertexShaderVector3Constant Gets a Vector3 value from the vertex shader constant float registers.
GetVertexShaderVector4ArrayConstant Gets an array of Vector4 values from the vertex shader constant float registers.
GetVertexShaderVector4Constant Gets a Vector4 value from the vertex shader constant float registers.
Present Overloaded. Presents the display with the contents of the next buffer in the sequ
ence of back buffers owned by the GraphicsDevice.
ReferenceEquals (Inherited from Object.)
Reset Overloaded. Resets the presentation parameters for the current GraphicsDevice.
ResolveBackBuffer Overloaded. Copies the current back buffer contents to a texture.
SetGammaRamp Sets the gamma correction ramp.
SetPixelShaderConstant Overloaded. Sets a pixel shader constant.
SetRenderTarget Overloaded. Sets a new color buffer for a GraphicsDevice.
SetVertexShaderConstant Overloaded. Sets a vertex shader constant.
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garb
age collection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_DeviceLost Occurs when a GraphicsDevice is about to be lost (for example, immediately before a reset).
raise_DeviceReset Occurs after a GraphicsDevice is reset, allowing an application to re-create all resources.
raise_DeviceResetting Occurs when a GraphicsDevice is resetting
raise_Disposing Raises the Disposing event when called from within a derived class.
raise_ResourceCreated Occurs when ResourceCreated is called.
raise_ResourceDestroyed Occurs when ResourceDestroyed is called.
Public Events
Name Description
DeviceLost Occurs when a GraphicsDevice is about to be lost (for example, immediately before a reset).
DeviceReset Occurs after a GraphicsDevice is reset, allowing an application to recreate all resources.
DeviceResetting Occurs when a GraphicsDevice is resetting, allowing the application to cancel the default handling of th
e reset.
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of t
he Microsoft .NET common language runtime.
ResourceCreated Occurs when a resource is created.
ResourceDestroyed Occurs when a resource is destroyed.
See Also
Reference
GraphicsDevice Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDevice Constructor
Creates a new instance of GraphicsDevice
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GraphicsDevice (
GraphicsAdapter adapter,
DeviceType deviceType,
IntPtr renderWindowHandle,
PresentationParameters presentationParameters
)
Parameters
adapter
The display adapter.
deviceType
The desired device type.
renderWindowHandle
The focus window.
presentationParameters
The presentation parameters for the device to be created.
Exceptions
Exception type Condition
ArgumentNullException adapter or presentationParameters is null.
ArgumentException
One of the following conditions is true:
PresentationParameters.MultiSampleType contains an invalid value. The only valid
MultiSampleType values on the Xbox 360 are MultiSampleType.None,
MultiSampleType.TwoSamples, or MultiSampleType.FourSamples. For Windows-based a
pplications, CheckDeviceMultiSampleType may be used to find valid values for this para
meter.
The back-buffer dimensions requested in PresentationParameters.BackBufferWidth and
PresentationParameters.BackBufferHeight are too large for this graphics adapter.
InvalidOperationException PresentationParameters.EnableAutoDepthStencil is true, but
PresentationParameters.AutoDepthStencilFormat is not a valid value.
DeviceNotSupportedException The graphics adapter does not support the requested capabilities. For Xbox 360,
DeviceType.Hardware is the only device type supported on this platform.
Remarks
When you create a new XNA Framework game using XNA Game Studio, the game derives from Game and contains a member
variable that is a GraphicsDeviceManager. This GraphicsDeviceManager automatically creates the best device that is available
for the application and exposes it as the GraphicsDeviceManager.GraphicsDevice property. If you wish to change the settings
used to create the device, you can create a custom PreparingDeviceSettings event handler for the graphics device manager
with the settings you require for your application. For more information on using the PreparingDeviceSettings event handler,
see GraphicsDeviceManager.
Note
If a graphics device has been constructed without the GraphicsDeviceManager, it is necessary to manually call Present subse
quent to any draw calls to present the back buffer.
See Also
Reference
GraphicsDeviceManager Class
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice Methods
Public Methods
Name Description
Clear Overloaded. Clears the viewport depth buffer, and erases the stencil buffer.
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
DrawIndexedPrimitives Renders the specified geometric primitive, based on indexing into an array of ve
rtices.
DrawPrimitives Renders a sequence of non-indexed geometric primitives of the specified type fr
om the current set of data input streams.
DrawUserIndexedPrimitives Overloaded. Renders the specified geometric primitive with data specified by th
e user.
DrawUserPrimitives Renders the given geometric primitive with data specified by the user.
Equals (Inherited from Object.)
EvictManagedResources Evicts all managed resources, including Microsoft Direct3D resources and those
that are driver managed.
GetGammaRamp Gets the gamma correction ramp.
GetHashCode (Inherited from Object.)
GetPixelShaderBooleanConstant Gets an array of Boolean values from the pixel shader constant Boolean register
s.
GetPixelShaderInt32Constant Gets an array of Int32 values from the pixel shader constant integer registers.
GetPixelShaderMatrixArrayConstant Gets an array of Matrix values from the pixel shader constant float registers.
GetPixelShaderMatrixConstant Gets a Matrix value from the pixel shader constant float registers.
GetPixelShaderQuaternionArrayConstant Gets an array of Quaternion values from the pixel shader constant float registers
.
GetPixelShaderQuaternionConstant Gets a Quaternion value from the pixel shader constant float registers.
GetPixelShaderSingleConstant Gets an array of Single values from the pixel shader constant float registers.
GetPixelShaderVector2ArrayConstant Gets an array of Vector2 values from the pixel shader constant float registers.
GetPixelShaderVector2Constant Gets a Vector2 value from the pixel shader constant float registers.
GetPixelShaderVector3ArrayConstant Gets an array of Vector3 values from the pixel shader constant float registers.
GetPixelShaderVector3Constant Gets a Vector3 value from the pixel shader constant float registers.
GetPixelShaderVector4ArrayConstant Gets an array of Vector4 values from the pixel shader constant float registers.
GetPixelShaderVector4Constant Gets a Vector4 value from the pixel shader constant float registers.
GetRenderTarget Gets a render target surface.
GetType (Inherited from Object.)
GetVertexShaderBooleanConstant Gets an array of Boolean values from the vertex shader constant Boolean registe
rs.
GetVertexShaderInt32Constant Gets an array of Int32 values from the vertex shader constant integer registers.
GetVertexShaderMatrixArrayConstant Gets an array of Matrix values from the vertex shader constant float registers.
GetVertexShaderMatrixConstant Gets a Matrix value from the vertex shader constant float registers.
GetVertexShaderQuaternionArrayConstant Gets an array of Quaternion values from the vertex shader constant float registe
rs.
GetVertexShaderQuaternionConstant Gets a Quaternion value from the vertex shader constant float registers.
GetVertexShaderSingleConstant Gets an array of Single values from the vertex shader constant float registers.
GetVertexShaderVector2ArrayConstant Gets an array of Vector2 values from the vertex shader constant float registers.
GetVertexShaderVector2Constant Gets a Vector2 value from the vertex shader constant float registers.
GetVertexShaderVector3ArrayConstant Gets an array of Vector3 values from the vertex shader constant float registers.
GetVertexShaderVector3Constant Gets a Vector3 value from the vertex shader constant float registers.
GetVertexShaderVector4ArrayConstant Gets an array of Vector4 values from the vertex shader constant float registers.
GetVertexShaderVector4Constant Gets a Vector4 value from the vertex shader constant float registers.
Present Overloaded. Presents the display with the contents of the next buffer in the sequ
ence of back buffers owned by the GraphicsDevice.
ReferenceEquals (Inherited from Object.)
Reset Overloaded. Resets the presentation parameters for the current GraphicsDevice.
ResolveBackBuffer Overloaded. Copies the current back buffer contents to a texture.
SetGammaRamp Sets the gamma correction ramp.
SetPixelShaderConstant Overloaded. Sets a pixel shader constant.
SetRenderTarget Overloaded. Sets a new color buffer for a GraphicsDevice.
SetVertexShaderConstant Overloaded. Sets a vertex shader constant.
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garb
age collection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_DeviceLost Occurs when a GraphicsDevice is about to be lost (for example, immediately before a reset).
raise_DeviceReset Occurs after a GraphicsDevice is reset, allowing an application to re-create all resources.
raise_DeviceResetting Occurs when a GraphicsDevice is resetting
raise_Disposing Raises the Disposing event when called from within a derived class.
raise_ResourceCreated Occurs when ResourceCreated is called.
raise_ResourceDestroyed Occurs when ResourceDestroyed is called.
See Also
Reference
GraphicsDevice Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDevice.Clear Method
Clears the viewport depth buffer, and erases the stencil buffer.
Overload List
Name Description
GraphicsDevice.Clear (ClearOptions, Color, Single, Int32) Clears the viewport to a specified color, clears the dept
h buffer, and erases the stencil buffer.
GraphicsDevice.Clear (ClearOptions, Color, Single, Int32, Rectangle[]) Clears a set of regions to a specified color, clears the d
epth buffer, and erases the stencil buffer.
GraphicsDevice.Clear (ClearOptions, Vector4, Single, Int32) Clears the viewport to a specified color, clears the dept
h buffer, and erases the stencil buffer.
GraphicsDevice.Clear (ClearOptions, Vector4, Single, Int32, Rectangle[]) Clears a set of regions to a specified color, clears the d
epth buffer, and erases the stencil buffer.
GraphicsDevice.Clear (Color) Clears the viewport to a specified color.
RemarksThis method fails if ClearOptions.ZBuffer or ClearOptions.Stencil is specified when the render target does not have an
attached depth buffer. Similarly, the method fails if ClearOptions.Stencil is specified when the depth-buffer format does not
contain stencil buffer information.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
options
Flags indicating which surfaces to clear.
color
Color value to which the render target surface is cleared.
depth
New depth value that this method stores in the depth buffer. This parameter can be in the range of 0.0 through 1.0 (for z-
based or w-based depth buffers). A value of 0.0 represents the nearest distance to the viewer; a value of 1.0 represents the
farthest distance.
stencil
Integer value to store in each stencil-buffer entry. This parameter can be in the range of 0 through 2n−1, where n is the bit
depth of the stencil buffer.
Exceptions
Exception type Condition
InvalidOperationException No DepthStencilBuffer surface exists, or the active render target and depth stencil surface do not ha
ve the same pixel size and multisampling type. Unable to clear the depth or stencil buffer.
ObjectDisposedException Clear was called after this GraphicsDevice was disposed.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
options
Flags that indicate which surfaces to clear.
color
Color value to which the render target surface is cleared.
depth
New depth value to store in the depth buffer. This parameter can be in the range of 0.0 through 1.0 (for z-based or w-based
depth buffers). A value of 0.0 represents the nearest distance to the viewer; a value of 1.0 represents the farthest distance.
stencil
Integer value to store in each stencil-buffer entry. This parameter can be in the range of 0 through 2n−1, where n is the bit
depth of the stencil buffer.
regions
The regions to clear.
Exceptions
Exception type Condition
InvalidOperationException No DepthStencilBuffer surface exists, or the active render target and depth stencil surface do not ha
ve the same pixel size and multisampling type. Unable to clear the depth or stencil buffer.
ObjectDisposedException Clear was called after this GraphicsDevice was disposed.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
options
The surfaces to clear.
color
Color value to which the render target surface is cleared.
depth
New z value that this method stores in the depth buffer. This parameter can be in the range of 0.0 through 1.0 (for z-based or
w-based depth buffers). A value of 0.0 represents the nearest distance to the viewer; a value of 1.0 represents the farthest
distance.
stencil
Integer value to store in each stencil-buffer entry. This parameter can be in the range of 0 through 2n−1, where n is the bit
depth of the stencil buffer.
Exceptions
Exception type Condition
InvalidOperationException No DepthStencilBuffer surface exists, or the active render target and depth stencil surface do not ha
ve the same pixel size and multisampling type. Unable to clear the depth or stencil buffer.
ObjectDisposedException Clear was called after this GraphicsDevice was disposed.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
options
The surfaces to clear.
color
Color value to which the render target surface is cleared.
depth
New z value that this method stores in the depth buffer. This parameter can be in the range of 0.0 through 1.0 (for z-based or
w-based depth buffers). A value of 0.0 represents the nearest distance to the viewer; a value of 1.0 represents the farthest
distance.
stencil
Integer value to store in each stencil-buffer entry. This parameter can be in the range of 0 through 2n−1, where n is the bit
depth of the stencil buffer.
regions
The regions to clear.
Exceptions
Exception type Condition
InvalidOperationException No DepthStencilBuffer surface exists, or the active render target and depth stencil surface do not ha
ve the same pixel size and multisampling type. Unable to clear the depth or stencil buffer.
ObjectDisposedException Clear was called after this GraphicsDevice was disposed.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
color
Color value to which the render target surface is cleared.
Exceptions
Exception type Condition
ObjectDisposedException Clear was called after this GraphicsDevice was disposed.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
GraphicsDevice.Dispose () Immediately releases the unmanaged resources used by this object.
GraphicsDevice.Dispose (Boolean) Immediately releases the unmanaged resources used by this object.
Remarks
Call Dispose when you are finished using the GraphicsDevice. The Dispose method leaves the GraphicsDevice in an unusable
state. After calling Dispose, you must release all references to the GraphicsDevice so the garbage collector can reclaim the
memory that the GraphicsDevice was occupying.
Note
Always call Dispose before you release your last reference to the GraphicsDevice. Otherwise, the resources it is using will not
be freed until the garbage collector calls the GraphicsDevice object's Finalize method.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDevice.Dispose Method ()
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
Remarks
Call Dispose when you are finished using the GraphicsDevice. The Dispose method leaves the GraphicsDevice in an unusable
state. After calling Dispose, you must release all references to the GraphicsDevice so the garbage collector can reclaim the
memory that the GraphicsDevice was occupying.
Note
Always call Dispose before you release your last reference to the GraphicsDevice. Otherwise, the resources it is using will not
be freed until the garbage collector calls the GraphicsDevice object's Finalize method.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
Remarks
This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean)
method with the disposing parameter set to true. Finalize invokes Dispose(Boolean) with disposing set to false.
When the disposing parameter is true, this method releases all resources held by any managed objects that this
GraphicsDevice references. This method invokes the Dispose method of each referenced object.
Note
Notes to Inheritors
Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects
disposed of in an earlier call to Dispose.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.DrawIndexedPrimitives Method
Renders the specified geometric primitive, based on indexing into an array of vertices.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void DrawIndexedPrimitives (
PrimitiveType primitiveType,
int baseVertex,
int minVertexIndex,
int numVertices,
int startIndex,
int primitiveCount
)
Parameters
primitiveType
Describes the type of primitive to render. PrimitiveType.PointList is not supported with this method.
baseVertex
Offset to add to each vertex index in the index buffer.
minVertexIndex
Minimum vertex index for vertices used during the call. The minVertexIndex parameter and all of the indices in the index
stream are relative to the baseVertex parameter.
numVertices
A number of vertices used during the call. The first vertex is located at index: baseVertex + minVertexIndex.
startIndex
Location in the index array at which to start reading vertices.
primitiveCount
A number of primitives to render. The number of vertices used is a function of primitiveCount and primitiveType. To
determine the maximum number of primitives allowed, check the MaxPrimitiveCount property member of the
Capabilities structure.
Exceptions
Exception type Condition
ArgumentOutOfRangeException primitiveCount is less than or equal to zero. When drawing, at least one primitive must be dra
wn.
InvalidOperationException
One of the following conditions is true:
VertexDeclaration is not a valid value. A valid vertex declaration must be set on the devi
ce before any draw operations can be performed.
A valid vertex shader and pixel shader was not set before calling DrawIndexedPrimiti
ves. Both a valid vertex shader and pixel shader (or valid effect) must be set on the devi
ce before any draw operations may be performed. See How To: Use BasicEffect or
How To: Create and Apply Custom Effects for more information on applying effects.
Vertices is not a valid vertex buffer, or Indices is not a valid index buffer. A valid vertex b
uffer and a valid index buffer must be set on the device before any draw operations ma
y be performed.
The active render target and depth stencil surface do not have the same pixel size and
multisampling type.
Example
The vertex stream and index data of the graphics device must be set before any call to DrawIndexedPrimitives. The following
example sets the index data and associates a user-created vertex buffer of type VertexPositionNormalTexture with vertex
stream 0 (zero) of the graphics device.
C#
graphics.GraphicsDevice.Vertices[0].SetSource(
vertexBuffer, 0,
VertexPositionNormalTexture.SizeInBytes);
graphics.GraphicsDevice.Indices = lineListIndexBuffer;
Remarks
This method draws indexed primitives from the current set of data input streams.
The minVertexIndex and numVertices parameters specify the range of vertex indices used for each call to
DrawIndexedPrimitives. These vertex indices are used to optimize vertex processing of indexed primitives by processing a
sequential range of vertices prior to indexing into them. Indices used during this call cannot reference any vertices outside this
range.
If no index array is set, DrawIndexedPrimitives fails.
See Also
Tasks
How To: Draw Points, Lines, and Other 3D Primitives
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.DrawPrimitives Method
Renders a sequence of non-indexed geometric primitives of the specified type from the current set of data input streams.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void DrawPrimitives (
PrimitiveType primitiveType,
int startVertex,
int primitiveCount
)
Parameters
primitiveType
Describes the type of primitive to render.
startVertex
Index of the first vertex to load. Beginning at startVertex, the correct number of vertices is read out of the vertex buffer.
primitiveCount
Number of primitives to render. To determine the maximum number of primitives allowed, check MaxPrimitiveCount. The
primitiveCount is the number of primitives as determined by the primitive type. If it is a line list, each primitive has two
vertices. If it is a triangle list, each primitive has three vertices.
Exceptions
Exception type Condition
ArgumentOutOfRangeException primitiveCount is less than or equal to zero. When drawing, at least one primitive must be dra
wn.
InvalidOperationException
One of the following conditions is true:
VertexDeclaration is not a valid value. A valid vertex declaration must be set on the devi
ce before any draw operations can be performed.
A valid vertex shader and pixel shader was not set before calling DrawPrimitives. Both
a valid vertex shader and pixel shader (or valid effect) must be set on the device before
any draw operations may be performed. See How To: Use BasicEffect or
How To: Create and Apply Custom Effects for more information on applying effects.
Vertices is not a valid vertex buffer. A valid vertex buffer must be set on the device befor
e any draw operations may be performed.
The active render target and depth stencil surface do not have the same pixel size and
multisampling type.
Remarks
DrawPrimitives should not be called with a single triangle at a time.
Example
The vertex stream of the graphics device must be set before any call to DrawPrimitives. The following example associates a
user created vertex buffer of type VertexPositionNormalTexture with vertex stream 0 (zero) of the graphics device.
C#
graphics.GraphicsDevice.Vertices[0].SetSource(
vertexBuffer, 0,
VertexPositionNormalTexture.SizeInBytes);
See Also
Tasks
How To: Draw Points, Lines, and Other 3D Primitives
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.DrawUserIndexedPrimitives Method
Renders the specified geometric primitive with data specified by the user.
Overload List
Name Description
GraphicsDevice.DrawUserIndexedPrimitives (PrimitiveType, T[], Int32, Int32, Int16[], Int32, Int32) Renders geometric primitives
with indexed data specified by
the user, specifying an index b
uffer as an array of type Int16.
GraphicsDevice.DrawUserIndexedPrimitives (PrimitiveType, T[], Int32, Int32, Int32[], Int32, Int32) Renders geometric primitives
with indexed data specified by
the user, specifying an index b
uffer as an array of type Int32.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Type Parameters
T
The type of vertex in vertexData.
Parameters
primitiveType
Describes the type of primitive to render.
vertexData
The vertex buffer indexed by indexData.
vertexOffset
Offset to add to each vertex index in the index buffer.
numVertices
Number of vertices used during this call. The first vertex is located at index minVertexIndex.
indexData
A list of indices into the vertex buffer, given in the order that you want the vertices to render. Using an array of type Int16,
which uses 16 bits per element, allows you conserve resources if the index buffer does not require a 32-bit depth array.
indexOffset
Location in the index array at which to start reading vertices.
primitiveCount
Number of primitives to render. The maximum number of primitives allowed is determined by checking MaxPrimitiveCount.
(The number of indices is a function of the primitive count and the primitive type.)
Exceptions
Exception type Condition
ArgumentException
One of the following conditions is true:
vertexOffset + numVertices is outside of the range of vertexData.
There are not enough indices in indexData based on the number of primitives requeste
d by primitiveCount.
ArgumentNullException vertexData or indexData is null.
ArgumentOutOfRangeException One of the following conditions is true:
indexOffset or vertexOffset is not in a range allowed by indexData or vertexData.
primitiveCount or numVertices is less than or equal to zero. When drawing, at least one
primitive must be drawn.
InvalidOperationException
One of the following conditions is true:
VertexDeclaration is not a valid value. A valid vertex declaration must be set on the devi
ce before any draw operations can be performed.
A valid vertex shader and pixel shader was not set before calling DrawUserIndexedPri
mitives. Both a valid vertex shader and pixel shader (or valid effect) must be set on the
device before any draw operations may be performed. See How To: Use BasicEffect or
How To: Create and Apply Custom Effects for more information on applying effects.
vertexData is not a valid vertex buffer, or indexData is not a valid index buffer. A valid v
ertex buffer (and a valid index buffer if you are using indexed primitives) must be set on
the device before any draw operations may be performed.
The active render target and depth stencil surface do not have the same pixel size and
multisampling type.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of vertex in vertexData.
Parameters
primitiveType
Describes the type of primitive to render.
vertexData
The vertex buffer indexed by indexData.
vertexOffset
Offset to add to each vertex index in the index buffer.
numVertices
Number of vertices used during this call. The first vertex is located at index minVertexIndex.
indexData
A list of indices into the vertex buffer, given in the order that you want the vertices to render. Using an array of type Int32,
which uses 32 bits per element, allows you to index a greater number of elements in the vertex buffer.
indexOffset
Location in the index array at which to start reading vertices.
primitiveCount
Number of primitives to render. The maximum number of primitives allowed is determined by checking MaxPrimitiveCount.
(The number of indices is a function of the primitive count and the primitive type.)
Exceptions
Exception type Condition
ArgumentException
One of the following conditions is true:
vertexOffset + numVertices is outside of the range of vertexData.
There are not enough indices in indexData based on the number of primitives requeste
d by primitiveCount.
ArgumentNullException vertexData or indexData is null.
ArgumentOutOfRangeException One of the following conditions is true:
indexOffset or vertexOffset is not in a range allowed by indexData or vertexData.
primitiveCount or numVertices is less than or equal to zero. When drawing, at least one
primitive must be drawn.
InvalidOperationException
One of the following conditions is true:
VertexDeclaration is not a valid value. A valid vertex declaration must be set on the devi
ce before any draw operations can be performed.
A valid vertex shader and pixel shader was not set before calling DrawUserIndexedPri
mitives. Both a valid vertex shader and pixel shader (or valid effect) must be set on the
device before any draw operations may be performed. See How To: Use BasicEffect or
How To: Create and Apply Custom Effects for more information on applying effects.
vertexData is not a valid vertex buffer, or indexData is not a valid index buffer. A valid v
ertex buffer (and a valid index buffer if you are using indexed primitives) must be set on
the device before any draw operations may be performed.
The active render target and depth stencil surface do not have the same pixel size and
multisampling type.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
Parameters
primitiveType
Describes the type of primitive to render.
vertexData
The vertex data.
vertexOffset
Offset at which to begin reading vertexData.
primitiveCount
Number of primitives to render. The maximum number of primitives allowed is determined by checking MaxPrimitiveCount.
The number of indices is a function of primitiveCount and primitiveType.
Exceptions
Exception type Condition
ArgumentException vertexOffset + numVertices is outside of the range of vertexData.
ArgumentNullException vertexData is null.
ArgumentOutOfRangeException
One of the following conditions is true:
primitiveCount is less than or equal to zero. When drawing, at least one primitive must
be drawn.
vertexOffset is less than zero or greater than the length of vertexData.
InvalidOperationException
One of the following conditions is true:
VertexDeclaration is not a valid value. A valid vertex declaration must be set on the devi
ce before any draw operations can be performed.
A valid vertex shader and pixel shader was not set before calling DrawUserPrimitives.
Both a valid vertex shader and pixel shader (or valid effect) must be set on the device be
fore any draw operations may be performed. See How To: Use BasicEffect or
How To: Create and Apply Custom Effects for more information on applying effects.
vertexData is not a valid vertex buffer. A valid vertex buffer must be set on the device be
fore any draw operations may be performed.
Remarks
This method is intended for use when drawing dynamic geometry specified by the user. It supports only a single vertex stream.
The effect of this call is to use the provided vertex data pointer and stride for vertex stream 0. It is invalid to have the
declaration of the current vertex shader refer to vertex streams other than stream 0.
The vertex data passed to DrawUserPrimitives does not need to persist after the call. Access to the data is completed before
returning from the call.
See Also
Tasks
How To: Draw Point Sprites
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.EvictManagedResources Method
Evicts all managed resources, including Microsoft Direct3D resources and those that are driver managed.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void EvictManagedResources ()
Exceptions
Exception type Condition
OutOfVideoMemoryException Direct3D does not have enough display memory to perform the operation.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.Finalize Method
Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the
object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void Finalize ()
Remarks
This method overrides System.Object.Finalize. Application code should not call this method; an object's Finalize method is
invoked automatically during garbage collection, unless a call to the GC.SuppressFinalize method has disabled finalization by
the garbage collector.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetGammaRamp Method
Gets the gamma correction ramp.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GammaRamp GetGammaRamp ()
Return Value
The gamma correction ramp.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetPixelShaderBooleanConstant Method
Gets an array of Boolean values from the pixel shader constant Boolean registers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool[] GetPixelShaderBooleanConstant (
int startRegister,
int constantCount
)
Parameters
startRegister
Pixel shader Boolean constant register of the first constant.
constantCount
Number of Boolean values to retrieve.
Return Value
Array of Boolean values retrieved from the constant registers.
Exceptions
Exception type Condition
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetPixelShaderInt32Constant Method
Gets an array of Int32 values from the pixel shader constant integer registers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int[] GetPixelShaderInt32Constant (
int startRegister,
int constantCount
)
Parameters
startRegister
Pixel shader integer register of the first constant.
constantCount
Number of Int32 values to retrieve.
Return Value
Array of Int32 values retrieved from the constant registers.
Exceptions
Exception type Condition
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetPixelShaderMatrixArrayConstant Method
Gets an array of Matrix values from the pixel shader constant float registers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Matrix[] GetPixelShaderMatrixArrayConstant (
int startRegister,
int constantCount
)
Parameters
startRegister
Pixel shader constant float register of the first constant.
constantCount
Number of Matrix values to retrieve.
Return Value
Array of Matrix values retrieved from the constant registers.
Exceptions
Exception type Condition
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetPixelShaderMatrixConstant Method
Gets a Matrix value from the pixel shader constant float registers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Matrix GetPixelShaderMatrixConstant (
int startRegister
)
Parameters
startRegister
Pixel shader constant float register of the first constant.
Return Value
Matrix value retrieved from the constant registers.
Exceptions
Exception type Condition
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetPixelShaderQuaternionArrayConstant
Method
Gets an array of Quaternion values from the pixel shader constant float registers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Quaternion[] GetPixelShaderQuaternionArrayConstant (
int startRegister,
int constantCount
)
Parameters
startRegister
Pixel shader constant float register of the first constant.
constantCount
Number of Quaternion values to retrieve.
Return Value
Array of Quaternion values retrieved from the constant registers.
Exceptions
Exception type Condition
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetPixelShaderQuaternionConstant Method
Gets a Quaternion value from the pixel shader constant float registers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Quaternion GetPixelShaderQuaternionConstant (
int startRegister
)
Parameters
startRegister
Pixel shader constant float register of the first constant.
Return Value
Quaternion value retrieved from the constant registers.
Exceptions
Exception type Condition
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetPixelShaderSingleConstant Method
Gets an array of Single values from the pixel shader constant float registers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float[] GetPixelShaderSingleConstant (
int startRegister,
int constantCount
)
Parameters
startRegister
Pixel shader constant float register of the first constant.
constantCount
Number of Single values to retrieve.
Return Value
Array of Single values retrieved from the constant registers.
Exceptions
Exception type Condition
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetPixelShaderVector2ArrayConstant Method
Gets an array of Vector2 values from the pixel shader constant float registers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector2[] GetPixelShaderVector2ArrayConstant (
int startRegister,
int constantCount
)
Parameters
startRegister
Pixel shader constant float register of the first constant.
constantCount
Number of Vector2 values to retrieve.
Return Value
Array of Vector2 values retrieved from the constant registers.
Exceptions
Exception type Condition
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetPixelShaderVector2Constant Method
Gets a Vector2 value from the pixel shader constant float registers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector2 GetPixelShaderVector2Constant (
int startRegister
)
Parameters
startRegister
Pixel shader constant float register of the first constant.
Return Value
Vector2 value retrieved from the constant registers.
Exceptions
Exception type Condition
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetPixelShaderVector3ArrayConstant Method
Gets an array of Vector3 values from the pixel shader constant float registers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3[] GetPixelShaderVector3ArrayConstant (
int startRegister,
int constantCount
)
Parameters
startRegister
Pixel shader constant float register of the first constant.
constantCount
Number of Vector3 values to retrieve.
Return Value
Array of Vector3 values retrieved from the constant registers.
Exceptions
Exception type Condition
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetPixelShaderVector3Constant Method
Gets a Vector3 value from the pixel shader constant float registers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 GetPixelShaderVector3Constant (
int startRegister
)
Parameters
startRegister
Pixel shader constant float register of the first constant.
Return Value
Vector3 value retrieved from the constant registers.
Exceptions
Exception type Condition
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetPixelShaderVector4ArrayConstant Method
Gets an array of Vector4 values from the pixel shader constant float registers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector4[] GetPixelShaderVector4ArrayConstant (
int startRegister,
int constantCount
)
Parameters
startRegister
Pixel shader constant float register of the first constant.
constantCount
Number of Vector4 values to retrieve.
Return Value
Array of Vector4 values retrieved from the constant registers.
Exceptions
Exception type Condition
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetPixelShaderVector4Constant Method
Gets a Vector4 value from the pixel shader constant float registers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector4 GetPixelShaderVector4Constant (
int startRegister
)
Parameters
startRegister
Pixel shader constant float register of the first constant.
Return Value
Vector4 value retrieved from the constant registers.
Exceptions
Exception type Condition
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetRenderTarget Method
Gets a render target surface.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public RenderTarget GetRenderTarget (
int renderTargetIndex
)
Parameters
renderTargetIndex
Index of the render target.
Return Value
The render target surface of the current graphics device.
Exceptions
Exception type Condition
ArgumentOutOfRangeException An invalid render target index was requested. On Xbox 360, there is only one render target av
ailable and renderTargetIndex must be zero.
Remarks
The GraphicsDevice can support multiple render targets. The number of render targets supported by a GraphicsDevice is
contained in MaxSimultaneousRenderTargets.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetVertexShaderBooleanConstant Method
Gets an array of Boolean values from the vertex shader constant Boolean registers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool[] GetVertexShaderBooleanConstant (
int startRegister,
int constantCount
)
Parameters
startRegister
Vertex shader constant Boolean register of the first constant.
constantCount
Number of Boolean values to retrieve.
Return Value
Array of Boolean values retrieved from the constant registers.
Exceptions
Exception type Condition
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetVertexShaderInt32Constant Method
Gets an array of Int32 values from the vertex shader constant integer registers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int[] GetVertexShaderInt32Constant (
int startRegister,
int constantCount
)
Parameters
startRegister
Vertex shader constant integer register of the first constant.
constantCount
Number of Int32 values to retrieve.
Return Value
Array of Int32 values retrieved from the constant registers.
Exceptions
Exception type Condition
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetVertexShaderMatrixArrayConstant Method
Gets an array of Matrix values from the vertex shader constant float registers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Matrix[] GetVertexShaderMatrixArrayConstant (
int startRegister,
int constantCount
)
Parameters
startRegister
Vertex shader constant float register of the first constant.
constantCount
Number of Matrix values to retrieve.
Return Value
Array of Matrix values retrieved from the constant registers.
Exceptions
Exception type Condition
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetVertexShaderMatrixConstant Method
Gets a Matrix value from the vertex shader constant float registers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Matrix GetVertexShaderMatrixConstant (
int startRegister
)
Parameters
startRegister
Vertex shader constant float register of the first constant.
Return Value
Matrix value retrieved from the constant registers.
Exceptions
Exception type Condition
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetVertexShaderQuaternionArrayConstant
Method
Gets an array of Quaternion values from the vertex shader constant float registers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Quaternion[] GetVertexShaderQuaternionArrayConstant (
int startRegister,
int constantCount
)
Parameters
startRegister
Vertex shader constant float register of the first constant.
constantCount
Number of Quaternion values to retrieve.
Return Value
Array of Quaternion values retrieved from the constant registers.
Exceptions
Exception type Condition
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetVertexShaderQuaternionConstant Method
Gets a Quaternion value from the vertex shader constant float registers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Quaternion GetVertexShaderQuaternionConstant (
int startRegister
)
Parameters
startRegister
Vertex shader constant float register of the first constant.
Return Value
Quaternion value retrieved from the constant registers.
Exceptions
Exception type Condition
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetVertexShaderSingleConstant Method
Gets an array of Single values from the vertex shader constant float registers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float[] GetVertexShaderSingleConstant (
int startRegister,
int constantCount
)
Parameters
startRegister
Vertex shader constant float register of the first constant.
constantCount
Number of Single values to retrieve.
Return Value
Array of Single values retrieved from the constant registers.
Exceptions
Exception type Condition
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetVertexShaderVector2ArrayConstant Method
Gets an array of Vector2 values from the vertex shader constant float registers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector2[] GetVertexShaderVector2ArrayConstant (
int startRegister,
int constantCount
)
Parameters
startRegister
Vertex shader constant float register of the first constant.
constantCount
Number of Vector2 values to retrieve.
Return Value
Array of Vector2 values retrieved from the constant registers.
Exceptions
Exception type Condition
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetVertexShaderVector2Constant Method
Gets a Vector2 value from the vertex shader constant float registers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector2 GetVertexShaderVector2Constant (
int startRegister
)
Parameters
startRegister
Vertex shader constant float register of the first constant.
Return Value
Vector2 value retrieved from the constant registers.
Exceptions
Exception type Condition
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetVertexShaderVector3ArrayConstant Method
Gets an array of Vector3 values from the vertex shader constant float registers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3[] GetVertexShaderVector3ArrayConstant (
int startRegister,
int constantCount
)
Parameters
startRegister
Vertex shader constant float register of the first constant.
constantCount
Number of Vector3 values to retrieve.
Return Value
Array of Vector3 values retrieved from the constant registers.
Exceptions
Exception type Condition
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetVertexShaderVector3Constant Method
Gets a Vector3 value from the vertex shader constant float registers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 GetVertexShaderVector3Constant (
int startRegister
)
Parameters
startRegister
Vertex shader constant float register of the first constant.
Return Value
Vector3 value retrieved from the constant registers.
Exceptions
Exception type Condition
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetVertexShaderVector4ArrayConstant Method
Gets an array of Vector4 values from the vertex shader constant float registers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector4[] GetVertexShaderVector4ArrayConstant (
int startRegister,
int constantCount
)
Parameters
startRegister
Vertex shader constant float register of the first constant.
constantCount
Number of Vector4 values to retrieve.
Return Value
Array of Vector4 values retrieved from the constant registers.
Exceptions
Exception type Condition
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GetVertexShaderVector4Constant Method
Gets a Vector4 value from the vertex shader constant float registers.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector4 GetVertexShaderVector4Constant (
int startRegister
)
Parameters
startRegister
Vertex shader constant float register of the first constant.
Return Value
Vector4 value retrieved from the constant registers.
Exceptions
Exception type Condition
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.Present Method
Presents the display with the contents of the next buffer in the sequence of back buffers owned by the GraphicsDevice.
Overload List
Name Description
GraphicsDevice.Present () Presents the display with the contents of the next
buffer in the sequence of back buffers owned by t
he GraphicsDevice.
GraphicsDevice.Present (IntPtr) Specifies the window target for a presentation an
d presents the display with the contents of the ne
xt buffer in the sequence of back buffers owned b
y the GraphicsDevice.
GraphicsDevice.Present (Nullable<Rectangle>, Nullable<Rectangle>, IntPtr) Specifies the window target for a presentation an
d presents the display with the contents of the ne
xt buffer in the sequence of back buffers owned b
y the GraphicsDevice.
Exceptions
Exception type Condition
DriverInternalErrorException Internal driver error. Applications should generally shut down when receiving this error.
DeviceLostException The GraphicsDevice is lost but cannot be reset at this time. Therefore, rendering is not possible.
Remarks
If necessary, a stretch operation is applied to transfer the pixels within the source rectangle to the destination rectangle in the
client area of the target window.
See Also
Reference
Reset
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDevice.Present Method ()
Presents the display with the contents of the next buffer in the sequence of back buffers owned by the GraphicsDevice.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Present ()
Exceptions
Exception type Condition
ObjectDisposedException Present was called after the GraphicsDevice was disposed.
DriverInternalErrorException Internal driver error. Applications should generally shut down when receiving this error.
DeviceLostException The GraphicsDevice is lost but cannot be reset at this time. Therefore, rendering is not possible.
Example
C#
// Create a new render target to receive the drawn data.
renderTarget = new RenderTarget2D(
graphics.GraphicsDevice,
// In this case, we are creating
// a render target to match half of a split screen:
leftViewPort.Width,
leftViewPort.Height,
// Number of levels in the render target:
1,
// Use the same surface format as the back buffer.
graphics.GraphicsDevice.PresentationParameters.BackBufferFormat);
See Also
Reference
Present
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
overrideWindowHandle
Destination window containing the client area that is the target for this presentation. If not specified, this is
DeviceWindowHandle.
Exceptions
Exception type Condition
ObjectDisposedException Present was called after the GraphicsDevice was disposed.
DriverInternalErrorException Internal driver error. Applications should generally shut down when receiving this error.
DeviceLostException The GraphicsDevice is lost but cannot be reset at this time. Therefore, rendering is not possible.
Example
C#
// Create a new render target to receive the drawn data.
renderTarget = new RenderTarget2D(
graphics.GraphicsDevice,
// In this case, we are creating
// a render target to match half of a split screen:
leftViewPort.Width,
leftViewPort.Height,
// Number of levels in the render target:
1,
// Use the same surface format as the back buffer.
graphics.GraphicsDevice.PresentationParameters.BackBufferFormat);
See Also
Reference
Present
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
sourceRectangle
The source rectangle. If null, the entire source surface is presented. If the rectangle exceeds the source surface, the rectangle
is clipped to the source surface. This parameter must be null unless the swap chain was created with SwapEffect.Copy.
destinationRectangle
The destination rectangle, in window client coordinates. If null, the entire client area is filled. If the rectangle exceeds the
destination client area, the rectangle is clipped to the destination client area. This parameter must be null unless the swap
chain was created with SwapEffect.Copy.
overrideWindowHandle
Destination window containing the client area that is the target for this presentation. If not specified, this is
DeviceWindowHandle.
Exceptions
Exception type Condition
ObjectDisposedException Present was called after the GraphicsDevice was disposed.
DriverInternalErrorException Internal driver error. Applications should generally shut down when receiving this error.
DeviceLostException The GraphicsDevice is lost but cannot be reset at this time. Therefore, rendering is not possible.
Example
C#
// Create a new render target to receive the drawn data.
renderTarget = new RenderTarget2D(
graphics.GraphicsDevice,
// In this case, we are creating
// a render target to match half of a split screen:
leftViewPort.Width,
leftViewPort.Height,
// Number of levels in the render target:
1,
// Use the same surface format as the back buffer.
graphics.GraphicsDevice.PresentationParameters.BackBufferFormat);
// Call GetTexture to retrieve the render target data and save it to a texture.
capturedTexture = renderTarget.GetTexture();
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.raise_DeviceLost Method
Occurs when a GraphicsDevice is about to be lost (for example, immediately before a reset).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected void raise_DeviceLost (
Object value0,
EventArgs value1
)
Parameters
value0
The source of this event.
value1
The event arguments that are associated with the action that raised the event.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.raise_DeviceReset Method
Occurs after a GraphicsDevice is reset, allowing an application to re-create all resources.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected void raise_DeviceReset (
Object value0,
EventArgs value1
)
Parameters
value0
The source of this event.
value1
The event arguments that are associated with the action that raised the event.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.raise_DeviceResetting Method
Occurs when a GraphicsDevice is resetting
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected void raise_DeviceResetting (
Object value0,
EventArgs value1
)
Parameters
value0
The source of this event.
value1
The event arguments that are associated with the action that raised the event.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.raise_Disposing Method
Raises the Disposing event when called from within a derived class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected void raise_Disposing (
Object value0,
EventArgs value1
)
Parameters
value0
Invoking object reference; should be this object.
value1
Arguments to pass to the event handler.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.raise_ResourceCreated Method
Occurs when ResourceCreated is called.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected void raise_ResourceCreated (
Object value0,
ResourceCreatedEventArgs value1
)
Parameters
value0
The source of the event.
value1
An EventArgs object that contains no data.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.raise_ResourceDestroyed Method
Occurs when ResourceDestroyed is called.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected void raise_ResourceDestroyed (
Object value0,
ResourceDestroyedEventArgs value1
)
Parameters
value0
The source of the event.
value1
An EventArgs object that contains no data.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.Reset Method
Resets the presentation parameters for the current GraphicsDevice.
Overload List
Name Description
GraphicsDevice.Reset () Resets the presentation parameters for the current
GraphicsDevice.
GraphicsDevice.Reset (GraphicsAdapter) Resets the presentation parameters for the specified Reset.
GraphicsDevice.Reset (PresentationParameters) Resets the current GraphicsDevice with the specified
PresentationParameters.
GraphicsDevice.Reset (PresentationParameters, GraphicsAdapter) Resets the specified Reset with the specified presentation pa
rameters.
Exceptions
Exception type Condition
DeviceLostException The GraphicsDevice is lost but cannot be reset at this time. Therefore, rendering is not possible.
DriverInternalErrorException Internal driver error. Applications should generally shut down when receiving this error.
OutOfVideoMemoryException Direct3D does not have enough display memory to perform the operation.
OutOfMemoryException Direct3D could not allocate sufficient memory to complete the call.
Remarks
When switching to full screen mode, Microsoft Direct3D tries to find a desktop format that matches the back buffer format, so
that back and front buffer formats are identical. This eliminates the need for color conversion.
Calling Reset causes all texture memory surfaces and state information to be lost, and managed textures to be flushed from
video memory. Before calling Reset for a GraphicsDevice, an application should release any explicit render targets, depth
stencil surfaces, additional swap chains, state blocks, and default resources associated with the GraphicsDevice.
Swap chains are either full screen or windowed. If the new swap chain is full screen, the adapter is placed in the display mode
that matches the new size.
A call to Reset fails if made on a different thread than the one used to create the GraphicsDevice being reset.
Pixel shaders and vertex shaders survive Reset calls for DirectX 9.0. They do not need to be re-created explicitly by the
application.
Unknown can be specified for the windowed-mode back-buffer format when creating a GraphicsDevice and Reset. This
means the application does not have to query the current desktop format before calling a GraphicsDevice constructor for
windowed mode. For full screen mode, the back-buffer format must be specified. Setting BackBufferCount to 0 results in the
creation of one back buffer.
When trying to reset more than one display adapter in a group, pass in an array of PresentationParameters objects, one for
each display in the adapter group.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDevice.Reset Method ()
Resets the presentation parameters for the current GraphicsDevice.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Reset ()
Exceptions
Exception type Condition
DeviceLostException The GraphicsDevice is lost but cannot be reset at this time. Therefore, rendering is not possible.
DriverInternalErrorException Internal driver error. Applications should generally shut down when receiving this error.
OutOfVideoMemoryException Direct3D does not have enough display memory to perform the operation.
OutOfMemoryException Direct3D could not allocate sufficient memory to complete the call."
See Also
Reference
Reset
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsAdapter
The graphics device being reset.
Exceptions
Exception type Condition
DeviceLostException The GraphicsDevice is lost but cannot be reset at this time. Therefore, rendering is not possible.
DriverInternalErrorException Internal driver error. Applications should generally shut down when receiving this error.
OutOfVideoMemoryException Direct3D does not have enough display memory to perform the operation.
OutOfMemoryException Direct3D could not allocate sufficient memory to complete the call."
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
presentationParameters
Describes the new presentation parameters. This value cannot be null.
Exceptions
Exception type Condition
ArgumentNullException presentationParameters is null.
DeviceLostException The GraphicsDevice is lost but cannot be reset at this time. Therefore, rendering is not possible.
DriverInternalErrorException Internal driver error. Applications should generally shut down when receiving this error.
OutOfVideoMemoryException Direct3D does not have enough display memory to perform the operation.
OutOfMemoryException Direct3D could not allocate sufficient memory to complete the call.
See Also
Reference
Reset
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
presentationParameters
Describes the new presentation parameters. This value cannot be null.
graphicsAdapter
The graphics device being reset.
Exceptions
Exception type Condition
ArgumentNullException presentationParameters is null.
DeviceLostException The GraphicsDevice is lost but cannot be reset at this time. Therefore, rendering is not possible.
DriverInternalErrorException Internal driver error. Applications should generally shut down when receiving this error.
OutOfVideoMemoryException Direct3D does not have enough display memory to perform the operation.
OutOfMemoryException Direct3D could not allocate sufficient memory to complete the call."
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.ResolveBackBuffer Method
Copies the current back buffer contents to a texture.
Overload List
Name Description
GraphicsDevice.ResolveBackBuffer (ResolveTexture2D) Copies the current back buffer contents to a texture.
GraphicsDevice.ResolveBackBuffer (ResolveTexture2D, Int32) Copies the contents of the back buffer at the specified index to a
texture.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
resolveTarget
Texture to update with the resolved back buffer.
Exceptions
Exception type Condition
InvalidOperationException ResolveBackBuffer may not be called when the current render target is null. Use
ResolveBackBuffer instead.
Remarks
On Xbox 360, the back buffer is cleared when ResolveBackBuffer is called.
Example
C#
In this example, a new Texture2D is created for use as a render target, the data is initial
ized with a call to ResolveBackBuffer, and the generation of mipmaps for the resolved rende
r target is requested.ResolveTexture2D renderTargetTexture;
renderTargetTexture = new ResolveTexture2D(
graphics.GraphicsDevice,
graphics.GraphicsDevice.PresentationParameters.BackBufferWidth,
graphics.GraphicsDevice.PresentationParameters.BackBufferHeight,
1,
graphics.GraphicsDevice.PresentationParameters.BackBufferFormat);
graphics.GraphicsDevice.ResolveBackBuffer(renderTargetTexture);
renderTargetTexture.GenerateMipMaps( TextureFilter.Linear );
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
resolveTarget
Texture to update with the resolved back buffer.
backBufferIndex
Index of the back buffer to resolve.
Exceptions
Exception type Condition
ArgumentException
One of the following conditions is true:
backBufferIndex is not valid. Note that on Xbox 360, there is only one back buffer available an
d backBufferIndex must be zero.
ArgumentNullException resolveTarget is null
InvalidOperationException ResolveBackBuffer may not be called when the current render target is null. Use
ResolveBackBuffer instead.
Remarks
On Xbox 360, the back buffer is cleared when ResolveBackBuffer is called.
Example
C#
In this example, a new Texture2D is created for use as a render target, the data is initial
ized with a call to ResolveBackBuffer, and the generation of mipmaps for the resolved rende
r target is requested.ResolveTexture2D renderTargetTexture;
renderTargetTexture = new ResolveTexture2D(
graphics.GraphicsDevice,
graphics.GraphicsDevice.PresentationParameters.BackBufferWidth,
graphics.GraphicsDevice.PresentationParameters.BackBufferHeight,
1,
graphics.GraphicsDevice.PresentationParameters.BackBufferFormat);
graphics.GraphicsDevice.ResolveBackBuffer(renderTargetTexture);
renderTargetTexture.GenerateMipMaps( TextureFilter.Linear );
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.SetGammaRamp Method
Sets the gamma correction ramp.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void SetGammaRamp (
bool calibrate,
GammaRamp ramp
)
Parameters
calibrate
[MarshalAsAttribute(U1)] true to indicate that correction should be applied. false to indicate that no gamma correction
should be applied. The supplied gamma table is transferred directly to the GraphicsDevice.
ramp
The gamma correction ramp to set.
Exceptions
Exception type Condition
ArgumentNullException ramp is null.
InvalidOperationException The arrays used in the red, green, and blue components of ramp do not have an array length of 256
. Arrays used for gamma ramps must have a length of 256.
Remarks
Gamma correction results in a more consistent display, but can incur processing overhead and should not be used frequently.
Short-duration effects, such as flashing the entire screen red, should not be calibrated, but long-duration gamma changes
should be. If a gamma calibrator is installed, the ramp is modified before being sent to the GraphicsDevice to account for the
system and monitor response curves. If no calibrator is installed, the ramp is passed directly to the GraphicsDevice.
The gamma ramp takes effect immediately. No wait for a vertical sync operation is performed.
If the GraphicsDevice does not support gamma ramps in the current presentation mode (full-screen or windowed), no error is
returned. Applications can check SupportsFullScreenGamma and CanCalibrateGamma to determine the capabilities of the
GraphicsDevice and whether a calibrator is installed.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.SetPixelShaderConstant Method
Sets a pixel shader constant.
Overload List
Name Description
GraphicsDevice.SetPixelShaderConstant (Int32, Boolean[]) Sets the specified pixel shader constant Boolean registers to an a
rray of Boolean values.
GraphicsDevice.SetPixelShaderConstant (Int32, Int32[]) Sets the specified pixel shader constant integer registers to an ar
ray of Int32 values.
GraphicsDevice.SetPixelShaderConstant (Int32, Matrix) Sets the specified pixel shader constant float registers to a Matrix
value.
GraphicsDevice.SetPixelShaderConstant (Int32, Matrix[]) Sets the specified pixel shader constant float registers to an array
of Matrix values.
GraphicsDevice.SetPixelShaderConstant (Int32, Quaternion) Sets the specified pixel shader constant float registers to a
Quaternion value.
GraphicsDevice.SetPixelShaderConstant (Int32, Quaternion[]) Sets the specified pixel shader constant float registers to an array
of Quaternion values.
GraphicsDevice.SetPixelShaderConstant (Int32, Single[]) Sets the specified pixel shader constant float registers to an array
of Single values.
GraphicsDevice.SetPixelShaderConstant (Int32, Vector2) Sets the specified pixel shader constant float register to a
Vector2 value.
GraphicsDevice.SetPixelShaderConstant (Int32, Vector2[]) Sets the specified pixel shader constant float registers to an array
of Vector2 values.
GraphicsDevice.SetPixelShaderConstant (Int32, Vector3) Sets the specified pixel shader constant float register to a
Vector3 value.
GraphicsDevice.SetPixelShaderConstant (Int32, Vector3[]) Sets the specified pixel shader constant float registers to an array
of Vector3 values.
GraphicsDevice.SetPixelShaderConstant (Int32, Vector4) Sets the specified pixel shader constant float register to a
Vector4 value.
GraphicsDevice.SetPixelShaderConstant (Int32, Vector4[]) Sets the specified pixel shader constant float registers to an array
of Vector4 values.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
startRegister
Zero-based index of the pixel shader constant Boolean register at which to begin setting values.
constantData
The constant data.
Exceptions
Exception type Condition
ArgumentNullException constantData is null.
ArgumentOutOfRangeException The graphics buffer is not large enough for this data.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
startRegister
Zero-based index of the pixel shader constant integer register at which to begin setting values.
constantData
The constant data.
Exceptions
Exception type Condition
ArgumentException When setting integer shader constant data, constantData must have a length that is a multipl
e of four.
ArgumentNullException constantData is null.
ArgumentOutOfRangeException The graphics buffer is not large enough for this data.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
startRegister
Zero-based index of the pixel shader constant float register at which to begin setting values.
constantData
The constant data.
Exceptions
Exception type Condition
ArgumentNullException constantData is null.
ArgumentOutOfRangeException The graphics buffer is not large enough for this data.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
startRegister
Zero-based index of the pixel shader constant float register at which to begin setting values.
constantData
The constant data.
Exceptions
Exception type Condition
ArgumentNullException constantData is null.
ArgumentOutOfRangeException The graphics buffer is not large enough for this data.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
startRegister
Zero-based index of the pixel shader constant float register at which to begin setting values.
constantData
The constant data.
Exceptions
Exception type Condition
ArgumentOutOfRangeException The graphics buffer is not large enough for this data.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
startRegister
Zero-based index of the pixel shader constant float register at which to begin setting values.
constantData
The constant data.
Exceptions
Exception type Condition
ArgumentNullException constantData is null.
ArgumentOutOfRangeException The graphics buffer is not large enough for this data.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
startRegister
Zero-based index of the pixel shader constant float register at which to begin setting values.
constantData
The constant data.
Exceptions
Exception type Condition
ArgumentNullException constantData is null.
ArgumentException When setting float shader constant data, constantData must have a length that is a multiple o
f four.
ArgumentOutOfRangeException The graphics buffer is not large enough for this data.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
startRegister
Zero-based index of the pixel shader constant float register at which to begin setting values.
constantData
The constant data.
Remarks Because the data in the Vector2 type is not large enough to fill the constant float register, the constant data will be
padded to fill the register. This means that setting register 0 to a Vector2 containing (1,2) will fill the register with (1,2,0,0).
Exceptions
Exception type Condition
ArgumentOutOfRangeException constantData is outside the allowable range of values as defined by the invoked method.
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
startRegister
Zero-based index of the pixel shader constant float register at which to begin setting values.
constantData
The constant data.
Remarks Because the data in the Vector2 type is not large enough to fill the constant float registers, the constant data will be
padded to fill the registers. This means that setting register 0 to an array of Vector2 values containing (1,2) and (3,4) will fill
register 0 with (1,2,0,0) and register 1 with (3,4,0,0).
Exceptions
Exception type Condition
ArgumentNullException constantData is null.
ArgumentOutOfRangeException The graphics buffer is not large enough for this data.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
startRegister
Zero-based index of the pixel shader constant float register at which to begin setting values.
constantData
The constant data.
RemarksBecause the data in the Vector3 type is not large enough to fill the constant float register, the constant data will be
padded to fill the register. This means that setting register 0 to a Vector3 containing (1,2,3) will fill the register with (1,2,3,0).
Exceptions
Exception type Condition
ArgumentOutOfRangeException The graphics buffer is not large enough for this data.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
startRegister
Zero-based index of the pixel shader constant float register at which to begin setting values.
constantData
The constant data.
Remarks Because the data in the Vector3 type is not large enough to fill the constant float registers, the constant data will be
padded to fill the registers. This means that setting register 0 to an array of Vector3 values containing (1,2,3) and (4,5,6) will fill
register 0 with (1,2,3,0) and register 1 with (4,5,6,0).
Exceptions
Exception type Condition
ArgumentNullException constantData is null.
ArgumentOutOfRangeException The graphics buffer is not large enough for this data.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
startRegister
Zero-based index of the pixel shader constant float register at which to begin setting values.
constantData
The constant data.
Exceptions
Exception type Condition
ArgumentOutOfRangeException The graphics buffer is not large enough for this data.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
startRegister
Zero-based index of the pixel shader constant float register at which to begin setting values.
constantData
The constant data.
Exceptions
Exception type Condition
ArgumentNullException constantData is null.
ArgumentOutOfRangeException The graphics buffer is not large enough for this data.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.SetRenderTarget Method
Sets a new color buffer for a GraphicsDevice.
Overload List
Name Description
GraphicsDevice.SetRenderTarget (Int32, RenderTarget2D) Sets a new render target for this GraphicsDevice.
GraphicsDevice.SetRenderTarget (Int32, RenderTargetCube, CubeMapFace) Sets a new render target for this GraphicsDevice.
See Also
Concepts
What Is a Render Target?
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
renderTargetIndex
Index of the render target. The number of render targets supported by a GraphicsDevice is contained in
MaxSimultaneousRenderTargets.
renderTarget
A new render target for the device, or null to set the device render target to the back buffer of the device.
Exceptions
Exception type Condition
ArgumentException An invalid render target index was requested. On Xbox 360, there is only one render target av
ailable and renderTargetIndex must be zero.
ArgumentOutOfRangeException The render target index must be within the valid range for this device.
ObjectDisposedException SetRenderTarget was called after this renderTarget was disposed.
Remarks
The following restrictions apply when using this method.
The multisample type must be the same for the render target and the depth stencil surface.
The formats must be compatible for the render target and the depth stencil surface. For more information, see
CheckDepthStencilMatch.
The size of the depth stencil surface must be greater than or equal to the size of the render target.
These restrictions are validated only when using the debug runtime when any of the GraphicsDevice drawing methods are
called.
Example
C#
// Create a new render target to receive the drawn data.
renderTarget = new RenderTarget2D(
graphics.GraphicsDevice,
// In this case, we are creating
// a render target to match half of a split screen:
leftViewPort.Width,
leftViewPort.Height,
// Number of levels in the render target:
1,
// Use the same surface format as the back buffer.
graphics.GraphicsDevice.PresentationParameters.BackBufferFormat);
// Call GetTexture to retrieve the render target data and save it to a texture.
capturedTexture = renderTarget.GetTexture();
See Also
Concepts
What Is a Render Target?
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
renderTargetIndex
Index of the render target. The number of render targets supported by a GraphicsDevice is contained in
MaxSimultaneousRenderTargets.
renderTarget
A new render target for the device, or null to set the device render target to the back buffer of the device.
faceType
The cube map face type.
Exceptions
Exception type Condition
ArgumentException An invalid render target index was requested. On Xbox 360, there is only one render target av
ailable and renderTargetIndex must be zero.
ArgumentOutOfRangeException The render target index must be within the valid range for this device.
ObjectDisposedException SetRenderTarget was called after this renderTarget was disposed.
Remarks
The following restrictions apply when using this method.
The multisample type must be the same for the render target and the depth stencil surface.
The formats must be compatible for the render target and the depth stencil surface. For more information, see
CheckDepthStencilMatch.
The size of the depth stencil surface must be greater than or equal to the size of the render target.
These restrictions are validated only when using the debug runtime when any of the GraphicsDevice drawing methods are
called.
Example
C#
// Create a new render target to receive the drawn data.
renderTarget = new RenderTarget2D(
graphics.GraphicsDevice,
// In this case, we are creating
// a render target to match half of a split screen:
leftViewPort.Width,
leftViewPort.Height,
// Number of levels in the render target:
1,
// Use the same surface format as the back buffer.
graphics.GraphicsDevice.PresentationParameters.BackBufferFormat);
// Call GetTexture to retrieve the render target data and save it to a texture.
capturedTexture = renderTarget.GetTexture();
See Also
Concepts
What Is a Render Target?
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.SetVertexShaderConstant Method
Sets a vertex shader constant.
Overload List
Name Description
GraphicsDevice.SetVertexShaderConstant (Int32, Boolean[]) Sets the specified vertex shader constant Boolean registers to a
n array of Boolean values.
GraphicsDevice.SetVertexShaderConstant (Int32, Int32[]) Sets the specified vertex shader constant integer registers to an
array of Int32 values.
GraphicsDevice.SetVertexShaderConstant (Int32, Matrix) Sets the specified vertex shader constant float registers to a
Matrix value.
GraphicsDevice.SetVertexShaderConstant (Int32, Matrix[]) Sets the specified vertex shader constant float registers to an ar
ray of Matrix values.
GraphicsDevice.SetVertexShaderConstant (Int32, Quaternion) Sets the specified vertex shader constant float register to a
Quaternion value.
GraphicsDevice.SetVertexShaderConstant (Int32, Quaternion[]) Sets the specified vertex shader constant float registers to an ar
ray of Quaternion values.
GraphicsDevice.SetVertexShaderConstant (Int32, Single[]) Sets the specified vertex shader constant float registers to an ar
ray of Single values.
GraphicsDevice.SetVertexShaderConstant (Int32, Vector2) Sets the specified vertex shader constant float register to a
Vector2 value.
GraphicsDevice.SetVertexShaderConstant (Int32, Vector2[]) Sets the specified vertex shader constant float registers to an ar
ray of Vector2 values.
GraphicsDevice.SetVertexShaderConstant (Int32, Vector3) Sets the specified vertex shader constant float register to a
Vector3 value.
GraphicsDevice.SetVertexShaderConstant (Int32, Vector3[]) Sets the specified vertex shader constant float registers to an ar
ray of Vector3 values.
GraphicsDevice.SetVertexShaderConstant (Int32, Vector4) Sets the specified vertex shader constant float register to a
Vector4 value.
GraphicsDevice.SetVertexShaderConstant (Int32, Vector4[]) Sets the specified vertex shader constant float registers to an ar
ray of Vector4 values.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
startRegister
Zero-based index of the vertex shader constant Boolean register at which to begin setting values.
constantData
The constant data.
Exceptions
Exception type Condition
ArgumentNullException constantData is null.
ArgumentOutOfRangeException The graphics buffer is not large enough for this data.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
startRegister
Zero-based index of the vertex shader constant integer register at which to begin setting values.
constantData
The constant data.
Exceptions
Exception type Condition
ArgumentException When setting integer shader constant data, constantData must have a length that is a multipl
e of four.
ArgumentNullException constantData is null.
ArgumentOutOfRangeException The graphics buffer is not large enough for this data.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
startRegister
Zero-based index of the vertex shader constant float register at which to begin setting values.
constantData
The constant data. This value will be transposed when the vertex shader constant is set.
Exceptions
Exception type Condition
ArgumentOutOfRangeException The graphics buffer is not large enough for this data.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
startRegister
Zero-based index of the vertex shader constant float register at which to begin setting values.
constantData
The constant data. This value will be transposed when the vertex shader constant is set.
Exceptions
Exception type Condition
ArgumentNullException constantData is null.
ArgumentOutOfRangeException The graphics buffer is not large enough for this data.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
startRegister
Zero-based index of the vertex shader constant float register at which to begin setting values.
constantData
The constant data.
Exceptions
Exception type Condition
ArgumentOutOfRangeException The graphics buffer is not large enough for this data.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
startRegister
Zero-based index of the vertex shader constant float register at which to begin setting values.
constantData
The constant data.
Exceptions
Exception type Condition
ArgumentNullException constantData is null.
ArgumentOutOfRangeException The graphics buffer is not large enough for this data.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
startRegister
Zero-based index of the vertex shader constant float register at which to begin setting values.
constantData
The constant data.
Exceptions
Exception type Condition
ArgumentException When setting float shader constant data, constantData must have a length that is a multiple o
f four.
ArgumentNullException constantData is null.
ArgumentOutOfRangeException The graphics buffer is not large enough for this data.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
startRegister
Zero-based index of the vertex shader constant float register at which to begin setting values.
constantData
The constant data.
Remarks Because the data in the Vector2 type is not large enough to fill the constant float register, the constant data will be
padded to fill the register. This means that setting register 0 to a Vector2 of of (1,2) will fill the register with (1,2,0,0).
Exceptions
Exception type Condition
ArgumentOutOfRangeException constantData is outside the allowable range of values as defined by the invoked method.
InvalidOperationException The method call is invalid. For example, a method's parameter may have an invalid value.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
startRegister
Zero-based index of the vertex shader constant float register at which to begin setting values.
constantData
The constant data.
Remarks Because the data in the Vector2 type is not large enough to fill the constant float registers, the constant data will be
padded to fill the registers. This means that setting register 0 to an array of Vector2 values containing (1,2) and (3,4) will fill
register 0 with (1,2,0,0) and register 1 with (3,4,0,0).
Exceptions
Exception type Condition
ArgumentNullException constantData is null.
ArgumentOutOfRangeException The graphics buffer is not large enough for this data.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
startRegister
Zero-based index of the vertex shader constant float register at which to begin setting values.
constantData
The constant data.
Remarks Because the data in the Vector3 type is not large enough to fill the constant float register, the constant data will be
padded to fill the register. This means that setting register 0 to a Vector3 of (1,2,3) will fill the register with (1,2,3,0).
Exceptions
Exception type Condition
ArgumentOutOfRangeException The graphics buffer is not large enough for this data.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
startRegister
Zero-based index of the vertex shader constant float register at which to begin setting values.
constantData
The constant data.
Remarks Because the data in the Vector3 type is not large enough to fill the constant float registers, the constant data will be
padded to fill the registers. This means that setting register 0 to to an array of Vector3 values containing (1,2,3) and (4,5,6) will
fill register 0 with (1,2,3,0) and register 1 with (4,5,6,0).
Exceptions
Exception type Condition
ArgumentNullException constantData is null.
ArgumentOutOfRangeException The graphics buffer is not large enough for this data.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
startRegister
Zero-based index of the vertex shader constant float register at which to begin setting values.
constantData
The constant data.
Exceptions
Exception type Condition
ArgumentOutOfRangeException The graphics buffer is not large enough for this data.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
startRegister
Zero-based index of the vertex shader constant float register at which to begin setting values.
constantData
The constant data.
Exceptions
Exception type Condition
ArgumentNullException constantData is null.
ArgumentOutOfRangeException The graphics buffer is not large enough for this data.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice Properties
Public Properties
Name Description
ClipPlanes Retrieves the clipping planes of the current GraphicsDevice.
CreationParameters Retrieves the creation parameters of the GraphicsDevice.
DepthStencilBuffer Gets or sets the depth stencil surface of this GraphicsDevice.
DisplayMode Retrieves the display mode's spatial resolution, color resolution, and refresh frequency.
DriverLevel Returns the driver level.
GraphicsDeviceCapabilities Gets the capabilities of the graphics device.
GraphicsDeviceStatus Retrieves the status of the device
Indices Gets or sets index data.
IsDisposed Gets a value that indicates whether the object is disposed.
PixelShader Gets or sets the current pixel shader.
PresentationParameters Gets the presentation parameters associated with this graphics device.
RasterStatus Retrieves information that describes the raster of the monitor on which the swap chain is prese
nted.
RenderState Retrieves a render-state value for a GraphicsDevice.
SamplerStates Retrieves a collection of SamplerState objects for the current GraphicsDevice.
ScissorRectangle Gets or sets the rectangle used for scissor testing.
SoftwareVertexProcessing Gets or sets the vertex processing mode.
Textures Returns the collection of textures that have been assigned to the texture stages of the device.
VertexDeclaration Gets or sets a vertex shader declaration.
VertexSamplerStates Gets the collection of vertex sampler states.
VertexShader Gets or sets the current vertex shader.
VertexTextures Gets the collection of vertex textures that support texture lookup in the vertex shader using the t
exldl - vs texture load statement. The vertex engine contains four texture sampler stages.
Vertices Gets the vertex stream collection.
Viewport Gets or sets a viewport identifying the portion of the render target to receive draw calls.
See Also
Reference
GraphicsDevice Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDevice.ClipPlanes Property
Retrieves the clipping planes of the current GraphicsDevice.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ClipPlaneCollection ClipPlanes { get; }
Property Value
The clipping planes.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.CreationParameters Property
Retrieves the creation parameters of the GraphicsDevice.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GraphicsDeviceCreationParameters CreationParameters { get; }
Property Value
The creation parameters.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.DepthStencilBuffer Property
Gets or sets the depth stencil surface of this GraphicsDevice.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public DepthStencilBuffer DepthStencilBuffer { get; set; }
Property Value
The depth stencil buffer. If no depth stencil buffer is associated with the GraphicsDevice, the return value is null.
Setting this value to null disables the depth stencil operation.
Exceptions
Exception type Condition
ObjectDisposedException DepthStencilBuffer was called after the GraphicsDevice was disposed.
Remarks
The following restrictions apply when using this property.
The multisample type must be the same for the render target and the depth stencil surface.
The formats for the render target and depth stencil surface must be compatible. For more information, see
CheckDepthStencilMatch.
The size of the depth stencil surface must be greater than or equal to the size of the render target.
These restrictions are validated only when using the debug runtime when any of the GraphicsDevice drawing methods are
called.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.DisplayMode Property
Retrieves the display mode's spatial resolution, color resolution, and refresh frequency.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public DisplayMode DisplayMode { get; }
Property Value
Data describing the display mode of the adapter (as opposed to the display mode of the GraphicsDevice, which might not be
active if the GraphicsDevice does not own full-screen mode).
RemarksFor a list of all supported display modes for an adapter, see the SupportedDisplayModes property.
Example
This simple example checks for a supported display mode and sets the back buffer dimensions to match the resolution of the
desired display mode.
C#
public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
graphics.PreparingDeviceSettings +=
new EventHandler<PreparingDeviceSettingsEventArgs>(
graphics_PreparingDeviceSettings);
}
/// <summary>
/// Modifies the display mode for the graphics device when it is reset or recreated.
/// </summary>
void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e
)
{
foreach (Microsoft.Xna.Framework.Graphics.DisplayMode displayMode in GraphicsAdapte
r.DefaultAdapter.SupportedDisplayModes)
{
// If 1080i (Widescreen) format is available, set it to use this format.
// 1080i is 1920�1080, so check to see if there is a DisplayMode available
// that matches.
if (displayMode.Width == 1920 && displayMode.Height == 1080)
{
e.GraphicsDeviceInformation.PresentationParameters.BackBufferFormat = displ
ayMode.Format;
e.GraphicsDeviceInformation.PresentationParameters.BackBufferHeight = displ
ayMode.Height;
e.GraphicsDeviceInformation.PresentationParameters.BackBufferWidth = displa
yMode.Width;
e.GraphicsDeviceInformation.PresentationParameters.FullScreenRefreshRateInH
z = displayMode.RefreshRate;
e.GraphicsDeviceInformation.PresentationParameters.IsFullScreen = true;
}
}
}
See Also
Concepts
Displays, Client Bounds, Viewports, and Back Buffers
Xbox 360 Programming Considerations
Reference
GraphicsAdapter.SupportedDisplayModes Property
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.DriverLevel Property
Returns the driver level.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int DriverLevel { get; }
Property Value
This method returns the driver version, which is one of the following:
700 - Direct3D 7 level driver
800 - Direct3D 8 level driver
900 - Direct3D 9 level driver
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GraphicsDeviceCapabilities Property
Gets the capabilities of the graphics device.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GraphicsDeviceCapabilities GraphicsDeviceCapabilities { get; }
Property Value
The capabilities.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.GraphicsDeviceStatus Property
Retrieves the status of the device
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GraphicsDeviceStatus GraphicsDeviceStatus { get; }
Property Value
The status of the device
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.Indices Property
Gets or sets index data.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public IndexBuffer Indices { get; set; }
Property Value
The index data.
Exceptions
Exception type Condition
ObjectDisposedException Indices was called after this GraphicsDevice was disposed.
Example
The vertex stream and index data of the graphics device must be set before any call to DrawIndexedPrimitives. The following
example sets the index data and associates a user-created vertex buffer of type VertexPositionNormalTexture with vertex
stream 0 (zero) of the graphics device.
C#
graphics.GraphicsDevice.Vertices[0].SetSource(
vertexBuffer, 0,
VertexPositionNormalTexture.SizeInBytes);
graphics.GraphicsDevice.Indices = lineListIndexBuffer;
See Also
Tasks
How To: Draw Points, Lines, and Other 3D Primitives
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.IsDisposed Property
Gets a value that indicates whether the object is disposed.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsDisposed { get; }
Property Value
true if the object is disposed; false otherwise.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.PixelShader Property
Gets or sets the current pixel shader.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public PixelShader PixelShader { get; set; }
Property Value
The current pixel shader or a pixel shader object to set.
Exceptions
Exception type Condition
ObjectDisposedException PixelShader was called after this GraphicsDevice was disposed.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.PresentationParameters Property
Gets the presentation parameters associated with this graphics device.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public PresentationParameters PresentationParameters { get; }
Property Value
The presentation parameters associated with this graphics device.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.RasterStatus Property
Retrieves information that describes the raster of the monitor on which the swap chain is presented.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public RasterStatus RasterStatus { get; }
Property Value
Information about the position or other status of the raster on the monitor driven by the current adapter.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.RenderState Property
Retrieves a render-state value for a GraphicsDevice.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public RenderState RenderState { get; }
Property Value
The render state.
Remarks This method returns the last render state that was set for the GraphicsDevice, or the default GraphicsDevice render
state, if not previously set.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.SamplerStates Property
Retrieves a collection of SamplerState objects for the current GraphicsDevice.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public SamplerStateCollection SamplerStates { get; }
Property Value
The sample states of this GraphicsDevice.
Remarks
This method returns the last sampler state that was set for the GraphicsDevice, or the default GraphicsDevice sampler state, if
not previously set. Programmable shaders reference textures using the sampler number, which is set as the index of a
GraphicsDevice.Textures.
See Also
Reference
GraphicsDevice.Textures Property
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.ScissorRectangle Property
Gets or sets the rectangle used for scissor testing.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Rectangle ScissorRectangle { get; set; }
Property Value
Defines the rendering area within the render target, if scissor testing is enabled.
RemarksThe scissor rectangle is used as a rectangular clipping region. Use ScissorTestEnable to enable scissor testing.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.SoftwareVertexProcessing Property
Gets or sets the vertex processing mode.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SoftwareVertexProcessing { get; set; }
Property Value
true for software vertex processing; false for hardware vertex processing.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.Textures Property
Returns the collection of textures that have been assigned to the texture stages of the device.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureCollection Textures { get; }
Property Value
The texture collection.
RemarksThe collection of texture stage on the device contains one or more textures (all of the same type and dimensions) that
can be accessed by shaders.
Note
At draw time, a texture cannot be simultaneously set as a render target and a texture at a stage.
Example
This C# code demonstrates the setting two elements of the Textures collection to two user-created Texture2D objects named
firstTexture and secondTexture.
C#
graphics.GraphicsDevice.Textures[0] = firstTexture;
graphics.GraphicsDevice.Textures[1] = secondTexture;
In the effect file, these textures can be accessed by declaring two sampler variables and setting them to the sampler register
numbers that correspond to the index in the texture collection.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.VertexDeclaration Property
Gets or sets a vertex shader declaration.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public VertexDeclaration VertexDeclaration { get; set; }
Property Value
The vertex shader declaration.
Exceptions
Exception type Condition
ObjectDisposedException VertexDeclaration was called after this GraphicsDevice was disposed.
RemarksA vertex shader declaration is made up of an array of vertex elements.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.VertexSamplerStates Property
Gets the collection of vertex sampler states.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public SamplerStateCollection VertexSamplerStates { get; }
Property Value
The collection of vertex sampler states.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.VertexShader Property
Gets or sets the current vertex shader.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public VertexShader VertexShader { get; set; }
Property Value
The GraphicsDevice's current vertex shader or a vertex shader object to set.
Exceptions
Exception type Condition
ObjectDisposedException VertexShader was called after this GraphicsDevice was disposed.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.VertexTextures Property
Gets the collection of vertex textures that support texture lookup in the vertex shader using the texldl - vs texture load
statement. The vertex engine contains four texture sampler stages.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureCollection VertexTextures { get; }
Property Value
The collection of vertex textures.
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.Vertices Property
Gets the vertex stream collection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public VertexStreamCollection Vertices { get; }
Property Value
The vertex stream collection.
Example
The vertex stream of the graphics device must be set before any call to DrawPrimitives. The following example associates a
user created vertex buffer of type VertexPositionNormalTexture with vertex stream 0 (zero) of the graphics device.
C#
graphics.GraphicsDevice.Vertices[0].SetSource(
vertexBuffer, 0,
VertexPositionNormalTexture.SizeInBytes);
See Also
Tasks
How To: Draw Points, Lines, and Other 3D Primitives
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.Viewport Property
Gets or sets a viewport identifying the portion of the render target to receive draw calls.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Viewport Viewport { get; set; }
Property Value
The viewport to set or get.
Remarks
Viewport can be used to draw on part of the screen. It should be set before any geometry is drawn so the viewport
parameters will take effect.
To draw multiple views within a scene, repeat setting Viewport and draw a geometry sequence for each view.
Example
This code sample, from How To: Use Viewports for Split Screen Gaming, demonstrates how to use the Viewport property to
display different scenes to different parts of the screen.
C#
Viewport defaultViewport;
Viewport leftViewport;
Viewport rightViewport;
Matrix projectionMatrix;
Matrix halfprojectionMatrix;
protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
defaultViewport = GraphicsDevice.Viewport;
leftViewport = defaultViewport;
rightViewport = defaultViewport;
leftViewport.Width = leftViewport.Width / 2;
rightViewport.Width = rightViewport.Width / 2;
rightViewport.X = leftViewport.Width + 1;
Ring = Content.Load<Model>("redtorus");
See Also
Tasks
How To: Use Viewports for Split Screen Gaming
Concepts
Displays, Client Bounds, Viewports, and Back Buffers
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice Events
Public Events
Name Description
DeviceLost Occurs when a GraphicsDevice is about to be lost (for example, immediately before a reset).
DeviceReset Occurs after a GraphicsDevice is reset, allowing an application to recreate all resources.
DeviceResetting Occurs when a GraphicsDevice is resetting, allowing the application to cancel the default handling of th
e reset.
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of t
he Microsoft .NET common language runtime.
ResourceCreated Occurs when a resource is created.
ResourceDestroyed Occurs when a resource is destroyed.
See Also
Reference
GraphicsDevice Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDevice.DeviceLost Event
Occurs when a GraphicsDevice is about to be lost (for example, immediately before a reset).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public event EventHandler DeviceLost
Example
To add an event handler that listens for DeviceLost, use the following C# code.
[C#]
GraphicsDevice.DeviceLost += new System.EventHandler( this.GraphicsDeviceLostEven
tHandler );
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.DeviceReset Event
Occurs after a GraphicsDevice is reset, allowing an application to recreate all resources.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public event EventHandler DeviceReset
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.DeviceResetting Event
Occurs when a GraphicsDevice is resetting, allowing the application to cancel the default handling of the reset.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public event EventHandler DeviceResetting
Example
To add an event handler that listens for DeviceResetting, use the following C# code.
[C#]
GraphicsDevice.DeviceResetting += new System.CancelEventHandler( this.GraphicsDev
iceResettingEventHandler );
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.Disposing Event
Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET
common language runtime.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public event EventHandler Disposing
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.ResourceCreated Event
Occurs when a resource is created.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public event EventHandler<ResourceCreatedEventArgs> ResourceCreated
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDevice.ResourceDestroyed Event
Occurs when a resource is destroyed.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public event EventHandler<ResourceDestroyedEventArgs> ResourceDestroyed
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities Class
Represents the capabilities of the hardware.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public sealed class GraphicsDeviceCapabilities : IDisposable
See Also
Tasks
How To: Check for Shader Model 2.0 Support
Reference
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities Members
The following tables list the members exposed by the GraphicsDeviceCapabilities type.
Public Properties
Name Description
AdapterOrdinalInGroup Gets the number indicating the order in which heads are referenced by the API.
AlphaCompareCapabilities Gets the alpha-test comparison capabilities.
CubeTextureFilterCapabilities Gets texture-filtering capabilities for a cube texture.
CursorCapabilities Gets hardware cursor capabilties.
DeclarationTypeCapabilities Gets vertex data type capabilities.
DepthBufferCompareCapabilities Gets depth buffer comparision capabilities.
DestinationBlendCapabilities Gets destination-blending capabilities.
DeviceCapabilities Gets graphics device capabilities.
DeviceType Returns the type of the current GraphicsDevice.
DriverCapabilities Gets device driver capabilities.
ExtentsAdjust Gets the number of pixels to adjust the extents rectangle outward to accommodate anti
aliasing kernels.
GuardBandBottom Gets the bottom screen-space coordinate of the guard-band clipping region.
GuardBandLeft Gets the left screen-space coordinate of the guard-band clipping region.
GuardBandRight Gets the right coordinate of the guard-band clipping region.
GuardBandTop Gets the top screen-space coordinate of the guard-band clipping region.
LineCapabilities Gets line-drawing primitives capabilities.
MasterAdapterOrdinal Gets the master device for this subordinate.
MaxAnisotropy Gets the maximum valid value for the MaxAnisotropy texture-stage state.
MaxPixelShader30InstructionSlots Gets the maximum number of pixel shader instruction slots supported.
MaxPixelShaderProfile Returns the maximum pixel shader profile for this GraphicsDevice.
MaxPointSize Gets the maximum size of a point primitive.
MaxPrimitiveCount Gets the maximum number of primitives for each DrawPrimitives call.
MaxSimultaneousRenderTargets Gets the maximum number of simultaneous render targets.
MaxSimultaneousTextures Gets the maximum number of textures that can be simultaneously bound to the fixed-f
unction pipeline sampler stages.
MaxStreams Gets the maximum number of concurrent data streams.
MaxStreamStride Gets the maximum stride.
MaxTextureAspectRatio Gets the maximum texture aspect ratio supported by the hardware.
MaxTextureHeight Gets the maximum texture height for this device.
MaxTextureRepeat Gets the maximum range of the integer bits of the post-normalized texture coordinates
.
MaxTextureWidth Gets the maximum texture width for this device.
MaxUserClipPlanes Gets the maximum number of user-defined clipping planes supported.
MaxVertexIndex Gets the maximum size of indices supported for hardware vertex processing.
MaxVertexShader30InstructionSlots Gets the maximum number of vertex shader instruction slots supported.
MaxVertexShaderConstants Gets the number of vertex shader registers that are reserved for constants.
MaxVertexShaderProfile Returns the maximum vertex shader profile for this GraphicsDevice.
MaxVertexW Gets the maximum W-based depth value that the device supports.
MaxVolumeExtent Gets the maximum value for any of the three dimensions (width, height, and depth) of
a volume texture.
NumberOfAdaptersInGroup Gets the number of adapters in this adapter group (only if master).
PixelShader1xMaxValue Gets the maximum value of pixel shader arithmetic component.
PixelShaderCapabilities Gets the pixel shader 2.0 capabilities.
PixelShaderVersion Gets the pixel shader main and sub versions.
PresentInterval Gets the rate at which the swap chain's back buffers are presented to the front buffer.
PrimitiveCapabilities Gets driver primitive capabilities.
RasterCapabilities Gets information on raster-drawing capabilities.
ShadingCapabilities Gets shading operations capabilities.
SourceBlendCapabilities Gets source-blending capabilities.
StencilCapabilities Gets the supported stencil-buffer operations.
TextureAddressCapabilities Gets texture-addressing capabilities for texture objects.
TextureCapabilities Gets miscellaneous texture-mapping capabilities.
TextureFilterCapabilities Gets texture-filtering capabilities for a texture.
VertexFormatCapabilities Gets flexible vertex format capabilities.
VertexProcessingCapabilities Gets vertex processing capabilities.
VertexShaderCapabilities Gets vertex shader version 2.0 extended capabilities.
VertexShaderVersion Gets the vertex shader main and sub versions.
VertexTextureFilterCapabilities Gets vertex shader texture filter capabilities.
VolumeTextureAddressCapabilities Gets texture-addressing capabilities for a volume texture
VolumeTextureFilterCapabilities Gets texture-filtering capabilities for a volume texture.
Public Methods
Name Description
Dispose Overloaded. Releases all resources used by the GraphicsDeviceCapabilities class.
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Compares two objects to determine whether they are the same.
op_Inequality Compares two objects to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities Methods
Public Methods
Name Description
Dispose Overloaded. Releases all resources used by the GraphicsDeviceCapabilities class.
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Compares two objects to determine whether they are the same.
op_Inequality Compares two objects to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.Dispose Method
Releases all resources used by the GraphicsDeviceCapabilities class.
Overload List
Name Description
GraphicsDeviceCapabilities.Dispose () Releases all resources used by the GraphicsDeviceCapabilities class.
GraphicsDeviceCapabilities.Dispose (Boolean) Releases the unmanaged resources used by the GraphicsDeviceCapabilities obje
ct and optionally releases the managed resources.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.Dispose Method ()
Releases all resources used by the GraphicsDeviceCapabilities class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
Remarks
Call Dispose when you are finished using the GraphicsDeviceCapabilities. The Dispose method leaves the
GraphicsDeviceCapabilities in an unusable state. After calling Dispose, you must release all references to the
GraphicsDeviceCapabilities so the garbage collector can reclaim the memory that the GraphicsDeviceCapabilities was
occupying.
Note
Always call Dispose before you release your last reference to the GraphicsDeviceCapabilities. Otherwise, the resources it is us
ing will not be freed until the garbage collector calls the GraphicsDeviceCapabilities object's Finalize method.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
GraphicsDeviceCapabilities.Equals (Object) Returns a value that indicates whether the current instance is equal to a spe
cified object.
GraphicsDeviceCapabilities.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
obj
The Object to compare with the current GraphicsDeviceCapabilities.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.GetHashCode Method
Gets the hash code for this instance.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for this object.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.op_Equality Method
Compares two objects to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
GraphicsDeviceCapabilities left,
GraphicsDeviceCapabilities right
)
Parameters
left
Object to the left of the equality operator.
right
Object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.op_Inequality Method
Compares two objects to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
GraphicsDeviceCapabilities left,
GraphicsDeviceCapabilities right
)
Parameters
left
Object to the left of the inequality operator.
right
Object to the right of the inequality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities Properties
Public Properties
Name Description
AdapterOrdinalInGroup Gets the number indicating the order in which heads are referenced by the API.
AlphaCompareCapabilities Gets the alpha-test comparison capabilities.
CubeTextureFilterCapabilities Gets texture-filtering capabilities for a cube texture.
CursorCapabilities Gets hardware cursor capabilties.
DeclarationTypeCapabilities Gets vertex data type capabilities.
DepthBufferCompareCapabilities Gets depth buffer comparision capabilities.
DestinationBlendCapabilities Gets destination-blending capabilities.
DeviceCapabilities Gets graphics device capabilities.
DeviceType Returns the type of the current GraphicsDevice.
DriverCapabilities Gets device driver capabilities.
ExtentsAdjust Gets the number of pixels to adjust the extents rectangle outward to accommodate anti
aliasing kernels.
GuardBandBottom Gets the bottom screen-space coordinate of the guard-band clipping region.
GuardBandLeft Gets the left screen-space coordinate of the guard-band clipping region.
GuardBandRight Gets the right coordinate of the guard-band clipping region.
GuardBandTop Gets the top screen-space coordinate of the guard-band clipping region.
LineCapabilities Gets line-drawing primitives capabilities.
MasterAdapterOrdinal Gets the master device for this subordinate.
MaxAnisotropy Gets the maximum valid value for the MaxAnisotropy texture-stage state.
MaxPixelShader30InstructionSlots Gets the maximum number of pixel shader instruction slots supported.
MaxPixelShaderProfile Returns the maximum pixel shader profile for this GraphicsDevice.
MaxPointSize Gets the maximum size of a point primitive.
MaxPrimitiveCount Gets the maximum number of primitives for each DrawPrimitives call.
MaxSimultaneousRenderTargets Gets the maximum number of simultaneous render targets.
MaxSimultaneousTextures Gets the maximum number of textures that can be simultaneously bound to the fixed-f
unction pipeline sampler stages.
MaxStreams Gets the maximum number of concurrent data streams.
MaxStreamStride Gets the maximum stride.
MaxTextureAspectRatio Gets the maximum texture aspect ratio supported by the hardware.
MaxTextureHeight Gets the maximum texture height for this device.
MaxTextureRepeat Gets the maximum range of the integer bits of the post-normalized texture coordinates
.
MaxTextureWidth Gets the maximum texture width for this device.
MaxUserClipPlanes Gets the maximum number of user-defined clipping planes supported.
MaxVertexIndex Gets the maximum size of indices supported for hardware vertex processing.
MaxVertexShader30InstructionSlots Gets the maximum number of vertex shader instruction slots supported.
MaxVertexShaderConstants Gets the number of vertex shader registers that are reserved for constants.
MaxVertexShaderProfile Returns the maximum vertex shader profile for this GraphicsDevice.
MaxVertexW Gets the maximum W-based depth value that the device supports.
MaxVolumeExtent Gets the maximum value for any of the three dimensions (width, height, and depth) of
a volume texture.
NumberOfAdaptersInGroup Gets the number of adapters in this adapter group (only if master).
PixelShader1xMaxValue Gets the maximum value of pixel shader arithmetic component.
PixelShaderCapabilities Gets the pixel shader 2.0 capabilities.
PixelShaderVersion Gets the pixel shader main and sub versions.
PresentInterval Gets the rate at which the swap chain's back buffers are presented to the front buffer.
PrimitiveCapabilities Gets driver primitive capabilities.
RasterCapabilities Gets information on raster-drawing capabilities.
ShadingCapabilities Gets shading operations capabilities.
SourceBlendCapabilities Gets source-blending capabilities.
StencilCapabilities Gets the supported stencil-buffer operations.
TextureAddressCapabilities Gets texture-addressing capabilities for texture objects.
TextureCapabilities Gets miscellaneous texture-mapping capabilities.
TextureFilterCapabilities Gets texture-filtering capabilities for a texture.
VertexFormatCapabilities Gets flexible vertex format capabilities.
VertexProcessingCapabilities Gets vertex processing capabilities.
VertexShaderCapabilities Gets vertex shader version 2.0 extended capabilities.
VertexShaderVersion Gets the vertex shader main and sub versions.
VertexTextureFilterCapabilities Gets vertex shader texture filter capabilities.
VolumeTextureAddressCapabilities Gets texture-addressing capabilities for a volume texture
VolumeTextureFilterCapabilities Gets texture-filtering capabilities for a volume texture.
See Also
Reference
GraphicsDeviceCapabilities Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.AdapterOrdinalInGroup Property
Gets the number indicating the order in which heads are referenced by the API.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int AdapterOrdinalInGroup { get; }
Property Value
The number indicating the order in which heads are referenced by the API.
Remarks
The value for the master adapter is always 0. These values do not correspond to the adapter ordinals. They apply only to heads
within a group.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.AlphaCompareCapabilities Property
Gets the alpha-test comparison capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public CompareCaps AlphaCompareCapabilities { get; }
Property Value
A GraphicsDeviceCapabilities.CompareCaps representing the alpha-test comparison capabilities of a device.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CubeTextureFilterCapabilities
Property
Gets texture-filtering capabilities for a cube texture.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public FilterCaps CubeTextureFilterCapabilities { get; }
Property Value
A GraphicsDeviceCapabilities.FilterCaps representing the texture-filtering capabilities for a cube texture of a device.
Remarks
Per-stage filtering capabilities reflect which filtering modes are supported for texture stages when performing multiple-texture
blending. This member can be any combination of the per-stage texture-filtering flags defined in
GraphicsDeviceCapabilities.FilterCaps.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CursorCapabilities Property
Gets hardware cursor capabilties.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public CursorCaps CursorCapabilities { get; }
Property Value
A GraphicsDeviceCapabilities.CursorCaps representing the hardware cursor capabilities of a device.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeclarationTypeCapabilities
Property
Gets vertex data type capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public DeclarationTypeCaps DeclarationTypeCapabilities { get; }
Property Value
A GraphicsDeviceCapabilities.DeclarationTypeCaps representing the vertex data type capabilities of a device.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DepthBufferCompareCapabilities
Property
Gets depth buffer comparision capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public CompareCaps DepthBufferCompareCapabilities { get; }
Property Value
A GraphicsDeviceCapabilities.CompareCaps representing the z-buffer comparison capabilities of a device.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DestinationBlendCapabilities
Property
Gets destination-blending capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public BlendCaps DestinationBlendCapabilities { get; }
Property Value
A GraphicsDeviceCapabilities.BlendCaps representing the destination-blending capabilities of a device.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceCapabilities Property
Gets graphics device capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public DeviceCaps DeviceCapabilities { get; }
Property Value
A GraphicsDeviceCapabilities.DeviceCaps representing the graphics capabilities of a device.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceType Property
Returns the type of the current GraphicsDevice.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public DeviceType DeviceType { get; }
Property Value
The type of the current GraphicsDevice.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DriverCapabilities Property
Gets device driver capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public DriverCaps DriverCapabilities { get; }
Property Value
A GraphicsDeviceCapabilities.DriverCaps representing the driver capabilities of a device.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.ExtentsAdjust Property
Gets the number of pixels to adjust the extents rectangle outward to accommodate antialiasing kernels.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float ExtentsAdjust { get; }
Property Value
Size of adjustment, in pixels.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.GuardBandBottom Property
Gets the bottom screen-space coordinate of the guard-band clipping region.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float GuardBandBottom { get; }
Property Value
The bottom coordinate of the guard-band clipping region.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.GuardBandLeft Property
Gets the left screen-space coordinate of the guard-band clipping region.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float GuardBandLeft { get; }
Property Value
The left coordinate of the guard-band clipping region.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.GuardBandRight Property
Gets the right coordinate of the guard-band clipping region.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float GuardBandRight { get; }
Property Value
The right coordinate of the guard-band clipping region.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.GuardBandTop Property
Gets the top screen-space coordinate of the guard-band clipping region.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float GuardBandTop { get; }
Property Value
The top coordinate of the guard-band clipping region.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.LineCapabilities Property
Gets line-drawing primitives capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public LineCaps LineCapabilities { get; }
Property Value
A GraphicsDeviceCapabilities.LineCaps representing the line-drawing primitives capabilities of a device.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.MasterAdapterOrdinal Property
Gets the master device for this subordinate.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int MasterAdapterOrdinal { get; }
Property Value
Number indicating the master device. This number is taken from the same space as the adapter values.
Remarks
For multi-head support, one head will be denoted the master head, and all other heads on the same card will be denoted
subordinate heads. If more than one multi-head adapter is present in a system, the master and its subordinates from one
multi-head adapter are called a group.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.MaxAnisotropy Property
Gets the maximum valid value for the MaxAnisotropy texture-stage state.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int MaxAnisotropy { get; }
Property Value
The maximum valid value for MaxAnisotropy.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.MaxPixelShader30InstructionSlots
Property
Gets the maximum number of pixel shader instruction slots supported.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int MaxPixelShader30InstructionSlots { get; }
Property Value
The maximum number of pixel shader instruction slots supported.
Remarks
The maximum value that can be set on this capability is 32,768. Devices that support ps_3_0 are required to support at least
512 instruction slots.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.MaxPixelShaderProfile Property
Returns the maximum pixel shader profile for this GraphicsDevice.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ShaderProfile MaxPixelShaderProfile { get; }
Property Value
The maximum pixel shader profile for this GraphicsDevice.
See Also
Tasks
How To: Check for Shader Model 2.0 Support
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.MaxPointSize Property
Gets the maximum size of a point primitive.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float MaxPointSize { get; }
Property Value
The maximum size of a point primitive. The range is greater than or equal to 1.0f.
Remarks
If the size is set to 1.0f, the device does not support point size control.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.MaxPrimitiveCount Property
Gets the maximum number of primitives for each DrawPrimitives call.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int MaxPrimitiveCount { get; }
Property Value
The maximum number of primitives.
See Also
Reference
DrawPrimitives
DrawIndexedPrimitives
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.MaxSimultaneousRenderTargets
Property
Gets the maximum number of simultaneous render targets.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int MaxSimultaneousRenderTargets { get; }
Property Value
The maximum number of simultaneous render targets supported by the device.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.MaxSimultaneousTextures Property
Gets the maximum number of textures that can be simultaneously bound to the fixed-function pipeline sampler stages.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int MaxSimultaneousTextures { get; }
Property Value
The maximum number of textures that can be simultaneously bound to the fixed-function pipeline sampler stages.
Remarks
If the same texture is bound to two sampler stages, it counts as two textures.
This value has no meaning in the programmable pipeline where the number of sampler stages is determined by each pixel
shader version. Each pixel shader version also determines the number of texture declaration instructions.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.MaxStreams Property
Gets the maximum number of concurrent data streams.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int MaxStreams { get; }
Property Value
The maximum number of concurrent data streams. The valid range is 1 to 16.
Remarks
If this value is 0, then the driver is not a Direct3D 9 driver.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.MaxStreamStride Property
Gets the maximum stride.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int MaxStreamStride { get; }
Property Value
The maximum stride.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.MaxTextureAspectRatio Property
Gets the maximum texture aspect ratio supported by the hardware.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int MaxTextureAspectRatio { get; }
Property Value
The maximum texture aspect ratio supported by the hardware, typically a power of 2.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.MaxTextureHeight Property
Gets the maximum texture height for this device.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int MaxTextureHeight { get; }
Property Value
The maximum texture height for this device.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.MaxTextureRepeat Property
Gets the maximum range of the integer bits of the post-normalized texture coordinates.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int MaxTextureRepeat { get; }
Property Value
The maximum range of the integer bits of the post-normalized texture coordinates.
Remarks
A texture coordinate is stored as a 32-bit signed integer using 27 bits to store the integer part and 5 bits for the floating-point
fraction. The maximum integer index, 227, is used to determine the maximum texture coordinate, depending on how the
hardware does texture-coordinate scaling.
Some hardware reports the cap TextureCaps.SupportsTextureRepeatNotScaledBySize. For this case, the device defers scaling
texture coordinates by the texture size until after interpolation and application of the texture address mode, so the number of
times a texture can be wrapped is given by the integer value in MaxTextureRepeat.
Less desirably, on some hardware TextureCaps.SupportsTextureRepeatNotScaledBySize is not set and the device scales the
texture coordinates by the texture size (using the highest level of detail) prior to interpolation. This limits the number of times a
texture can be wrapped to MaxTextureRepeat / texture size.
For example, assume that MaxTextureRepeat is equal to 32K and the size of the texture is 4K. If the hardware sets
TextureCaps.SupportsTextureRepeatNotScaledBySize, then the number of times a texture can be wrapped is equal to
MaxTextureRepeat (32K, in this example). Otherwise, the number of times a texture can be wrapped is equal to
MaxTextureRepeat divided by texture size, which, in this example, is 32K/4K, or 8.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.MaxTextureWidth Property
Gets the maximum texture width for this device.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int MaxTextureWidth { get; }
Property Value
The maximum texture width for this device.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.MaxUserClipPlanes Property
Gets the maximum number of user-defined clipping planes supported.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int MaxUserClipPlanes { get; }
Property Value
The maximum number of user-defined clipping planes supported. This number can be 0.
Remarks
For a given physical device, this capability might vary across Direct3D devices, depending on the parameters supplied to the
Device constructor.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.MaxVertexIndex Property
Gets the maximum size of indices supported for hardware vertex processing.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int MaxVertexIndex { get; }
Property Value
The maximum size of indices supported for hardware vertex processing.
Remarks
It is possible to create 32-bit index buffers; however, you will not be able to render with the index buffer unless this value is
greater than 0x0000FFFF.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.MaxVertexShader30InstructionSlots
Property
Gets the maximum number of vertex shader instruction slots supported.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int MaxVertexShader30InstructionSlots { get; }
Property Value
The maximum number of vertex shader instruction slots supported.
Remarks
The maximum value that can be set on this cap is 32,768. Devices that support vs_3_0 are required to support at least 512
instruction slots.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.MaxVertexShaderConstants
Property
Gets the number of vertex shader registers that are reserved for constants.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int MaxVertexShaderConstants { get; }
Property Value
The number of vertex shader registers that are reserved for constants.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.MaxVertexShaderProfile Property
Returns the maximum vertex shader profile for this GraphicsDevice.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ShaderProfile MaxVertexShaderProfile { get; }
Property Value
The maximum vertex shader profile for this GraphicsDevice.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.MaxVertexW Property
Gets the maximum W-based depth value that the device supports.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float MaxVertexW { get; }
Property Value
The maximum W-based depth value that the device supports.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.MaxVolumeExtent Property
Gets the maximum value for any of the three dimensions (width, height, and depth) of a volume texture.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int MaxVolumeExtent { get; }
Property Value
The maximum value for any of the three dimensions (width, height, and depth) of a volume texture.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.NumberOfAdaptersInGroup
Property
Gets the number of adapters in this adapter group (only if master).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int NumberOfAdaptersInGroup { get; }
Property Value
The number of adapters in this adapter group (only if master).
Remarks
NumberOfAdaptersInGroup will be 1 for conventional adapters, greater than 1 for the master adapter of a multi-head card,
or 0 for a subordinate adapter of a multihead card. Each card can have at most one master, but may have many subordinates.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShader1xMaxValue Property
Gets the maximum value of pixel shader arithmetic component.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float PixelShader1xMaxValue { get; }
Property Value
The maximum value of pixel shader arithmetic component.
Remarks
PixelShader1xMaxValue indicates the internal range of values supported for pixel color blending operations. Within the
range that they report to, implementations must allow data to pass through pixel processing unmodified (unclamped).
Normally, the value of this member is an absolute value. For example, a 1.0 indicates that the range is −1.0 to 1, and an 8.0
indicates that the range is −8.0 to 8.0. The value must be greater than or equal to 1.0 for any hardware that supports pixel
shaders.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCapabilities Property
Gets the pixel shader 2.0 capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public PixelShaderCaps PixelShaderCapabilities { get; }
Property Value
A GraphicsDeviceCapabilities.PixelShaderCaps representing the pixel shader 2.0 capabilities of a device.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderVersion Property
Gets the pixel shader main and sub versions.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Version PixelShaderVersion { get; }
Property Value
The pixel shader main and sub versions.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PresentInterval Property
Gets the rate at which the swap chain's back buffers are presented to the front buffer.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public PresentInterval PresentInterval { get; }
Property Value
The rate at which the swap chain's back buffers are presented to the front buffer.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PrimitiveCapabilities Property
Gets driver primitive capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public PrimitiveCaps PrimitiveCapabilities { get; }
Property Value
A GraphicsDeviceCapabilities.PrimitiveCaps representing the primitive capabilities of a device.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.RasterCapabilities Property
Gets information on raster-drawing capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public RasterCaps RasterCapabilities { get; }
Property Value
A GraphicsDeviceCapabilities.RasterCaps representing the raster capabilities of a device.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.ShadingCapabilities Property
Gets shading operations capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ShadingCaps ShadingCapabilities { get; }
Property Value
A GraphicsDeviceCapabilities.ShadingCaps representing the shading capabilities of a device.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.SourceBlendCapabilities Property
Gets source-blending capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public BlendCaps SourceBlendCapabilities { get; }
Property Value
A GraphicsDeviceCapabilities.BlendCaps representing the source-blending capabilities of a device.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.StencilCapabilities Property
Gets the supported stencil-buffer operations.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public StencilCaps StencilCapabilities { get; }
Property Value
A GraphicsDeviceCapabilities.StencilCaps representing the stencil-buffer capabilities of a device.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureAddressCapabilities
Property
Gets texture-addressing capabilities for texture objects.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public AddressCaps TextureAddressCapabilities { get; }
Property Value
A GraphicsDeviceCapabilities.AddressCaps representing the texture-addressing capabilities of a device.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureCapabilities Property
Gets miscellaneous texture-mapping capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureCaps TextureCapabilities { get; }
Property Value
A GraphicsDeviceCapabilities.TextureCaps representing the texture-mapping capabilities of a device.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureFilterCapabilities Property
Gets texture-filtering capabilities for a texture.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public FilterCaps TextureFilterCapabilities { get; }
Property Value
A GraphicsDeviceCapabilities.FilterCaps representing the texture-filtering capabilities of a device.
Remarks
Per-stage filtering capabilities reflect which filtering modes are supported for texture stages when performing multiple-texture
blending. This member can be any combination of the per-stage texture-filtering flags defined in
GraphicsDeviceCapabilities.FilterCaps.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexFormatCapabilities Property
Gets flexible vertex format capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public VertexFormatCaps VertexFormatCapabilities { get; }
Property Value
A GraphicsDeviceCapabilities.VertexFormatCaps representing the flexible vertex format capabilities of a device.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexProcessingCapabilities
Property
Gets vertex processing capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public VertexProcessingCaps VertexProcessingCapabilities { get; }
Property Value
A GraphicsDeviceCapabilities.VertexProcessingCaps representing the vertex processing capabilities of a device.
Remarks
For a given physical device, this capability might vary across Direct3D devices, depending on the parameters supplied to the
Device constructor.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexShaderCapabilities Property
Gets vertex shader version 2.0 extended capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public VertexShaderCaps VertexShaderCapabilities { get; }
Property Value
A GraphicsDeviceCapabilities.VertexShaderCaps representing the vertex shader 2.0 capabilities of a device.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexShaderVersion Property
Gets the vertex shader main and sub versions.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Version VertexShaderVersion { get; }
Property Value
The vertex shader main and sub versions.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexTextureFilterCapabilities
Property
Gets vertex shader texture filter capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public FilterCaps VertexTextureFilterCapabilities { get; }
Property Value
A GraphicsDeviceCapabilities.FilterCaps representing the vertex shader filter capabilities of a device.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VolumeTextureAddressCapabilities
Property
Gets texture-addressing capabilities for a volume texture
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public AddressCaps VolumeTextureAddressCapabilities { get; }
Property Value
A GraphicsDeviceCapabilities.AddressCaps representing the texture-addressing capabilities of a device.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VolumeTextureFilterCapabilities
Property
Gets texture-filtering capabilities for a volume texture.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public FilterCaps VolumeTextureFilterCapabilities { get; }
Property Value
A GraphicsDeviceCapabilities.FilterCaps representing the texture-filtering capabilities of a device.
See Also
Reference
GraphicsDeviceCapabilities Class
GraphicsDeviceCapabilities Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.AddressCaps Structure
Represents the texture addressing capabilities for Texture structures.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct GraphicsDeviceCapabilities.AddressCaps
See Also
Reference
GraphicsDeviceCapabilities.AddressCaps Members
TextureAddressCapabilities
VolumeTextureAddressCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.AddressCaps Members
The following tables list the members exposed by the GraphicsDeviceCapabilities.AddressCaps type.
Public Properties
Name Description
SupportsBorder Gets a value indicating whether the device supports the setting of coordinates outside the range [0
.0, 1.0] to the border color.
SupportsClamp Gets a value indicating whether the device supports the clamping of textures to addresses.
SupportsIndependentUV Gets a value indicating whether the device can separate the texture-addressing modes of the textu
re's u and v coordinates.
SupportsMirror Gets a value indicating whether a device can mirror textures to addresses.
SupportsMirrorOnce Gets a value indicating whether a device can take the absolute value of the texture coordinate (thu
s, mirroring around 0) and then clamp to the maximum value.
SupportsWrap Gets a value indicating whether a device can wrap textures to addresses.
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.AddressCaps instances are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.AddressCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.AddressCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.AddressCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.AddressCaps Methods
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.AddressCaps instances are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.AddressCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.AddressCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.AddressCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.AddressCaps.Equals Method
Determines whether two GraphicsDeviceCapabilities.AddressCaps instances are equal.
Overload List
Name Description
GraphicsDeviceCapabilities.AddressCaps.Equals (Object) Determines whether two
GraphicsDeviceCapabilities.AddressCaps instances are equal.
GraphicsDeviceCapabilities.AddressCaps.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.AddressCaps Structure
GraphicsDeviceCapabilities.AddressCaps Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.AddressCaps.Equals Method
(Object)
Determines whether two GraphicsDeviceCapabilities.AddressCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override bool Equals (
Object obj
)
Parameters
obj
The GraphicsDeviceCapabilities.AddressCaps object this instance is being compared to .
Return Value
true if the instances are equal; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.AddressCaps Structure
GraphicsDeviceCapabilities.AddressCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.AddressCaps.GetHashCode Method
Gets the hash code for this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
The hash code for this object.
See Also
Reference
GraphicsDeviceCapabilities.AddressCaps Structure
GraphicsDeviceCapabilities.AddressCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.AddressCaps.op_Equality Method
Determines whether two GraphicsDeviceCapabilities.AddressCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
AddressCaps left,
AddressCaps right
)
Parameters
left
GraphicsDeviceCapabilities.AddressCaps on the left side of the equal sign.
right
GraphicsDeviceCapabilities.AddressCaps on the right side of the equal sign.
Return Value
true if left is equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.AddressCaps Structure
GraphicsDeviceCapabilities.AddressCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.AddressCaps.op_Inequality Method
Determines whether two GraphicsDeviceCapabilities.AddressCaps instances are unequal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
AddressCaps left,
AddressCaps right
)
Parameters
left
GraphicsDeviceCapabilities.AddressCaps on the left side of the inequality operator.
right
GraphicsDeviceCapabilities.AddressCaps on the right side of the inequality operator.
Return Value
true if left is not equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.AddressCaps Structure
GraphicsDeviceCapabilities.AddressCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.AddressCaps.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
GraphicsDeviceCapabilities.AddressCaps Structure
GraphicsDeviceCapabilities.AddressCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.AddressCaps Properties
Public Properties
Name Description
SupportsBorder Gets a value indicating whether the device supports the setting of coordinates outside the range [0
.0, 1.0] to the border color.
SupportsClamp Gets a value indicating whether the device supports the clamping of textures to addresses.
SupportsIndependentUV Gets a value indicating whether the device can separate the texture-addressing modes of the textu
re's u and v coordinates.
SupportsMirror Gets a value indicating whether a device can mirror textures to addresses.
SupportsMirrorOnce Gets a value indicating whether a device can take the absolute value of the texture coordinate (thu
s, mirroring around 0) and then clamp to the maximum value.
SupportsWrap Gets a value indicating whether a device can wrap textures to addresses.
See Also
Reference
GraphicsDeviceCapabilities.AddressCaps Structure
TextureAddressCapabilities
VolumeTextureAddressCapabilities
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.AddressCaps.SupportsBorder
Property
Gets a value indicating whether the device supports the setting of coordinates outside the range [0.0, 1.0] to the border color.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsBorder { get; }
Property Value
true if the device supports the setting of coordinates outside the range to the border color; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.AddressCaps Structure
GraphicsDeviceCapabilities.AddressCaps Members
TextureAddressCapabilities
VolumeTextureAddressCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.AddressCaps.SupportsClamp
Property
Gets a value indicating whether the device supports the clamping of textures to addresses.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsClamp { get; }
Property Value
true if the device supports clamping textures to addresses; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.AddressCaps Structure
GraphicsDeviceCapabilities.AddressCaps Members
TextureAddressCapabilities
VolumeTextureAddressCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.AddressCaps.SupportsIndependentUV
Property
Gets a value indicating whether the device can separate the texture-addressing modes of the texture's u and v coordinates.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsIndependentUV { get; }
Property Value
true if the device supports separating the texture-addressing modes of the u and v coordinates; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.AddressCaps Structure
GraphicsDeviceCapabilities.AddressCaps Members
TextureAddressCapabilities
VolumeTextureAddressCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.AddressCaps.SupportsMirror
Property
Gets a value indicating whether a device can mirror textures to addresses.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsMirror { get; }
Property Value
true if the device supports mirroring textures to addresses; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.AddressCaps Structure
GraphicsDeviceCapabilities.AddressCaps Members
TextureAddressCapabilities
VolumeTextureAddressCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.AddressCaps.SupportsMirrorOnce
Property
Gets a value indicating whether a device can take the absolute value of the texture coordinate (thus, mirroring around 0) and
then clamp to the maximum value.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsMirrorOnce { get; }
Property Value
true if the device can mirror once; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.AddressCaps Structure
GraphicsDeviceCapabilities.AddressCaps Members
TextureAddressCapabilities
VolumeTextureAddressCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.AddressCaps.SupportsWrap
Property
Gets a value indicating whether a device can wrap textures to addresses.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsWrap { get; }
Property Value
true if the device can wrap textures to addresses; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.AddressCaps Structure
GraphicsDeviceCapabilities.AddressCaps Members
TextureAddressCapabilities
VolumeTextureAddressCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.BlendCaps Structure
Represents the supported blend capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct GraphicsDeviceCapabilities.BlendCaps
See Also
Reference
GraphicsDeviceCapabilities.BlendCaps Members
DestinationBlendCapabilities
SourceBlendCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.BlendCaps Members
The following tables list the members exposed by the GraphicsDeviceCapabilities.BlendCaps type.
Public Properties
Name Description
SupportsBlendFactor Gets a value indicating that the driver supports the Blend.BlendFactor blend mode.
SupportsBothInverseSourceAlpha Gets a value indicating that the driver supports the Blend.BothInverseSourceAlpha blend
mode.
SupportsBothSourceAlpha Gets a value indicating that the driver supports the Blend.BothSourceAlpha blend mode.
SupportsDestinationAlpha Gets a value indicating that the driver supports the Blend.DestinationAlpha blend mode.
SupportsDestinationColor Gets a value indicating that the driver supports the Blend.DestinationColor blend mode.
SupportsInverseDestinationAlpha Gets a value indicating that the driver supports the Blend.InverseDestinationAlpha blend
mode.
SupportsInverseDestinationColor Gets a value indicating that the driver supports the Blend.InverseDestinationColor blend
mode.
SupportsInverseSourceAlpha Gets a value indicating that the driver supports the Blend.InverseSourceAlpha blend mod
e.
SupportsInverseSourceColor Gets a value indicating that the driver supports the Blend.InverseSourceColor blend mod
e.
SupportsOne Gets a value indicating that the driver supports the Blend.One blend mode.
SupportsSourceAlpha Gets a value indicating that the driver supports the Blend.SourceAlpha blend mode.
SupportsSourceAlphaSat Gets a value indicating that the driver supports the Blend.SourceAlphaSat blend mode.
SupportsSourceColor Gets a value indicating that the driver supports the Blend.SourceColor blend mode.
SupportsZero Gets a value indicating that the driver supports the Blend.Zero blend mode.
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.BlendCaps instances are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.BlendCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.BlendCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.BlendCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.BlendCaps Methods
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.BlendCaps instances are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.BlendCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.BlendCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.BlendCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.BlendCaps.Equals Method
Determines whether two GraphicsDeviceCapabilities.BlendCaps instances are equal.
Overload List
Name Description
GraphicsDeviceCapabilities.BlendCaps.Equals (Object) Determines whether two GraphicsDeviceCapabilities.BlendCaps i
nstances are equal.
GraphicsDeviceCapabilities.BlendCaps.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.BlendCaps Structure
GraphicsDeviceCapabilities.BlendCaps Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
obj
The GraphicsDeviceCapabilities.BlendCaps to compare this instance to.
Return Value
true if the instances are equal; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.BlendCaps Structure
GraphicsDeviceCapabilities.BlendCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.BlendCaps.GetHashCode Method
Gets the hash code for this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
The hash code for this object.
See Also
Reference
GraphicsDeviceCapabilities.BlendCaps Structure
GraphicsDeviceCapabilities.BlendCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.BlendCaps.op_Equality Method
Determines whether two GraphicsDeviceCapabilities.BlendCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
BlendCaps left,
BlendCaps right
)
Parameters
left
GraphicsDeviceCapabilities.BlendCaps on the left side of the equal sign.
right
GraphicsDeviceCapabilities.BlendCaps on the right side of the equal sign.
Return Value
true if left is equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.BlendCaps Structure
GraphicsDeviceCapabilities.BlendCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.BlendCaps.op_Inequality Method
Determines whether two GraphicsDeviceCapabilities.BlendCaps instances are unequal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
BlendCaps left,
BlendCaps right
)
Parameters
left
GraphicsDeviceCapabilities.BlendCaps on the left side of the inequality operator.
right
GraphicsDeviceCapabilities.BlendCaps on the right side of the inequality operator.
Return Value
true if left is not equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.BlendCaps Structure
GraphicsDeviceCapabilities.BlendCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.BlendCaps.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
GraphicsDeviceCapabilities.BlendCaps Structure
GraphicsDeviceCapabilities.BlendCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.BlendCaps Properties
Public Properties
Name Description
SupportsBlendFactor Gets a value indicating that the driver supports the Blend.BlendFactor blend mode.
SupportsBothInverseSourceAlpha Gets a value indicating that the driver supports the Blend.BothInverseSourceAlpha blend
mode.
SupportsBothSourceAlpha Gets a value indicating that the driver supports the Blend.BothSourceAlpha blend mode.
SupportsDestinationAlpha Gets a value indicating that the driver supports the Blend.DestinationAlpha blend mode.
SupportsDestinationColor Gets a value indicating that the driver supports the Blend.DestinationColor blend mode.
SupportsInverseDestinationAlpha Gets a value indicating that the driver supports the Blend.InverseDestinationAlpha blend
mode.
SupportsInverseDestinationColor Gets a value indicating that the driver supports the Blend.InverseDestinationColor blend
mode.
SupportsInverseSourceAlpha Gets a value indicating that the driver supports the Blend.InverseSourceAlpha blend mod
e.
SupportsInverseSourceColor Gets a value indicating that the driver supports the Blend.InverseSourceColor blend mod
e.
SupportsOne Gets a value indicating that the driver supports the Blend.One blend mode.
SupportsSourceAlpha Gets a value indicating that the driver supports the Blend.SourceAlpha blend mode.
SupportsSourceAlphaSat Gets a value indicating that the driver supports the Blend.SourceAlphaSat blend mode.
SupportsSourceColor Gets a value indicating that the driver supports the Blend.SourceColor blend mode.
SupportsZero Gets a value indicating that the driver supports the Blend.Zero blend mode.
See Also
Reference
GraphicsDeviceCapabilities.BlendCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.BlendCaps.SupportsBlendFactor
Property
Gets a value indicating that the driver supports the Blend.BlendFactor blend mode.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsBlendFactor { get; }
Property Value
true if the driver supports the Blend.BlendFactor blend mode; false otherwise.
Remarks
Constant color blending factor used by the frame-buffer blender.
See Also
Reference
GraphicsDeviceCapabilities.BlendCaps Structure
GraphicsDeviceCapabilities.BlendCaps Members
Blend.BlendFactor
DestinationBlendCapabilities
SourceBlendCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.BlendCaps.SupportsBothInverseSourceAlpha
Property
Gets a value indicating that the driver supports the Blend.BothInverseSourceAlpha blend mode.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsBothInverseSourceAlpha { get; }
Property Value
true if the driver supports the Blend.BothInverseSourceAlpha blend mode; false otherwise.
Remarks
Source blend factor is (1 − As, 1 − As, 1 − As, 1 − As), and destination blend factor is (As, As, As, As); the destination blend selection is
overridden. This blend mode is supported only for the SourceBlend render state.
See Also
Reference
GraphicsDeviceCapabilities.BlendCaps Structure
GraphicsDeviceCapabilities.BlendCaps Members
Blend.BothInverseSourceAlpha
DestinationBlendCapabilities
SourceBlendCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.BlendCaps.SupportsBothSourceAlpha
Property
Gets a value indicating that the driver supports the Blend.BothSourceAlpha blend mode.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsBothSourceAlpha { get; }
Property Value
true if the driver supports the Blend.BothSourceAlpha blend mode; false otherwise.
Remarks
This mode is obsolete. For DirectX 6 and later, you can achieve the same effect by setting the source and destination blend factors
to Blend.SourceAlpha and Blend.InverseSourceAlpha in separate calls.
See Also
Reference
GraphicsDeviceCapabilities.BlendCaps Structure
GraphicsDeviceCapabilities.BlendCaps Members
Blend.BothSourceAlpha
DestinationBlendCapabilities
SourceBlendCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.BlendCaps.SupportsDestinationAlpha
Property
Gets a value indicating that the driver supports the Blend.DestinationAlpha blend mode.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsDestinationAlpha { get; }
Property Value
true if the driver supports the Blend.DestinationAlpha blend mode; false otherwise.
Remarks
The Blend.DestinationAlpha blend factor is (Ad, Ad, Ad, Ad), where Ad is the destination alpha value.
See Also
Reference
GraphicsDeviceCapabilities.BlendCaps Structure
GraphicsDeviceCapabilities.BlendCaps Members
Blend.DestinationAlpha
DestinationBlendCapabilities
SourceBlendCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.BlendCaps.SupportsDestinationColor
Property
Gets a value indicating that the driver supports the Blend.DestinationColor blend mode.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsDestinationColor { get; }
Property Value
true if the driver supports the Blend.DestinationColor blend mode; false otherwise.
Remarks
The Blend.DestinationColor blend factor is (R d, Gd, Bd, Ad), where R, G, B, and A respectively stand for red, green, blue, and alpha
destination values.
See Also
Reference
GraphicsDeviceCapabilities.BlendCaps Structure
GraphicsDeviceCapabilities.BlendCaps Members
Blend.DestinationColor
DestinationBlendCapabilities
SourceBlendCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.BlendCaps.SupportsInverseDestinationAlpha
Property
Gets a value indicating that the driver supports the Blend.InverseDestinationAlpha blend mode.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsInverseDestinationAlpha { get; }
Property Value
true if the driver supports the Blend.InverseDestinationAlpha blend mode; false otherwise.
Remarks
The Blend.InverseDestinationAlpha blend factor is (1 − Ad, 1 − Ad, 1 − Ad, 1 − Ad), where Ad is the alpha destination value.
See Also
Reference
GraphicsDeviceCapabilities.BlendCaps Structure
GraphicsDeviceCapabilities.BlendCaps Members
Blend.InverseDestinationAlpha
DestinationBlendCapabilities
SourceBlendCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.BlendCaps.SupportsInverseDestinationColor
Property
Gets a value indicating that the driver supports the Blend.InverseDestinationColor blend mode.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsInverseDestinationColor { get; }
Property Value
true if the driver supports the Blend.InverseDestinationColor blend mode; false otherwise.
Remarks
The Blend.InverseDestinationColor blend factor is (1 − R d, 1 − Gd, 1 − Bd, 1 − Ad), where R d, Gd, Bd, and Ad respectively stand for the red,
green, blue, and alpha destination values.
See Also
Reference
GraphicsDeviceCapabilities.BlendCaps Structure
GraphicsDeviceCapabilities.BlendCaps Members
Blend.InverseDestinationColor
DestinationBlendCapabilities
SourceBlendCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.BlendCaps.SupportsInverseSourceAlpha
Property
Gets a value indicating that the driver supports the Blend.InverseSourceAlpha blend mode.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsInverseSourceAlpha { get; }
Property Value
true if the driver supports the Blend.InverseSourceAlpha blend mode; false otherwise.
Remarks
The Blend.InverseSourceAlpha blend factor is (1 − As, 1 − As, 1 − As, 1 − As), where As is the alpha destination value.
See Also
Reference
GraphicsDeviceCapabilities.BlendCaps Structure
GraphicsDeviceCapabilities.BlendCaps Members
Blend.InverseSourceAlpha
DestinationBlendCapabilities
SourceBlendCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.BlendCaps.SupportsInverseSourceColor
Property
Gets a value indicating that the driver supports the Blend.InverseSourceColor blend mode.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsInverseSourceColor { get; }
Property Value
true if the driver supports the Blend.InverseSourceColor blend mode; false otherwise.
Remarks
The Blend.InverseSourceColor blend factor is (1 − R s, 1 − Gs, 1 − Bs, 1 − As) where R, G, B, and A respectively stand for the red, green,
blue, and alpha destination values.
See Also
Reference
GraphicsDeviceCapabilities.BlendCaps Structure
GraphicsDeviceCapabilities.BlendCaps Members
Blend.InverseSourceColor
DestinationBlendCapabilities
SourceBlendCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.BlendCaps.SupportsOne Property
Gets a value indicating that the driver supports the Blend.One blend mode.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsOne { get; }
Property Value
true if the driver supports the Blend.One blend mode; false otherwise.
Remarks
The Blend.One blend factor is (1, 1, 1, 1).
See Also
Reference
GraphicsDeviceCapabilities.BlendCaps Structure
GraphicsDeviceCapabilities.BlendCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.BlendCaps.SupportsSourceAlpha
Property
Gets a value indicating that the driver supports the Blend.SourceAlpha blend mode.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsSourceAlpha { get; }
Property Value
true if the driver supports the Blend.SourceAlpha blend mode; false otherwise.
Remarks
The Blend.SourceAlpha blend factor is (As, As, As, As), where As is the alpha source value.
See Also
Reference
GraphicsDeviceCapabilities.BlendCaps Structure
GraphicsDeviceCapabilities.BlendCaps Members
Blend.SourceAlpha
DestinationBlendCapabilities
SourceBlendCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.BlendCaps.SupportsSourceAlphaSat
Property
Gets a value indicating that the driver supports the Blend.SourceAlphaSat blend mode.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsSourceAlphaSat { get; }
Property Value
true if the driver supports the Blend.SourceAlphaSat blend mode; false otherwise.
Remarks
The Blend.SourceAlphaSat blend factor is (f, f, f, 1), where f = min(A, 1 − Ad).
See Also
Reference
GraphicsDeviceCapabilities.BlendCaps Structure
GraphicsDeviceCapabilities.BlendCaps Members
Blend.SourceAlphaSat
DestinationBlendCapabilities
SourceBlendCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.BlendCaps.SupportsSourceColor
Property
Gets a value indicating that the driver supports the Blend.SourceColor blend mode.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsSourceColor { get; }
Property Value
true if the driver supports the Blend.SourceColor blend mode; false otherwise.
Remarks
The Blend.SourceColor blend factor is (R s, Gs, Bs, As), where R, G, B, and A respectively stand for the red, green, blue, and alpha
source values.
See Also
Reference
GraphicsDeviceCapabilities.BlendCaps Structure
GraphicsDeviceCapabilities.BlendCaps Members
Blend.SourceColor
DestinationBlendCapabilities
SourceBlendCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.BlendCaps.SupportsZero Property
Gets a value indicating that the driver supports the Blend.Zero blend mode.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsZero { get; }
Property Value
true if the driver supports the Blend.Zero blend mode; false otherwise.
Remarks
The Blend.Zero blend factor is (0, 0, 0, 0).
See Also
Reference
GraphicsDeviceCapabilities.BlendCaps Structure
GraphicsDeviceCapabilities.BlendCaps Members
Blend.Zero
DestinationBlendCapabilities
SourceBlendCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CompareCaps Structure
Represents comparison capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct GraphicsDeviceCapabilities.CompareCaps
See Also
Reference
GraphicsDeviceCapabilities.CompareCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CompareCaps Members
The following tables list the members exposed by the GraphicsDeviceCapabilities.CompareCaps type.
Public Properties
Name Description
SupportsAlways Gets a value indicating whether always passing the comparison test is supported.
SupportsEqual Gets a value indicating whether comparison tests in which the new value equals the current value are
supported.
SupportsGreater Gets a value indicating whether comparison tests in which the new value is greater than the current v
alue are supported.
SupportsGreaterEqual Gets a value indicating whether comparison tests in which the new value is greater than or equal to t
he current value are supported.
SupportsLess Gets a value indicating whether comparison tests in which the new value is less than the current valu
e are supported.
SupportsLessEqual Gets a value indicating whether comparison tests in which the new value is less than or equal to the c
urrent value are supported.
SupportsNever Gets a value indicating whether never passing the comparison test is supported.
SupportsNotEqual Gets a value indicating whether comparison tests in which the new value does not equal the current
value are supported.
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.CompareCaps instances are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.CompareCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.CompareCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.CompareCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CompareCaps Methods
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.CompareCaps instances are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.CompareCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.CompareCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.CompareCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CompareCaps.Equals Method
Determines whether two GraphicsDeviceCapabilities.CompareCaps instances are equal.
Overload List
Name Description
GraphicsDeviceCapabilities.CompareCaps.Equals (Object) Determines whether two
GraphicsDeviceCapabilities.CompareCaps instances are equa
l.
GraphicsDeviceCapabilities.CompareCaps.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.CompareCaps Structure
GraphicsDeviceCapabilities.CompareCaps Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CompareCaps.Equals Method
(Object)
Determines whether two GraphicsDeviceCapabilities.CompareCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override bool Equals (
Object obj
)
Parameters
obj
The GraphicsDeviceCapabilities.CompareCaps object to compare this instance to.
Return Value
true if the instances are equal; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.CompareCaps Structure
GraphicsDeviceCapabilities.CompareCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CompareCaps.GetHashCode
Method
Gets the hash code for this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
The hash code for this object.
See Also
Reference
GraphicsDeviceCapabilities.CompareCaps Structure
GraphicsDeviceCapabilities.CompareCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CompareCaps.op_Equality Method
Determines whether two GraphicsDeviceCapabilities.CompareCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
CompareCaps left,
CompareCaps right
)
Parameters
left
GraphicsDeviceCapabilities.CompareCaps on the left side of the equal sign.
right
GraphicsDeviceCapabilities.CompareCaps on the right side of the equal sign.
Return Value
true if left is equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.CompareCaps Structure
GraphicsDeviceCapabilities.CompareCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CompareCaps.op_Inequality
Method
Determines whether two GraphicsDeviceCapabilities.CompareCaps instances are unequal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
CompareCaps left,
CompareCaps right
)
Parameters
left
GraphicsDeviceCapabilities.CompareCaps on the left side of the inequality operator.
right
GraphicsDeviceCapabilities.CompareCaps on the right side of the inequality operator.
Return Value
true if left is not equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.CompareCaps Structure
GraphicsDeviceCapabilities.CompareCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CompareCaps.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
GraphicsDeviceCapabilities.CompareCaps Structure
GraphicsDeviceCapabilities.CompareCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CompareCaps Properties
Public Properties
Name Description
SupportsAlways Gets a value indicating whether always passing the comparison test is supported.
SupportsEqual Gets a value indicating whether comparison tests in which the new value equals the current value are
supported.
SupportsGreater Gets a value indicating whether comparison tests in which the new value is greater than the current v
alue are supported.
SupportsGreaterEqual Gets a value indicating whether comparison tests in which the new value is greater than or equal to t
he current value are supported.
SupportsLess Gets a value indicating whether comparison tests in which the new value is less than the current valu
e are supported.
SupportsLessEqual Gets a value indicating whether comparison tests in which the new value is less than or equal to the c
urrent value are supported.
SupportsNever Gets a value indicating whether never passing the comparison test is supported.
SupportsNotEqual Gets a value indicating whether comparison tests in which the new value does not equal the current
value are supported.
See Also
Reference
GraphicsDeviceCapabilities.CompareCaps Structure
AlphaCompareCapabilities
DepthBufferCompareCapabilities
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CompareCaps.SupportsAlways
Property
Gets a value indicating whether always passing the comparison test is supported.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsAlways { get; }
Property Value
true if always passing the comparison test is supported; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.CompareCaps Structure
GraphicsDeviceCapabilities.CompareCaps Members
AlphaCompareCapabilities
DepthBufferCompareCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CompareCaps.SupportsEqual
Property
Gets a value indicating whether comparison tests in which the new value equals the current value are supported.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsEqual { get; }
Property Value
true if comparison tests in which the new value equals the current value are supported; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.CompareCaps Structure
GraphicsDeviceCapabilities.CompareCaps Members
AlphaCompareCapabilities
DepthBufferCompareCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CompareCaps.SupportsGreater
Property
Gets a value indicating whether comparison tests in which the new value is greater than the current value are supported.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsGreater { get; }
Property Value
true if comparison tests in which the new value is greater than the current value are supported; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.CompareCaps Structure
GraphicsDeviceCapabilities.CompareCaps Members
AlphaCompareCapabilities
DepthBufferCompareCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CompareCaps.SupportsGreaterEqual
Property
Gets a value indicating whether comparison tests in which the new value is greater than or equal to the current value are
supported.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsGreaterEqual { get; }
Property Value
true if comparison tests in which the new value is greater than or equal to the current value are supported; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.CompareCaps Structure
GraphicsDeviceCapabilities.CompareCaps Members
AlphaCompareCapabilities
DepthBufferCompareCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CompareCaps.SupportsLess
Property
Gets a value indicating whether comparison tests in which the new value is less than the current value are supported.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsLess { get; }
Property Value
true if comparison tests in which the new value is less than the current value are supported; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.CompareCaps Structure
GraphicsDeviceCapabilities.CompareCaps Members
AlphaCompareCapabilities
DepthBufferCompareCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CompareCaps.SupportsLessEqual
Property
Gets a value indicating whether comparison tests in which the new value is less than or equal to the current value are
supported.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsLessEqual { get; }
Property Value
true if comparison tests in which the new value is less than or equal to the current value are supported; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.CompareCaps Structure
GraphicsDeviceCapabilities.CompareCaps Members
AlphaCompareCapabilities
DepthBufferCompareCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CompareCaps.SupportsNever
Property
Gets a value indicating whether never passing the comparison test is supported.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsNever { get; }
Property Value
true if never passing the comparison test is supported; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.CompareCaps Structure
GraphicsDeviceCapabilities.CompareCaps Members
AlphaCompareCapabilities
DepthBufferCompareCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CompareCaps.SupportsNotEqual
Property
Gets a value indicating whether comparison tests in which the new value does not equal the current value are supported.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsNotEqual { get; }
Property Value
true if comparison tests in which the new value does not equal the current value are supported; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.CompareCaps Structure
GraphicsDeviceCapabilities.CompareCaps Members
AlphaCompareCapabilities
DepthBufferCompareCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CursorCaps Structure
Represents hardware support for cursors.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct GraphicsDeviceCapabilities.CursorCaps
See Also
Reference
GraphicsDeviceCapabilities.CursorCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CursorCaps Members
The following tables list the members exposed by the GraphicsDeviceCapabilities.CursorCaps type.
Public Properties
Name Description
SupportsColor Gets a value indicating whether a full-color cursor is supported in hardware in high-resolution mo
des.
SupportsLowResolution Gets a value indicating whether a full-color cursor is supported in hardware in low-resolution mod
es.
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.CursorCaps instances are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.CursorCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.CursorCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.CursorCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CursorCaps Methods
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.CursorCaps instances are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.CursorCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.CursorCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.CursorCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CursorCaps.Equals Method
Determines whether two GraphicsDeviceCapabilities.CursorCaps instances are equal.
Overload List
Name Description
GraphicsDeviceCapabilities.CursorCaps.Equals (Object) Determines whether two
GraphicsDeviceCapabilities.CursorCaps instances are equal.
GraphicsDeviceCapabilities.CursorCaps.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.CursorCaps Structure
GraphicsDeviceCapabilities.CursorCaps Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
obj
The GraphicsDeviceCapabilities.CursorCaps to compare this instance to.
Return Value
true if the instances are equal; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.CursorCaps Structure
GraphicsDeviceCapabilities.CursorCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CursorCaps.GetHashCode Method
Gets the hash code for this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
The hash code for this object.
See Also
Reference
GraphicsDeviceCapabilities.CursorCaps Structure
GraphicsDeviceCapabilities.CursorCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CursorCaps.op_Equality Method
Determines whether two GraphicsDeviceCapabilities.CursorCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
CursorCaps left,
CursorCaps right
)
Parameters
left
GraphicsDeviceCapabilities.CursorCaps on the left side of the equal sign.
right
GraphicsDeviceCapabilities.CursorCaps on the right side of the equal sign.
Return Value
true if left is equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.CursorCaps Structure
GraphicsDeviceCapabilities.CursorCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CursorCaps.op_Inequality Method
Determines whether two GraphicsDeviceCapabilities.CursorCaps instances are unequal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
CursorCaps left,
CursorCaps right
)
Parameters
left
GraphicsDeviceCapabilities.CursorCaps on the left side of the inequality operator.
right
GraphicsDeviceCapabilities.CursorCaps on the right side of the inequality operator.
Return Value
true if left is not equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.CursorCaps Structure
GraphicsDeviceCapabilities.CursorCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CursorCaps.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
GraphicsDeviceCapabilities.CursorCaps Structure
GraphicsDeviceCapabilities.CursorCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CursorCaps Properties
Public Properties
Name Description
SupportsColor Gets a value indicating whether a full-color cursor is supported in hardware in high-resolution mo
des.
SupportsLowResolution Gets a value indicating whether a full-color cursor is supported in hardware in low-resolution mod
es.
See Also
Reference
GraphicsDeviceCapabilities.CursorCaps Structure
CursorCapabilities
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CursorCaps.SupportsColor Property
Gets a value indicating whether a full-color cursor is supported in hardware in high-resolution modes.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsColor { get; }
Property Value
true if the hardware supports a full-color cursor in high resolution; false otherwise.
Remarks
Specifically, this flag indicates that the driver supports at least a hardware color cursor in high-resolution modes (with scan
lines greater than or equal to 400).
See Also
Reference
GraphicsDeviceCapabilities.CursorCaps Structure
GraphicsDeviceCapabilities.CursorCaps Members
CursorCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.CursorCaps.SupportsLowResolution
Property
Gets a value indicating whether a full-color cursor is supported in hardware in low-resolution modes.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsLowResolution { get; }
Property Value
true if the hardware supports a full-color cursor in low resolution; false otherwise.
Remarks
Specifically, this flag indicates that the driver supports at least a hardware color cursor in low-resolution modes (with scan lines
less than 400).
See Also
Reference
GraphicsDeviceCapabilities.CursorCaps Structure
GraphicsDeviceCapabilities.CursorCaps Members
CursorCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeclarationTypeCaps Structure
Represents data types contained in a vertex declaration.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct GraphicsDeviceCapabilities.DeclarationTypeCaps
See Also
Reference
GraphicsDeviceCapabilities.DeclarationTypeCaps Members
DeclarationTypeCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeclarationTypeCaps Members
The following tables list the members exposed by the GraphicsDeviceCapabilities.DeclarationTypeCaps type.
Public Properties
Name Description
SupportsByte4 Gets a value indicating whether vertex declarations support VertexElementFormat.Byte4.
SupportsHalfVector2 Gets a value indicating whether vertex declarations support VertexElementFormat.HalfVector2
SupportsHalfVector4 Gets a value indicating whether vertex declarations support VertexElementFormat.HalfVector4.
SupportsNormalized101010 Gets a value indicating whether vertex declarations support
VertexElementFormat.Normalized101010.
SupportsNormalizedShort2 Gets a value indicating whether vertex declarations support
VertexElementFormat.NormalizedShort2.
SupportsNormalizedShort4 Gets a value indicating whether vertex declarations support
VertexElementFormat.NormalizedShort4.
SupportsRg32 Gets a value indicating whether vertex declarations support VertexElementFormat.Rg32.
SupportsRgba32 Gets a value indicating whether vertex declarations support VertexElementFormat.Rgba32.
SupportsRgba64 Gets a value indicating whether vertex declarations support VertexElementFormat.Rgba64.
SupportsUInt101010 Gets a value indicating whether vertex declarations support VertexElementFormat.UInt101010.
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.DeclarationTypeCaps instances are eq
ual.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.DeclarationTypeCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.DeclarationTypeCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.DeclarationTypeCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeclarationTypeCaps Methods
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.DeclarationTypeCaps instances are eq
ual.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.DeclarationTypeCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.DeclarationTypeCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.DeclarationTypeCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeclarationTypeCaps.Equals
Method
Determines whether two GraphicsDeviceCapabilities.DeclarationTypeCaps instances are equal.
Overload List
Name Description
GraphicsDeviceCapabilities.DeclarationTypeCaps.Equals (Object) Determines whether two
GraphicsDeviceCapabilities.DeclarationTypeCaps insta
nces are equal.
GraphicsDeviceCapabilities.DeclarationTypeCaps.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.DeclarationTypeCaps Structure
GraphicsDeviceCapabilities.DeclarationTypeCaps Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeclarationTypeCaps.Equals
Method (Object)
Determines whether two GraphicsDeviceCapabilities.DeclarationTypeCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override bool Equals (
Object obj
)
Parameters
obj
The GraphicsDeviceCapabilities.DeclarationTypeCaps object to compare this instance to.
Return Value
true if the instances are equal; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DeclarationTypeCaps Structure
GraphicsDeviceCapabilities.DeclarationTypeCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeclarationTypeCaps.GetHashCode
Method
Gets the hash code for this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
The hash code for this object.
See Also
Reference
GraphicsDeviceCapabilities.DeclarationTypeCaps Structure
GraphicsDeviceCapabilities.DeclarationTypeCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeclarationTypeCaps.op_Equality
Method
Determines whether two GraphicsDeviceCapabilities.DeclarationTypeCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
DeclarationTypeCaps left,
DeclarationTypeCaps right
)
Parameters
left
GraphicsDeviceCapabilities.DeclarationTypeCaps on the left side of the equal sign.
right
GraphicsDeviceCapabilities.DeclarationTypeCaps on the right side of the equal sign.
Return Value
true if left is equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DeclarationTypeCaps Structure
GraphicsDeviceCapabilities.DeclarationTypeCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeclarationTypeCaps.op_Inequality
Method
Determines whether two GraphicsDeviceCapabilities.DeclarationTypeCaps instances are unequal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
DeclarationTypeCaps left,
DeclarationTypeCaps right
)
Parameters
left
GraphicsDeviceCapabilities.DeclarationTypeCaps on the left side of the inequality operator.
right
GraphicsDeviceCapabilities.DeclarationTypeCaps on the right side of the inequality operator.
Return Value
true if left is not equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DeclarationTypeCaps Structure
GraphicsDeviceCapabilities.DeclarationTypeCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeclarationTypeCaps.ToString
Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
GraphicsDeviceCapabilities.DeclarationTypeCaps Structure
GraphicsDeviceCapabilities.DeclarationTypeCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeclarationTypeCaps Properties
Public Properties
Name Description
SupportsByte4 Gets a value indicating whether vertex declarations support VertexElementFormat.Byte4.
SupportsHalfVector2 Gets a value indicating whether vertex declarations support VertexElementFormat.HalfVector2
SupportsHalfVector4 Gets a value indicating whether vertex declarations support VertexElementFormat.HalfVector4.
SupportsNormalized101010 Gets a value indicating whether vertex declarations support
VertexElementFormat.Normalized101010.
SupportsNormalizedShort2 Gets a value indicating whether vertex declarations support
VertexElementFormat.NormalizedShort2.
SupportsNormalizedShort4 Gets a value indicating whether vertex declarations support
VertexElementFormat.NormalizedShort4.
SupportsRg32 Gets a value indicating whether vertex declarations support VertexElementFormat.Rg32.
SupportsRgba32 Gets a value indicating whether vertex declarations support VertexElementFormat.Rgba32.
SupportsRgba64 Gets a value indicating whether vertex declarations support VertexElementFormat.Rgba64.
SupportsUInt101010 Gets a value indicating whether vertex declarations support VertexElementFormat.UInt101010.
See Also
Reference
GraphicsDeviceCapabilities.DeclarationTypeCaps Structure
DeclarationTypeCapabilities
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeclarationTypeCaps.SupportsByte4
Property
Gets a value indicating whether vertex declarations support VertexElementFormat.Byte4.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsByte4 { get; }
Property Value
true if vertex declarations support VertexElementFormat.Byte4; otherwise false.
See Also
Reference
GraphicsDeviceCapabilities.DeclarationTypeCaps Structure
GraphicsDeviceCapabilities.DeclarationTypeCaps Members
DeclarationTypeCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeclarationTypeCaps.SupportsHalfVector2
Property
Gets a value indicating whether vertex declarations support VertexElementFormat.HalfVector2
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsHalfVector2 { get; }
Property Value
true if vertex declarations support VertexElementFormat.HalfVector2; otherwise false.
See Also
Reference
GraphicsDeviceCapabilities.DeclarationTypeCaps Structure
GraphicsDeviceCapabilities.DeclarationTypeCaps Members
DeclarationTypeCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeclarationTypeCaps.SupportsHalfVector4
Property
Gets a value indicating whether vertex declarations support VertexElementFormat.HalfVector4.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsHalfVector4 { get; }
Property Value
true if vertex declarations support VertexElementFormat.HalfVector4; otherwise false.
See Also
Reference
GraphicsDeviceCapabilities.DeclarationTypeCaps Structure
GraphicsDeviceCapabilities.DeclarationTypeCaps Members
DeclarationTypeCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeclarationTypeCaps.SupportsNormalized101010
Property
Gets a value indicating whether vertex declarations support VertexElementFormat.Normalized101010.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsNormalized101010 { get; }
Property Value
true if vertex declarations support VertexElementFormat.Normalized101010; otherwise false.
See Also
Reference
GraphicsDeviceCapabilities.DeclarationTypeCaps Structure
GraphicsDeviceCapabilities.DeclarationTypeCaps Members
DeclarationTypeCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeclarationTypeCaps.SupportsNormalizedShort2
Property
Gets a value indicating whether vertex declarations support VertexElementFormat.NormalizedShort2.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsNormalizedShort2 { get; }
Property Value
true if vertex declarations support VertexElementFormat.NormalizedShort2; otherwise false.
See Also
Reference
GraphicsDeviceCapabilities.DeclarationTypeCaps Structure
GraphicsDeviceCapabilities.DeclarationTypeCaps Members
DeclarationTypeCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeclarationTypeCaps.SupportsNormalizedShort4
Property
Gets a value indicating whether vertex declarations support VertexElementFormat.NormalizedShort4.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsNormalizedShort4 { get; }
Property Value
true if vertex declarations support VertexElementFormat.NormalizedShort4; otherwise false.
See Also
Reference
GraphicsDeviceCapabilities.DeclarationTypeCaps Structure
GraphicsDeviceCapabilities.DeclarationTypeCaps Members
DeclarationTypeCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeclarationTypeCaps.SupportsRg32
Property
Gets a value indicating whether vertex declarations support VertexElementFormat.Rg32.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsRg32 { get; }
Property Value
true if vertex declarations support VertexElementFormat.Rg32; otherwise false.
See Also
Reference
GraphicsDeviceCapabilities.DeclarationTypeCaps Structure
GraphicsDeviceCapabilities.DeclarationTypeCaps Members
DeclarationTypeCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeclarationTypeCaps.SupportsRgba32
Property
Gets a value indicating whether vertex declarations support VertexElementFormat.Rgba32.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsRgba32 { get; }
Property Value
true if vertex declarations support VertexElementFormat.Rgba32; otherwise false.
See Also
Reference
GraphicsDeviceCapabilities.DeclarationTypeCaps Structure
GraphicsDeviceCapabilities.DeclarationTypeCaps Members
DeclarationTypeCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeclarationTypeCaps.SupportsRgba64
Property
Gets a value indicating whether vertex declarations support VertexElementFormat.Rgba64.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsRgba64 { get; }
Property Value
true if vertex declarations support VertexElementFormat.Rgba64; otherwise false.
See Also
Reference
GraphicsDeviceCapabilities.DeclarationTypeCaps Structure
GraphicsDeviceCapabilities.DeclarationTypeCaps Members
DeclarationTypeCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeclarationTypeCaps.SupportsUInt101010
Property
Gets a value indicating whether vertex declarations support VertexElementFormat.UInt101010.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsUInt101010 { get; }
Property Value
true if vertex declarations support VertexElementFormat.UInt101010; otherwise false.
See Also
Reference
GraphicsDeviceCapabilities.DeclarationTypeCaps Structure
GraphicsDeviceCapabilities.DeclarationTypeCaps Members
DeclarationTypeCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceCaps Structure
Represents device-specific capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct GraphicsDeviceCapabilities.DeviceCaps
See Also
Reference
GraphicsDeviceCapabilities.DeviceCaps Members
DeviceCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceCaps Members
The following tables list the members exposed by the GraphicsDeviceCapabilities.DeviceCaps type.
Public Properties
Name Description
CanDrawSystemToNonLocal Gets a value indicating whether the device supports blits from system-memor
y textures to non-local video-memory textures.
CanRenderAfterFlip Gets a value indicating whether the device can queue rendering commands aft
er a page flip.
IsDirect3D9Driver Gets a value indicating if the device supports copying the contents of a source
rectangle to a destination rectangle using a texture as the source.
SupportsDrawPrimitives2 Gets a value indicating whether the device can support at least a DirectX 5–co
mpliant driver.
SupportsDrawPrimitives2Ex Gets a value indicating whether the device can support at least a DirectX 7–co
mpliant driver.
SupportsDrawPrimitivesTransformedVertex Gets a value indicating whether the device exports a DrawPrimitives-aware har
dware abstraction layer (HAL).
SupportsExecuteSystemMemory Gets a value indicating whether the device can use execute buffers from video
memory.
SupportsExecuteVideoMemory Gets a value indicating whether the device can use execute buffers from video
memory.
SupportsHardwareRasterization Gets a value indicating whether the device has hardware acceleration for scene
rasterization.
SupportsHardwareTransformAndLight Gets a value indicating whether the device can support transformation and lig
hting in hardware.
SupportsSeparateTextureMemories Gets a value indicating whether the device is texturing from separate memory
pools.
SupportsStreamOffset Gets a value indicating whether the device supports stream offsets.
SupportsTextureNonLocalVideoMemory Gets a value indicating whether the device can retrieve textures from non-local
video memory.
SupportsTextureSystemMemory Gets a value indicating whether the device can retrieve textures from system m
emory.
SupportsTextureVideoMemory Gets a value indicating whether the device can retrieve textures from device m
emory.
SupportsTransformedVertexSystemMemory Gets a value indicating whether the device can use buffers from system memo
ry for transformed and lit vertices.
SupportsTransformedVertexVideoMemory Gets a value indicating whether the device can use buffers from video memory
for transformed and lit vertices.
VertexElementScanSharesStreamOffset Gets a value indicating whether the device allows multiple vertex elements to s
hare the same offset in a stream.
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.DeviceCaps instances are equal.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.DeviceCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.DeviceCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.DeviceCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceCaps Methods
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.DeviceCaps instances are equal.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.DeviceCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.DeviceCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.DeviceCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceCaps.Equals Method
Determines whether two GraphicsDeviceCapabilities.DeviceCaps instances are equal.
Overload List
Name Description
GraphicsDeviceCapabilities.DeviceCaps.Equals (Object) Determines whether two
GraphicsDeviceCapabilities.DeviceCaps instances are equal.
GraphicsDeviceCapabilities.DeviceCaps.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.DeviceCaps Structure
GraphicsDeviceCapabilities.DeviceCaps Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
obj
The GraphicsDeviceCapabilities.DeviceCaps to compare this instance to.
Return Value
true if the instances are equal; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DeviceCaps Structure
GraphicsDeviceCapabilities.DeviceCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceCaps.op_Equality Method
Determines whether two GraphicsDeviceCapabilities.DeviceCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
DeviceCaps l,
DeviceCaps r
)
Parameters
l
GraphicsDeviceCapabilities.DeviceCaps on the left side of the equal sign.
r
GraphicsDeviceCapabilities.DeviceCaps on the right side of the equal sign.
Return Value
true if left is equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DeviceCaps Structure
GraphicsDeviceCapabilities.DeviceCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceCaps.op_Inequality Method
Determines whether two GraphicsDeviceCapabilities.DeviceCaps instances are unequal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
DeviceCaps l,
DeviceCaps r
)
Parameters
l
GraphicsDeviceCapabilities.DeviceCaps on the left side of the inequality operator.
r
GraphicsDeviceCapabilities.DeviceCaps on the right side of the inequality operator.
Return Value
true if left is not equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DeviceCaps Structure
GraphicsDeviceCapabilities.DeviceCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceCaps.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
GraphicsDeviceCapabilities.DeviceCaps Structure
GraphicsDeviceCapabilities.DeviceCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceCaps Properties
Public Properties
Name Description
CanDrawSystemToNonLocal Gets a value indicating whether the device supports blits from system-memor
y textures to non-local video-memory textures.
CanRenderAfterFlip Gets a value indicating whether the device can queue rendering commands aft
er a page flip.
IsDirect3D9Driver Gets a value indicating if the device supports copying the contents of a source
rectangle to a destination rectangle using a texture as the source.
SupportsDrawPrimitives2 Gets a value indicating whether the device can support at least a DirectX 5–co
mpliant driver.
SupportsDrawPrimitives2Ex Gets a value indicating whether the device can support at least a DirectX 7–co
mpliant driver.
SupportsDrawPrimitivesTransformedVertex Gets a value indicating whether the device exports a DrawPrimitives-aware har
dware abstraction layer (HAL).
SupportsExecuteSystemMemory Gets a value indicating whether the device can use execute buffers from video
memory.
SupportsExecuteVideoMemory Gets a value indicating whether the device can use execute buffers from video
memory.
SupportsHardwareRasterization Gets a value indicating whether the device has hardware acceleration for scene
rasterization.
SupportsHardwareTransformAndLight Gets a value indicating whether the device can support transformation and lig
hting in hardware.
SupportsSeparateTextureMemories Gets a value indicating whether the device is texturing from separate memory
pools.
SupportsStreamOffset Gets a value indicating whether the device supports stream offsets.
SupportsTextureNonLocalVideoMemory Gets a value indicating whether the device can retrieve textures from non-local
video memory.
SupportsTextureSystemMemory Gets a value indicating whether the device can retrieve textures from system m
emory.
SupportsTextureVideoMemory Gets a value indicating whether the device can retrieve textures from device m
emory.
SupportsTransformedVertexSystemMemory Gets a value indicating whether the device can use buffers from system memo
ry for transformed and lit vertices.
SupportsTransformedVertexVideoMemory Gets a value indicating whether the device can use buffers from video memory
for transformed and lit vertices.
VertexElementScanSharesStreamOffset Gets a value indicating whether the device allows multiple vertex elements to s
hare the same offset in a stream.
See Also
Reference
GraphicsDeviceCapabilities.DeviceCaps Structure
DeviceCapabilities
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceCaps.CanDrawSystemToNonLocal
Property
Gets a value indicating whether the device supports blits from system-memory textures to non-local video-memory textures.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool CanDrawSystemToNonLocal { get; }
Property Value
true if the device supports blits from system-memory textures to non-local video-memory textures; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DeviceCaps Structure
GraphicsDeviceCapabilities.DeviceCaps Members
DeviceCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceCaps.CanRenderAfterFlip
Property
Gets a value indicating whether the device can queue rendering commands after a page flip.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool CanRenderAfterFlip { get; }
Property Value
true if the device can queue rendering commands after a page flip; false otherwise.
Remarks
Applications do not change their behavior if this flag is set; this capability means that the device is relatively fast.
See Also
Reference
GraphicsDeviceCapabilities.DeviceCaps Structure
GraphicsDeviceCapabilities.DeviceCaps Members
DeviceCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceCaps.IsDirect3D9Driver
Property
Gets a value indicating if the device supports copying the contents of a source rectangle to a destination rectangle using a
texture as the source.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsDirect3D9Driver { get; }
Property Value
true if the device supports copying the contents of a source rectangle to a destination rectangle using a texture as the source;
false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DeviceCaps Structure
GraphicsDeviceCapabilities.DeviceCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceCaps.SupportsDrawPrimitives2
Property
Gets a value indicating whether the device can support at least a DirectX 5–compliant driver.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsDrawPrimitives2 { get; }
Property Value
true if the device can support at least a DirectX 5–compliant driver; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DeviceCaps Structure
GraphicsDeviceCapabilities.DeviceCaps Members
DeviceCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceCaps.SupportsDrawPrimitives2Ex
Property
Gets a value indicating whether the device can support at least a DirectX 7–compliant driver.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsDrawPrimitives2Ex { get; }
Property Value
true if the device can support at least a DirectX 7–compliant driver; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DeviceCaps Structure
GraphicsDeviceCapabilities.DeviceCaps Members
DeviceCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceCaps.SupportsDrawPrimitivesTransformedVertex
Property
Gets a value indicating whether the device exports a DrawPrimitives-aware hardware abstraction layer (HAL).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsDrawPrimitivesTransformedVertex { get; }
Property Value
true if the device exports an DrawPrimitives-aware HAL; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DeviceCaps Structure
GraphicsDeviceCapabilities.DeviceCaps Members
DeviceCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceCaps.SupportsExecuteSystemMemory
Property
Gets a value indicating whether the device can use execute buffers from video memory.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsExecuteSystemMemory { get; }
Property Value
true if the device can use execute buffers from video memory; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DeviceCaps Structure
GraphicsDeviceCapabilities.DeviceCaps Members
DeviceCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceCaps.SupportsExecuteVideoMemory
Property
Gets a value indicating whether the device can use execute buffers from video memory.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsExecuteVideoMemory { get; }
Property Value
true if the device can use execute buffers from video memory; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DeviceCaps Structure
GraphicsDeviceCapabilities.DeviceCaps Members
DeviceCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceCaps.SupportsHardwareRasterization
Property
Gets a value indicating whether the device has hardware acceleration for scene rasterization.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsHardwareRasterization { get; }
Property Value
true if the device has hardware acceleration for scene rasterization; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DeviceCaps Structure
GraphicsDeviceCapabilities.DeviceCaps Members
DeviceCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceCaps.SupportsHardwareTransformAndLight
Property
Gets a value indicating whether the device can support transformation and lighting in hardware.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsHardwareTransformAndLight { get; }
Property Value
true if the device can support transformation and lighting in hardware; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DeviceCaps Structure
GraphicsDeviceCapabilities.DeviceCaps Members
DeviceCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceCaps.SupportsSeparateTextureMemories
Property
Gets a value indicating whether the device is texturing from separate memory pools.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsSeparateTextureMemories { get; }
Property Value
true if the device is texturing from separate memory pools; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DeviceCaps Structure
GraphicsDeviceCapabilities.DeviceCaps Members
DeviceCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceCaps.SupportsStreamOffset
Property
Gets a value indicating whether the device supports stream offsets.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsStreamOffset { get; }
Property Value
true if the device supports stream offsets; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DeviceCaps Structure
GraphicsDeviceCapabilities.DeviceCaps Members
DeviceCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceCaps.SupportsTextureNonLocalVideoMemory
Property
Gets a value indicating whether the device can retrieve textures from non-local video memory.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsTextureNonLocalVideoMemory { get; }
Property Value
true if the device can retrieve textures from non-local video memory; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DeviceCaps Structure
GraphicsDeviceCapabilities.DeviceCaps Members
DeviceCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceCaps.SupportsTextureSystemMemory
Property
Gets a value indicating whether the device can retrieve textures from system memory.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsTextureSystemMemory { get; }
Property Value
true if the device can retrieve textures from system memory; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DeviceCaps Structure
GraphicsDeviceCapabilities.DeviceCaps Members
DeviceCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceCaps.SupportsTextureVideoMemory
Property
Gets a value indicating whether the device can retrieve textures from device memory.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsTextureVideoMemory { get; }
Property Value
true if the device can retrieve textures from device memory; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DeviceCaps Structure
GraphicsDeviceCapabilities.DeviceCaps Members
DeviceCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceCaps.SupportsTransformedVertexSystemMemory
Property
Gets a value indicating whether the device can use buffers from system memory for transformed and lit vertices.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsTransformedVertexSystemMemory { get; }
Property Value
true if the device can use buffers from system memory for transformed and lit vertices; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DeviceCaps Structure
GraphicsDeviceCapabilities.DeviceCaps Members
DeviceCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceCaps.SupportsTransformedVertexVideoMemory
Property
Gets a value indicating whether the device can use buffers from video memory for transformed and lit vertices.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsTransformedVertexVideoMemory { get; }
Property Value
true if the device can use buffers from video memory for transformed and lit vertices; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DeviceCaps Structure
GraphicsDeviceCapabilities.DeviceCaps Members
DeviceCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DeviceCaps.VertexElementScanSharesStreamOffset
Property
Gets a value indicating whether the device allows multiple vertex elements to share the same offset in a stream.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool VertexElementScanSharesStreamOffset { get; }
Property Value
true if the device allows multiple vertex elements to share the same offset in a stream; false otherwise.
Remarks
Multiple vertex elements can share the same offset in a stream if VertexElementScanSharesStreamOffset is true and the vertex declaration does not have
an element with VertexElementUsage.PositionTransformed.
See Also
Reference
GraphicsDeviceCapabilities.DeviceCaps Structure
GraphicsDeviceCapabilities.DeviceCaps Members
DeviceCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DriverCaps Structure
Represents driver-specific capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct GraphicsDeviceCapabilities.DriverCaps
See Also
Reference
GraphicsDeviceCapabilities.DriverCaps Members
DriverCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DriverCaps Members
The following tables list the members exposed by the GraphicsDeviceCapabilities.DriverCaps type.
Public Properties
Name Description
CanAutoGenerateMipMap Gets a value indicating whether the driver is capable of automatically generating mi
pmaps.
CanCalibrateGamma Gets a value indicating whether the system has a calibrator installed that can autom
atically adjust the gamma ramp.
CanManageResource Gets a value indicating whether the driver is capable of managing resources.
ReadScanLine Gets a value indicating whether the display hardware is capable of returning the cur
rent scan line.
SupportsAlphaFullScreenFlipOrDiscard Gets a value indicating whether the device can respect the AlphaBlendEnable render
state in full-screen mode while using the FLIP or DISCARD swap effect.
SupportsCopyToSystemMemory Gets a value indicating whether the device can accelerate a memory copy from local
video memory to system memory.
SupportsCopyToVideoMemory Gets a value indicating whether the device can accelerate a memory copy from syst
em memory to local video memory.
SupportsDynamicTextures Gets a value indicating whether the driver supports dynamic textures.
SupportsFullScreenGamma Gets a value indicating whether the driver supports dynamic gamma ramp adjustm
ent in full-screen mode.
SupportsLinearToSrgbPresentation Gets a value indicating whether the device can perform gamma correction from a w
indowed back buffer (containing linear content) to an sRGB desktop.
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.DriverCaps instances are equal.
GetHashCode gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.DriverCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.DriverCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.DriverCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DriverCaps Methods
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.DriverCaps instances are equal.
GetHashCode gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.DriverCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.DriverCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.DriverCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DriverCaps.Equals Method
Determines whether two GraphicsDeviceCapabilities.DriverCaps instances are equal.
Overload List
Name Description
GraphicsDeviceCapabilities.DriverCaps.Equals (Object) Determines whether two GraphicsDeviceCapabilities.DriverCaps
instances are equal.
GraphicsDeviceCapabilities.DriverCaps.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.DriverCaps Structure
GraphicsDeviceCapabilities.DriverCaps Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
obj
The GraphicsDeviceCapabilities.DriverCaps object to compare this instance to.
Return Value
true if the instances are equal; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DriverCaps Structure
GraphicsDeviceCapabilities.DriverCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DriverCaps.GetHashCode Method
gets the hash code for this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
The hash code for this object.
See Also
Reference
GraphicsDeviceCapabilities.DriverCaps Structure
GraphicsDeviceCapabilities.DriverCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DriverCaps.op_Equality Method
Determines whether two GraphicsDeviceCapabilities.DriverCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
DriverCaps left,
DriverCaps right
)
Parameters
left
GraphicsDeviceCapabilities.DriverCaps on the left side of the equal sign.
right
GraphicsDeviceCapabilities.DriverCaps on the left side of the equal sign.
Return Value
true if left is equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DriverCaps Structure
GraphicsDeviceCapabilities.DriverCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DriverCaps.op_Inequality Method
Determines whether two GraphicsDeviceCapabilities.DriverCaps instances are unequal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
DriverCaps left,
DriverCaps right
)
Parameters
left
GraphicsDeviceCapabilities.DriverCaps on the left side of the inequality operator.
right
GraphicsDeviceCapabilities.DriverCaps on the right side of the inequality operator.
Return Value
true if left is not equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DriverCaps Structure
GraphicsDeviceCapabilities.DriverCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DriverCaps.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
GraphicsDeviceCapabilities.DriverCaps Structure
GraphicsDeviceCapabilities.DriverCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DriverCaps Properties
Public Properties
Name Description
CanAutoGenerateMipMap Gets a value indicating whether the driver is capable of automatically generating mi
pmaps.
CanCalibrateGamma Gets a value indicating whether the system has a calibrator installed that can autom
atically adjust the gamma ramp.
CanManageResource Gets a value indicating whether the driver is capable of managing resources.
ReadScanLine Gets a value indicating whether the display hardware is capable of returning the cur
rent scan line.
SupportsAlphaFullScreenFlipOrDiscard Gets a value indicating whether the device can respect the AlphaBlendEnable render
state in full-screen mode while using the FLIP or DISCARD swap effect.
SupportsCopyToSystemMemory Gets a value indicating whether the device can accelerate a memory copy from local
video memory to system memory.
SupportsCopyToVideoMemory Gets a value indicating whether the device can accelerate a memory copy from syst
em memory to local video memory.
SupportsDynamicTextures Gets a value indicating whether the driver supports dynamic textures.
SupportsFullScreenGamma Gets a value indicating whether the driver supports dynamic gamma ramp adjustm
ent in full-screen mode.
SupportsLinearToSrgbPresentation Gets a value indicating whether the device can perform gamma correction from a w
indowed back buffer (containing linear content) to an sRGB desktop.
See Also
Reference
GraphicsDeviceCapabilities.DriverCaps Structure
DriverCapabilities
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DriverCaps.CanAutoGenerateMipMap
Property
Gets a value indicating whether the driver is capable of automatically generating mipmaps.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool CanAutoGenerateMipMap { get; }
Property Value
true if the driver is capable of automatically generating mipmaps; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DriverCaps Structure
GraphicsDeviceCapabilities.DriverCaps Members
DriverCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DriverCaps.CanCalibrateGamma
Property
Gets a value indicating whether the system has a calibrator installed that can automatically adjust the gamma ramp.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool CanCalibrateGamma { get; }
Property Value
true if the system has a calibrator installed that can automatically adjust the gamma ramp; false otherwise.
Remarks
To invoke the calibrator when setting new gamma levels, set calibrate to true when calling SetGammaRamp. Calibrating
gamma ramps incurs some processing overhead and should not be used frequently.
See Also
Reference
GraphicsDeviceCapabilities.DriverCaps Structure
GraphicsDeviceCapabilities.DriverCaps Members
DriverCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DriverCaps.CanManageResource
Property
Gets a value indicating whether the driver is capable of managing resources.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool CanManageResource { get; }
Property Value
true if the driver is capable of managing resources; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DriverCaps Structure
GraphicsDeviceCapabilities.DriverCaps Members
DriverCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DriverCaps.ReadScanLine Property
Gets a value indicating whether the display hardware is capable of returning the current scan line.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool ReadScanLine { get; }
Property Value
true if the driver display hardware is capable of returning the current scan line; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DriverCaps Structure
GraphicsDeviceCapabilities.DriverCaps Members
DriverCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DriverCaps.SupportsAlphaFullScreenFlipOrDiscard
Property
Gets a value indicating whether the device can respect the AlphaBlendEnable render state in full-screen mode while using the FLIP or DISCARD swap effect.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsAlphaFullScreenFlipOrDiscard { get; }
Property Value
true if the driver the device can respect the AlphaBlendEnable render state in full-screen mode while using the FLIP or DISCARD swap effect; false
otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DriverCaps Structure
GraphicsDeviceCapabilities.DriverCaps Members
DriverCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DriverCaps.SupportsCopyToSystemMemory
Property
Gets a value indicating whether the device can accelerate a memory copy from local video memory to system memory.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsCopyToSystemMemory { get; }
Property Value
true if the device can accelerate a memory copy from local video memory to system memory; false otherwise.
Remarks
This setting guarantees that GetRenderTarget calls will be hardware accelerated. If this setting is false, those calls will succeed but will be
slower.
See Also
Reference
GraphicsDeviceCapabilities.DriverCaps Structure
GraphicsDeviceCapabilities.DriverCaps Members
DriverCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DriverCaps.SupportsCopyToVideoMemory
Property
Gets a value indicating whether the device can accelerate a memory copy from system memory to local video memory.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsCopyToVideoMemory { get; }
Property Value
true if the device can accelerate a memory copy from system memory to local video memory; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DriverCaps Structure
GraphicsDeviceCapabilities.DriverCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DriverCaps.SupportsDynamicTextures
Property
Gets a value indicating whether the driver supports dynamic textures.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsDynamicTextures { get; }
Property Value
true if the driver supports dynamic textures; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DriverCaps Structure
GraphicsDeviceCapabilities.DriverCaps Members
DriverCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DriverCaps.SupportsFullScreenGamma
Property
Gets a value indicating whether the driver supports dynamic gamma ramp adjustment in full-screen mode.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsFullScreenGamma { get; }
Property Value
true if the driver supports dynamic gamma ramp adjustment in full-screen mode; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DriverCaps Structure
GraphicsDeviceCapabilities.DriverCaps Members
DriverCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.DriverCaps.SupportsLinearToSrgbPresentation
Property
Gets a value indicating whether the device can perform gamma correction from a windowed back buffer (containing linear content) to an sRGB
desktop.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsLinearToSrgbPresentation { get; }
Property Value
true if the device can perform gamma correction from a windowed back buffer to an sRGB desktop; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.DriverCaps Structure
GraphicsDeviceCapabilities.DriverCaps Members
DriverCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.FilterCaps Structure
Represents texture filter capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct GraphicsDeviceCapabilities.FilterCaps
See Also
Reference
GraphicsDeviceCapabilities.FilterCaps Members
CubeTextureFilterCapabilities
TextureFilterCapabilities
VertexTextureFilterCapabilities
VolumeTextureFilterCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.FilterCaps Members
The following tables list the members exposed by the GraphicsDeviceCapabilities.FilterCaps type.
Public Properties
Name Description
SupportsMagnifyAnisotropic Gets a value that indicates that the device supports per-stage anisotropic filtering for mag
nifying textures.
SupportsMagnifyGaussianQuad Gets a value indicating whether the device supports per-stage Gaussian quad filtering for
magnifying textures.
SupportsMagnifyLinear Gets a value that indicates that the device supports per-stage bilinear interpolation filterin
g for magnifying textures.
SupportsMagnifyPoint Gets a value that indicates that the device supports per-stage point-sample filtering for m
agnifying textures.
SupportsMagnifyPyramidalQuad Gets a value that indicates that the device supports per-stage pyramidal sample filtering f
or magnifying textures.
SupportsMinifyAnisotropic Gets a value that indicates that the device supports per-stage anisotropic filtering for mini
fying textures.
SupportsMinifyGaussianQuad Gets a value indicating whether the device supports per-stage Gaussian quad filtering for
minifying textures.
SupportsMinifyLinear Gets a value that indicates that the device supports per-stage bilinear interpolation filterin
g for minifying textures.
SupportsMinifyPoint Gets a value that indicates whether the device supports per-stage point-sample filtering fo
r minifying textures.
SupportsMinifyPyramidalQuad Gets a value that indicates that the device supports per-stage pyramidal sample filtering f
or minifying textures.
SupportsMipMapLinear Gets a value that indicates that the device supports per-stage trilinear interpolation filterin
g for mipmaps.
SupportsMipMapPoint Gets a value that indicates that the device supports per-stage point-sample filtering for mi
pmaps.
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.FilterCaps instances are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.FilterCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.FilterCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.FilterCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.FilterCaps Methods
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.FilterCaps instances are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.FilterCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.FilterCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.FilterCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.FilterCaps.Equals Method
Determines whether two GraphicsDeviceCapabilities.FilterCaps instances are equal.
Overload List
Name Description
GraphicsDeviceCapabilities.FilterCaps.Equals (Object) Determines whether two GraphicsDeviceCapabilities.FilterCaps in
stances are equal.
GraphicsDeviceCapabilities.FilterCaps.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.FilterCaps Structure
GraphicsDeviceCapabilities.FilterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
obj
The GraphicsDeviceCapabilities.FilterCaps to compare this instance to.
Return Value
true if the instances are equal; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.FilterCaps Structure
GraphicsDeviceCapabilities.FilterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.FilterCaps.GetHashCode Method
Gets the hash code for this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
The hash code for this object.
See Also
Reference
GraphicsDeviceCapabilities.FilterCaps Structure
GraphicsDeviceCapabilities.FilterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.FilterCaps.op_Equality Method
Determines whether two GraphicsDeviceCapabilities.FilterCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
FilterCaps left,
FilterCaps right
)
Parameters
left
GraphicsDeviceCapabilities.FilterCaps on the left side of the equal sign.
right
GraphicsDeviceCapabilities.FilterCaps on the right side of the equal sign.
Return Value
true if left is equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.FilterCaps Structure
GraphicsDeviceCapabilities.FilterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.FilterCaps.op_Inequality Method
Determines whether two GraphicsDeviceCapabilities.FilterCaps instances are unequal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
FilterCaps left,
FilterCaps right
)
Parameters
left
GraphicsDeviceCapabilities.FilterCaps on the left side of the inequality operator.
right
GraphicsDeviceCapabilities.FilterCaps on the right side of the inequality operator.
Return Value
true if left is not equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.FilterCaps Structure
GraphicsDeviceCapabilities.FilterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.FilterCaps.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
GraphicsDeviceCapabilities.FilterCaps Structure
GraphicsDeviceCapabilities.FilterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.FilterCaps Properties
Public Properties
Name Description
SupportsMagnifyAnisotropic Gets a value that indicates that the device supports per-stage anisotropic filtering for mag
nifying textures.
SupportsMagnifyGaussianQuad Gets a value indicating whether the device supports per-stage Gaussian quad filtering for
magnifying textures.
SupportsMagnifyLinear Gets a value that indicates that the device supports per-stage bilinear interpolation filterin
g for magnifying textures.
SupportsMagnifyPoint Gets a value that indicates that the device supports per-stage point-sample filtering for m
agnifying textures.
SupportsMagnifyPyramidalQuad Gets a value that indicates that the device supports per-stage pyramidal sample filtering f
or magnifying textures.
SupportsMinifyAnisotropic Gets a value that indicates that the device supports per-stage anisotropic filtering for mini
fying textures.
SupportsMinifyGaussianQuad Gets a value indicating whether the device supports per-stage Gaussian quad filtering for
minifying textures.
SupportsMinifyLinear Gets a value that indicates that the device supports per-stage bilinear interpolation filterin
g for minifying textures.
SupportsMinifyPoint Gets a value that indicates whether the device supports per-stage point-sample filtering fo
r minifying textures.
SupportsMinifyPyramidalQuad Gets a value that indicates that the device supports per-stage pyramidal sample filtering f
or minifying textures.
SupportsMipMapLinear Gets a value that indicates that the device supports per-stage trilinear interpolation filterin
g for mipmaps.
SupportsMipMapPoint Gets a value that indicates that the device supports per-stage point-sample filtering for mi
pmaps.
See Also
Reference
GraphicsDeviceCapabilities.FilterCaps Structure
CubeTextureFilterCapabilities
TextureFilterCapabilities
VertexTextureFilterCapabilities
VolumeTextureFilterCapabilities
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.FilterCaps.SupportsMagnifyAnisotropic
Property
Gets a value that indicates that the device supports per-stage anisotropic filtering for magnifying textures.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsMagnifyAnisotropic { get; }
Property Value
true if the device supports per-stage anisotropic filtering for magnifying textures; false otherwise.
Remarks
Anisotropic filters compensate for distortion caused by the difference in angle between the texture polygon and the plane of the
screen.
The anisotropic magnification filter is represented by the TextureFilter.Anisotropic enumerated value.
See Also
Reference
GraphicsDeviceCapabilities.FilterCaps Structure
GraphicsDeviceCapabilities.FilterCaps Members
CubeTextureFilterCapabilities
TextureFilterCapabilities
VertexTextureFilterCapabilities
VolumeTextureFilterCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.FilterCaps.SupportsMagnifyGaussianQuad
Property
Gets a value indicating whether the device supports per-stage Gaussian quad filtering for magnifying textures.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsMagnifyGaussianQuad { get; }
Property Value
true if the device supports per-stage Gaussian quad filtering for magnifying textures; false otherwise.
Remarks
The Gaussian quad filter is represented by the TextureFilter.GaussianQuad enumerated value.
See Also
Reference
GraphicsDeviceCapabilities.FilterCaps Structure
GraphicsDeviceCapabilities.FilterCaps Members
CubeTextureFilterCapabilities
TextureFilterCapabilities
VertexTextureFilterCapabilities
VolumeTextureFilterCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.FilterCaps.SupportsMagnifyLinear
Property
Gets a value that indicates that the device supports per-stage bilinear interpolation filtering for magnifying textures.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsMagnifyLinear { get; }
Property Value
true if the device supports per-stage bilinear interpolation filtering for magnifying textures; false otherwise.
Remarks
The bilinear interpolation mipmapping filter is represented by the TextureFilter.Linear enumerated value.
See Also
Reference
GraphicsDeviceCapabilities.FilterCaps Structure
GraphicsDeviceCapabilities.FilterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.FilterCaps.SupportsMagnifyPoint
Property
Gets a value that indicates that the device supports per-stage point-sample filtering for magnifying textures.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsMagnifyPoint { get; }
Property Value
true if the device supports per-stage point-sample filtering for magnifying textures; false otherwise.
Remarks
The point-sample magnification filter is represented by the TextureFilter.Point enumerated value.
See Also
Reference
GraphicsDeviceCapabilities.FilterCaps Structure
GraphicsDeviceCapabilities.FilterCaps Members
CubeTextureFilterCapabilities
TextureFilterCapabilities
VertexTextureFilterCapabilities
VolumeTextureFilterCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.FilterCaps.SupportsMagnifyPyramidalQuad
Property
Gets a value that indicates that the device supports per-stage pyramidal sample filtering for magnifying textures.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsMagnifyPyramidalQuad { get; }
Property Value
true if the device supports per-stage pyramidal sample filtering for magnifying textures; false otherwise.
Remarks
The pyramidal sample filter is represented by the TextureFilter.PyramidalQuad enumerated value.
See Also
Reference
GraphicsDeviceCapabilities.FilterCaps Structure
GraphicsDeviceCapabilities.FilterCaps Members
CubeTextureFilterCapabilities
TextureFilterCapabilities
VertexTextureFilterCapabilities
VolumeTextureFilterCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.FilterCaps.SupportsMinifyAnisotropic
Property
Gets a value that indicates that the device supports per-stage anisotropic filtering for minifying textures.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsMinifyAnisotropic { get; }
Property Value
true if the device supports per-stage anisotropic filtering for minifying textures; false otherwise.
Remarks
The anisotropic minification filter is represented by the TextureFilter.Anisotropic enumerated value.
See Also
Reference
GraphicsDeviceCapabilities.FilterCaps Structure
GraphicsDeviceCapabilities.FilterCaps Members
CubeTextureFilterCapabilities
TextureFilterCapabilities
VertexTextureFilterCapabilities
VolumeTextureFilterCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.FilterCaps.SupportsMinifyGaussianQuad
Property
Gets a value indicating whether the device supports per-stage Gaussian quad filtering for minifying textures.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsMinifyGaussianQuad { get; }
Property Value
true if the device supports per-stage Gaussian quad filtering for magnifying textures; false otherwise.
Remarks
The Gaussian quad filter is represented by the TextureFilter.GaussianQuad enumerated value.
See Also
Reference
GraphicsDeviceCapabilities.FilterCaps Structure
GraphicsDeviceCapabilities.FilterCaps Members
CubeTextureFilterCapabilities
TextureFilterCapabilities
VertexTextureFilterCapabilities
VolumeTextureFilterCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.FilterCaps.SupportsMinifyLinear
Property
Gets a value that indicates that the device supports per-stage bilinear interpolation filtering for minifying textures.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsMinifyLinear { get; }
Property Value
true if the device supports per-stage bilinear interpolation filtering for minifying textures; false otherwise.
Remarks
The linear minification filter is represented by the TextureFilter.Linear enumerated value.
See Also
Reference
GraphicsDeviceCapabilities.FilterCaps Structure
GraphicsDeviceCapabilities.FilterCaps Members
CubeTextureFilterCapabilities
TextureFilterCapabilities
VertexTextureFilterCapabilities
VolumeTextureFilterCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.FilterCaps.SupportsMinifyPoint
Property
Gets a value that indicates whether the device supports per-stage point-sample filtering for minifying textures.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsMinifyPoint { get; }
Property Value
true if the device supports per-stage point-sample filtering for minifying textures; false otherwise.
Remarks
The point-sample minification filter is represented by the TextureFilter.Point enumerated value.
See Also
Reference
GraphicsDeviceCapabilities.FilterCaps Structure
GraphicsDeviceCapabilities.FilterCaps Members
CubeTextureFilterCapabilities
TextureFilterCapabilities
VertexTextureFilterCapabilities
VolumeTextureFilterCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.FilterCaps.SupportsMinifyPyramidalQuad
Property
Gets a value that indicates that the device supports per-stage pyramidal sample filtering for minifying textures.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsMinifyPyramidalQuad { get; }
Property Value
true if the device supports per-stage pyramidal sample filtering for minifying textures; false otherwise.
Remarks
The pyramidal sample filter is represented by the TextureFilter.PyramidalQuad enumerated value.
See Also
Reference
GraphicsDeviceCapabilities.FilterCaps Structure
GraphicsDeviceCapabilities.FilterCaps Members
CubeTextureFilterCapabilities
TextureFilterCapabilities
VertexTextureFilterCapabilities
VolumeTextureFilterCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.FilterCaps.SupportsMipMapLinear
Property
Gets a value that indicates that the device supports per-stage trilinear interpolation filtering for mipmaps.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsMipMapLinear { get; }
Property Value
true if the device supports per-stage trilinear interpolation filtering for mipmaps; false otherwise.
Remarks
The bilinear interpolation mipmapping filter is represented by the TextureFilter.Linear enumerated value.
See Also
Reference
GraphicsDeviceCapabilities.FilterCaps Structure
GraphicsDeviceCapabilities.FilterCaps Members
CubeTextureFilterCapabilities
TextureFilterCapabilities
VertexTextureFilterCapabilities
VolumeTextureFilterCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.FilterCaps.SupportsMipMapPoint
Property
Gets a value that indicates that the device supports per-stage point-sample filtering for mipmaps.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsMipMapPoint { get; }
Property Value
true if the device supports per-stage point-sample filtering for mipmaps; false otherwise.
Remarks
The point-sample mipmapping filter is represented by the TextureFilter.Point enumerated value.
See Also
Reference
GraphicsDeviceCapabilities.FilterCaps Structure
GraphicsDeviceCapabilities.FilterCaps Members
CubeTextureFilterCapabilities
TextureFilterCapabilities
VertexTextureFilterCapabilities
VolumeTextureFilterCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.LineCaps Structure
Represents the capabilities for line-drawing primitives.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct GraphicsDeviceCapabilities.LineCaps
See Also
Reference
GraphicsDeviceCapabilities.LineCaps Members
LineCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.LineCaps Members
The following tables list the members exposed by the GraphicsDeviceCapabilities.LineCaps type.
Public Properties
Name Description
SupportsAlphaCompare Gets a value indicating whether the device supports alpha-test comparisons.
SupportsAntiAlias Gets a value indicating whether the device supports antialiased lines.
SupportsBlend Gets a value indicating whether the device supports source blending.
SupportsDepthBufferTest Gets a value indicating whether the device supports depth buffer comparisons.
SupportsFog Gets a value indicating whether the device supports fog.
SupportsTextureMapping Gets a value indicating whether the device supports texture mapping.
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.LineCaps instances are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.LineCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.LineCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.LineCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.LineCaps Methods
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.LineCaps instances are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.LineCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.LineCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.LineCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.LineCaps.Equals Method
Determines whether two GraphicsDeviceCapabilities.LineCaps instances are equal.
Overload List
Name Description
GraphicsDeviceCapabilities.LineCaps.Equals (Object) Determines whether two GraphicsDeviceCapabilities.LineCaps inst
ances are equal.
GraphicsDeviceCapabilities.LineCaps.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.LineCaps Structure
GraphicsDeviceCapabilities.LineCaps Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
obj
The GraphicsDeviceCapabilities.LineCaps object to compare this instance to.
Return Value
true if the instances are equal; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.LineCaps Structure
GraphicsDeviceCapabilities.LineCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.LineCaps.GetHashCode Method
Gets the hash code for this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
The hash code for this object.
See Also
Reference
GraphicsDeviceCapabilities.LineCaps Structure
GraphicsDeviceCapabilities.LineCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.LineCaps.op_Equality Method
Determines whether two GraphicsDeviceCapabilities.LineCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
LineCaps left,
LineCaps right
)
Parameters
left
GraphicsDeviceCapabilities.LineCaps on the left side of the equal sign.
right
GraphicsDeviceCapabilities.LineCaps on the right side of the equal sign.
Return Value
true if left is equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.LineCaps Structure
GraphicsDeviceCapabilities.LineCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.LineCaps.op_Inequality Method
Determines whether two GraphicsDeviceCapabilities.LineCaps instances are unequal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
LineCaps left,
LineCaps right
)
Parameters
left
GraphicsDeviceCapabilities.LineCaps on the left side of the inequality operator.
right
GraphicsDeviceCapabilities.LineCaps on the right side of the inequality operator.
Return Value
true if left is not equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.LineCaps Structure
GraphicsDeviceCapabilities.LineCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.LineCaps.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
GraphicsDeviceCapabilities.LineCaps Structure
GraphicsDeviceCapabilities.LineCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.LineCaps Properties
Public Properties
Name Description
SupportsAlphaCompare Gets a value indicating whether the device supports alpha-test comparisons.
SupportsAntiAlias Gets a value indicating whether the device supports antialiased lines.
SupportsBlend Gets a value indicating whether the device supports source blending.
SupportsDepthBufferTest Gets a value indicating whether the device supports depth buffer comparisons.
SupportsFog Gets a value indicating whether the device supports fog.
SupportsTextureMapping Gets a value indicating whether the device supports texture mapping.
See Also
Reference
GraphicsDeviceCapabilities.LineCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.LineCaps.SupportsAlphaCompare
Property
Gets a value indicating whether the device supports alpha-test comparisons.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsAlphaCompare { get; }
Property Value
true if the device supports alpha-test comparisons; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.LineCaps Structure
GraphicsDeviceCapabilities.LineCaps Members
LineCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.LineCaps.SupportsAntiAlias
Property
Gets a value indicating whether the device supports antialiased lines.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsAntiAlias { get; }
Property Value
true if the device supports antialiased lines; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.LineCaps Structure
GraphicsDeviceCapabilities.LineCaps Members
LineCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.LineCaps.SupportsBlend Property
Gets a value indicating whether the device supports source blending.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsBlend { get; }
Property Value
true if the device supports source blending; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.LineCaps Structure
GraphicsDeviceCapabilities.LineCaps Members
LineCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.LineCaps.SupportsDepthBufferTest
Property
Gets a value indicating whether the device supports depth buffer comparisons.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsDepthBufferTest { get; }
Property Value
true if the device supports depth buffer comparisons; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.LineCaps Structure
GraphicsDeviceCapabilities.LineCaps Members
LineCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.LineCaps.SupportsFog Property
Gets a value indicating whether the device supports fog.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsFog { get; }
Property Value
true if the device supports fog; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.LineCaps Structure
GraphicsDeviceCapabilities.LineCaps Members
LineCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.LineCaps.SupportsTextureMapping
Property
Gets a value indicating whether the device supports texture mapping.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsTextureMapping { get; }
Property Value
true if the device supports texture mapping; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.LineCaps Structure
GraphicsDeviceCapabilities.LineCaps Members
LineCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps Structure
Represents pixel shader capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct GraphicsDeviceCapabilities.PixelShaderCaps
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Members
PixelShaderCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps Members
The following tables list the members exposed by the GraphicsDeviceCapabilities.PixelShaderCaps type.
Public Fields
Name Description
MaxDynamicFlowControlDepth Specifies the maximum level of nesting of dynamic flow control instructions (break - vs, bre
ak_comp - vs, breakp - vs, if_comp - vs, if_comp - vs, if pred - vs).
MaxNumberInstructionSlots Specifies the maximum number of instruction slots supported.
MaxNumberTemps Specifies the maximum number of temporary registers supported.
MaxStaticFlowControlDepth Specifies the depth of nesting of the loop - vs/rep - vs and call - vs/callnz bool - vs instructi
ons
MinDynamicFlowControlDepth Specifies the minimum level of nesting of dynamic flow control instructions (break - vs, bre
ak_comp - vs, breakp - vs, if_comp - vs, if_comp - vs, if pred - vs).
MinNumberInstructionSlots Specifies the minimum number of instruction slots supported.
MinNumberTemps Specifies the minimum number of temporary registers supported.
MinStaticFlowControlDepth Specifies the minimum depth of nesting of the loop - vs/rep - vs and call - vs/callnz bool - v
s instructions.
Public Properties
Name Description
DynamicFlowControlDepth Gets a value specifying the dynamic flow control depth.
NumberInstructionSlots Gets a value specifying the number of instruction slots supported.
NumberTemps Gets a value specifying the number of temporary registers supported.
StaticFlowControlDepth Gets a value specifying the depth of nesting of the loop - vs/rep - vs and call - vs/callnz
bool - vs instructions.
SupportsArbitrarySwizzle Gets a value indicating whether arbitrary swizzling is supported.
SupportsGradientInstructions Gets a value indicating whether gradient instructions are supported.
SupportsNoDependentReadLimit Gets a value indicating whether there is a limit on the number of dependent reads per i
nstruction.
SupportsNoTextureInstructionLimit Gets a value indicating whether there is a limit on the number of texture instructions.
SupportsPredication Gets a value indicating whether instruction predication is supported.
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.PixelShaderCaps instances are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.PixelShaderCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.PixelShaderCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps Fields
Public Fields
Name Description
MaxDynamicFlowControlDepth Specifies the maximum level of nesting of dynamic flow control instructions (break - vs, bre
ak_comp - vs, breakp - vs, if_comp - vs, if_comp - vs, if pred - vs).
MaxNumberInstructionSlots Specifies the maximum number of instruction slots supported.
MaxNumberTemps Specifies the maximum number of temporary registers supported.
MaxStaticFlowControlDepth Specifies the depth of nesting of the loop - vs/rep - vs and call - vs/callnz bool - vs instructi
ons
MinDynamicFlowControlDepth Specifies the minimum level of nesting of dynamic flow control instructions (break - vs, bre
ak_comp - vs, breakp - vs, if_comp - vs, if_comp - vs, if pred - vs).
MinNumberInstructionSlots Specifies the minimum number of instruction slots supported.
MinNumberTemps Specifies the minimum number of temporary registers supported.
MinStaticFlowControlDepth Specifies the minimum depth of nesting of the loop - vs/rep - vs and call - vs/callnz bool - v
s instructions.
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Structure
PixelShaderCapabilities
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps.MaxDynamicFlowControlDepth
Field
Specifies the maximum level of nesting of dynamic flow control instructions (break - vs, break_comp - vs, breakp - vs, if_comp - vs, if_comp - vs, if
pred - vs).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public const int MaxDynamicFlowControlDepth
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Structure
GraphicsDeviceCapabilities.PixelShaderCaps Members
PixelShaderCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps.MaxNumberInstructionSlots
Field
Specifies the maximum number of instruction slots supported.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public const int MaxNumberInstructionSlots
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Structure
GraphicsDeviceCapabilities.PixelShaderCaps Members
PixelShaderCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps.MaxNumberTemps
Field
Specifies the maximum number of temporary registers supported.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public const int MaxNumberTemps
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Structure
GraphicsDeviceCapabilities.PixelShaderCaps Members
PixelShaderCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps.MaxStaticFlowControlDepth
Field
Specifies the depth of nesting of the loop - vs/rep - vs and call - vs/callnz bool - vs instructions
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public const int MaxStaticFlowControlDepth
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Structure
GraphicsDeviceCapabilities.PixelShaderCaps Members
PixelShaderCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps.MinDynamicFlowControlDepth
Field
Specifies the minimum level of nesting of dynamic flow control instructions (break - vs, break_comp - vs, breakp - vs, if_comp - vs, if_comp - vs, if
pred - vs).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public const int MinDynamicFlowControlDepth
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Structure
GraphicsDeviceCapabilities.PixelShaderCaps Members
PixelShaderCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps.MinNumberInstructionSlots
Field
Specifies the minimum number of instruction slots supported.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public const int MinNumberInstructionSlots
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Structure
GraphicsDeviceCapabilities.PixelShaderCaps Members
PixelShaderCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps.MinNumberTemps
Field
Specifies the minimum number of temporary registers supported.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public const int MinNumberTemps
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Structure
GraphicsDeviceCapabilities.PixelShaderCaps Members
PixelShaderCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps.MinStaticFlowControlDepth
Field
Specifies the minimum depth of nesting of the loop - vs/rep - vs and call - vs/callnz bool - vs instructions.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public const int MinStaticFlowControlDepth
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Structure
GraphicsDeviceCapabilities.PixelShaderCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps Methods
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.PixelShaderCaps instances are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.PixelShaderCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.PixelShaderCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps.Equals Method
Determines whether two GraphicsDeviceCapabilities.PixelShaderCaps instances are equal.
Overload List
Name Description
GraphicsDeviceCapabilities.PixelShaderCaps.Equals (Object) Determines whether two
GraphicsDeviceCapabilities.PixelShaderCaps instances are
equal.
GraphicsDeviceCapabilities.PixelShaderCaps.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Structure
GraphicsDeviceCapabilities.PixelShaderCaps Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps.Equals Method
(Object)
Determines whether two GraphicsDeviceCapabilities.PixelShaderCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override bool Equals (
Object obj
)
Parameters
obj
The GraphicsDeviceCapabilities.PixelShaderCaps object to compare this instance to.
Return Value
true if the instances are equal; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Structure
GraphicsDeviceCapabilities.PixelShaderCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps.GetHashCode
Method
Gets the hash code for this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
The hash code for this object.
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Structure
GraphicsDeviceCapabilities.PixelShaderCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps.op_Equality
Method
Determines whether two GraphicsDeviceCapabilities.PixelShaderCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
PixelShaderCaps left,
PixelShaderCaps right
)
Parameters
left
GraphicsDeviceCapabilities.PixelShaderCaps on the left side of the equal sign.
right
GraphicsDeviceCapabilities.PixelShaderCaps on the right side of the equal sign.
Return Value
true if left is equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Structure
GraphicsDeviceCapabilities.PixelShaderCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps.op_Inequality
Method
Determines whether two GraphicsDeviceCapabilities.PixelShaderCaps instances are unequal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
PixelShaderCaps left,
PixelShaderCaps right
)
Parameters
left
GraphicsDeviceCapabilities.PixelShaderCaps on the left side of the inequality operator.
right
GraphicsDeviceCapabilities.PixelShaderCaps on the right side of the inequality operator.
Return Value
true if left is not equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Structure
GraphicsDeviceCapabilities.PixelShaderCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Structure
GraphicsDeviceCapabilities.PixelShaderCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps Properties
Public Properties
Name Description
DynamicFlowControlDepth Gets a value specifying the dynamic flow control depth.
NumberInstructionSlots Gets a value specifying the number of instruction slots supported.
NumberTemps Gets a value specifying the number of temporary registers supported.
StaticFlowControlDepth Gets a value specifying the depth of nesting of the loop - vs/rep - vs and call - vs/callnz
bool - vs instructions.
SupportsArbitrarySwizzle Gets a value indicating whether arbitrary swizzling is supported.
SupportsGradientInstructions Gets a value indicating whether gradient instructions are supported.
SupportsNoDependentReadLimit Gets a value indicating whether there is a limit on the number of dependent reads per i
nstruction.
SupportsNoTextureInstructionLimit Gets a value indicating whether there is a limit on the number of texture instructions.
SupportsPredication Gets a value indicating whether instruction predication is supported.
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Structure
PixelShaderCapabilities
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps.DynamicFlowControlDepth
Property
Gets a value specifying the dynamic flow control depth.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int DynamicFlowControlDepth { get; }
Property Value
The dynamic flow control depth. Must be 0 or 24.
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Structure
GraphicsDeviceCapabilities.PixelShaderCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps.NumberInstructionSlots
Property
Gets a value specifying the number of instruction slots supported.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int NumberInstructionSlots { get; }
Property Value
The number of instruction slots supported.
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Structure
GraphicsDeviceCapabilities.PixelShaderCaps Members
PixelShaderCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps.NumberTemps
Property
Gets a value specifying the number of temporary registers supported.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int NumberTemps { get; }
Property Value
The number of temporary registers supported.
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Structure
GraphicsDeviceCapabilities.PixelShaderCaps Members
PixelShaderCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps.StaticFlowControlDepth
Property
Gets a value specifying the depth of nesting of the loop - vs/rep - vs and call - vs/callnz bool - vs instructions.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int StaticFlowControlDepth { get; }
Property Value
The static flow control depth.
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Structure
GraphicsDeviceCapabilities.PixelShaderCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps.SupportsArbitrarySwizzle
Property
Gets a value indicating whether arbitrary swizzling is supported.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsArbitrarySwizzle { get; }
Property Value
true if arbitrary swizzling is supported; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Structure
GraphicsDeviceCapabilities.PixelShaderCaps Members
PixelShaderCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps.SupportsGradientInstructions
Property
Gets a value indicating whether gradient instructions are supported.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsGradientInstructions { get; }
Property Value
true if gradient instructions are supported; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Structure
GraphicsDeviceCapabilities.PixelShaderCaps Members
PixelShaderCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps.SupportsNoDependentReadLimit
Property
Gets a value indicating whether there is a limit on the number of dependent reads per instruction.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsNoDependentReadLimit { get; }
Property Value
true if there is no dependent read limit; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Structure
GraphicsDeviceCapabilities.PixelShaderCaps Members
PixelShaderCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps.SupportsNoTextureInstructionLimit
Property
Gets a value indicating whether there is a limit on the number of texture instructions.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsNoTextureInstructionLimit { get; }
Property Value
true if there is no limit on the number of texture instructions; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Structure
GraphicsDeviceCapabilities.PixelShaderCaps Members
PixelShaderCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PixelShaderCaps.SupportsPredication
Property
Gets a value indicating whether instruction predication is supported.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsPredication { get; }
Property Value
true if instruction predication is supported; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.PixelShaderCaps Structure
GraphicsDeviceCapabilities.PixelShaderCaps Members
PixelShaderCapabilities
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PrimitiveCaps Structure
Represents driver primitive capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct GraphicsDeviceCapabilities.PrimitiveCaps
See Also
Reference
GraphicsDeviceCapabilities.PrimitiveCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PrimitiveCaps Members
The following tables list the members exposed by the GraphicsDeviceCapabilities.PrimitiveCaps type.
Public Properties
Name Description
HasFogVertexClamped Gets a value indicating whether the device clamps fog blend facto
r per vertex.
IsNullReference Gets a value indicating whether the device is a null reference devic
e that does not render.
SupportsBlendOperation Gets a value indicating whether the device supports blending oper
ations other than BlendFunction.Add.
SupportsClipTransformedVertices Gets a value indicating whether the device clips post-transformed
vertex primitives.
SupportsColorWrite Gets a value indicating whether the device supports per-channel
writes for the render-target color buffer through the
ColorWriteChannels state.
SupportsCullClockwiseFace Gets a value indicating whether the driver supports clockwise tria
ngle culling through the CullMode state.
SupportsCullCounterClockwiseFace Gets a value indicating whether the driver supports counterclockw
ise triangle culling through the CullMode state.
SupportsCullNone Gets a value indicating whether the driver does not perform trian
gle culling.
SupportsFogAndSpecularAlpha Gets a value indicating whether the driver supports separate fog a
nd specular alpha.
SupportsIndependentWriteMasks Gets a value indicating whether the device supports independent
write masks for multiple element textures or multiple render targe
ts.
SupportsMaskZ Gets a value indicating whether the device can enable and disable
modification of the depth buffer on pixel operations.
SupportsMultipleRenderTargetsIndependentBitDepths Gets a value indicating whether the device supports different bit d
epths for multiple render targets.
SupportsMultipleRenderTargetsPostPixelShaderBlending Gets a value indicating whether the device supports post-pixel sha
der operations for multiple render targets.
SupportsSeparateAlphaBlend Gets a value indicating whether the device supports separate blen
d settings for the alpha channel.
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.PrimitiveCaps instances are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.PrimitiveCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.PrimitiveCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.PrimitiveCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PrimitiveCaps Methods
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.PrimitiveCaps instances are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.PrimitiveCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.PrimitiveCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.PrimitiveCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PrimitiveCaps.Equals Method
Determines whether two GraphicsDeviceCapabilities.PrimitiveCaps instances are equal.
Overload List
Name Description
GraphicsDeviceCapabilities.PrimitiveCaps.Equals (Object) Determines whether two
GraphicsDeviceCapabilities.PrimitiveCaps instances are equal
.
GraphicsDeviceCapabilities.PrimitiveCaps.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.PrimitiveCaps Structure
GraphicsDeviceCapabilities.PrimitiveCaps Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PrimitiveCaps.Equals Method
(Object)
Determines whether two GraphicsDeviceCapabilities.PrimitiveCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override bool Equals (
Object obj
)
Parameters
obj
The GraphicsDeviceCapabilities.PrimitiveCaps object to compare this instance to.
Return Value
true if the instances are equal; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.PrimitiveCaps Structure
GraphicsDeviceCapabilities.PrimitiveCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PrimitiveCaps.GetHashCode
Method
Gets the hash code for this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
The hash code for this object.
See Also
Reference
GraphicsDeviceCapabilities.PrimitiveCaps Structure
GraphicsDeviceCapabilities.PrimitiveCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PrimitiveCaps.op_Equality Method
Determines whether two GraphicsDeviceCapabilities.PrimitiveCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
PrimitiveCaps left,
PrimitiveCaps right
)
Parameters
left
GraphicsDeviceCapabilities.PrimitiveCaps on the left side of the equal sign.
right
GraphicsDeviceCapabilities.PrimitiveCaps on the right side of the equal sign.
Return Value
true if left is equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.PrimitiveCaps Structure
GraphicsDeviceCapabilities.PrimitiveCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PrimitiveCaps.op_Inequality
Method
Determines whether two GraphicsDeviceCapabilities.PrimitiveCaps instances are unequal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
PrimitiveCaps left,
PrimitiveCaps right
)
Parameters
left
GraphicsDeviceCapabilities.PrimitiveCaps on the left side of the inequality operator.
right
GraphicsDeviceCapabilities.PrimitiveCaps on the right side of the inequality operator.
Return Value
true if left is not equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.PrimitiveCaps Structure
GraphicsDeviceCapabilities.PrimitiveCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PrimitiveCaps.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
GraphicsDeviceCapabilities.PrimitiveCaps Structure
GraphicsDeviceCapabilities.PrimitiveCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PrimitiveCaps Properties
Public Properties
Name Description
HasFogVertexClamped Gets a value indicating whether the device clamps fog blend facto
r per vertex.
IsNullReference Gets a value indicating whether the device is a null reference devic
e that does not render.
SupportsBlendOperation Gets a value indicating whether the device supports blending oper
ations other than BlendFunction.Add.
SupportsClipTransformedVertices Gets a value indicating whether the device clips post-transformed
vertex primitives.
SupportsColorWrite Gets a value indicating whether the device supports per-channel
writes for the render-target color buffer through the
ColorWriteChannels state.
SupportsCullClockwiseFace Gets a value indicating whether the driver supports clockwise tria
ngle culling through the CullMode state.
SupportsCullCounterClockwiseFace Gets a value indicating whether the driver supports counterclockw
ise triangle culling through the CullMode state.
SupportsCullNone Gets a value indicating whether the driver does not perform trian
gle culling.
SupportsFogAndSpecularAlpha Gets a value indicating whether the driver supports separate fog a
nd specular alpha.
SupportsIndependentWriteMasks Gets a value indicating whether the device supports independent
write masks for multiple element textures or multiple render targe
ts.
SupportsMaskZ Gets a value indicating whether the device can enable and disable
modification of the depth buffer on pixel operations.
SupportsMultipleRenderTargetsIndependentBitDepths Gets a value indicating whether the device supports different bit d
epths for multiple render targets.
SupportsMultipleRenderTargetsPostPixelShaderBlending Gets a value indicating whether the device supports post-pixel sha
der operations for multiple render targets.
SupportsSeparateAlphaBlend Gets a value indicating whether the device supports separate blen
d settings for the alpha channel.
See Also
Reference
GraphicsDeviceCapabilities.PrimitiveCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PrimitiveCaps.HasFogVertexClamped
Property
Gets a value indicating whether the device clamps fog blend factor per vertex.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool HasFogVertexClamped { get; }
Property Value
true if the device clamps fog blend factor per vertex; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.PrimitiveCaps Structure
GraphicsDeviceCapabilities.PrimitiveCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PrimitiveCaps.IsNullReference
Property
Gets a value indicating whether the device is a null reference device that does not render.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsNullReference { get; }
Property Value
true if the device is a null reference device; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.PrimitiveCaps Structure
GraphicsDeviceCapabilities.PrimitiveCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PrimitiveCaps.SupportsBlendOperation
Property
Gets a value indicating whether the device supports blending operations other than BlendFunction.Add.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsBlendOperation { get; }
Property Value
true if the driver supports other blend operations; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.PrimitiveCaps Structure
GraphicsDeviceCapabilities.PrimitiveCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PrimitiveCaps.SupportsClipTransformedVertices
Property
Gets a value indicating whether the device clips post-transformed vertex primitives.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsClipTransformedVertices { get; }
Property Value
true if the device clips post-transformed vertex primitives; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.PrimitiveCaps Structure
GraphicsDeviceCapabilities.PrimitiveCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PrimitiveCaps.SupportsColorWrite
Property
Gets a value indicating whether the device supports per-channel writes for the render-target color buffer through the
ColorWriteChannels state.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsColorWrite { get; }
Property Value
true if the device supports per-channel writes; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.PrimitiveCaps Structure
GraphicsDeviceCapabilities.PrimitiveCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PrimitiveCaps.SupportsCullClockwiseFace
Property
Gets a value indicating whether the driver supports clockwise triangle culling through the CullMode state.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsCullClockwiseFace { get; }
Property Value
true if the driver supports clockwise triangle culling; false otherwise.
Remarks
This applies only to triangle primitives.
See Also
Reference
GraphicsDeviceCapabilities.PrimitiveCaps Structure
GraphicsDeviceCapabilities.PrimitiveCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PrimitiveCaps.SupportsCullCounterClockwiseFace
Property
Gets a value indicating whether the driver supports counterclockwise triangle culling through the CullMode state.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsCullCounterClockwiseFace { get; }
Property Value
true if the driver supports counterclockwise triangle culling; false otherwise.
Remarks
This applies only to triangle primitives.
See Also
Reference
GraphicsDeviceCapabilities.PrimitiveCaps Structure
GraphicsDeviceCapabilities.PrimitiveCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PrimitiveCaps.SupportsCullNone
Property
Gets a value indicating whether the driver does not perform triangle culling.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsCullNone { get; }
Property Value
true if the driver does not perform triangle culling; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.PrimitiveCaps Structure
GraphicsDeviceCapabilities.PrimitiveCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PrimitiveCaps.SupportsFogAndSpecularAlpha
Property
Gets a value indicating whether the driver supports separate fog and specular alpha.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsFogAndSpecularAlpha { get; }
Property Value
true if the driver supports separate fog and specular alpha; false otherwise.
Remarks
Many devices use the specular alpha channel to store the fog factor.
See Also
Reference
GraphicsDeviceCapabilities.PrimitiveCaps Structure
GraphicsDeviceCapabilities.PrimitiveCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PrimitiveCaps.SupportsIndependentWriteMasks
Property
Gets a value indicating whether the device supports independent write masks for multiple element textures or multiple render targets.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsIndependentWriteMasks { get; }
Property Value
true if the device supports independent write masks; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.PrimitiveCaps Structure
GraphicsDeviceCapabilities.PrimitiveCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PrimitiveCaps.SupportsMaskZ
Property
Gets a value indicating whether the device can enable and disable modification of the depth buffer on pixel operations.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsMaskZ { get; }
Property Value
true if the device can enable and disable modification of the depth buffer; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.PrimitiveCaps Structure
GraphicsDeviceCapabilities.PrimitiveCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PrimitiveCaps.SupportsMultipleRenderTargetsIndependentBitDepths
Property
Gets a value indicating whether the device supports different bit depths for multiple render targets.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsMultipleRenderTargetsIndependentBitDepths { get; }
Property Value
true if the device supports different bit depths for multiple render targets; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.PrimitiveCaps Structure
GraphicsDeviceCapabilities.PrimitiveCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PrimitiveCaps.SupportsMultipleRenderTargetsPostPixelShaderBlending
Property
Gets a value indicating whether the device supports post-pixel shader operations for multiple render targets.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsMultipleRenderTargetsPostPixelShaderBlending { get; }
Property Value
true if the device supports post-pixel shader operations for multiple render targets; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.PrimitiveCaps Structure
GraphicsDeviceCapabilities.PrimitiveCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.PrimitiveCaps.SupportsSeparateAlphaBlend
Property
Gets a value indicating whether the device supports separate blend settings for the alpha channel.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsSeparateAlphaBlend { get; }
Property Value
true if the device supports separate blend settings for the alpha channel; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.PrimitiveCaps Structure
GraphicsDeviceCapabilities.PrimitiveCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.RasterCaps Structure
Represents raster-drawing capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct GraphicsDeviceCapabilities.RasterCaps
See Also
Reference
GraphicsDeviceCapabilities.RasterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.RasterCaps Members
The following tables list the members exposed by the GraphicsDeviceCapabilities.RasterCaps type.
Public Properties
Name Description
SupportsAnisotropy Gets a value indicating whether the device supports anisotropic filtering.
SupportsColorPerspective Gets a value indicating whether the device iterates colors perspective correctly.
SupportsDepthBias Gets a value indicating whether the device supports legacy depth bias.
SupportsDepthBufferLessHsr Gets a value indicating whether the device can perform hidden-surface removal (HSR)
without requiring the application to sort polygons and without requiring the allocation
of a depth buffer.
SupportsDepthBufferTest Gets a value indicating whether the device can perform depth-test operations.
SupportsDepthFog Gets a value indicating whether the device supports depth-based fog.
SupportsFogRange Gets a value indicating whether the device supports range-based fog.
SupportsFogTable Gets a value indicating whether the device calculates the fog value by referring to a look
up table containing fog values that are indexed to the depth of a given pixel.
SupportsFogVertex Gets a value indicating whether the device calculates the fog value during the lighting o
peration and interpolates the fog value during rasterization.
SupportsMipMapLevelOfDetailBias Gets a value indicating whether the device supports level-of-detail bias adjustments.
SupportsMultisampleToggle Gets a value indicating whether the device supports toggling multisampling on and off.
SupportsScissorTest Gets a value indicating whether the device supports scissor test.
SupportsSlopeScaleDepthBias Gets a value indicating whether the device performs true slope-scale based depth bias.
SupportsWFog Gets a value indicating whether the device supports w-based fog.
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.RasterCaps instances are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.RasterCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.RasterCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.RasterCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.RasterCaps Methods
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.RasterCaps instances are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.RasterCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.RasterCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.RasterCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.RasterCaps.Equals Method
Determines whether two GraphicsDeviceCapabilities.RasterCaps instances are equal.
Overload List
Name Description
GraphicsDeviceCapabilities.RasterCaps.Equals (Object) Determines whether two
GraphicsDeviceCapabilities.RasterCaps instances are equal.
GraphicsDeviceCapabilities.RasterCaps.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.RasterCaps Structure
GraphicsDeviceCapabilities.RasterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
obj
The GraphicsDeviceCapabilities.RasterCaps object to compare this instance to.
Return Value
true if the instances are equal; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.RasterCaps Structure
GraphicsDeviceCapabilities.RasterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.RasterCaps.GetHashCode Method
Gets the hash code for this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
The hash code for this object.
See Also
Reference
GraphicsDeviceCapabilities.RasterCaps Structure
GraphicsDeviceCapabilities.RasterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.RasterCaps.op_Equality Method
Determines whether two GraphicsDeviceCapabilities.RasterCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
RasterCaps left,
RasterCaps right
)
Parameters
left
GraphicsDeviceCapabilities.RasterCaps on the left side of the equal sign.
right
GraphicsDeviceCapabilities.RasterCaps on the right side of the equal sign.
Return Value
true if left is equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.RasterCaps Structure
GraphicsDeviceCapabilities.RasterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.RasterCaps.op_Inequality Method
Determines whether two GraphicsDeviceCapabilities.RasterCaps instances are unequal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
RasterCaps left,
RasterCaps right
)
Parameters
left
GraphicsDeviceCapabilities.RasterCaps on the left side of the inequality operator.
right
GraphicsDeviceCapabilities.RasterCaps on the right side of the inequality operator.
Return Value
true if left is not equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.RasterCaps Structure
GraphicsDeviceCapabilities.RasterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.RasterCaps.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
GraphicsDeviceCapabilities.RasterCaps Structure
GraphicsDeviceCapabilities.RasterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.RasterCaps Properties
Public Properties
Name Description
SupportsAnisotropy Gets a value indicating whether the device supports anisotropic filtering.
SupportsColorPerspective Gets a value indicating whether the device iterates colors perspective correctly.
SupportsDepthBias Gets a value indicating whether the device supports legacy depth bias.
SupportsDepthBufferLessHsr Gets a value indicating whether the device can perform hidden-surface removal (HSR)
without requiring the application to sort polygons and without requiring the allocation
of a depth buffer.
SupportsDepthBufferTest Gets a value indicating whether the device can perform depth-test operations.
SupportsDepthFog Gets a value indicating whether the device supports depth-based fog.
SupportsFogRange Gets a value indicating whether the device supports range-based fog.
SupportsFogTable Gets a value indicating whether the device calculates the fog value by referring to a look
up table containing fog values that are indexed to the depth of a given pixel.
SupportsFogVertex Gets a value indicating whether the device calculates the fog value during the lighting o
peration and interpolates the fog value during rasterization.
SupportsMipMapLevelOfDetailBias Gets a value indicating whether the device supports level-of-detail bias adjustments.
SupportsMultisampleToggle Gets a value indicating whether the device supports toggling multisampling on and off.
SupportsScissorTest Gets a value indicating whether the device supports scissor test.
SupportsSlopeScaleDepthBias Gets a value indicating whether the device performs true slope-scale based depth bias.
SupportsWFog Gets a value indicating whether the device supports w-based fog.
See Also
Reference
GraphicsDeviceCapabilities.RasterCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.RasterCaps.SupportsAnisotropy
Property
Gets a value indicating whether the device supports anisotropic filtering.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsAnisotropy { get; }
Property Value
true if the device supports anisotropic filtering; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.RasterCaps Structure
GraphicsDeviceCapabilities.RasterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.RasterCaps.SupportsColorPerspective
Property
Gets a value indicating whether the device iterates colors perspective correctly.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsColorPerspective { get; }
Property Value
true if the device iterates colors perspective correctly; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.RasterCaps Structure
GraphicsDeviceCapabilities.RasterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.RasterCaps.SupportsDepthBias
Property
Gets a value indicating whether the device supports legacy depth bias.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsDepthBias { get; }
Property Value
true if the device supports legacy depth bias; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.RasterCaps Structure
GraphicsDeviceCapabilities.RasterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.RasterCaps.SupportsDepthBufferLessHsr
Property
Gets a value indicating whether the device can perform hidden-surface removal (HSR) without requiring the application to sort polygons
and without requiring the allocation of a depth buffer.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsDepthBufferLessHsr { get; }
Property Value
true if the device can perform hidden-surface removal (HSR) without requiring the application to sort polygons and without requiring
the allocation of a depth buffer; false otherwise.
Remarks
This leaves more video memory for textures. The method used to perform HSR is hardware-dependent and is transparent to the
application.
Z-bufferless HSR is performed if no depth-buffer surface is associated with the rendering-target surface and the depth-buffer
comparison test is enabled (that is, when the state value associated with the DepthBufferEnable is true).
See Also
Reference
GraphicsDeviceCapabilities.RasterCaps Structure
GraphicsDeviceCapabilities.RasterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.RasterCaps.SupportsDepthBufferTest
Property
Gets a value indicating whether the device can perform depth-test operations.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsDepthBufferTest { get; }
Property Value
true if the device can perform depth-test operations; false otherwise.
Remarks
This effectively renders a primitive and indicates whether any depth pixels have been rendered.
See Also
Reference
GraphicsDeviceCapabilities.RasterCaps Structure
GraphicsDeviceCapabilities.RasterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.RasterCaps.SupportsDepthFog
Property
Gets a value indicating whether the device supports depth-based fog.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsDepthFog { get; }
Property Value
true if the device supports depth-based fog; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.RasterCaps Structure
GraphicsDeviceCapabilities.RasterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.RasterCaps.SupportsFogRange
Property
Gets a value indicating whether the device supports range-based fog.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsFogRange { get; }
Property Value
true if the device supports range-based fog; false otherwise.
Remarks
In range-based fog, the distance of an object from the viewer is used to compute fog effects, not the depth of the object (that is,
the z-coordinate) in the scene.
See Also
Reference
GraphicsDeviceCapabilities.RasterCaps Structure
GraphicsDeviceCapabilities.RasterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.RasterCaps.SupportsFogTable
Property
Gets a value indicating whether the device calculates the fog value by referring to a lookup table containing fog values that are
indexed to the depth of a given pixel.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsFogTable { get; }
Property Value
true if the device calculates the fog value by referring to a lookup table; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.RasterCaps Structure
GraphicsDeviceCapabilities.RasterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.RasterCaps.SupportsFogVertex
Property
Gets a value indicating whether the device calculates the fog value during the lighting operation and interpolates the fog value
during rasterization.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsFogVertex { get; }
Property Value
true if the device calculates the fog value during the lighting operation and interpolates the fog value during rasterization;
false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.RasterCaps Structure
GraphicsDeviceCapabilities.RasterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.RasterCaps.SupportsMipMapLevelOfDetailBias
Property
Gets a value indicating whether the device supports level-of-detail bias adjustments.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsMipMapLevelOfDetailBias { get; }
Property Value
true if the device supports level-of-detail bias adjustments; false otherwise.
Remarks
These bias adjustments enable an application to make a mipmap appear crisper or less sharp than it normally would.
See Also
Reference
GraphicsDeviceCapabilities.RasterCaps Structure
GraphicsDeviceCapabilities.RasterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.RasterCaps.SupportsMultisampleToggle
Property
Gets a value indicating whether the device supports toggling multisampling on and off.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsMultisampleToggle { get; }
Property Value
true if the device supports toggling multisampling on and off; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.RasterCaps Structure
GraphicsDeviceCapabilities.RasterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.RasterCaps.SupportsScissorTest
Property
Gets a value indicating whether the device supports scissor test.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsScissorTest { get; }
Property Value
true if the device supports scissor test; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.RasterCaps Structure
GraphicsDeviceCapabilities.RasterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.RasterCaps.SupportsSlopeScaleDepthBias
Property
Gets a value indicating whether the device performs true slope-scale based depth bias.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsSlopeScaleDepthBias { get; }
Property Value
true if the device performs true slope-scale based depth bias; false otherwise.
Remarks
This is in contrast to the legacy-style depth bias.
See Also
Reference
GraphicsDeviceCapabilities.RasterCaps Structure
GraphicsDeviceCapabilities.RasterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.RasterCaps.SupportsWFog Property
Gets a value indicating whether the device supports w-based fog.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsWFog { get; }
Property Value
true if the device supports w-based fog; false otherwise.
Remarks
W-based fog is used when a perspective projection matrix is specified, but affine projections still use z-based fog. The system
considers a projection matrix that contains a nonzero value in the [3][4] element to be a perspective projection matrix.
See Also
Reference
GraphicsDeviceCapabilities.RasterCaps Structure
GraphicsDeviceCapabilities.RasterCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.ShadingCaps Structure
Represents shading operations capabilities
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct GraphicsDeviceCapabilities.ShadingCaps
See Also
Reference
GraphicsDeviceCapabilities.ShadingCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.ShadingCaps Members
The following tables list the members exposed by the GraphicsDeviceCapabilities.ShadingCaps type.
Public Properties
Name Description
SupportsAlphaGouraudBlend Gets a value indicating whether the device can support an alpha component for Gouraud-bl
ended transparency.
SupportsColorGouraudRgb Gets a value indicating whether the device can support colored Gouraud shading.
SupportsFogGouraud Gets a value indicating whether the device can support fog in the Gouraud shading mode.
SupportsSpecularGouraudRgb Gets a value indicating whether the device supports Gouraud shading of specular highlights.
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.ShadingCaps instances are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.ShadingCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.ShadingCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.ShadingCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.ShadingCaps Methods
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.ShadingCaps instances are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.ShadingCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.ShadingCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.ShadingCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.ShadingCaps.Equals Method
Determines whether two GraphicsDeviceCapabilities.ShadingCaps instances are equal.
Overload List
Name Description
GraphicsDeviceCapabilities.ShadingCaps.Equals (Object) Determines whether two
GraphicsDeviceCapabilities.ShadingCaps instances are equal.
GraphicsDeviceCapabilities.ShadingCaps.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.ShadingCaps Structure
GraphicsDeviceCapabilities.ShadingCaps Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.ShadingCaps.Equals Method
(Object)
Determines whether two GraphicsDeviceCapabilities.ShadingCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override bool Equals (
Object obj
)
Parameters
obj
The GraphicsDeviceCapabilities.ShadingCaps object to compare this instance to.
Return Value
true if the instances are equal; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.ShadingCaps Structure
GraphicsDeviceCapabilities.ShadingCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.ShadingCaps.GetHashCode Method
Gets the hash code for this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
The hash code for this object.
See Also
Reference
GraphicsDeviceCapabilities.ShadingCaps Structure
GraphicsDeviceCapabilities.ShadingCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.ShadingCaps.op_Equality Method
Determines whether two GraphicsDeviceCapabilities.ShadingCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
ShadingCaps left,
ShadingCaps right
)
Parameters
left
GraphicsDeviceCapabilities.ShadingCaps on the left side of the equal sign.
right
GraphicsDeviceCapabilities.ShadingCaps on the right side of the equal sign.
Return Value
true if left is equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.ShadingCaps Structure
GraphicsDeviceCapabilities.ShadingCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.ShadingCaps.op_Inequality Method
Determines whether two GraphicsDeviceCapabilities.ShadingCaps instances are unequal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
ShadingCaps left,
ShadingCaps right
)
Parameters
left
GraphicsDeviceCapabilities.ShadingCaps on the left side of the inequality operator.
right
GraphicsDeviceCapabilities.ShadingCaps on the right side of the inequality operator.
Return Value
true if left is not equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.ShadingCaps Structure
GraphicsDeviceCapabilities.ShadingCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.ShadingCaps.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
GraphicsDeviceCapabilities.ShadingCaps Structure
GraphicsDeviceCapabilities.ShadingCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.ShadingCaps Properties
Public Properties
Name Description
SupportsAlphaGouraudBlend Gets a value indicating whether the device can support an alpha component for Gouraud-bl
ended transparency.
SupportsColorGouraudRgb Gets a value indicating whether the device can support colored Gouraud shading.
SupportsFogGouraud Gets a value indicating whether the device can support fog in the Gouraud shading mode.
SupportsSpecularGouraudRgb Gets a value indicating whether the device supports Gouraud shading of specular highlights.
See Also
Reference
GraphicsDeviceCapabilities.ShadingCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.ShadingCaps.SupportsAlphaGouraudBlend
Property
Gets a value indicating whether the device can support an alpha component for Gouraud-blended transparency.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsAlphaGouraudBlend { get; }
Property Value
true if can support an alpha component for Gouraud-blended transparency; false otherwise.
Remarks
In this mode, the alpha color component of a primitive is provided at vertices and interpolated across a face along with the other color
components.
See Also
Reference
GraphicsDeviceCapabilities.ShadingCaps Structure
GraphicsDeviceCapabilities.ShadingCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.ShadingCaps.SupportsColorGouraudRgb
Property
Gets a value indicating whether the device can support colored Gouraud shading.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsColorGouraudRgb { get; }
Property Value
true if the device can support colored Gouraud shading; false otherwise.
Remarks
In this mode, the per-vertex color components (red, green, and blue) are interpolated across a triangle face.
See Also
Reference
GraphicsDeviceCapabilities.ShadingCaps Structure
GraphicsDeviceCapabilities.ShadingCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.ShadingCaps.SupportsFogGouraud
Property
Gets a value indicating whether the device can support fog in the Gouraud shading mode.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsFogGouraud { get; }
Property Value
true if the device can support fog in the Gouraud shading mode; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.ShadingCaps Structure
GraphicsDeviceCapabilities.ShadingCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.ShadingCaps.SupportsSpecularGouraudRgb
Property
Gets a value indicating whether the device supports Gouraud shading of specular highlights.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsSpecularGouraudRgb { get; }
Property Value
true if the device supports Gouraud shading of specular highlights; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.ShadingCaps Structure
GraphicsDeviceCapabilities.ShadingCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.StencilCaps Structure
Represents driver stencil capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct GraphicsDeviceCapabilities.StencilCaps
See Also
Reference
GraphicsDeviceCapabilities.StencilCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.StencilCaps Members
The following tables list the members exposed by the GraphicsDeviceCapabilities.StencilCaps type.
Public Properties
Name Description
SupportsDecrement Gets a value indicating whether the device supports decrementing the stencil-buffer entry, w
rapping to the maximum value if the new value is less than zero.
SupportsDecrementSaturation Gets a value indicating whether the device supports decrementing the stencil-buffer entry, cl
amping to zero.
SupportsIncrement Gets a value indicating whether the device supports incrementing the stencil-buffer entry, wr
apping to zero if the new value exceeds the maximum value.
SupportsIncrementSaturation Gets a value indicating whether the device supports incrementing the stencil-buffer entry, cl
amping to the maximum value.
SupportsInvert Gets a value indicating whether the device supports inverting the bits in the stencil-buffer en
try.
SupportsKeep Gets a value indicating whether the device does not update the entry in the stencil buffer.
SupportsReplace Gets a value indicating whether the device supports replacing the stencil-buffer entry with a
reference value.
SupportsTwoSided Gets a value indicating whether the device supports two-sided stencil.
SupportsZero Gets a value indicating whether the device supports setting the stencil-buffer entry to 0.
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.StencilCaps instances are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.StencilCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.StencilCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.StencilCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.StencilCaps Methods
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.StencilCaps instances are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.StencilCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.StencilCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.StencilCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.StencilCaps.Equals Method
Determines whether two GraphicsDeviceCapabilities.StencilCaps instances are equal.
Overload List
Name Description
GraphicsDeviceCapabilities.StencilCaps.Equals (Object) Determines whether two
GraphicsDeviceCapabilities.StencilCaps instances are equal.
GraphicsDeviceCapabilities.StencilCaps.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.StencilCaps Structure
GraphicsDeviceCapabilities.StencilCaps Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
obj
The GraphicsDeviceCapabilities.StencilCaps object to compare this instance to.
Return Value
true if the instances are equal; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.StencilCaps Structure
GraphicsDeviceCapabilities.StencilCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.StencilCaps.GetHashCode Method
Gets the hash code for this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
The hash code for this object.
See Also
Reference
GraphicsDeviceCapabilities.StencilCaps Structure
GraphicsDeviceCapabilities.StencilCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.StencilCaps.op_Equality Method
Determines whether two GraphicsDeviceCapabilities.StencilCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
StencilCaps left,
StencilCaps right
)
Parameters
left
GraphicsDeviceCapabilities.StencilCaps on the left side of the equal sign.
right
GraphicsDeviceCapabilities.StencilCaps on the right side of the equal sign.
Return Value
true if left is equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.StencilCaps Structure
GraphicsDeviceCapabilities.StencilCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.StencilCaps.op_Inequality Method
Determines whether two GraphicsDeviceCapabilities.StencilCaps instances are unequal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
StencilCaps left,
StencilCaps right
)
Parameters
left
GraphicsDeviceCapabilities.StencilCaps on the left side of the inequality operator.
right
GraphicsDeviceCapabilities.StencilCaps on the right side of the inequality operator.
Return Value
true if left is not equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.StencilCaps Structure
GraphicsDeviceCapabilities.StencilCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.StencilCaps.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
GraphicsDeviceCapabilities.StencilCaps Structure
GraphicsDeviceCapabilities.StencilCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.StencilCaps Properties
Public Properties
Name Description
SupportsDecrement Gets a value indicating whether the device supports decrementing the stencil-buffer entry, w
rapping to the maximum value if the new value is less than zero.
SupportsDecrementSaturation Gets a value indicating whether the device supports decrementing the stencil-buffer entry, cl
amping to zero.
SupportsIncrement Gets a value indicating whether the device supports incrementing the stencil-buffer entry, wr
apping to zero if the new value exceeds the maximum value.
SupportsIncrementSaturation Gets a value indicating whether the device supports incrementing the stencil-buffer entry, cl
amping to the maximum value.
SupportsInvert Gets a value indicating whether the device supports inverting the bits in the stencil-buffer en
try.
SupportsKeep Gets a value indicating whether the device does not update the entry in the stencil buffer.
SupportsReplace Gets a value indicating whether the device supports replacing the stencil-buffer entry with a
reference value.
SupportsTwoSided Gets a value indicating whether the device supports two-sided stencil.
SupportsZero Gets a value indicating whether the device supports setting the stencil-buffer entry to 0.
See Also
Reference
GraphicsDeviceCapabilities.StencilCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.StencilCaps.SupportsDecrement
Property
Gets a value indicating whether the device supports decrementing the stencil-buffer entry, wrapping to the maximum value if
the new value is less than zero.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsDecrement { get; }
Property Value
true if the device supports decrementing the stencil-buffer entry; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.StencilCaps Structure
GraphicsDeviceCapabilities.StencilCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.StencilCaps.SupportsDecrementSaturation
Property
Gets a value indicating whether the device supports decrementing the stencil-buffer entry, clamping to zero.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsDecrementSaturation { get; }
Property Value
true if the device supports the stencil-buffer entry, clamping to zero; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.StencilCaps Structure
GraphicsDeviceCapabilities.StencilCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.StencilCaps.SupportsIncrement
Property
Gets a value indicating whether the device supports incrementing the stencil-buffer entry, wrapping to zero if the new value
exceeds the maximum value.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsIncrement { get; }
Property Value
true if the device supports incrementing the stencil-buffer entry, wrapping to zero if the new value exceeds the maximum
value; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.StencilCaps Structure
GraphicsDeviceCapabilities.StencilCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.StencilCaps.SupportsIncrementSaturation
Property
Gets a value indicating whether the device supports incrementing the stencil-buffer entry, clamping to the maximum value.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsIncrementSaturation { get; }
Property Value
true if the device supports incrementing the stencil-buffer entry, clamping to the maximum value; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.StencilCaps Structure
GraphicsDeviceCapabilities.StencilCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.StencilCaps.SupportsInvert
Property
Gets a value indicating whether the device supports inverting the bits in the stencil-buffer entry.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsInvert { get; }
Property Value
true if the device supports inverting the bits in the stencil-buffer entry; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.StencilCaps Structure
GraphicsDeviceCapabilities.StencilCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.StencilCaps.SupportsKeep Property
Gets a value indicating whether the device does not update the entry in the stencil buffer.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsKeep { get; }
Property Value
true if the device does not update the entry in the stencil buffer; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.StencilCaps Structure
GraphicsDeviceCapabilities.StencilCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.StencilCaps.SupportsReplace
Property
Gets a value indicating whether the device supports replacing the stencil-buffer entry with a reference value.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsReplace { get; }
Property Value
true if the device supports replacing the stencil-buffer entry with a reference value; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.StencilCaps Structure
GraphicsDeviceCapabilities.StencilCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.StencilCaps.SupportsTwoSided
Property
Gets a value indicating whether the device supports two-sided stencil.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsTwoSided { get; }
Property Value
true if the device supports two-sided stencil; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.StencilCaps Structure
GraphicsDeviceCapabilities.StencilCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.StencilCaps.SupportsZero Property
Gets a value indicating whether the device supports setting the stencil-buffer entry to 0.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsZero { get; }
Property Value
true if the device supports setting the stencil-buffer entry to 0; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.StencilCaps Structure
GraphicsDeviceCapabilities.StencilCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureCaps Structure
Represents miscellaneous texture-mapping capabilities
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct GraphicsDeviceCapabilities.TextureCaps
See Also
Reference
GraphicsDeviceCapabilities.TextureCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureCaps Members
The following tables list the members exposed by the GraphicsDeviceCapabilities.TextureCaps type.
Public Properties
Name Description
RequiresCubeMapPower2 Gets a value indicating whether the device requires that cube texture maps have di
mensions specified as powers of two.
RequiresPower2 Gets a value indicating whether the device only supports textures that are powers
of two.
RequiresSquareOnly Gets a value indicating whether the device requires all textures to be square.
RequiresVolumeMapPower2 Gets a value indicating whether the device requires that volume texture maps have
dimensions specified as powers of two.
SupportsAlpha Gets a value indicating whether the device supports alpha in texture pixels.
SupportsCubeMap Gets a value indicating whether the device supports cube textures
SupportsMipCubeMap Gets a value indicating whether the device supports mipmapped cube textures.
SupportsMipMap Gets a value indicating whether the device supports mipmapped textures.
SupportsMipVolumeMap Gets a value indicating whether the device supports mipmapped volume textures.
SupportsNonPower2Conditional Gets a value indicating whether the device supports the use of 2D textures with di
mensions that are not powers of two, under certain conditions.
SupportsNoProjectedBumpEnvironment Gets a value indicating whether the device does not support a projected bump-env
ironment lookup operation in programmable and fixed-function shaders.
SupportsPerspective Gets a value indicating whether the device supports perspective correction texturin
g
SupportsProjected Gets a value indicating whether the device supports per pixel projective divide.
SupportsTextureRepeatNotScaledBySize Gets a value indicating whether the device does not scale texture indices by the tex
ture size prior to interpolation.
SupportsVolumeMap Gets a value indicating whether the device supports volume textures.
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.TextureCaps instances are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.TextureCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.TextureCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.TextureCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureCaps Methods
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.TextureCaps instances are equal.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.TextureCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.TextureCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.TextureCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureCaps.Equals Method
Determines whether two GraphicsDeviceCapabilities.TextureCaps instances are equal.
Overload List
Name Description
GraphicsDeviceCapabilities.TextureCaps.Equals (Object) Determines whether two
GraphicsDeviceCapabilities.TextureCaps instances are equal.
GraphicsDeviceCapabilities.TextureCaps.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.TextureCaps Structure
GraphicsDeviceCapabilities.TextureCaps Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureCaps.Equals Method
(Object)
Determines whether two GraphicsDeviceCapabilities.TextureCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override bool Equals (
Object obj
)
Parameters
obj
The GraphicsDeviceCapabilities.TextureCaps object to compare this instance to.
Return Value
true if the instances are equal; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.TextureCaps Structure
GraphicsDeviceCapabilities.TextureCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureCaps.GetHashCode Method
Gets the hash code for this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
The hash code for this object.
See Also
Reference
GraphicsDeviceCapabilities.TextureCaps Structure
GraphicsDeviceCapabilities.TextureCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureCaps.op_Equality Method
Determines whether two GraphicsDeviceCapabilities.TextureCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
TextureCaps left,
TextureCaps right
)
Parameters
left
GraphicsDeviceCapabilities.TextureCaps on the left side of the equal sign.
right
GraphicsDeviceCapabilities.TextureCaps on the right side of the equal sign.
Return Value
true if left is equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.TextureCaps Structure
GraphicsDeviceCapabilities.TextureCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureCaps.op_Inequality Method
Determines whether two GraphicsDeviceCapabilities.TextureCaps instances are unequal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
TextureCaps left,
TextureCaps right
)
Parameters
left
GraphicsDeviceCapabilities.TextureCaps on the left side of the inequality operator.
right
GraphicsDeviceCapabilities.TextureCaps on the right side of the inequality operator.
Return Value
true if left is not equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.TextureCaps Structure
GraphicsDeviceCapabilities.TextureCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureCaps.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
GraphicsDeviceCapabilities.TextureCaps Structure
GraphicsDeviceCapabilities.TextureCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureCaps Properties
Public Properties
Name Description
RequiresCubeMapPower2 Gets a value indicating whether the device requires that cube texture maps have di
mensions specified as powers of two.
RequiresPower2 Gets a value indicating whether the device only supports textures that are powers
of two.
RequiresSquareOnly Gets a value indicating whether the device requires all textures to be square.
RequiresVolumeMapPower2 Gets a value indicating whether the device requires that volume texture maps have
dimensions specified as powers of two.
SupportsAlpha Gets a value indicating whether the device supports alpha in texture pixels.
SupportsCubeMap Gets a value indicating whether the device supports cube textures
SupportsMipCubeMap Gets a value indicating whether the device supports mipmapped cube textures.
SupportsMipMap Gets a value indicating whether the device supports mipmapped textures.
SupportsMipVolumeMap Gets a value indicating whether the device supports mipmapped volume textures.
SupportsNonPower2Conditional Gets a value indicating whether the device supports the use of 2D textures with di
mensions that are not powers of two, under certain conditions.
SupportsNoProjectedBumpEnvironment Gets a value indicating whether the device does not support a projected bump-env
ironment lookup operation in programmable and fixed-function shaders.
SupportsPerspective Gets a value indicating whether the device supports perspective correction texturin
g
SupportsProjected Gets a value indicating whether the device supports per pixel projective divide.
SupportsTextureRepeatNotScaledBySize Gets a value indicating whether the device does not scale texture indices by the tex
ture size prior to interpolation.
SupportsVolumeMap Gets a value indicating whether the device supports volume textures.
See Also
Reference
GraphicsDeviceCapabilities.TextureCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureCaps.RequiresCubeMapPower2
Property
Gets a value indicating whether the device requires that cube texture maps have dimensions specified as powers of two.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool RequiresCubeMapPower2 { get; }
Property Value
true if the device requires that cube texture maps have dimensions specified as powers of two; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.TextureCaps Structure
GraphicsDeviceCapabilities.TextureCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureCaps.RequiresPower2
Property
Gets a value indicating whether the device only supports textures that are powers of two.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool RequiresPower2 { get; }
Property Value
true if the device only supports textures that are powers of two; false otherwise.
Remarks
If RequiresPower2 is false, all textures must have widths and heights specified as powers of two. This requirement does
not apply to either cube textures or volume textures.
If RequiresPower2 is true, the device conditionally supports the use of 2D textures with dimensions that are not powers
of two.
If this value is false, and RequiresPower2 is false, unconditional support is provided for 2D textures with dimensions
that are not powers of two.
See Also
Reference
GraphicsDeviceCapabilities.TextureCaps Structure
GraphicsDeviceCapabilities.TextureCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureCaps.RequiresSquareOnly
Property
Gets a value indicating whether the device requires all textures to be square.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool RequiresSquareOnly { get; }
Property Value
true if the device requires all textures to be square; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.TextureCaps Structure
GraphicsDeviceCapabilities.TextureCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureCaps.RequiresVolumeMapPower2
Property
Gets a value indicating whether the device requires that volume texture maps have dimensions specified as powers of two.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool RequiresVolumeMapPower2 { get; }
Property Value
true if the device requires that volume texture maps have dimensions specified as powers of two; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.TextureCaps Structure
GraphicsDeviceCapabilities.TextureCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureCaps.SupportsAlpha
Property
Gets a value indicating whether the device supports alpha in texture pixels.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsAlpha { get; }
Property Value
true if the device supports alpha in texture pixels; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.TextureCaps Structure
GraphicsDeviceCapabilities.TextureCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureCaps.SupportsCubeMap
Property
Gets a value indicating whether the device supports cube textures
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsCubeMap { get; }
Property Value
true if the device supports cube textures; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.TextureCaps Structure
GraphicsDeviceCapabilities.TextureCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureCaps.SupportsMipCubeMap
Property
Gets a value indicating whether the device supports mipmapped cube textures.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsMipCubeMap { get; }
Property Value
true if the device supports mipmapped cube textures; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.TextureCaps Structure
GraphicsDeviceCapabilities.TextureCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureCaps.SupportsMipMap
Property
Gets a value indicating whether the device supports mipmapped textures.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsMipMap { get; }
Property Value
true if the device supports mipmapped textures; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.TextureCaps Structure
GraphicsDeviceCapabilities.TextureCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureCaps.SupportsMipVolumeMap
Property
Gets a value indicating whether the device supports mipmapped volume textures.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsMipVolumeMap { get; }
Property Value
true if the device supports mipmapped volume textures; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.TextureCaps Structure
GraphicsDeviceCapabilities.TextureCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureCaps.SupportsNonPower2Conditional
Property
Gets a value indicating whether the device supports the use of 2D textures with dimensions that are not powers of two, under certain conditions.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsNonPower2Conditional { get; }
Property Value
true if the device supports the use of 2D textures with dimensions that are not powers of two, under certain conditions; false otherwise.
Remarks
The device can use a texture with dimensions that are not a power of two, as long as these conditions are met:
The texture addressing mode for the texture stage is set to TextureAddressMode.Clamp.
Texture wrapping for the texture stage is disabled (Wrap1 - Wrap15 set to TextureWrapCoordinates.Zero)
Mipmapping is not in use (use magnification filter only).
Texture formats must not be SurfaceFormat.Dxt1 through SurfaceFormat.Dxt5.
If this flag is not set, and .RequiresPower2 is also not set, then unconditional support is provided for 2D textures with dimensions that are not
powers of two.
A texture that is not a power of two cannot be set at a stage that will be read based on a shader computation (such as the bem - ps and texm3x3 -
ps instructions in pixel shaders versions 1_0 to 1_3). For example, these textures can be used to store bumps that will be fed into texture reads, but
not the environment maps that are used in texbem - ps, texbeml - ps, and texm3x3spec - ps. This means that a texture with dimensions that are
not powers of two cannot be addressed or sampled using texture coordinates computed within the shader. This type of operation is known as a
dependent read and cannot be performed on these types of textures.
See Also
Reference
GraphicsDeviceCapabilities.TextureCaps Structure
GraphicsDeviceCapabilities.TextureCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureCaps.SupportsNoProjectedBumpEnvironment
Property
Gets a value indicating whether the device does not support a projected bump-environment lookup operation in programmable and fixed-function shaders.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsNoProjectedBumpEnvironment { get; }
Property Value
true if the device does not support a projected bump-environment lookup operation in programmable and fixed-function shaders; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.TextureCaps Structure
GraphicsDeviceCapabilities.TextureCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureCaps.SupportsPerspective
Property
Gets a value indicating whether the device supports perspective correction texturing
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsPerspective { get; }
Property Value
true if the device supports perspective correction texturing; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.TextureCaps Structure
GraphicsDeviceCapabilities.TextureCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureCaps.SupportsProjected
Property
Gets a value indicating whether the device supports per pixel projective divide.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsProjected { get; }
Property Value
true if the device supports supports per pixel projective divide; false otherwise.
Remarks
When applied, the device divides transformed texture coordinates by the last texture coordinate. If this capability is present, the
projective divide occurs per pixel. If this capability is not present, but the projective divide needs to occur anyway, it is
performed on a per-vertex basis by the Direct3D runtime.
See Also
Reference
GraphicsDeviceCapabilities.TextureCaps Structure
GraphicsDeviceCapabilities.TextureCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureCaps.SupportsTextureRepeatNotScaledBySize
Property
Gets a value indicating whether the device does not scale texture indices by the texture size prior to interpolation.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsTextureRepeatNotScaledBySize { get; }
Property Value
true if the device does not scale texture indices by the texture size prior to interpolation; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.TextureCaps Structure
GraphicsDeviceCapabilities.TextureCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.TextureCaps.SupportsVolumeMap
Property
Gets a value indicating whether the device supports volume textures.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsVolumeMap { get; }
Property Value
true if the device supports volume textures; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.TextureCaps Structure
GraphicsDeviceCapabilities.TextureCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexFormatCaps Structure
Represents flexible vertex format capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct GraphicsDeviceCapabilities.VertexFormatCaps
See Also
Reference
GraphicsDeviceCapabilities.VertexFormatCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexFormatCaps Members
The following tables list the members exposed by the GraphicsDeviceCapabilities.VertexFormatCaps type.
Public Properties
Name Description
NumberSimultaneousTextureCoordinates Gets the total number of texture coordinate sets that the device can simultaneous
ly use for multiple texture blending.
SupportsDoNotStripElements Gets a value indicating whether vertex elements should not be stripped.
SupportsPointSize Gets a value indicating whether point size comes from point size data in the verte
x declaration.
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.VertexFormatCaps instances are equal
.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.VertexFormatCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.VertexFormatCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.VertexFormatCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexFormatCaps Methods
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.VertexFormatCaps instances are equal
.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.VertexFormatCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.VertexFormatCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.VertexFormatCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexFormatCaps.Equals Method
Determines whether two GraphicsDeviceCapabilities.VertexFormatCaps instances are equal.
Overload List
Name Description
GraphicsDeviceCapabilities.VertexFormatCaps.Equals (Object) Determines whether two
GraphicsDeviceCapabilities.VertexFormatCaps instances
are equal.
GraphicsDeviceCapabilities.VertexFormatCaps.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.VertexFormatCaps Structure
GraphicsDeviceCapabilities.VertexFormatCaps Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexFormatCaps.Equals Method
(Object)
Determines whether two GraphicsDeviceCapabilities.VertexFormatCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override bool Equals (
Object obj
)
Parameters
obj
The GraphicsDeviceCapabilities.VertexFormatCaps object to compare this instance to.
Return Value
true if the instances are equal; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.VertexFormatCaps Structure
GraphicsDeviceCapabilities.VertexFormatCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexFormatCaps.GetHashCode
Method
Gets the hash code for this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
The hash code for this object.
See Also
Reference
GraphicsDeviceCapabilities.VertexFormatCaps Structure
GraphicsDeviceCapabilities.VertexFormatCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexFormatCaps.op_Equality
Method
Determines whether two GraphicsDeviceCapabilities.VertexFormatCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
VertexFormatCaps left,
VertexFormatCaps right
)
Parameters
left
GraphicsDeviceCapabilities.VertexFormatCaps on the left side of the equal sign.
right
GraphicsDeviceCapabilities.VertexFormatCaps on the right side of the equal sign.
Return Value
true if left is equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.VertexFormatCaps Structure
GraphicsDeviceCapabilities.VertexFormatCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexFormatCaps.op_Inequality
Method
Determines whether two GraphicsDeviceCapabilities.VertexFormatCaps instances are unequal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
VertexFormatCaps left,
VertexFormatCaps right
)
Parameters
left
GraphicsDeviceCapabilities.VertexFormatCaps on the left side of the inequality operator.
right
GraphicsDeviceCapabilities.VertexFormatCaps on the right side of the inequality operator.
Return Value
true if left is not equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.VertexFormatCaps Structure
GraphicsDeviceCapabilities.VertexFormatCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexFormatCaps.ToString
Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
GraphicsDeviceCapabilities.VertexFormatCaps Structure
GraphicsDeviceCapabilities.VertexFormatCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexFormatCaps Properties
Public Properties
Name Description
NumberSimultaneousTextureCoordinates Gets the total number of texture coordinate sets that the device can simultaneous
ly use for multiple texture blending.
SupportsDoNotStripElements Gets a value indicating whether vertex elements should not be stripped.
SupportsPointSize Gets a value indicating whether point size comes from point size data in the verte
x declaration.
See Also
Reference
GraphicsDeviceCapabilities.VertexFormatCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexFormatCaps.NumberSimultaneousTextureCoordinates
Property
Gets the total number of texture coordinate sets that the device can simultaneously use for multiple texture blending.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public short NumberSimultaneousTextureCoordinates { get; }
Property Value
The total number of texture coordinate sets that the device can simultaneously use for multiple texture blending. (You can use up to eight texture coordinate sets for any vertex,
but the device can blend using only the specified number of texture coordinate sets.)
See Also
Reference
GraphicsDeviceCapabilities.VertexFormatCaps Structure
GraphicsDeviceCapabilities.VertexFormatCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexFormatCaps.SupportsDoNotStripElements
Property
Gets a value indicating whether vertex elements should not be stripped.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsDoNotStripElements { get; }
Property Value
true if vertex elements should not be stripped; otherwise false.
Remarks
If the vertex format contains elements that are not used with the current render states, there is no need to regenerate the vertices. If this property is false,
stripping extraneous elements from the vertex format provides better performance.
See Also
Reference
GraphicsDeviceCapabilities.VertexFormatCaps Structure
GraphicsDeviceCapabilities.VertexFormatCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexFormatCaps.SupportsPointSize
Property
Gets a value indicating whether point size comes from point size data in the vertex declaration.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsPointSize { get; }
Property Value
true if point size comes from point size data in the vertex declaration; otherwise false.
Remarks
If this property is false, point size is determined by PointSize. If an application provides point size in both the render state and the
vertex declaration, the vertex data overrides the render-state data.
See Also
Reference
GraphicsDeviceCapabilities.VertexFormatCaps Structure
GraphicsDeviceCapabilities.VertexFormatCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexProcessingCaps Structure
Represents vertex processing capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct GraphicsDeviceCapabilities.VertexProcessingCaps
See Also
Reference
GraphicsDeviceCapabilities.VertexProcessingCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexProcessingCaps Members
The following tables list the members exposed by the GraphicsDeviceCapabilities.VertexProcessingCaps type.
Public Properties
Name Description
SupportsLocalViewer Gets a value indicating whether the device can do local viewer.
SupportsNoTextureGenerationNonLocalViewer Gets a value indicating whether the device supports texture generation in n
on-local viewer mode.
SupportsTextureGeneration Gets a value indicating whether the device can do texture generation.
SupportsTextureGenerationSphereMap Gets a value indicating whether the device supports use of the specified text
ure coordinates for sphere mapping.
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.VertexProcessingCaps instances are e
qual.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.VertexProcessingCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.VertexProcessingCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.VertexProcessingCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexProcessingCaps Methods
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.VertexProcessingCaps instances are e
qual.
GetHashCode Gets the hash code for this object.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.VertexProcessingCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.VertexProcessingCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.VertexProcessingCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexProcessingCaps.Equals
Method
Determines whether two GraphicsDeviceCapabilities.VertexProcessingCaps instances are equal.
Overload List
Name Description
GraphicsDeviceCapabilities.VertexProcessingCaps.Equals (Object) Determines whether two
GraphicsDeviceCapabilities.VertexProcessingCaps ins
tances are equal.
GraphicsDeviceCapabilities.VertexProcessingCaps.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.VertexProcessingCaps Structure
GraphicsDeviceCapabilities.VertexProcessingCaps Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexProcessingCaps.Equals
Method (Object)
Determines whether two GraphicsDeviceCapabilities.VertexProcessingCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override bool Equals (
Object obj
)
Parameters
obj
The GraphicsDeviceCapabilities.VertexProcessingCaps object to compare this instance to.
Return Value
true if the instances are equal; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.VertexProcessingCaps Structure
GraphicsDeviceCapabilities.VertexProcessingCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexProcessingCaps.GetHashCode
Method
Gets the hash code for this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
The hash code for this object.
See Also
Reference
GraphicsDeviceCapabilities.VertexProcessingCaps Structure
GraphicsDeviceCapabilities.VertexProcessingCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexProcessingCaps.op_Equality
Method
Determines whether two GraphicsDeviceCapabilities.VertexProcessingCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
VertexProcessingCaps left,
VertexProcessingCaps right
)
Parameters
left
GraphicsDeviceCapabilities.VertexProcessingCaps on the left side of the equal sign.
right
GraphicsDeviceCapabilities.VertexProcessingCaps on the right side of the equal sign.
Return Value
true if left is equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.VertexProcessingCaps Structure
GraphicsDeviceCapabilities.VertexProcessingCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexProcessingCaps.op_Inequality
Method
Determines whether two GraphicsDeviceCapabilities.VertexProcessingCaps instances are unequal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
VertexProcessingCaps left,
VertexProcessingCaps right
)
Parameters
left
GraphicsDeviceCapabilities.VertexProcessingCaps on the left side of the inequality operator.
right
GraphicsDeviceCapabilities.VertexProcessingCaps on the right side of the inequality operator.
Return Value
true if left is not equal to right; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.VertexProcessingCaps Structure
GraphicsDeviceCapabilities.VertexProcessingCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexProcessingCaps.ToString
Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
GraphicsDeviceCapabilities.VertexProcessingCaps Structure
GraphicsDeviceCapabilities.VertexProcessingCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexProcessingCaps Properties
Public Properties
Name Description
SupportsLocalViewer Gets a value indicating whether the device can do local viewer.
SupportsNoTextureGenerationNonLocalViewer Gets a value indicating whether the device supports texture generation in n
on-local viewer mode.
SupportsTextureGeneration Gets a value indicating whether the device can do texture generation.
SupportsTextureGenerationSphereMap Gets a value indicating whether the device supports use of the specified text
ure coordinates for sphere mapping.
See Also
Reference
GraphicsDeviceCapabilities.VertexProcessingCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexProcessingCaps.SupportsLocalViewer
Property
Gets a value indicating whether the device can do local viewer.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsLocalViewer { get; }
Property Value
true if the device can do local viewer; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.VertexProcessingCaps Structure
GraphicsDeviceCapabilities.VertexProcessingCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexProcessingCaps.SupportsNoTextureGenerationNonLocalViewer
Property
Gets a value indicating whether the device supports texture generation in non-local viewer mode.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsNoTextureGenerationNonLocalViewer { get; }
Property Value
true if the device does not support texture generation in non-local viewer mode; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.VertexProcessingCaps Structure
GraphicsDeviceCapabilities.VertexProcessingCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexProcessingCaps.SupportsTextureGeneration
Property
Gets a value indicating whether the device can do texture generation.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsTextureGeneration { get; }
Property Value
true if the device can do texture generation; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.VertexProcessingCaps Structure
GraphicsDeviceCapabilities.VertexProcessingCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexProcessingCaps.SupportsTextureGenerationSphereMap
Property
Gets a value indicating whether the device supports use of the specified texture coordinates for sphere mapping.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsTextureGenerationSphereMap { get; }
Property Value
true if the device supports use of the specified texture coordinates for sphere mapping; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.VertexProcessingCaps Structure
GraphicsDeviceCapabilities.VertexProcessingCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexShaderCaps Structure
Represents vertex shader version 2_0 extended capabilities.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct GraphicsDeviceCapabilities.VertexShaderCaps
See Also
Reference
GraphicsDeviceCapabilities.VertexShaderCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexShaderCaps Members
The following tables list the members exposed by the GraphicsDeviceCapabilities.VertexShaderCaps type.
Public Fields
Name Description
MaxDynamicFlowControlDepth Specifies the maximum level of nesting of dynamic flow control instructions (break - vs, bre
ak_comp - vs, breakp - vs, if_comp - vs, if_comp - vs, if pred - vs).
MaxNumberTemps Specifies the maximum number of temporary registers supported.
MaxStaticFlowControlDepth Specifies the maximum depth of nesting of the loop - vs/rep - vs and call - vs/callnz bool - v
s instructions.
MinDynamicFlowControlDepth Specifies the minimum level of nesting of dynamic flow control instructions (break - vs, bre
ak_comp - vs, breakp - vs, if_comp - vs, if_comp - vs, if pred - vs).
MinNumberTemps Specifies the minimum number of temporary registers supported.
MinStaticFlowControlDepth Specifies the minimum depth of nesting of the loop - vs/rep - vs and call - vs/callnz bool - v
s instructions.
Public Properties
Name Description
DynamicFlowControlDepth Gets a value specifying the depth of the dynamic flow control instruction nesting.
NumberTemps Gets a value specifying the number of temporary registers supported.
StaticFlowControlDepth Gets a value specifying the depth of nesting of the loop - vs/rep - vs and call - vs/callnz bool - vs
instructions.
SupportsPredication Gets a value indicating whether instruction predication is supported.
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.VertexShaderCaps instances are equal
.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.VertexShaderCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.VertexShaderCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.VertexShaderCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexShaderCaps Fields
Public Fields
Name Description
MaxDynamicFlowControlDepth Specifies the maximum level of nesting of dynamic flow control instructions (break - vs, bre
ak_comp - vs, breakp - vs, if_comp - vs, if_comp - vs, if pred - vs).
MaxNumberTemps Specifies the maximum number of temporary registers supported.
MaxStaticFlowControlDepth Specifies the maximum depth of nesting of the loop - vs/rep - vs and call - vs/callnz bool - v
s instructions.
MinDynamicFlowControlDepth Specifies the minimum level of nesting of dynamic flow control instructions (break - vs, bre
ak_comp - vs, breakp - vs, if_comp - vs, if_comp - vs, if pred - vs).
MinNumberTemps Specifies the minimum number of temporary registers supported.
MinStaticFlowControlDepth Specifies the minimum depth of nesting of the loop - vs/rep - vs and call - vs/callnz bool - v
s instructions.
See Also
Reference
GraphicsDeviceCapabilities.VertexShaderCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexShaderCaps.MaxDynamicFlowControlDepth
Field
Specifies the maximum level of nesting of dynamic flow control instructions (break - vs, break_comp - vs, breakp - vs, if_comp - vs, if_comp - vs, if pred
- vs).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public const int MaxDynamicFlowControlDepth
See Also
Reference
GraphicsDeviceCapabilities.VertexShaderCaps Structure
GraphicsDeviceCapabilities.VertexShaderCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexShaderCaps.MaxNumberTemps
Field
Specifies the maximum number of temporary registers supported.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public const int MaxNumberTemps
See Also
Reference
GraphicsDeviceCapabilities.VertexShaderCaps Structure
GraphicsDeviceCapabilities.VertexShaderCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexShaderCaps.MaxStaticFlowControlDepth
Field
Specifies the maximum depth of nesting of the loop - vs/rep - vs and call - vs/callnz bool - vs instructions.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public const int MaxStaticFlowControlDepth
See Also
Reference
GraphicsDeviceCapabilities.VertexShaderCaps Structure
GraphicsDeviceCapabilities.VertexShaderCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexShaderCaps.MinDynamicFlowControlDepth
Field
Specifies the minimum level of nesting of dynamic flow control instructions (break - vs, break_comp - vs, breakp - vs, if_comp - vs, if_comp - vs, if
pred - vs).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public const int MinDynamicFlowControlDepth
See Also
Reference
GraphicsDeviceCapabilities.VertexShaderCaps Structure
GraphicsDeviceCapabilities.VertexShaderCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexShaderCaps.MinNumberTemps
Field
Specifies the minimum number of temporary registers supported.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public const int MinNumberTemps
See Also
Reference
GraphicsDeviceCapabilities.VertexShaderCaps Structure
GraphicsDeviceCapabilities.VertexShaderCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexShaderCaps.MinStaticFlowControlDepth
Field
Specifies the minimum depth of nesting of the loop - vs/rep - vs and call - vs/callnz bool - vs instructions.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public const int MinStaticFlowControlDepth
See Also
Reference
GraphicsDeviceCapabilities.VertexShaderCaps Structure
GraphicsDeviceCapabilities.VertexShaderCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexShaderCaps Methods
Public Methods
Name Description
Equals Overloaded. Determines whether two GraphicsDeviceCapabilities.VertexShaderCaps instances are equal
.
GetType (Inherited from Object.)
op_Equality Determines whether two GraphicsDeviceCapabilities.VertexShaderCaps instances are equal.
op_Inequality Determines whether two GraphicsDeviceCapabilities.VertexShaderCaps instances are unequal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.VertexShaderCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexShaderCaps.Equals Method
Determines whether two GraphicsDeviceCapabilities.VertexShaderCaps instances are equal.
Overload List
Name Description
GraphicsDeviceCapabilities.VertexShaderCaps.Equals (Object) Determines whether two
GraphicsDeviceCapabilities.VertexShaderCaps instances
are equal.
GraphicsDeviceCapabilities.VertexShaderCaps.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
GraphicsDeviceCapabilities.VertexShaderCaps Structure
GraphicsDeviceCapabilities.VertexShaderCaps Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexShaderCaps.Equals Method
(Object)
Determines whether two GraphicsDeviceCapabilities.VertexShaderCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override bool Equals (
Object obj
)
Parameters
obj
The GraphicsDeviceCapabilities.VertexShaderCaps object to compare this instance to.
Return Value
true if the instances are equal; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.VertexShaderCaps Structure
GraphicsDeviceCapabilities.VertexShaderCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexShaderCaps.op_Equality
Method
Determines whether two GraphicsDeviceCapabilities.VertexShaderCaps instances are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
VertexShaderCaps l,
VertexShaderCaps r
)
Parameters
l
GraphicsDeviceCapabilities.VertexShaderCaps on the left side of the equal sign.
r
GraphicsDeviceCapabilities.VertexShaderCaps on the right side of the equal sign.
Return Value
true if l is equal to r; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.VertexShaderCaps Structure
GraphicsDeviceCapabilities.VertexShaderCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexShaderCaps.op_Inequality
Method
Determines whether two GraphicsDeviceCapabilities.VertexShaderCaps instances are unequal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
VertexShaderCaps l,
VertexShaderCaps r
)
Parameters
l
GraphicsDeviceCapabilities.VertexShaderCaps on the left side of the inequality operator.
r
GraphicsDeviceCapabilities.VertexShaderCaps on the right side of the inequality operator.
Return Value
true if l is not equal to r; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.VertexShaderCaps Structure
GraphicsDeviceCapabilities.VertexShaderCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexShaderCaps.ToString
Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
GraphicsDeviceCapabilities.VertexShaderCaps Structure
GraphicsDeviceCapabilities.VertexShaderCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexShaderCaps Properties
Public Properties
Name Description
DynamicFlowControlDepth Gets a value specifying the depth of the dynamic flow control instruction nesting.
NumberTemps Gets a value specifying the number of temporary registers supported.
StaticFlowControlDepth Gets a value specifying the depth of nesting of the loop - vs/rep - vs and call - vs/callnz bool - vs
instructions.
SupportsPredication Gets a value indicating whether instruction predication is supported.
See Also
Reference
GraphicsDeviceCapabilities.VertexShaderCaps Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexShaderCaps.DynamicFlowControlDepth
Property
Gets a value specifying the depth of the dynamic flow control instruction nesting.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int DynamicFlowControlDepth { get; }
Property Value
The depth of the dynamic flow control instruction nesting; either 0 or 24.
See Also
Reference
GraphicsDeviceCapabilities.VertexShaderCaps Structure
GraphicsDeviceCapabilities.VertexShaderCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexShaderCaps.NumberTemps
Property
Gets a value specifying the number of temporary registers supported.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int NumberTemps { get; }
Property Value
The number of temporary registers supported.
See Also
Reference
GraphicsDeviceCapabilities.VertexShaderCaps Structure
GraphicsDeviceCapabilities.VertexShaderCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexShaderCaps.StaticFlowControlDepth
Property
Gets a value specifying the depth of nesting of the loop - vs/rep - vs and call - vs/callnz bool - vs instructions.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int StaticFlowControlDepth { get; }
Property Value
The depth of nesting of the loop - vs/rep - vs and call - vs/callnz bool - vs instructions.
See Also
Reference
GraphicsDeviceCapabilities.VertexShaderCaps Structure
GraphicsDeviceCapabilities.VertexShaderCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCapabilities.VertexShaderCaps.SupportsPredication
Property
Gets a value indicating whether instruction predication is supported.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SupportsPredication { get; }
Property Value
true if instruction predication is supported; false otherwise.
See Also
Reference
GraphicsDeviceCapabilities.VertexShaderCaps Structure
GraphicsDeviceCapabilities.VertexShaderCaps Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCreationParameters Structure
Describes the creation parameters for a device.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public struct GraphicsDeviceCreationParameters
See Also
Reference
GraphicsDeviceCreationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCreationParameters Members
The following tables list the members exposed by the GraphicsDeviceCreationParameters type.
Public Constructors
Name Description
GraphicsDeviceCreationParameters Initializes a new instance of the GraphicsDeviceCreationParameters class.
Public Properties
Name Description
Adapter Gets the graphics adapter.
DeviceType Gets a information describing the amount of emulated functionality for the device.
FocusWindowHandle Gets a pointer to the window to which focus belongs for the current device.
Public Methods
Name Description
Equals (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCreationParameters Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCreationParameters Constructor
Initializes a new instance of the GraphicsDeviceCreationParameters class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GraphicsDeviceCreationParameters (
GraphicsAdapter graphicsAdapter,
DeviceType deviceType,
IntPtr windowHandle
)
Parameters
graphicsAdapter
The display adapter.
deviceType
The emulated functionality for this device.
windowHandle
Window handle to which focus belongs for this Direct3D device.
See Also
Reference
GraphicsDeviceCreationParameters Structure
GraphicsDeviceCreationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCreationParameters Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GraphicsDeviceCreationParameters Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCreationParameters.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
GraphicsDeviceCreationParameters Structure
GraphicsDeviceCreationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCreationParameters Properties
Public Properties
Name Description
Adapter Gets the graphics adapter.
DeviceType Gets a information describing the amount of emulated functionality for the device.
FocusWindowHandle Gets a pointer to the window to which focus belongs for the current device.
See Also
Reference
GraphicsDeviceCreationParameters Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsDeviceCreationParameters.Adapter Property
Gets the graphics adapter.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GraphicsAdapter Adapter { get; }
Property Value
The graphics adapter.
See Also
Reference
GraphicsDeviceCreationParameters Structure
GraphicsDeviceCreationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCreationParameters.DeviceType Property
Gets a information describing the amount of emulated functionality for the device.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public DeviceType DeviceType { get; }
Property Value
The amount of emulated functionality for the device.
RemarksThe value of these parameters mirrors the value passed to the GraphicsDevice constructor call that created the device.
See Also
Reference
GraphicsDeviceCreationParameters Structure
GraphicsDeviceCreationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceCreationParameters.FocusWindowHandle
Property
Gets a pointer to the window to which focus belongs for the current device.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public IntPtr FocusWindowHandle { get; }
Property Value
Value that points to the window to which focus belongs for the device.
See Also
Reference
GraphicsDeviceCreationParameters Structure
GraphicsDeviceCreationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsDeviceStatus Enumeration
Describes the status of the device.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum GraphicsDeviceStatus
Members
Member name Description
Lost The device has been lost.
Normal The device is normal.
NotReset The device has not been reset.
See Also
Reference
GraphicsDevice.GraphicsDeviceStatus Property
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsResource Class
Queries and prepares resources.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public abstract class GraphicsResource : IDisposable
See Also
Reference
GraphicsResource Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsResource Members
The following tables list the members exposed by the GraphicsResource type.
Public Properties
Name Description
GraphicsDevice Gets the GraphicsDevice associated with this GraphicsResource.
IsDisposed Gets a value that indicates whether the object is disposed.
Name Gets the name of the resource.
Priority Gets or sets the resource-management priority for this resource.
ResourceType Gets the type of this resource.
Tag Gets the resource tags for this resource.
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_Disposing Raises the Disposing event when called from within a derived class.
Public Events
Name Description
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micro
soft .NET common language runtime.
See Also
Reference
GraphicsResource Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsResource Methods
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_Disposing Raises the Disposing event when called from within a derived class.
See Also
Reference
GraphicsResource Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsResource.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
GraphicsResource.Dispose () Immediately releases the unmanaged resources used by this object.
GraphicsResource.Dispose (Boolean) Immediately releases the unmanaged resources used by this object.
See Also
Reference
GraphicsResource Class
GraphicsResource Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsResource.Dispose Method ()
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
Remarks
Call Dispose when you are finished using the GraphicsResource. The Dispose method leaves the GraphicsResource in an
unusable state. After calling Dispose, you must release all references to the GraphicsResource so the garbage collector can
reclaim the memory that the GraphicsResource was occupying.
Note
Always call Dispose before you release your last reference to the GraphicsResource. Otherwise, the resources it is using will n
ot be freed until the garbage collector calls the GraphicsResource object's Finalize method.
See Also
Reference
GraphicsResource Class
GraphicsResource Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
Remarks
This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean)
method with the disposing parameter set to true. Finalize invokes Dispose(Boolean) with disposing set to false.
When the disposing parameter is true, this method releases all resources held by any managed objects that this
GraphicsResource references. This method invokes the Dispose method of each referenced object.
Note
Notes to Inheritors
Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects
disposed of in an earlier call to Dispose.
See Also
Reference
GraphicsResource Class
GraphicsResource Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsResource.Finalize Method
Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the
object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void Finalize ()
Remarks
This method overrides System.Object.Finalize. Application code should not call this method; an object's Finalize method is
automatically invoked during garbage collection, unless a call to the GC.SuppressFinalize method has disabled finalization by
the garbage collector.
See Also
Reference
GraphicsResource Class
GraphicsResource Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsResource.raise_Disposing Method
Raises the Disposing event when called from within a derived class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected void raise_Disposing (
Object value0,
EventArgs value1
)
Parameters
value0
Invoking object reference; should be this object.
value1
Arguments to pass to the event handler.
See Also
Reference
GraphicsResource Class
GraphicsResource Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsResource Properties
Public Properties
Name Description
GraphicsDevice Gets the GraphicsDevice associated with this GraphicsResource.
IsDisposed Gets a value that indicates whether the object is disposed.
Name Gets the name of the resource.
Priority Gets or sets the resource-management priority for this resource.
ResourceType Gets the type of this resource.
Tag Gets the resource tags for this resource.
See Also
Reference
GraphicsResource Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsResource.GraphicsDevice Property
Gets the GraphicsDevice associated with this GraphicsResource.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public virtual GraphicsDevice GraphicsDevice { get; }
Property Value
The GraphicsDevice associated with this GraphicsResource.
See Also
Reference
GraphicsResource Class
GraphicsResource Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsResource.IsDisposed Property
Gets a value that indicates whether the object is disposed.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsDisposed { get; }
Property Value
true if the object is disposed; false otherwise.
See Also
Reference
GraphicsResource Class
GraphicsResource Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsResource.Name Property
Gets the name of the resource.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Name { get; set; }
Property Value
The name of the resource.
See Also
Reference
GraphicsResource Class
GraphicsResource Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsResource.Priority Property
Gets or sets the resource-management priority for this resource.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Priority { get; set; }
Property Value
The new resource-management priority for this resource.
See Also
Reference
GraphicsResource Class
GraphicsResource Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsResource.ResourceType Property
Gets the type of this resource.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public virtual ResourceType ResourceType { get; }
Property Value
The resource type.
See Also
Reference
GraphicsResource Class
GraphicsResource Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsResource.Tag Property
Gets the resource tags for this resource.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Object Tag { get; set; }
Property Value
The resource tags.
See Also
Reference
GraphicsResource Class
GraphicsResource Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GraphicsResource Events
Public Events
Name Description
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micro
soft .NET common language runtime.
See Also
Reference
GraphicsResource Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
GraphicsResource.Disposing Event
Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET
common language runtime.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public event EventHandler Disposing
See Also
Reference
GraphicsResource Class
GraphicsResource Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IDynamicGraphicsResource Interface
For internal use only.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private interface IDynamicGraphicsResource
See Also
Reference
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IGraphicsDeviceService Interface
Defines a mechanism for retrieving GraphicsDevice objects.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public interface IGraphicsDeviceService
See Also
Tasks
Application Model Overview
Reference
GraphicsDeviceManager
IGraphicsDeviceService Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IGraphicsDeviceService Members
The following tables list the members exposed by the IGraphicsDeviceService type.
Public Properties
Name Description
GraphicsDevice Retrieves a graphcs device.
Public Events
Name Description
DeviceCreated The event that occurs when a graphics device is created.
DeviceDisposing The event that occurs when a graphics device is disposing.
DeviceReset The event that occurs when a graphics device is reset.
DeviceResetting The event that occurs when a graphics device is in the process of resetting.
See Also
Reference
IGraphicsDeviceService Interface
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
IGraphicsDeviceService Properties
Public Properties
Name Description
GraphicsDevice Retrieves a graphcs device.
See Also
Reference
IGraphicsDeviceService Interface
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
IGraphicsDeviceService.GraphicsDevice Property
Retrieves a graphcs device.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public abstract GraphicsDevice GraphicsDevice { get; }
Property Value
A graphics device.
See Also
Reference
IGraphicsDeviceService Interface
IGraphicsDeviceService Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IGraphicsDeviceService Events
Public Events
Name Description
DeviceCreated The event that occurs when a graphics device is created.
DeviceDisposing The event that occurs when a graphics device is disposing.
DeviceReset The event that occurs when a graphics device is reset.
DeviceResetting The event that occurs when a graphics device is in the process of resetting.
See Also
Reference
IGraphicsDeviceService Interface
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
IGraphicsDeviceService.DeviceCreated Event
The event that occurs when a graphics device is created.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public abstract event EventHandler DeviceCreated
See Also
Reference
IGraphicsDeviceService Interface
IGraphicsDeviceService Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IGraphicsDeviceService.DeviceDisposing Event
The event that occurs when a graphics device is disposing.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public abstract event EventHandler DeviceDisposing
See Also
Reference
IGraphicsDeviceService Interface
IGraphicsDeviceService Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IGraphicsDeviceService.DeviceReset Event
The event that occurs when a graphics device is reset.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public abstract event EventHandler DeviceReset
See Also
Reference
IGraphicsDeviceService Interface
IGraphicsDeviceService Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IGraphicsDeviceService.DeviceResetting Event
The event that occurs when a graphics device is in the process of resetting.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public abstract event EventHandler DeviceResetting
See Also
Reference
IGraphicsDeviceService Interface
IGraphicsDeviceService Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IGraphicsResource Interface
For internal use only.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private interface IGraphicsResource
See Also
Reference
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ImageFileFormat Enumeration
Defines supported image file formats that may be used for textures.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum ImageFileFormat
Members
Member name Description
Bmp Microsoft Windows bitmap file format.
Dds DirectDrawSurface file format.
Dib Microsoft Windows bitmap file format.
Hdr High dynamic-range file format.
Jpg Joint Photographic Experts Group (JPEG) compressed file format.
Pfm Portable float map file format.
Png Portable Network Graphics file format.
Ppm Portable pixmap file format.
Tga Truevision Targa image file format.
See Also
Reference
Texture.Save Method
TextureInformation.ImageFormat Property
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IndexBuffer Class
Describes the rendering order of the vertices in a vertex buffer.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class IndexBuffer : GraphicsResource
Example
The vertex stream and index data of the graphics device must be set before any call to DrawIndexedPrimitives. The following
example sets the index data and associates a user-created vertex buffer of type VertexPositionNormalTexture with vertex
stream 0 (zero) of the graphics device.
C#
graphics.GraphicsDevice.Vertices[0].SetSource(
vertexBuffer, 0,
VertexPositionNormalTexture.SizeInBytes);
graphics.GraphicsDevice.Indices = lineListIndexBuffer;
See Also
Tasks
How To: Draw Points, Lines, and Other 3D Primitives
Reference
IndexBuffer Members
Indices
DrawUserIndexedPrimitives
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IndexBuffer Members
The following tables list the members exposed by the IndexBuffer type.
Public Constructors
Name Description
IndexBuffer Overloaded. Initializes a new instance of this class.
Public Properties
Name Description
BufferUsage Gets the state of the related BufferUsage enumeration.
GraphicsDevice (Inherited from GraphicsResource.)
IndexElementSize Gets or sets a value indicating the size of this index element.
IsDisposed (Inherited from GraphicsResource.)
Name (Inherited from GraphicsResource.)
Priority (Inherited from GraphicsResource.)
ResourceType (Inherited from GraphicsResource.)
SizeInBytes Gets the size, in bytes, of this IndexBuffer.
Tag (Inherited from GraphicsResource.)
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetData Overloaded. Copies the index buffer into an array.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
SetData Overloaded. Copies array data to the index buffer.
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
MemberwiseClone (Inherited from Object.)
raise_Disposing (Inherited from GraphicsResource.)
Public Events
Name Description
Disposing (Inherited from GraphicsResource.)
See Also
Reference
IndexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
IndexBuffer Constructor
Initializes a new instance of this class.
Overload List
Name Description
IndexBuffer (GraphicsDevice, Int32, BufferUsage, IndexElementSize) Initializes a new instance of the IndexBuffer class.
IndexBuffer (GraphicsDevice, Type, Int32, BufferUsage) Initializes a new instance of the IndexBuffer class.
See Also
Tasks
How To: Load Content
Reference
GraphicsDeviceManager.DeviceReset Event
IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
graphicsDevice
The GraphicsDevice object to associate with the index buffer.
sizeInBytes
The size, in bytes, of the index buffer.
usage
A set of options identifying the behaviors of this index buffer resource.
elementSize
The size, in bits, of an index element.
Exceptions
Exception type Condition
ArgumentNullException graphicsDevice is null.
ArgumentOutOfRangeException
One of the following conditions is true:
elementSize is an invalid value. elementSize must be either
IndexElementSize.SixteenBits or IndexElementSize.ThirtyTwoBits.
sizeInBytes is not a valid value. sizeInBytes must be greater than zero, and a multiple of e
lementSize.
InvalidOperationException Unable to create this IndexBuffer resource on the graphics device.
See Also
Tasks
How To: Load Content
Reference
GraphicsDeviceManager.DeviceReset Event
IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The GraphicsDevice object to associate with the index buffer.
indexType
The type to use for index values.
elementCount
The number of values in the buffer.
usage
A set of options identifying the behaviors of this index buffer resource.
Exceptions
Exception type Condition
ArgumentNullException graphicsDevice is null.
ArgumentOutOfRangeException The elementCount parameter is invalid. Index buffers can only be created for indices which ar
e sixteen or thirty-two bits in length.
InvalidOperationException Unable to create this IndexBuffer resource on the graphics device.
See Also
Tasks
How To: Load Content
Reference
GraphicsDeviceManager.DeviceReset Event
IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IndexBuffer Methods
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetData Overloaded. Copies the index buffer into an array.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
SetData Overloaded. Copies array data to the index buffer.
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
MemberwiseClone (Inherited from Object.)
raise_Disposing (Inherited from GraphicsResource.)
See Also
Reference
IndexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
IndexBuffer.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
IndexBuffer.Dispose (Boolean) Immediately releases the unmanaged resources used by this object.
IndexBuffer.Dispose () (Inherited from GraphicsResource.)
Remarks
Call Dispose when you are finished using the IndexBuffer. The Dispose method leaves the IndexBuffer in an unusable state.
After calling Dispose, you must release all references to the IndexBuffer so the garbage collector can reclaim the memory that
the IndexBuffer was occupying.
Note
Always call Dispose before you release your last reference to the IndexBuffer. Otherwise, the resources it is using will not be f
reed until the garbage collector calls the IndexBuffer object's Finalize method.
See Also
Reference
IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
Remarks
This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean)
method with the disposing parameter set to true. Finalize invokes Dispose(Boolean) with disposing set to false.
When the disposing parameter is true, this method releases all resources held by any managed objects that this IndexBuffer
references. This method invokes the Dispose method of each referenced object.
Note
Notes to Inheritors
Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects
disposed of in an earlier call to Dispose.
See Also
Reference
IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IndexBuffer.GetData Method
Copies the index buffer into an array.
Overload List
Name Description
IndexBuffer.GetData (Int32, T[], Int32, Int32) Copies the index buffer into an array.
IndexBuffer.GetData (T[]) Copies the index buffer into an array.
IndexBuffer.GetData (T[], Int32, Int32) Copies the index buffer into an array.
See Also
Reference
IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Type Parameters
T
The type of elements in the array.
Parameters
offsetInBytes
The number of bytes into the index buffer where copying will start.
data
The array to receive index buffer data.
startIndex
The index of the element in the array at which to start copying.
elementCount
The number of elements to copy.
Exceptions
Exception type Condition
ArgumentNullException data is null.
InvalidOperationException The array specified in the data parameter is not the correct size for the amount of data requested.
NotSupportedException This IndexBuffer was created with a usage type of BufferUsage.WriteOnly. Calling GetData on a res
ource that was created with BufferUsage.WriteOnly is not supported.
See Also
Reference
IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of elements in the array.
Parameters
data
The array to receive index buffer data.
Exceptions
Exception type Condition
ArgumentNullException data is null.
InvalidOperationException The array specified in the data parameter is not the correct size for the amount of data requested.
NotSupportedException This IndexBuffer was created with a usage type of BufferUsage.WriteOnly. Calling GetData on a res
ource that was created with BufferUsage.WriteOnly is not supported.
Remarks An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or
SetData methods) a resource that is currently set on a graphics device.
See Also
Reference
IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of elements in the array.
Parameters
data
The array to receive index buffer data.
startIndex
The index of the element in the array at which to start copying.
elementCount
The number of elements to copy.
Exceptions
Exception type Condition
ArgumentNullException data is null.
InvalidOperationException The array specified in the data parameter is not the correct size for the amount of data requested.
NotSupportedException This IndexBuffer was created with a usage type of BufferUsage.WriteOnly. Calling GetData on a res
ource that was created with BufferUsage.WriteOnly is not supported.
Remarks An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or
SetData methods) a resource that is currently set on a graphics device.
See Also
Reference
IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IndexBuffer.SetData Method
Copies array data to the index buffer.
Overload List
Name Description
IndexBuffer.SetData (Int32, T[], Int32, Int32) Copies array data to the index buffer.
IndexBuffer.SetData (T[]) Copies array data to the index buffer.
IndexBuffer.SetData (T[], Int32, Int32) Copies array data to the index buffer.
See Also
Reference
IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Type Parameters
T
The type of the elements in the array.
Parameters
offsetInBytes
Number of bytes into the index buffer where copying will start.
data
The array of data to copy.
startIndex
The index of the element in the array at which to start copying.
elementCount
The number of elements to copy.
Remarks An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or
SetData methods) a resource that is currently set on a graphics device.
See Also
Reference
IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of the elements in the array.
Parameters
data
The array of data to copy.
Remarks
Caution
Here is a tip for rendering objects within the Draw method of an Xbox 360 game. Do not use SetData when writing data to v
ertex buffers, index buffers, and textures. This method may lead to graphics corruption or crashes. To avoid this potential issu
e, use DrawUserPrimitives or DynamicIndexBuffer as the preferred alternative to SetData for dynamic vertex generation.
This is because, in cases where the size of the back buffer and depth stencil buffer exceed the size of the Xbox 360 10 MB of e
mbedded memory (EDRAM), predicated tiling is utilized on this platform to compensate for the additional memory requirem
ents. Predicated tiling is a process by which scene rendering is performed multiple times on subsections of the final render ta
rget dimensions.
When predicated tiling has been triggered, the drawing commands contained in the Draw function are not submitted until
Present is called. (Note that Draw implicitly calls Present at the end of this method.) In this case, these resources are not avail
able for modification until the GPU is finished with presenting the entire frame.
An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or SetData
methods) a resource that is currently set on a graphics device.
See Also
Concepts
Predicated Tiling
Reference
IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of the elements in the array.
Parameters
data
The array of data to copy.
startIndex
The index of the element in the array at which to start copying.
elementCount
The number of elements to copy.
Remarks An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or
SetData methods) a resource that is currently set on a graphics device.
See Also
Reference
IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IndexBuffer.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IndexBuffer Properties
Public Properties
Name Description
BufferUsage Gets the state of the related BufferUsage enumeration.
GraphicsDevice (Inherited from GraphicsResource.)
IndexElementSize Gets or sets a value indicating the size of this index element.
IsDisposed (Inherited from GraphicsResource.)
Name (Inherited from GraphicsResource.)
Priority (Inherited from GraphicsResource.)
ResourceType (Inherited from GraphicsResource.)
SizeInBytes Gets the size, in bytes, of this IndexBuffer.
Tag (Inherited from GraphicsResource.)
See Also
Reference
IndexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
IndexBuffer.BufferUsage Property
Gets the state of the related BufferUsage enumeration.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public BufferUsage BufferUsage { get; }
Property Value
Indicates how the application uses buffer contents.
See Also
Reference
IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IndexBuffer.IndexElementSize Property
Gets or sets a value indicating the size of this index element.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public IndexElementSize IndexElementSize { get; }
Property Value
The size of this index element.
See Also
Reference
IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IndexBuffer.SizeInBytes Property
Gets the size, in bytes, of this IndexBuffer.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int SizeInBytes { get; }
Property Value
The size, in bytes, of this IndexBuffer.
See Also
Reference
IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IndexElementSize Enumeration
Defines the size of an element of an index buffer.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum IndexElementSize
Members
Member name Description
SixteenBits Sixteen bits.
ThirtyTwoBits Thirty-two bits.
See Also
Reference
IndexBuffer Constructor
IndexBuffer.IndexElementSize Property
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Model Class
Represents a 3D model composed of multiple ModelMesh objects which may be moved independently.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class Model
See Also
Tasks
How To: Render a Model
Reference
Model Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Model Members
The following tables list the members exposed by the Model type.
Public Constructors
Name Description
Model Initializes a new instance of Model.
Public Properties
Name Description
Bones Gets a collection of ModelBone objects which describe how each mesh in the Meshes collection for this model relat
es to its parent mesh.
Meshes Gets a collection of ModelMesh objects which compose the model. Each ModelMesh in a model may be moved ind
ependently and may be composed of multiple materials identified as ModelMeshPart objects.
Root Gets the root bone for this model.
Tag Gets or sets an object identifying this model.
Public Methods
Name Description
CopyAbsoluteBoneTransformsTo Copies a transform of each bone in a model relative to all parent bones of the bone into a
given array.
CopyBoneTransformsFrom Copies an array of transforms into each bone in the model.
CopyBoneTransformsTo Copies each bone transform relative only to the parent bone of the model to a given array
.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Model Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Model Constructor
Initializes a new instance of Model.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Model ()
See Also
Reference
Model Class
Model Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Model Methods
Public Methods
Name Description
CopyAbsoluteBoneTransformsTo Copies a transform of each bone in a model relative to all parent bones of the bone into a
given array.
CopyBoneTransformsFrom Copies an array of transforms into each bone in the model.
CopyBoneTransformsTo Copies each bone transform relative only to the parent bone of the model to a given array
.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Model Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Model.CopyAbsoluteBoneTransformsTo Method
Copies a transform of each bone in a model relative to all parent bones of the bone into a given array.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void CopyAbsoluteBoneTransformsTo (
Matrix[] destinationBoneTransforms
)
Parameters
destinationBoneTransforms
The array to receive bone transforms.
Exceptions
Exception type Condition
ArgumentNullException destinationBoneTransforms is null.
ArgumentOutOfRangeException destinationBoneTransforms is not the same size as Bones
Remarks
In an absolute transform, each bone is transformed according to the position of all parent bones.
This is the same as iterating the Bones collection and applying the transformation matrix of every parent of a ModelBone to the
Transform property of each ModelBone and copying the results into an array that can be indexed into by the bone index.
An array of transformation matrices for the meshes of any model can be obtained by calling CopyAbsoluteBoneTransformsTo
or CopyBoneTransformsTo. The resulting array contains the transforms that describe how each ModelMesh is located relative
to one another in the Model. The transformation matrix that should be applied to each ModelMesh can be obtained using the
index of the CopyAbsoluteBoneTransformsTo to retrieve a transformation matrix from this collection.
For a demonstration of how to use the transforms for the parent bones of a model mesh to set the position of the mesh parts,
please see How To: Render a Model.
See Also
Tasks
How To: Render a Model
Reference
Model Class
Model Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Model.CopyBoneTransformsFrom Method
Copies an array of transforms into each bone in the model.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void CopyBoneTransformsFrom (
Matrix[] sourceBoneTransforms
)
Parameters
sourceBoneTransforms
An array containing new bone transforms.
Exceptions
Exception type Condition
ArgumentNullException sourceBoneTransforms is null.
ArgumentOutOfRangeException sourceBoneTransforms is not the same size as Bones
See Also
Reference
Model Class
Model Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Model.CopyBoneTransformsTo Method
Copies each bone transform relative only to the parent bone of the model to a given array.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void CopyBoneTransformsTo (
Matrix[] destinationBoneTransforms
)
Parameters
destinationBoneTransforms
The array to receive bone transforms.
Exceptions
Exception type Condition
ArgumentNullException destinationBoneTransforms is null.
ArgumentOutOfRangeException destinationBoneTransforms is not the same size as Bones
Remarks
This is the same as iterating the Bones collection and copying the Transform property into an array that can be indexed into by
the bone index.
An array of transformation matrices for the meshes of any model can be obtained by calling CopyAbsoluteBoneTransformsTo
or CopyBoneTransformsTo. The resulting array contains the transforms that describe how each ModelMesh is located relative
to one another in the Model. The transformation matrix that should be applied to each ModelMesh can be obtained using the
index of the CopyBoneTransformsTo to retrieve a transformation matrix from this collection.
For a demonstration of how to use the transforms for the parent bones of a model mesh to set the position of the mesh parts,
please see How To: Render a Model.
See Also
Tasks
How To: Render a Model
Reference
Model.CopyAbsoluteBoneTransformsTo Method
Model Class
Model Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Model Properties
Public Properties
Name Description
Bones Gets a collection of ModelBone objects which describe how each mesh in the Meshes collection for this model relat
es to its parent mesh.
Meshes Gets a collection of ModelMesh objects which compose the model. Each ModelMesh in a model may be moved ind
ependently and may be composed of multiple materials identified as ModelMeshPart objects.
Root Gets the root bone for this model.
Tag Gets or sets an object identifying this model.
See Also
Reference
Model Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Model.Bones Property
Gets a collection of ModelBone objects which describe how each mesh in the Meshes collection for this model relates to its
parent mesh.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ModelBoneCollection Bones { get; }
Property Value
A collection of ModelBone objects used by this model.
Remarks
Caution
Please note that the transforms contained in this collection of bones does not describe the cumulative relationship of each m
esh relative to all of its parent meshes in the collection, just the immediate parent of the mesh. For this information, please se
e CopyAbsoluteBoneTransformsTo.
The transforms of each ModelBone in Bones can also be obtained using the CopyBoneTransformsTo method.
For a demonstration of how to use the transforms for the parent bones of a model mesh to set the position of the mesh parts,
please see How To: Render a Model.
See Also
Tasks
How To: Render a Model
Reference
Model.CopyAbsoluteBoneTransformsTo Method
Model Class
Model Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Model.Meshes Property
Gets a collection of ModelMesh objects which compose the model. Each ModelMesh in a model may be moved independently
and may be composed of multiple materials identified as ModelMeshPart objects.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ModelMeshCollection Meshes { get; }
Property Value
A collection of ModelMesh objects used by this model.
Remarks
For a demonstration of how to use the transforms for the parent bones of a model mesh to set the position of the mesh
objects, please see How To: Render a Model.
See Also
Tasks
How To: Render a Model
Reference
Model Class
Model Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Model.Root Property
Gets the root bone for this model.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ModelBone Root { get; }
Property Value
The root bone for this model.
See Also
Reference
Model Class
Model Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Model.Tag Property
Gets or sets an object identifying this model.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Object Tag { get; set; }
Property Value
An object identifying this model.
See Also
Reference
Model Class
Model Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelBone Class
Represents bone data for a model.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class ModelBone
See Also
Reference
ModelBone Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelBone Members
The following tables list the members exposed by the ModelBone type.
Public Properties
Name Description
Children Gets a collection of bones that are children of this bone.
Index Gets the index of this bone in the Bones collection.
Name Gets the name of this bone.
Parent Gets the parent of this bone.
Transform Gets or sets the matrix used to transform this bone relative to its parent bone.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ModelBone Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelBone Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ModelBone Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelBone Properties
Public Properties
Name Description
Children Gets a collection of bones that are children of this bone.
Index Gets the index of this bone in the Bones collection.
Name Gets the name of this bone.
Parent Gets the parent of this bone.
Transform Gets or sets the matrix used to transform this bone relative to its parent bone.
See Also
Reference
ModelBone Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelBone.Children Property
Gets a collection of bones that are children of this bone.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ModelBoneCollection Children { get; }
Property Value
A collection of bones that are children of this bone.
See Also
Reference
ModelBone Class
ModelBone Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelBone.Index Property
Gets the index of this bone in the Bones collection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Index { get; }
Property Value
The index of this bone in the Bones collection.
See Also
Reference
ModelBone Class
ModelBone Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelBone.Name Property
Gets the name of this bone.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Name { get; }
Property Value
The name of this bone.
See Also
Reference
ModelBone Class
ModelBone Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelBone.Parent Property
Gets the parent of this bone.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ModelBone Parent { get; }
Property Value
The parent of this bone.
See Also
Reference
ModelBone Class
ModelBone Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelBone.Transform Property
Gets or sets the matrix used to transform this bone relative to its parent bone.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Matrix Transform { get; set; }
Property Value
The matrix used to transform this bone relative only to its parent bone.
Remarks
Caution
Please note that the transform described by Transform does not describe the cumulative relationship of each mesh relative t
o all of its parent meshes in a Model, just the immediate parent of the mesh. For this information, please see
CopyAbsoluteBoneTransformsTo.
For a demonstration of how to use the transforms for the parent bones of a model mesh to set the position of the mesh parts,
please see How To: Render a Model.
See Also
Tasks
How To: Render a Model
Reference
Model.CopyAbsoluteBoneTransformsTo Method
ModelBone Class
ModelBone Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelBoneCollection Class
Represents a set of bones associated with a model.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class ModelBoneCollection : ReadOnlyCollection<ModelBone>
See Also
Reference
ModelBoneCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelBoneCollection Members
The following tables list the members exposed by the ModelBoneCollection type.
Public Properties
Name Description
Count (Inherited from ReadOnlyCollection.)
Item Overloaded. Retrieves a ModelBone from the collection.
Protected Properties
Name Description
Items (Inherited from ReadOnlyCollection.)
Public Methods
Name Description
Contains (Inherited from ReadOnlyCollection.)
CopyTo (Inherited from ReadOnlyCollection.)
Equals (Inherited from Object.)
GetEnumerator Returns a ModelBoneCollection.Enumerator that can iterate through a ModelBoneCollection.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
IndexOf (Inherited from ReadOnlyCollection.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
TryGetValue Finds a bone with a given name if it exists in the collection.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ModelBoneCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelBoneCollection Methods
Public Methods
Name Description
Contains (Inherited from ReadOnlyCollection.)
CopyTo (Inherited from ReadOnlyCollection.)
Equals (Inherited from Object.)
GetEnumerator Returns a ModelBoneCollection.Enumerator that can iterate through a ModelBoneCollection.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
IndexOf (Inherited from ReadOnlyCollection.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
TryGetValue Finds a bone with a given name if it exists in the collection.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ModelBoneCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelBoneCollection.GetEnumerator Method
Returns a ModelBoneCollection.Enumerator that can iterate through a ModelBoneCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Enumerator GetEnumerator ()
Return Value
The ModelBoneCollection.Enumerator of the bone collection.
See Also
Reference
ModelBoneCollection Class
ModelBoneCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelBoneCollection.TryGetValue Method
Finds a bone with a given name if it exists in the collection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool TryGetValue (
string boneName,
out ModelBone value
)
Parameters
boneName
The name of the bone to find.
value
[OutAttribute] The bone named boneName, if found.
Return Value
true if the named bone is found, otherwise false.
Exceptions
Exception type Condition
ArgumentNullException boneName is null.
See Also
Reference
ModelBoneCollection Class
ModelBoneCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelBoneCollection Properties
Public Properties
Name Description
Count (Inherited from ReadOnlyCollection.)
Item Overloaded. Retrieves a ModelBone from the collection.
Protected Properties
Name Description
Items (Inherited from ReadOnlyCollection.)
See Also
Reference
ModelBoneCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelBoneCollection.Item Property
Retrieves a ModelBone from the collection.
Overload List
Name Description
ModelBoneCollection.Item (String) Retrieves a ModelBone from the collection, given the name of the bone.
ModelBoneCollection.Item (Int32) (Inherited from ReadOnlyCollection.)
See Also
Reference
ModelBoneCollection Class
ModelBoneCollection Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Property Value
The ModelBone identified by boneName.
Exceptions
Exception type Condition
KeyNotFoundException boneName was not found in this ModelBoneCollection.
See Also
Reference
ModelBoneCollection Class
ModelBoneCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelBoneCollection.Enumerator Structure
Provides the ability to iterate through the bones in an ModelBoneCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct ModelBoneCollection.Enumerator : IEnumerator<ModelBone>, IDisposable, IEnumer
ator
See Also
Reference
ModelBoneCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelBoneCollection.Enumerator Members
The following tables list the members exposed by the ModelBoneCollection.Enumerator type.
Public Properties
Name Description
Current Gets the current element in the ModelBoneCollection.
Public Methods
Name Description
Dispose Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetType (Inherited from Object.)
MoveNext Advances the enumerator to the next element of the ModelBoneCollection.
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
System.Collections.IEnumerator.Current Gets the current element in the ModelBoneCollection as a Object.
System.Collections.IEnumerator.Reset Sets the enumerator to its initial position, which is before the first element in the
ModelBoneCollection.
See Also
Reference
ModelBoneCollection.Enumerator Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelBoneCollection.Enumerator Methods
Public Methods
Name Description
Dispose Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetType (Inherited from Object.)
MoveNext Advances the enumerator to the next element of the ModelBoneCollection.
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
System.Collections.IEnumerator.Current Gets the current element in the ModelBoneCollection as a Object.
System.Collections.IEnumerator.Reset Sets the enumerator to its initial position, which is before the first element in the
ModelBoneCollection.
See Also
Reference
ModelBoneCollection.Enumerator Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelBoneCollection.Enumerator.Dispose Method
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
See Also
Reference
ModelBoneCollection.Enumerator Structure
ModelBoneCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelBoneCollection.Enumerator.MoveNext Method
Advances the enumerator to the next element of the ModelBoneCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool MoveNext ()
Return Value
true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the
collection.
Exceptions
Exception type Condition
InvalidOperationException The collection was modified after the enumerator was created.
Remarks
After an enumerator is created or after a call to System.Collections.IEnumerator.Reset, an enumerator is positioned before the
first element of the collection, and the first call to MoveNext moves the enumerator over the first element of the collection.
After the end of the collection is passed, subsequent calls to MoveNext return false until System.Collections.IEnumerator.Reset
is called.
An enumerator remains valid as long as the collection remains unchanged. If changes, such as adding, modifying, or deleting
elements are made to the collection, the enumerator is irrecoverably invalidated and the next call to MoveNext or
System.Collections.IEnumerator.Reset throws an InvalidOperationException.
See Also
Reference
ModelBoneCollection.Enumerator Structure
ModelBoneCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
System.Collections.IEnumerator.Reset Method
Sets the enumerator to its initial position, which is before the first element in the ModelBoneCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private void System.Collections.IEnumerator.Reset ()
Exceptions
Exception type Condition
InvalidOperationException
The collection was modified after the enumerator was created.
Remarks
An enumerator remains valid as long as the collection remains unchanged. If changes, such as adding, modifying, or deleting
elements are made to the collection, the enumerator is irrecoverably invalidated and the next call to MoveNext or the
System.Collections.IEnumerator.Reset throws an InvalidOperationException.
Note
Notes to Implementers: All calls to System.Collections.IEnumerator.Reset must result in the same state for the enumerato
r. The preferred implementation is to move the enumerator to the beginning of the collection, before the first element. This in
validates the enumerator if the collection has been modified since the enumerator was created, which is consistent with
MoveNext and Current.
See Also
Reference
ModelBoneCollection.Enumerator Structure
ModelBoneCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelBoneCollection.Enumerator Properties
Public Properties
Name Description
Current Gets the current element in the ModelBoneCollection.
See Also
Reference
ModelBoneCollection.Enumerator Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelBoneCollection.Enumerator.Current Property
Gets the current element in the ModelBoneCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ModelBone Current { get; }
Property Value
The current element in the ModelBoneCollection.
See Also
Reference
ModelBoneCollection.Enumerator Structure
ModelBoneCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelBoneCollection.Enumerator.System.Collections.IEnumerator.Current
Property
Gets the current element in the ModelBoneCollection as a Object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private Object System.Collections.IEnumerator.Current { get; }
Property Value
The current element in the ModelBoneCollection as an Object.
See Also
Reference
ModelBoneCollection.Enumerator Structure
ModelBoneCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelEffectCollection Class
Represents a collection of effects associated with a model.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class ModelEffectCollection : ReadOnlyCollection<Effect>
See Also
Reference
ModelEffectCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelEffectCollection Members
The following tables list the members exposed by the ModelEffectCollection type.
Public Properties
Name Description
Count (Inherited from ReadOnlyCollection.)
Item (Inherited from ReadOnlyCollection.)
Protected Properties
Name Description
Items (Inherited from ReadOnlyCollection.)
Public Methods
Name Description
Contains (Inherited from ReadOnlyCollection.)
CopyTo (Inherited from ReadOnlyCollection.)
Equals (Inherited from Object.)
GetEnumerator Returns a ModelEffectCollection.Enumerator that can iterate through a ModelEffectCollection.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
IndexOf (Inherited from ReadOnlyCollection.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ModelEffectCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelEffectCollection Methods
Public Methods
Name Description
Contains (Inherited from ReadOnlyCollection.)
CopyTo (Inherited from ReadOnlyCollection.)
Equals (Inherited from Object.)
GetEnumerator Returns a ModelEffectCollection.Enumerator that can iterate through a ModelEffectCollection.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
IndexOf (Inherited from ReadOnlyCollection.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ModelEffectCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelEffectCollection.GetEnumerator Method
Returns a ModelEffectCollection.Enumerator that can iterate through a ModelEffectCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Enumerator GetEnumerator ()
Return Value
The ModelEffectCollection.Enumerator of the effect collection.
See Also
Reference
ModelEffectCollection Class
ModelEffectCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelEffectCollection Properties
Public Properties
Name Description
Count (Inherited from ReadOnlyCollection.)
Item (Inherited from ReadOnlyCollection.)
Protected Properties
Name Description
Items (Inherited from ReadOnlyCollection.)
See Also
Reference
ModelEffectCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelEffectCollection.Enumerator Structure
Provides the ability to iterate through the bones in an ModelEffectCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct ModelEffectCollection.Enumerator : IEnumerator<Effect>, IDisposable, IEnumera
tor
See Also
Reference
ModelEffectCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelEffectCollection.Enumerator Members
The following tables list the members exposed by the ModelEffectCollection.Enumerator type.
Public Properties
Name Description
Current Gets the current element in the ModelEffectCollection.
Public Methods
Name Description
Dispose Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetType (Inherited from Object.)
MoveNext Advances the enumerator to the next element of the ModelEffectCollection.
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
System.Collections.IEnumerator.Current Gets the current element in the ModelEffectCollection as a Object.
System.Collections.IEnumerator.Reset Sets the enumerator to its initial position, which is before the first element in the
ModelEffectCollection.
See Also
Reference
ModelEffectCollection.Enumerator Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelEffectCollection.Enumerator Methods
Public Methods
Name Description
Dispose Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetType (Inherited from Object.)
MoveNext Advances the enumerator to the next element of the ModelEffectCollection.
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
System.Collections.IEnumerator.Current Gets the current element in the ModelEffectCollection as a Object.
System.Collections.IEnumerator.Reset Sets the enumerator to its initial position, which is before the first element in the
ModelEffectCollection.
See Also
Reference
ModelEffectCollection.Enumerator Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelEffectCollection.Enumerator.Dispose Method
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
See Also
Reference
ModelEffectCollection.Enumerator Structure
ModelEffectCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelEffectCollection.Enumerator.MoveNext Method
Advances the enumerator to the next element of the ModelEffectCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool MoveNext ()
Return Value
true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the
collection.
Exceptions
Exception type Condition
InvalidOperationException The collection was modified after the enumerator was created.
Remarks
After an enumerator is created or after a call to System.Collections.IEnumerator.Reset, an enumerator is positioned before the
first element of the collection, and the first call to MoveNext moves the enumerator over the first element of the collection.
After the end of the collection is passed, subsequent calls to MoveNext return false until System.Collections.IEnumerator.Reset
is called.
An enumerator remains valid as long as the collection remains unchanged. If changes, such as adding, modifying, or deleting
elements are made to the collection, the enumerator is irrecoverably invalidated and the next call to MoveNext or
System.Collections.IEnumerator.Reset throws an InvalidOperationException.
See Also
Reference
ModelEffectCollection.Enumerator Structure
ModelEffectCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
System.Collections.IEnumerator.Reset Method
Sets the enumerator to its initial position, which is before the first element in the ModelEffectCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private void System.Collections.IEnumerator.Reset ()
Exceptions
Exception type Condition
InvalidOperationException
The collection was modified after the enumerator was created.
Remarks
An enumerator remains valid as long as the collection remains unchanged. If changes, such as adding, modifying, or deleting
elements are made to the collection, the enumerator is irrecoverably invalidated and the next call to MoveNext or the
System.Collections.IEnumerator.Reset throws an InvalidOperationException.
Note
Notes to Implementers: All calls to System.Collections.IEnumerator.Reset must result in the same state for the enumerato
r. The preferred implementation is to move the enumerator to the beginning of the collection, before the first element. This in
validates the enumerator if the collection has been modified since the enumerator was created, which is consistent with
MoveNext and Current.
See Also
Reference
ModelEffectCollection.Enumerator Structure
ModelEffectCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelEffectCollection.Enumerator Properties
Public Properties
Name Description
Current Gets the current element in the ModelEffectCollection.
See Also
Reference
ModelEffectCollection.Enumerator Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelEffectCollection.Enumerator.Current Property
Gets the current element in the ModelEffectCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Effect Current { get; }
Property Value
The current element in the ModelEffectCollection.
See Also
Reference
ModelEffectCollection.Enumerator Structure
ModelEffectCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelEffectCollection.Enumerator.System.Collections.IEnumerator.Current
Property
Gets the current element in the ModelEffectCollection as a Object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private Object System.Collections.IEnumerator.Current { get; }
Property Value
The current element in the ModelEffectCollection as a Object.
See Also
Reference
ModelEffectCollection.Enumerator Structure
ModelEffectCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMesh Class
Represents a mesh that is part of a Model.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class ModelMesh
See Also
Tasks
How To: Render a Model
Reference
ModelMesh Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMesh Members
The following tables list the members exposed by the ModelMesh type.
Public Properties
Name Description
BoundingSphere Gets the BoundingSphere that contains this mesh.
Effects Gets a collection of effects associated with this mesh.
IndexBuffer Gets the index buffer for this mesh.
MeshParts Gets the ModelMeshPart objects that make up this mesh. Each part of a mesh is composed of a set of prim
itives that share the same material.
Name Gets the name of this mesh.
ParentBone Gets the parent bone for this mesh. The parent bone of a mesh contains a transformation matrix that descr
ibes how the mesh is located relative to any parent meshes in a model.
Tag Gets or sets an object identifying this mesh.
VertexBuffer Gets the vertex buffer used to render this mesh.
Public Methods
Name Description
Draw Overloaded. Draws all the ModelMeshPart objects in this mesh, using their current Effect settings.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ModelMesh Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelMesh Methods
Public Methods
Name Description
Draw Overloaded. Draws all the ModelMeshPart objects in this mesh, using their current Effect settings.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ModelMesh Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelMesh.Draw Method
Draws all the ModelMeshPart objects in this mesh, using their current Effect settings.
Overload List
Name Description
ModelMesh.Draw () Draws all of the ModelMeshPart objects in this mesh, using their current Effect settings.
ModelMesh.Draw (SaveStateMode) Draws all of the ModelMeshPart objects in this mesh, using their current Effect settings, an
d specifying options for saving effect state.
See Also
Tasks
How To: Render a Model
Reference
ModelMesh Class
ModelMesh Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelMesh.Draw Method ()
Draws all of the ModelMeshPart objects in this mesh, using their current Effect settings.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Draw ()
Exceptions
Exception type Condition
InvalidOperationException Effect is a null.
Remarks
Unexpected behavior can result when rendering sprites and 3D objects on the same graphics device. For more information, see
Render States and the Graphics Device.
See Also
Tasks
How To: Render a Model
Reference
ModelMesh Class
ModelMesh Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
saveStateMode
The save state options to pass to each Effect.
Exceptions
Exception type Condition
InvalidOperationException Effect is a null.
Remarks
Unexpected behavior can result when rendering sprites and 3D objects on the same graphics device. For more information, see
Render States and the Graphics Device.
See Also
Tasks
How To: Render a Model
Reference
ModelMesh Class
ModelMesh Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMesh Properties
Public Properties
Name Description
BoundingSphere Gets the BoundingSphere that contains this mesh.
Effects Gets a collection of effects associated with this mesh.
IndexBuffer Gets the index buffer for this mesh.
MeshParts Gets the ModelMeshPart objects that make up this mesh. Each part of a mesh is composed of a set of prim
itives that share the same material.
Name Gets the name of this mesh.
ParentBone Gets the parent bone for this mesh. The parent bone of a mesh contains a transformation matrix that descr
ibes how the mesh is located relative to any parent meshes in a model.
Tag Gets or sets an object identifying this mesh.
VertexBuffer Gets the vertex buffer used to render this mesh.
See Also
Reference
ModelMesh Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelMesh.BoundingSphere Property
Gets the BoundingSphere that contains this mesh.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public BoundingSphere BoundingSphere { get; }
Property Value
The BoundingSphere that contains this mesh.
See Also
Reference
ModelMesh Class
ModelMesh Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMesh.Effects Property
Gets a collection of effects associated with this mesh.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ModelEffectCollection Effects { get; }
Property Value
A collection of effects associated with this mesh.
Remarks
ModelMesh.Effects is a shortcut for iterating over the MeshParts property of the ModelMesh and looking up the
ModelMeshPart.Effect property of each ModelMeshPart.
ModelMesh.Effects is a collection of all the Effect properties of the for the MeshParts of this ModelMesh. Each ModelMeshPart
has a single Effect which is a reference to one of the Effects of the parent ModelMesh property. By updating all the effects of
the ModelMesh all of the effects of each ModelMeshPart are updated as well.
See Also
Reference
ModelMesh Class
ModelMesh Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMesh.IndexBuffer Property
Gets the index buffer for this mesh.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public IndexBuffer IndexBuffer { get; }
Property Value
The index buffer for this mesh.
See Also
Reference
ModelMesh Class
ModelMesh Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMesh.MeshParts Property
Gets the ModelMeshPart objects that make up this mesh. Each part of a mesh is composed of a set of primitives that share the
same material.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ModelMeshPartCollection MeshParts { get; }
Property Value
The ModelMeshPart objects that make up this mesh.
Remarks
It is not necessary to use this class directly. In advanced rendering scenarios, it is possible to draw using MeshParts properties
in combination with the vertex and index buffers on ModelMesh. However, in most cases, ModelMesh.Draw will be sufficient.
See Also
Tasks
How To: Render a Model
Reference
ModelMesh Class
ModelMesh Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMesh.Name Property
Gets the name of this mesh.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Name { get; }
Property Value
The name of this mesh.
See Also
Reference
ModelMesh Class
ModelMesh Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMesh.ParentBone Property
Gets the parent bone for this mesh. The parent bone of a mesh contains a transformation matrix that describes how the mesh
is located relative to any parent meshes in a model.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ModelBone ParentBone { get; }
Property Value
The parent bone for this mesh.
Remarks
An array of transformation matrices for the meshes of any model can be obtained by calling CopyAbsoluteBoneTransformsTo
or CopyBoneTransformsTo. The resulting array contains the transforms that describe how each ModelMesh is located relative
to one another in the Model. The transformation matrix that should be applied to each ModelMesh can be obtained using the
index of the ParentBone to retrieve a transformation matrix from this collection.
For a demonstration of how to use the transforms for the parent bones of a model mesh to set the position of the mesh parts,
please see How To: Render a Model.
See Also
Tasks
How To: Render a Model
Reference
ModelMesh Class
ModelMesh Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMesh.Tag Property
Gets or sets an object identifying this mesh.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Object Tag { get; set; }
Property Value
An object identifying this mesh.
See Also
Reference
ModelMesh Class
ModelMesh Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMesh.VertexBuffer Property
Gets the vertex buffer used to render this mesh.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public VertexBuffer VertexBuffer { get; }
Property Value
The vertex buffer used to render this mesh.
See Also
Reference
ModelMesh Class
ModelMesh Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMeshCollection Class
Represents a collection of ModelMesh objects.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class ModelMeshCollection : ReadOnlyCollection<ModelMesh>
See Also
Reference
ModelMeshCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMeshCollection Members
The following tables list the members exposed by the ModelMeshCollection type.
Public Properties
Name Description
Count (Inherited from ReadOnlyCollection.)
Item Overloaded. Retrieves a ModelMesh from the collection.
Protected Properties
Name Description
Items (Inherited from ReadOnlyCollection.)
Public Methods
Name Description
Contains (Inherited from ReadOnlyCollection.)
CopyTo (Inherited from ReadOnlyCollection.)
Equals (Inherited from Object.)
GetEnumerator Returns a ModelMeshCollection.Enumerator that can iterate through a ModelMeshCollection.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
IndexOf (Inherited from ReadOnlyCollection.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
TryGetValue Finds a mesh with a given name if it exists in the collection.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ModelMeshCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelMeshCollection Methods
Public Methods
Name Description
Contains (Inherited from ReadOnlyCollection.)
CopyTo (Inherited from ReadOnlyCollection.)
Equals (Inherited from Object.)
GetEnumerator Returns a ModelMeshCollection.Enumerator that can iterate through a ModelMeshCollection.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
IndexOf (Inherited from ReadOnlyCollection.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
TryGetValue Finds a mesh with a given name if it exists in the collection.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ModelMeshCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelMeshCollection.GetEnumerator Method
Returns a ModelMeshCollection.Enumerator that can iterate through a ModelMeshCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Enumerator GetEnumerator ()
Return Value
The ModelMeshCollection.Enumerator of the mesh collection.
See Also
Reference
ModelMeshCollection Class
ModelMeshCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMeshCollection.TryGetValue Method
Finds a mesh with a given name if it exists in the collection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool TryGetValue (
string meshName,
out ModelMesh value
)
Parameters
meshName
The name of the mesh to find.
value
[OutAttribute] The mesh named meshName, if found.
Return Value
true if the named mesh is found; false otherwise.
Exceptions
Exception type Condition
ArgumentNullException meshName is null.
See Also
Reference
ModelMeshCollection Class
ModelMeshCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMeshCollection Properties
Public Properties
Name Description
Count (Inherited from ReadOnlyCollection.)
Item Overloaded. Retrieves a ModelMesh from the collection.
Protected Properties
Name Description
Items (Inherited from ReadOnlyCollection.)
See Also
Reference
ModelMeshCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelMeshCollection.Item Property
Retrieves a ModelMesh from the collection.
Overload List
Name Description
ModelMeshCollection.Item (String) Retrieves a ModelMesh from the collection, given the name of the mesh.
ModelMeshCollection.Item (Int32) (Inherited from ReadOnlyCollection.)
See Also
Reference
ModelMeshCollection Class
ModelMeshCollection Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Property Value
The ModelMesh identified by meshName.
Exceptions
Exception type Condition
KeyNotFoundException meshName was not found in this ModelMeshCollection.
See Also
Reference
ModelMeshCollection Class
ModelMeshCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMeshCollection.Enumerator Structure
Provides the ability to iterate through the bones in an ModelMeshCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct ModelMeshCollection.Enumerator : IEnumerator<ModelMesh>, IDisposable, IEnumer
ator
See Also
Reference
ModelMeshCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMeshCollection.Enumerator Members
The following tables list the members exposed by the ModelMeshCollection.Enumerator type.
Public Properties
Name Description
Current Gets the current element in the ModelMeshCollection.
Public Methods
Name Description
Dispose Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetType (Inherited from Object.)
MoveNext Advances the enumerator to the next element of the ModelMeshCollection.
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
System.Collections.IEnumerator.Current Gets the current element in the ModelMeshCollection as a Object.
System.Collections.IEnumerator.Reset Sets the enumerator to its initial position, which is before the first element in the
ModelMeshCollection.
See Also
Reference
ModelMeshCollection.Enumerator Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelMeshCollection.Enumerator Methods
Public Methods
Name Description
Dispose Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetType (Inherited from Object.)
MoveNext Advances the enumerator to the next element of the ModelMeshCollection.
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
System.Collections.IEnumerator.Current Gets the current element in the ModelMeshCollection as a Object.
System.Collections.IEnumerator.Reset Sets the enumerator to its initial position, which is before the first element in the
ModelMeshCollection.
See Also
Reference
ModelMeshCollection.Enumerator Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelMeshCollection.Enumerator.Dispose Method
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
See Also
Reference
ModelMeshCollection.Enumerator Structure
ModelMeshCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMeshCollection.Enumerator.MoveNext Method
Advances the enumerator to the next element of the ModelMeshCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool MoveNext ()
Return Value
true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the
collection.
Exceptions
Exception type Condition
InvalidOperationException The collection was modified after the enumerator was created.
Remarks
After an enumerator is created or after a call to System.Collections.IEnumerator.Reset, an enumerator is positioned before the
first element of the collection, and the first call to MoveNext moves the enumerator over the first element of the collection.
After the end of the collection is passed, subsequent calls to MoveNext return false until System.Collections.IEnumerator.Reset
is called.
An enumerator remains valid as long as the collection remains unchanged. If changes, such as adding, modifying, or deleting
elements are made to the collection, the enumerator is irrecoverably invalidated and the next call to MoveNext or
System.Collections.IEnumerator.Reset throws an InvalidOperationException.
See Also
Reference
ModelMeshCollection.Enumerator Structure
ModelMeshCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
System.Collections.IEnumerator.Reset Method
Sets the enumerator to its initial position, which is before the first element in the ModelMeshCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private void System.Collections.IEnumerator.Reset ()
Exceptions
Exception type Condition
InvalidOperationException
The collection was modified after the enumerator was created.
Remarks
An enumerator remains valid as long as the collection remains unchanged. If changes, such as adding, modifying, or deleting
elements are made to the collection, the enumerator is irrecoverably invalidated and the next call to MoveNext or the
System.Collections.IEnumerator.Reset throws an InvalidOperationException.
Note
Notes to Implementers: All calls to System.Collections.IEnumerator.Reset must result in the same state for the enumerato
r. The preferred implementation is to move the enumerator to the beginning of the collection, before the first element. This in
validates the enumerator if the collection has been modified since the enumerator was created, which is consistent with
MoveNext and Current.
See Also
Reference
ModelMeshCollection.Enumerator Structure
ModelMeshCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMeshCollection.Enumerator Properties
Public Properties
Name Description
Current Gets the current element in the ModelMeshCollection.
See Also
Reference
ModelMeshCollection.Enumerator Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelMeshCollection.Enumerator.Current Property
Gets the current element in the ModelMeshCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ModelMesh Current { get; }
Property Value
The current element in the ModelMeshCollection.
See Also
Reference
ModelMeshCollection.Enumerator Structure
ModelMeshCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMeshCollection.Enumerator.System.Collections.IEnumerator.Current
Property
Gets the current element in the ModelMeshCollection as a Object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private Object System.Collections.IEnumerator.Current { get; }
Property Value
The current element in the ModelMeshCollection.
See Also
Reference
ModelMeshCollection.Enumerator Structure
ModelMeshCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMeshPart Class
Represents a batch of geometry information to submit to the graphics device during rendering. Each ModelMeshPart is a
subdivision of a ModelMesh object. The ModelMesh class is split into multiple ModelMeshPart objects, typically based on
material information.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class ModelMeshPart
Remarks
It is not necessary to use this class directly. In advanced rendering scenarios, it is possible to draw using ModelMeshPart
properties in combination with the vertex and index buffers on ModelMesh. However, in most cases, ModelMesh.Draw will be
sufficient.
See Also
Tasks
How To: Render a Model
Reference
ModelMeshPart Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMeshPart Members
The following tables list the members exposed by the ModelMeshPart type.
Public Properties
Name Description
BaseVertex Gets the offset to add to each vertex index in the index buffer.
Effect Gets or sets the material Effect for this mesh part.
NumVertices Gets the number of vertices used during a draw call.
PrimitiveCount Gets the number of primitives to render.
StartIndex Gets the location in the index array at which to start reading vertices.
StreamOffset Gets the offset in bytes from the beginning of the VertexBuffer.
Tag Gets or sets an object identifying this model mesh part.
VertexDeclaration Gets the vertex declaration for this model mesh part.
VertexStride Gets the size, in bytes, of the elements in this vertex stream.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ModelMeshPart Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelMeshPart Properties
Public Properties
Name Description
BaseVertex Gets the offset to add to each vertex index in the index buffer.
Effect Gets or sets the material Effect for this mesh part.
NumVertices Gets the number of vertices used during a draw call.
PrimitiveCount Gets the number of primitives to render.
StartIndex Gets the location in the index array at which to start reading vertices.
StreamOffset Gets the offset in bytes from the beginning of the VertexBuffer.
Tag Gets or sets an object identifying this model mesh part.
VertexDeclaration Gets the vertex declaration for this model mesh part.
VertexStride Gets the size, in bytes, of the elements in this vertex stream.
See Also
Reference
ModelMeshPart Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelMeshPart.BaseVertex Property
Gets the offset to add to each vertex index in the index buffer.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int BaseVertex { get; }
Property Value
Offset to add to each vertex index in the index buffer.
See Also
Reference
ModelMeshPart Class
ModelMeshPart Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMeshPart.Effect Property
Gets or sets the material Effect for this mesh part.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Effect Effect { get; set; }
Property Value
The material effect for this mesh part.
Remarks
ModelMesh.Effects is a shortcut for iterating over the MeshParts property of the ModelMesh and looking up the
ModelMeshPart.Effect property of each ModelMeshPart.
ModelMesh.Effects is a collection of all the Effect properties of the for the MeshParts of this ModelMesh. Each ModelMeshPart
has a single Effect which is a reference to one of the Effects of the parent ModelMesh property. By updating all the effects of
the ModelMesh all of the effects of each ModelMeshPart are updated as well.
Example
The Effect property can be used to assign a custom Effect to a model loaded with BasicEffect.
C#
public static void RemapModel(Model model, Effect effect)
{
foreach (ModelMesh mesh in model.Meshes)
{
foreach (ModelMeshPart part in mesh.MeshParts)
{
part.Effect = effect;
}
}
}
See Also
Tasks
How To: Render a Model
How To: Draw a Model with a Custom Effect
Reference
ModelMeshPart Class
ModelMeshPart Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMeshPart.NumVertices Property
Gets the number of vertices used during a draw call.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int NumVertices { get; }
Property Value
The number of vertices used during the call.
See Also
Reference
ModelMeshPart Class
ModelMeshPart Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMeshPart.PrimitiveCount Property
Gets the number of primitives to render.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int PrimitiveCount { get; }
Property Value
The number of primitives to render. The number of vertices used is a function of primitiveCount and primitiveType.
See Also
Reference
ModelMeshPart Class
ModelMeshPart Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMeshPart.StartIndex Property
Gets the location in the index array at which to start reading vertices.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int StartIndex { get; }
Property Value
Location in the index array at which to start reading vertices.
See Also
Reference
ModelMeshPart Class
ModelMeshPart Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMeshPart.StreamOffset Property
Gets the offset in bytes from the beginning of the VertexBuffer.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int StreamOffset { get; }
Property Value
The offset in bytes from the beginning of the VertexBuffer.
See Also
Reference
ModelMeshPart Class
ModelMeshPart Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMeshPart.Tag Property
Gets or sets an object identifying this model mesh part.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Object Tag { get; set; }
Property Value
An object identifying this model mesh part.
See Also
Reference
ModelMeshPart Class
ModelMeshPart Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMeshPart.VertexDeclaration Property
Gets the vertex declaration for this model mesh part.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public VertexDeclaration VertexDeclaration { get; }
Property Value
The vertex declaration for this model mesh part.
See Also
Reference
ModelMeshPart Class
ModelMeshPart Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMeshPart.VertexStride Property
Gets the size, in bytes, of the elements in this vertex stream.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int VertexStride { get; }
Property Value
The size, in bytes, of the elements in this vertex stream.
See Also
Reference
ModelMeshPart Class
ModelMeshPart Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMeshPartCollection Class
Represents a collection of ModelMeshPart objects.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class ModelMeshPartCollection : ReadOnlyCollection<ModelMeshPart>
See Also
Reference
ModelMeshPartCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMeshPartCollection Members
The following tables list the members exposed by the ModelMeshPartCollection type.
Public Properties
Name Description
Count (Inherited from ReadOnlyCollection.)
Item (Inherited from ReadOnlyCollection.)
Protected Properties
Name Description
Items (Inherited from ReadOnlyCollection.)
Public Methods
Name Description
Contains (Inherited from ReadOnlyCollection.)
CopyTo (Inherited from ReadOnlyCollection.)
Equals (Inherited from Object.)
GetEnumerator Returns a ModelMeshPartCollection.Enumerator that can iterate through a ModelMeshPartCollection.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
IndexOf (Inherited from ReadOnlyCollection.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ModelMeshPartCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelMeshPartCollection Methods
Public Methods
Name Description
Contains (Inherited from ReadOnlyCollection.)
CopyTo (Inherited from ReadOnlyCollection.)
Equals (Inherited from Object.)
GetEnumerator Returns a ModelMeshPartCollection.Enumerator that can iterate through a ModelMeshPartCollection.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
IndexOf (Inherited from ReadOnlyCollection.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ModelMeshPartCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelMeshPartCollection.GetEnumerator Method
Returns a ModelMeshPartCollection.Enumerator that can iterate through a ModelMeshPartCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Enumerator GetEnumerator ()
Return Value
The ModelMeshPartCollection.Enumerator of the ModelMeshPart collection.
See Also
Reference
ModelMeshPartCollection Class
ModelMeshPartCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMeshPartCollection Properties
Public Properties
Name Description
Count (Inherited from ReadOnlyCollection.)
Item (Inherited from ReadOnlyCollection.)
Protected Properties
Name Description
Items (Inherited from ReadOnlyCollection.)
See Also
Reference
ModelMeshPartCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelMeshPartCollection.Enumerator Structure
Provides the ability to iterate through the bones in an ModelMeshPartCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct ModelMeshPartCollection.Enumerator : IEnumerator<ModelMeshPart>, IDisposable,
IEnumerator
See Also
Reference
ModelMeshPartCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMeshPartCollection.Enumerator Members
The following tables list the members exposed by the ModelMeshPartCollection.Enumerator type.
Public Properties
Name Description
Current Gets the current element in the ModelMeshPartCollection.
Public Methods
Name Description
Dispose Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetType (Inherited from Object.)
MoveNext Advances the enumerator to the next element of the ModelMeshPartCollection.
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
System.Collections.IEnumerator.Current Gets the current element in the ModelMeshPartCollection as a Object.
System.Collections.IEnumerator.Reset Sets the enumerator to its initial position, which is before the first element in the
ModelMeshPartCollection.
See Also
Reference
ModelMeshPartCollection.Enumerator Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelMeshPartCollection.Enumerator Methods
Public Methods
Name Description
Dispose Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetType (Inherited from Object.)
MoveNext Advances the enumerator to the next element of the ModelMeshPartCollection.
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
System.Collections.IEnumerator.Current Gets the current element in the ModelMeshPartCollection as a Object.
System.Collections.IEnumerator.Reset Sets the enumerator to its initial position, which is before the first element in the
ModelMeshPartCollection.
See Also
Reference
ModelMeshPartCollection.Enumerator Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelMeshPartCollection.Enumerator.Dispose Method
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
See Also
Reference
ModelMeshPartCollection.Enumerator Structure
ModelMeshPartCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMeshPartCollection.Enumerator.MoveNext Method
Advances the enumerator to the next element of the ModelMeshPartCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool MoveNext ()
Return Value
true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the
collection.
Exceptions
Exception type Condition
InvalidOperationException The collection was modified after the enumerator was created.
Remarks
After an enumerator is created or after a call to System.Collections.IEnumerator.Reset, an enumerator is positioned before the
first element of the collection, and the first call to MoveNext moves the enumerator over the first element of the collection.
After the end of the collection is passed, subsequent calls to MoveNext return false until System.Collections.IEnumerator.Reset
is called.
An enumerator remains valid as long as the collection remains unchanged. If changes, such as adding, modifying, or deleting
elements are made to the collection, the enumerator is irrecoverably invalidated and the next call to MoveNext or
System.Collections.IEnumerator.Reset throws an InvalidOperationException.
See Also
Reference
ModelMeshPartCollection.Enumerator Structure
ModelMeshPartCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
System.Collections.IEnumerator.Reset Method
Sets the enumerator to its initial position, which is before the first element in the ModelMeshPartCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private void System.Collections.IEnumerator.Reset ()
Exceptions
Exception type Condition
InvalidOperationException
The collection was modified after the enumerator was created.
Remarks
An enumerator remains valid as long as the collection remains unchanged. If changes, such as adding, modifying, or deleting
elements are made to the collection, the enumerator is irrecoverably invalidated and the next call to MoveNext or the
System.Collections.IEnumerator.Reset throws an InvalidOperationException.
Note
Notes to Implementers: All calls to System.Collections.IEnumerator.Reset must result in the same state for the enumerato
r. The preferred implementation is to move the enumerator to the beginning of the collection, before the first element. This in
validates the enumerator if the collection has been modified since the enumerator was created, which is consistent with
MoveNext and Current.
See Also
Reference
ModelMeshPartCollection.Enumerator Structure
ModelMeshPartCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMeshPartCollection.Enumerator Properties
Public Properties
Name Description
Current Gets the current element in the ModelMeshPartCollection.
See Also
Reference
ModelMeshPartCollection.Enumerator Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ModelMeshPartCollection.Enumerator.Current Property
Gets the current element in the ModelMeshPartCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ModelMeshPart Current { get; }
Property Value
The current element in the ModelMeshPartCollection.
See Also
Reference
ModelMeshPartCollection.Enumerator Structure
ModelMeshPartCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ModelMeshPartCollection.Enumerator.System.Collections.IEnumerator.Current
Property
Gets the current element in the ModelMeshPartCollection as a Object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private Object System.Collections.IEnumerator.Current { get; }
Property Value
The current element in the ModelBoneCollection as an Object.
See Also
Reference
ModelMeshPartCollection.Enumerator Structure
ModelMeshPartCollection.Enumerator Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MultiSampleType Enumeration
Defines the levels of full-scene multisampling that the game machine can apply.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum MultiSampleType
Members
Member name Description
SixteenSamples Enables 16 levels of full-scene multisampling.
FifteenSamples Enables 15 levels of full-scene multisampling.
FourteenSampl Enables 14 levels of full-scene multisampling.
es
ThirteenSample Enables 13 levels of full-scene multisampling.
s
TwelveSamples Enables 12 levels of full-scene multisampling.
ElevenSamples Enables 11 levels of full-scene multisampling.
TenSamples Enables 10 levels of full-scene multisampling.
NineSamples Enables 9 levels of full-scene multisampling.
EightSamples Enables 8 levels of full-scene multisampling.
SevenSamples Enables 7 levels of full-scene multisampling.
SixSamples Enables 6 levels of full-scene multisampling.
FiveSamples Enables 5 levels of full-scene multisampling.
FourSamples Enables 4 levels of full-scene multisampling.
ThreeSamples Enables 3 levels of full-scene multisampling.
TwoSamples Enables 2 levels of full-scene multisampling.
NonMaskable Enables the multisample quality value. For a quality of 1, the video card determines the best multisampling
mode.
None Specifies no full-scene multisampling, and enables swap effects other than SwapEffect.Discard.
Remarks
When multisampling is enabled, all subsamples of a pixel are updated in one pass. However, when subsamples are used for
other effects that involve multiple rendering passes, the application can specify that only some of them be affected by a given
rendering pass. This latter approach enables simulation of motion blur, depth-of-field focus effects, reflection blur, and other
effects.
In addition to enabling full-scene multisampling when a Reset occurs, there are render states that turn various multisampling
aspects on and off at fine-grained levels. For more information, see RenderState.
Multisampling is valid only on a swap chain that is created or reset with SwapEffect.Discard.
The multisampling antialiasing value can be set with the parameters or sub-parameters in the following methods.
Module Parameters Sub-parameters
CheckDeviceMultiSampleType multiSampleType, qualityLevels None
GraphicsDevice presentationParameters MultiSampleType, MultiSampleQuality
Reset presentationParameters MultiSampleType, MultiSampleQuality
Example
Use the PreparingDeviceSettings event to set MultiSampleType after calling CheckDeviceMultiSampleType:
C#
void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventAr
gs e)
{
// Xbox 360 and most PCs support FourSamples/1 (4x) and TwoSamples/1 (2x)
// antialiasing.
#if XBOX
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleQuality = 1;
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleType =
MultiSampleType.FourSamples;
return;
#endif
int quality = 0;
GraphicsAdapter adapter = e.GraphicsDeviceInformation.Adapter;
SurfaceFormat format = adapter.CurrentDisplayMode.Format;
// Check for 4xAA
if (adapter.CheckDeviceMultiSampleType(DeviceType.Hardware, format,
false, MultiSampleType.FourSamples, out quality))
{
// even if a greater quality is returned, we only want quality 1
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleQuality = 1;
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleType =
MultiSampleType.FourSamples;
}
// Check for 2xAA
else if (adapter.CheckDeviceMultiSampleType(DeviceType.Hardware, format,
false, MultiSampleType.TwoSamples, out quality))
{
// even if a greater quality is returned, we only want quality 1
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleQuality = 1;
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleType =
MultiSampleType.TwoSamples;
}
return;
}
See Also
Tasks
How To: Enable Antialiasing (Multisampling)
Reference
GraphicsAdapter.CheckDeviceMultiSampleType Method
PresentationParameters.MultiSampleQuality Property
PresentationParameters.MultiSampleType Property
DepthStencilBuffer.MultiSampleType Property
SwapEffect Enumeration
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
OcclusionQuery Class
Used to perform an occlusion query against the latest drawn objects.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class OcclusionQuery : IGraphicsResource, IDisposable
Remarks
An occlusion query is a technique that determines how many pixels were actually drawn during a set of draw calls. This is
useful for certain rendering techniques and rendering optimizations.
An example of using this query follows:
OcclusionQuery query = new OcclusionQuery(device);
query.Begin();
// Drawing simple objects, bounding areas, etc.
query.End();
// Do additional work here to provide enough time for the GPU to complete query e
xecution.
// Draw additional models
if (query.IsComplete == true && query.PixelCount > )
{
// A non-zero pixel count means some of the low res model is visible
// so let's draw the real version of it
}
The number of non-occluded pixels (indicated by PixelCount) can differ based on the platform.
For Xbox 360 games, PixelCount represents the number of pixels modified by drawing. This includes GraphicsDevice.Clear calls
and any drawing associated with sprite batches.
For Windows games, PixelCount represents the number of pixels that passed the depth and stencil tests. This does not include
sprite batch drawing (because the depth test is turned off) or calls to GraphicsDevice.Clear.
To achieve consistent results across all platforms, use occlusion queries only when the depth buffer is enabled. In addition,
avoid calling Clear or changing the assigned render target inside an occlusion query begin/end block.
See Also
Reference
OcclusionQuery Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
OcclusionQuery Members
The following tables list the members exposed by the OcclusionQuery type.
Public Constructors
Name Description
OcclusionQuery Initializes a new instance of OcclusionQuery with the specified device.
Public Properties
Name Description
GraphicsDevice Gets the graphics device being queried.
IsComplete Gets a value that indicates if the occlusion query has completed.
IsDisposed Gets a value that indicates whether the object is disposed.
IsSupported Specifies if occlusion queries are supported on the related graphics device.
Name Gets the name of this occlusion query
PixelCount Gets the number of visible pixels.
Tag Gets the resource tag for this occlusion query.
Public Methods
Name Description
Begin Begins application of the query.
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
End Ends the application of the query.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_Disposing Raises the Disposing event when called from within a derived class.
Public Events
Name Description
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micro
soft .NET common language runtime.
See Also
Reference
OcclusionQuery Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
OcclusionQuery Constructor
Initializes a new instance of OcclusionQuery with the specified device.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public OcclusionQuery (
GraphicsDevice graphicsDevice
)
Parameters
graphicsDevice
The graphics device to associate with this query.
Exceptions
Exception type Condition
ArgumentNullException graphicsDevice is null.
InvalidOperationException This resource could not be created.
See Also
Reference
OcclusionQuery Class
OcclusionQuery Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
OcclusionQuery Methods
Public Methods
Name Description
Begin Begins application of the query.
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
End Ends the application of the query.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_Disposing Raises the Disposing event when called from within a derived class.
See Also
Reference
OcclusionQuery Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
OcclusionQuery.Begin Method
Begins application of the query.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Begin ()
Exceptions
Exception type Condition
InvalidOperationException Begin cannot be called again until End has been successfully called.
Begin may not be called on this query object again before IsComplete has been checked.
See Also
Reference
OcclusionQuery Class
OcclusionQuery Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
OcclusionQuery.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
OcclusionQuery.Dispose () Immediately releases the unmanaged resources used by this object.
OcclusionQuery.Dispose (Boolean) Releases the unmanaged resources used by Dispose and optionally releases the managed
resources.
See Also
Reference
OcclusionQuery Class
OcclusionQuery Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
OcclusionQuery.Dispose Method ()
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
See Also
Reference
OcclusionQuery Class
OcclusionQuery Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
See Also
Reference
OcclusionQuery Class
OcclusionQuery Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
OcclusionQuery.End Method
Ends the application of the query.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void End ()
Exceptions
Exception type Condition
InvalidOperationException Begin must be called successfully before End can be called.
See Also
Reference
OcclusionQuery Class
OcclusionQuery Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
OcclusionQuery.Finalize Method
Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the
object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void Finalize ()
See Also
Reference
OcclusionQuery Class
OcclusionQuery Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
OcclusionQuery.raise_Disposing Method
Raises the Disposing event when called from within a derived class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected void raise_Disposing (
Object value0,
EventArgs value1
)
Parameters
value0
Invoking object reference; should be this object.
value1
Arguments to pass to the event handler.
See Also
Reference
OcclusionQuery Class
OcclusionQuery Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
OcclusionQuery.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
OcclusionQuery Class
OcclusionQuery Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
OcclusionQuery Properties
Public Properties
Name Description
GraphicsDevice Gets the graphics device being queried.
IsComplete Gets a value that indicates if the occlusion query has completed.
IsDisposed Gets a value that indicates whether the object is disposed.
IsSupported Specifies if occlusion queries are supported on the related graphics device.
Name Gets the name of this occlusion query
PixelCount Gets the number of visible pixels.
Tag Gets the resource tag for this occlusion query.
See Also
Reference
OcclusionQuery Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
OcclusionQuery.GraphicsDevice Property
Gets the graphics device being queried.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GraphicsDevice GraphicsDevice { get; }
Property Value
The related graphics device queried the occlusion query.
See Also
Reference
OcclusionQuery Class
OcclusionQuery Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
OcclusionQuery.IsComplete Property
Gets a value that indicates if the occlusion query has completed.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsComplete { get; }
Property Value
true if the query completed; otherwise false.
Remarks
If predicated tiling has been triggered for an Xbox 360 game, calls to IsComplete from within the tiling bracket always fail.
Access this data by switching to a different render target or end the frame. This condition does not apply to games targeting
the Windows platform.
See Also
Reference
OcclusionQuery Class
OcclusionQuery Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
OcclusionQuery.IsDisposed Property
Gets a value that indicates whether the object is disposed.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsDisposed { get; }
Property Value
true if the object is disposed; otherwise false.
See Also
Reference
OcclusionQuery Class
OcclusionQuery Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
OcclusionQuery.IsSupported Property
Specifies if occlusion queries are supported on the related graphics device.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsSupported { get; }
Property Value
true if occlusion queries are supported; false otherwise.
Occlusion queries are always supported on the Xbox 360 platform. Occlusion queries on the Windows platform are dependent
upon the abilities of the installed video card.
See Also
Reference
OcclusionQuery Class
OcclusionQuery Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
OcclusionQuery.Name Property
Gets the name of this occlusion query
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Name { get; set; }
Property Value
Name of the query.
See Also
Reference
OcclusionQuery Class
OcclusionQuery Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
OcclusionQuery.PixelCount Property
Gets the number of visible pixels.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int PixelCount { get; }
Property Value
Number of visible pixels. Zero indicates full occlusion, which means the pixels are not visible from the current camera position.
Exceptions
Exception type Condition
InvalidOperationException The query data is not yet available. Use the IsComplete property to determine if the data is available
before attempting to retrieve it.
Remarks
The number of non-occluded pixels (indicated by PixelCount) can differ based on the platform.
For Xbox 360 games, PixelCount represents the number of pixels modified by drawing. This includes GraphicsDevice.Clear calls
and any drawing associated with sprite batches.
For Windows games, PixelCount represents the number of pixels that passed the depth and stencil tests. This does not include
sprite batch drawing (because the depth test is turned off) or calls to GraphicsDevice.Clear.
To achieve consistent results across all platforms, use occlusion queries only when the depth buffer is enabled. In addition,
avoid calling Clear or changing the assigned render target inside an occlusion query begin/end block.
See Also
Reference
OcclusionQuery Class
OcclusionQuery Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
OcclusionQuery.Tag Property
Gets the resource tag for this occlusion query.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Object Tag { get; set; }
Property Value
The resource tag for this query.
See Also
Reference
OcclusionQuery Class
OcclusionQuery Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
OcclusionQuery Events
Public Events
Name Description
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micro
soft .NET common language runtime.
See Also
Reference
OcclusionQuery Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
OcclusionQuery.Disposing Event
Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET
common language runtime.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public event EventHandler Disposing
See Also
Reference
OcclusionQuery Class
OcclusionQuery Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
OutOfVideoMemoryException Class
The exception that is thrown when Direct3D does not have enough display memory to perform the operation.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public sealed class OutOfVideoMemoryException : ExternalException
See Also
Reference
OutOfVideoMemoryException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
OutOfVideoMemoryException Members
The following tables list the members exposed by the OutOfVideoMemoryException type.
Public Constructors
Name Description
OutOfVideoMemoryException Overloaded. Initializes a new instance of this class.
Public Properties
Name Description
Data (Inherited from Exception.)
ErrorCode (Inherited from ExternalException.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
OutOfVideoMemoryException Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
OutOfVideoMemoryException Constructor
Initializes a new instance of this class.
Overload List
Name Description
OutOfVideoMemoryException () Initializes a new instance of this class.
OutOfVideoMemoryException (String) Initializes a new instance of this class with a specified error message.
OutOfVideoMemoryException (String, Exception) Initializes a new instance of this class with a specified error message and a re
ference to the inner exception that is the cause of this exception.
See Also
Reference
OutOfVideoMemoryException Class
OutOfVideoMemoryException Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
OutOfVideoMemoryException Constructor ()
Initializes a new instance of this class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public OutOfVideoMemoryException ()
Remarks
This constructor initializes the Message property of the new instance to a system-supplied message that describes the error,
such as "Direct3D does not have enough display memory to perform the operation." This message takes into account the
current system culture.
The following table shows the initial property values for an instance of OutOfVideoMemoryException.
Property Value
InnerException A null reference.
Message The localized error message string.
See Also
Reference
OutOfVideoMemoryException Class
OutOfVideoMemoryException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
message
A message that describes the error.
Remarks
The content of the message parameter is intended to be understood by humans. The caller of this constructor is required to
ensure that this string has been localized for the current system culture.
The following table shows the initial property values for an instance of OutOfVideoMemoryException.
Property Value
InnerException A null reference.
Message The localized error message string.
See Also
Reference
OutOfVideoMemoryException Class
OutOfVideoMemoryException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
message
A message that describes the error.
inner
The exception that is the cause of the current exception. If the inner parameter is not a null reference, the current exception is
raised in a catch block that handles the inner exception.
Remarks
The content of the message parameter is intended to be understood by humans. The caller of this constructor is required to
ensure that this string has been localized for the current system culture.
An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in
the InnerException property. The InnerException property returns the same value that is passed into the constructor, or a null
reference if the InnerException property does not supply the inner exception value to the constructor.
The following table shows the initial property values for an instance of OutOfVideoMemoryException.
Property Value
InnerException A null reference.
Message The localized error message string.
See Also
Reference
OutOfVideoMemoryException Class
OutOfVideoMemoryException Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
OutOfVideoMemoryException Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
OutOfVideoMemoryException Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
OutOfVideoMemoryException Properties
Public Properties
Name Description
Data (Inherited from Exception.)
ErrorCode (Inherited from ExternalException.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
See Also
Reference
OutOfVideoMemoryException Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
PixelShader Class
Encapsulates the functionality of a pixel shader.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class PixelShader : IDisposable
See Also
Reference
PixelShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PixelShader Members
The following tables list the members exposed by the PixelShader type.
Public Constructors
Name Description
PixelShader Initializes a new instance of the PixelShader class.
Public Properties
Name Description
GraphicsDevice Gets the GraphicsDevice associated with this PixelShader.
IsDisposed Gets a value that indicates whether the object is disposed.
Name Returns the name of the pixel shader.
Tag Gets the resource tags.
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetShaderCode Gets an array of bytes containing the shader code.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_Disposing Raises the Disposing event when called from within a derived class.
Public Events
Name Description
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micro
soft .NET common language runtime.
See Also
Reference
PixelShader Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
PixelShader Constructor
Initializes a new instance of the PixelShader class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public PixelShader (
GraphicsDevice graphicsDevice,
byte[] shaderCode
)
Parameters
graphicsDevice
Device to create the pixel shader.
shaderCode
The compiled byte code. A pixel shader function token array, specifying the blending operations.
Exceptions
Exception type Condition
ArgumentException The array specified in shaderCode must have a length that is a multiple of four.
ArgumentNullException graphicsDevice or shaderCode is null.
InvalidOperationException Unable to create this PixelShader resource on the graphics device.
See Also
Reference
PixelShader Class
PixelShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PixelShader Methods
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetShaderCode Gets an array of bytes containing the shader code.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_Disposing Raises the Disposing event when called from within a derived class.
See Also
Reference
PixelShader Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
PixelShader.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
PixelShader.Dispose () Immediately releases the unmanaged resources used by this object.
PixelShader.Dispose (Boolean) Immediately releases the unmanaged resources used by this object.
See Also
Reference
PixelShader Class
PixelShader Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
PixelShader.Dispose Method ()
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
Remarks
Call Dispose when you are finished using the PixelShader. The Dispose method leaves the PixelShader in an unusable state.
After calling Dispose, you must release all references to the PixelShader so the garbage collector can reclaim the memory that
the PixelShader was occupying.
Note
Always call Dispose before you release your last reference to the PixelShader. Otherwise, the resources it is using will not be f
reed until the garbage collector calls the PixelShader object's Finalize method.
See Also
Reference
PixelShader Class
PixelShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
Remarks
This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean)
method with the disposing parameter set to true. Finalize invokes Dispose(Boolean) with disposing set to false.
When the disposing parameter is true, this method releases all resources held by any managed objects that this PixelShader
references. This method invokes the Dispose method of each referenced object.
Note
Notes to Inheritors
Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects
disposed of in an earlier call to Dispose.
See Also
Reference
PixelShader Class
PixelShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PixelShader.Finalize Method
Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the
object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void Finalize ()
Remarks
This method overrides System.Object.Finalize. Application code should not call this method; an object's Finalize method is
automatically invoked during garbage collection, unless a call to the GC.SuppressFinalize method has disabled finalization by
the garbage collector.
See Also
Reference
PixelShader Class
PixelShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PixelShader.GetShaderCode Method
Gets an array of bytes containing the shader code.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public byte[] GetShaderCode ()
Return Value
The shader code.
See Also
Reference
PixelShader Class
PixelShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PixelShader.raise_Disposing Method
Raises the Disposing event when called from within a derived class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected void raise_Disposing (
Object value0,
EventArgs value1
)
Parameters
value0
Invoking object reference; should be this object.
value1
Arguments to pass to the event handler.
See Also
Reference
PixelShader Class
PixelShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PixelShader.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
PixelShader Class
PixelShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PixelShader Properties
Public Properties
Name Description
GraphicsDevice Gets the GraphicsDevice associated with this PixelShader.
IsDisposed Gets a value that indicates whether the object is disposed.
Name Returns the name of the pixel shader.
Tag Gets the resource tags.
See Also
Reference
PixelShader Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
PixelShader.GraphicsDevice Property
Gets the GraphicsDevice associated with this PixelShader.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GraphicsDevice GraphicsDevice { get; }
Property Value
The GraphicsDevice associated with this PixelShader.
See Also
Reference
PixelShader Class
PixelShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PixelShader.IsDisposed Property
Gets a value that indicates whether the object is disposed.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsDisposed { get; }
Property Value
true if the object is disposed; false otherwise.
See Also
Reference
PixelShader Class
PixelShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PixelShader.Name Property
Returns the name of the pixel shader.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Name { get; set; }
Property Value
The name of the pixel shader.
See Also
Reference
PixelShader Class
PixelShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PixelShader.Tag Property
Gets the resource tags.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Object Tag { get; set; }
Property Value
The resource tags
See Also
Reference
PixelShader Class
PixelShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PixelShader Events
Public Events
Name Description
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micro
soft .NET common language runtime.
See Also
Reference
PixelShader Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
PixelShader.Disposing Event
Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET
common language runtime.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public event EventHandler Disposing
See Also
Reference
PixelShader Class
PixelShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentationParameters Class
Contains presentation parameters.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public class PresentationParameters : IDisposable
See Also
Concepts
What Is Antialiasing?
Tasks
How To: Restrict Graphics Devices to Widescreen Aspect Ratios in Full-Screen Mode
How To: Enable Antialiasing (Multisampling)
Reference
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentationParameters Members
The following tables list the members exposed by the PresentationParameters type.
Public Constructors
Name Description
PresentationParameters Initializes a new instance of this class.
Public Fields
Name Description
DefaultPresentRate The default presentation rate.
Public Properties
Name Description
AutoDepthStencilFormat Gets or sets a value specifying the format of the depth-stencil surface that the device will autom
atically create.
BackBufferCount Gets or sets a value specifying how many back buffers to create.
BackBufferFormat Gets or sets the format of the back buffer.
BackBufferHeight Gets or sets a value indicating the height of the new swap chain's back buffer.
BackBufferWidth Gets or sets a value indicating the width of the new swap chain's back buffer.
DeviceWindowHandle Gets or sets the handle to the device window.
EnableAutoDepthStencil Gets or sets a value indicating whether Direct3D will manage depth buffers for the application.
FullScreenRefreshRateInHz Gets or sets a value indicating the rate at which the display adapter will refresh the screen.
IsFullScreen Gets or sets a value indicating whether the application is in full screen mode.
MultiSampleQuality Gets or sets a value indicating the multisample quality level.
MultiSampleType Gets or sets the multisample type.
PresentationInterval Gets or sets the maximum rate at which the swap chain's back buffers can be presented to the fr
ont buffer.
PresentOptions Gets or sets miscellaneous presentation flags.
RenderTargetUsage Gets or sets render target usage flags.
SwapEffect Gets or sets the swap effect.
Public Methods
Name Description
Clear Resets all of the PresentationParameters values.
Clone Creates a copy of this PresentationParameters object.
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Compares two objects to determine whether they are the same.
op_Inequality Compares two objects to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
PresentationParameters Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
PresentationParameters Fields
Public Fields
Name Description
DefaultPresentRate The default presentation rate.
See Also
Reference
PresentationParameters Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
PresentationParameters.DefaultPresentRate Field
The default presentation rate.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public const int DefaultPresentRate
See Also
Reference
PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentationParameters Constructor
Initializes a new instance of this class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public PresentationParameters ()
See Also
Reference
PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentationParameters Methods
Public Methods
Name Description
Clear Resets all of the PresentationParameters values.
Clone Creates a copy of this PresentationParameters object.
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Compares two objects to determine whether they are the same.
op_Inequality Compares two objects to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
PresentationParameters Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
PresentationParameters.Clear Method
Resets all of the PresentationParameters values.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Clear ()
See Also
Reference
PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentationParameters.Clone Method
Creates a copy of this PresentationParameters object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public PresentationParameters Clone ()
Return Value
A copy of this PresentationParameters object.
See Also
Reference
PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentationParameters.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
PresentationParameters.Dispose () Immediately releases the unmanaged resources used by this object.
PresentationParameters.Dispose (Boolean) Immediately releases the unmanaged resources used by this object.
See Also
Reference
PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
PresentationParameters.Dispose Method ()
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
Remarks
Call Dispose when you are finished using the PresentationParameters. The Dispose method leaves the PresentationParameters
in an unusable state. After calling Dispose, you must release all references to the PresentationParameters so the garbage
collector can reclaim the memory that the PresentationParameters was occupying.
Note
Always call Dispose before you release your last reference to the PresentationParameters. Otherwise, the resources it is using
will not be freed until the garbage collector calls the PresentationParameters object's Finalize method.
See Also
Reference
PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
Remarks
This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean)
method with the disposing parameter set to true. Finalize invokes Dispose(Boolean) with disposing set to false.
When the disposing parameter is true, this method releases all resources held by any managed objects that this
PresentationParameters references. This method invokes the Dispose method of each referenced object.
Note
Notes to Inheritors
Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects
disposed of in an earlier call to Dispose.
See Also
Reference
PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentationParameters.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
PresentationParameters.Equals (Object) Returns a value that indicates whether the current instance is equal to a specifi
ed object.
PresentationParameters.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
obj
The Object to compare with the current PresentationParameters.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentationParameters.GetHashCode Method
Gets the hash code for this instance.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for this object.
See Also
Reference
PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentationParameters.op_Equality Method
Compares two objects to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
PresentationParameters left,
PresentationParameters right
)
Parameters
left
Object to the left of the equality operator.
right
Object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentationParameters.op_Inequality Method
Compares two objects to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
PresentationParameters left,
PresentationParameters right
)
Parameters
left
Object to the left of the inequality operator.
right
Object to the right of the inequality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentationParameters.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentationParameters Properties
Public Properties
Name Description
AutoDepthStencilFormat Gets or sets a value specifying the format of the depth-stencil surface that the device will autom
atically create.
BackBufferCount Gets or sets a value specifying how many back buffers to create.
BackBufferFormat Gets or sets the format of the back buffer.
BackBufferHeight Gets or sets a value indicating the height of the new swap chain's back buffer.
BackBufferWidth Gets or sets a value indicating the width of the new swap chain's back buffer.
DeviceWindowHandle Gets or sets the handle to the device window.
EnableAutoDepthStencil Gets or sets a value indicating whether Direct3D will manage depth buffers for the application.
FullScreenRefreshRateInHz Gets or sets a value indicating the rate at which the display adapter will refresh the screen.
IsFullScreen Gets or sets a value indicating whether the application is in full screen mode.
MultiSampleQuality Gets or sets a value indicating the multisample quality level.
MultiSampleType Gets or sets the multisample type.
PresentationInterval Gets or sets the maximum rate at which the swap chain's back buffers can be presented to the fr
ont buffer.
PresentOptions Gets or sets miscellaneous presentation flags.
RenderTargetUsage Gets or sets render target usage flags.
SwapEffect Gets or sets the swap effect.
See Also
Reference
PresentationParameters Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
PresentationParameters.AutoDepthStencilFormat Property
Gets or sets a value specifying the format of the depth-stencil surface that the device will automatically create.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public DepthFormat AutoDepthStencilFormat { get; set; }
Property Value
The format of the depth-stencil surface that the device will automatically create.
Remarks
This member is ignored unless EnableAutoDepthStencil is true.
Caution
In cases where the size of the back buffer and depth stencil buffer exceed the size of the Xbox 360 10 MB of embedded mem
ory (EDRAM), predicated tiling is utilized on this platform to compensate for the additional memory requirements. Predicated
tiling is a process by which scene rendering is performed multiple times on subsections of the final render target dimensions
. Using a depth-stencil surface directly affects the size of the back buffer and depth-stencil buffer and may trigger predicated
tiling.
See Also
Concepts
What Is a Depth Buffer?
What Is a Stencil Buffer?
Predicated Tiling
Reference
PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentationParameters.BackBufferCount Property
Gets or sets a value specifying how many back buffers to create.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int BackBufferCount { get; set; }
Property Value
The number of back buffers to create. Can be 0, 1, 2, or 3. 0 is considered 1.
Remarks
When an instance of this class is returned from a method (for example, the GraphicsDevice constructor), BackBufferCount is
set to the number of back buffers that can be created. For that reason, an application can call the method twice and expect the
second call to successfully create back buffers.
SwapEffect.Copy requires exactly one back buffer.
See Also
Reference
PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentationParameters.BackBufferFormat Property
Gets or sets the format of the back buffer.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public SurfaceFormat BackBufferFormat { get; set; }
Property Value
The format of the back buffer.
Remarks
For windowed applications, the back-buffer format no longer needs to match the display-mode format because color
conversion can now be done by the hardware (if the hardware supports color conversion). The set of possible back-buffer
formats is constrained, but the runtime will allow any valid back-buffer format to be presented to any desktop format. (There is
the additional requirement that the device be operable in the desktop mode; devices typically do not operate in 8-bits-per-pixel
modes.)
Full screen applications cannot do color conversion.
Caution
In cases where the size of the back buffer and depth stencil buffer exceed the size of the Xbox 360 10 MB of embedded mem
ory (EDRAM), predicated tiling is utilized on this platform to compensate for the additional memory requirements. Predicated
tiling is a process by which scene rendering is performed multiple times on subsections of the final render target dimensions
. The format of the back buffer chosen with the BackBufferFormat property directly affects the size of the back buffer and m
ay trigger predicated tiling.
See Also
Concepts
Predicated Tiling
Reference
PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentationParameters.BackBufferHeight Property
Gets or sets a value indicating the height of the new swap chain's back buffer.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int BackBufferHeight { get; set; }
Property Value
The height of the back buffer, in pixels.
Remarks
If IsFullScreen is true, BackBufferHeight and BackBufferWidth must equal the width and height of one of the enumerated
display modes found through SupportedDisplayModes. If IsFullScreen is false and either of these values is zero, the
corresponding dimension of the client area of the DeviceWindowHandle (or the focus window, if DeviceWindowHandle is
Zero) is taken.
See Also
Concepts
Displays, Client Bounds, Viewports, and Back Buffers
Tasks
How To: Restrict Graphics Devices to Widescreen Aspect Ratios in Full-Screen Mode
Reference
PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentationParameters.BackBufferWidth Property
Gets or sets a value indicating the width of the new swap chain's back buffer.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int BackBufferWidth { get; set; }
Property Value
The width of the back buffer, in pixels.
Remarks
If IsFullScreen is true, BackBufferHeight and BackBufferWidth must equal the width and height of one of the enumerated
display modes found through SupportedDisplayModes. If IsFullScreen is false and either of these values is zero, the
corresponding dimension of the client area of the DeviceWindowHandle (or the focus window, if DeviceWindowHandle is
Zero) is taken.
See Also
Concepts
Displays, Client Bounds, Viewports, and Back Buffers
Tasks
How To: Restrict Graphics Devices to Widescreen Aspect Ratios in Full-Screen Mode
Reference
PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentationParameters.DeviceWindowHandle Property
Gets or sets the handle to the device window.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public IntPtr DeviceWindowHandle { get; set; }
Property Value
The handle to the device window.
Remarks
The device window determines the location and size of the back buffer on screen. This is used by Direct3D when the back
buffer contents are copied to the front buffer during Present.
For a full screen application, this is a handle to the top window (which is the focus window). For applications that use multiple
full screen devices (such as a multimonitor system), exactly one device can use the focus window as the device window. All
other devices must have unique device windows.
For a windowed-mode application, this handle will be the default target window for Present. If this handle is Zero, the focus
window will be taken.
Note that the runtime does not attempt to reflect user changes in window size. The back buffer is not implicitly reset when this
window is reset. However, the Present method does automatically track window position changes.
See Also
Reference
PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentationParameters.EnableAutoDepthStencil Property
Gets or sets a value indicating whether Direct3D will manage depth buffers for the application.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool EnableAutoDepthStencil { get; set; }
Property Value
true if Direct3D will manage depth buffers for the application; false otherwise.
Remarks
If EnableAutoDepthStencil is true, the device will create a depth-stencil buffer when it is created. The depth-stencil buffer will
be automatically set as the render target of the device. When the device is reset, the depth-stencil buffer will be automatically
destroyed and recreated in the new size.
If EnableAutoDepthStencil is true, then AutoDepthStencilFormat must be a valid depth-stencil format.
See Also
Concepts
What Is a Depth Buffer?
What Is a Stencil Buffer?
Reference
PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentationParameters.FullScreenRefreshRateInHz Property
Gets or sets a value indicating the rate at which the display adapter will refresh the screen.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int FullScreenRefreshRateInHz { get; set; }
Property Value
The refresh rate in hertz, or 0 in windowed mode.
Remarks
For full screen mode, the refresh rate must be one of the refresh rates found in SupportedDisplayModes.
See Also
Reference
PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentationParameters.IsFullScreen Property
Gets or sets a value indicating whether the application is in full screen mode.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsFullScreen { get; set; }
Property Value
true if the application is running full screen; false if the application is running in a window.
See Also
Reference
PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentationParameters.MultiSampleQuality Property
Gets or sets a value indicating the multisample quality level.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int MultiSampleQuality { get; set; }
Property Value
The multisample quality level. The valid range is from 0 to one less than the value returned by CheckDeviceMultiSampleType.
Remarks
Paired values of render targets or of depth-stencil surfaces and MultiSampleType must match.
Example
Use the PreparingDeviceSettings event to set MultiSampleQuality after calling CheckDeviceMultiSampleType:
C#
void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventAr
gs e)
{
// Xbox 360 and most PCs support FourSamples/1 (4x) and TwoSamples/1 (2x)
// antialiasing.
#if XBOX
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleQuality = 1;
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleType =
MultiSampleType.FourSamples;
return;
#endif
int quality = 0;
GraphicsAdapter adapter = e.GraphicsDeviceInformation.Adapter;
SurfaceFormat format = adapter.CurrentDisplayMode.Format;
// Check for 4xAA
if (adapter.CheckDeviceMultiSampleType(DeviceType.Hardware, format,
false, MultiSampleType.FourSamples, out quality))
{
// even if a greater quality is returned, we only want quality 1
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleQuality = 1;
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleType =
MultiSampleType.FourSamples;
}
// Check for 2xAA
else if (adapter.CheckDeviceMultiSampleType(DeviceType.Hardware, format,
false, MultiSampleType.TwoSamples, out quality))
{
// even if a greater quality is returned, we only want quality 1
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleQuality = 1;
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleType =
MultiSampleType.TwoSamples;
}
return;
}
See Also
Concepts
What Is Antialiasing?
Tasks
How To: Enable Antialiasing (Multisampling)
Reference
PresentationParameters Class
PresentationParameters Members
CheckDeviceMultiSampleType
PreparingDeviceSettings
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentationParameters.MultiSampleType Property
Gets or sets the multisample type.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public MultiSampleType MultiSampleType { get; set; }
Property Value
The multisample type. Must be MultiSampleType.None unless SwapEffect has been set to SwapEffect.Discard. Multisampling is
supported only if SwapEffect is SwapEffect.Discard.
Remarks
Caution
In cases where the size of the back buffer and depth stencil buffer exceed the size of the Xbox 360 10 MB of embedded mem
ory (EDRAM), the platform uses predicated tiling to compensate for the additional memory requirements. Predicated tiling re
nders scenes performed multiple times on subsections of the final render target dimensions. The multisampling chosen with
the MultiSampleType property directly affects the size of the back buffer and may trigger predicated tiling.
Example
Use the PreparingDeviceSettings event to set MultiSampleType after calling CheckDeviceMultiSampleType:
C#
void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventAr
gs e)
{
// Xbox 360 and most PCs support FourSamples/1 (4x) and TwoSamples/1 (2x)
// antialiasing.
#if XBOX
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleQuality = 1;
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleType =
MultiSampleType.FourSamples;
return;
#endif
int quality = 0;
GraphicsAdapter adapter = e.GraphicsDeviceInformation.Adapter;
SurfaceFormat format = adapter.CurrentDisplayMode.Format;
// Check for 4xAA
if (adapter.CheckDeviceMultiSampleType(DeviceType.Hardware, format,
false, MultiSampleType.FourSamples, out quality))
{
// even if a greater quality is returned, we only want quality 1
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleQuality = 1;
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleType =
MultiSampleType.FourSamples;
}
// Check for 2xAA
else if (adapter.CheckDeviceMultiSampleType(DeviceType.Hardware, format,
false, MultiSampleType.TwoSamples, out quality))
{
// even if a greater quality is returned, we only want quality 1
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleQuality = 1;
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleType =
MultiSampleType.TwoSamples;
}
return;
}
See Also
Concepts
Predicated Tiling
Concepts
What Is Antialiasing?
Tasks
How To: Enable Antialiasing (Multisampling)
Reference
PresentationParameters Class
PresentationParameters Members
CheckDeviceMultiSampleType
PreparingDeviceSettings
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentationParameters.PresentationInterval Property
Gets or sets the maximum rate at which the swap chain's back buffers can be presented to the front buffer.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public PresentInterval PresentationInterval { get; set; }
Property Value
The maximum rate at which the swap chain's back buffers can be presented to the front buffer.
See Also
Reference
PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentationParameters.PresentOptions Property
Gets or sets miscellaneous presentation flags.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public PresentOptions PresentOptions { get; set; }
Property Value
Presentation flags.
See Also
Reference
PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentationParameters.RenderTargetUsage Property
Gets or sets render target usage flags.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public RenderTargetUsage RenderTargetUsage { get; set; }
Property Value
Usage flags for the render target.
See Also
Reference
PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentationParameters.SwapEffect Property
Gets or sets the swap effect.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public SwapEffect SwapEffect { get; set; }
Property Value
The swap effect to use.
Remarks
The runtime will guarantee the implied semantics concerning buffer swap behavior; therefore, if IsFullScreen is false and
SwapEffect is set to SwapEffect.Flip, the runtime will create one extra back buffer and copy whichever becomes the front buffer
at presentation time.
SwapEffect.Copy requires that BackBufferCount be set to 1.
SwapEffect.Discard will be enforced in the debug runtime by filling any buffer with noise after it is presented.
See Also
Reference
PresentationParameters Class
PresentationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentInterval Enumeration
Defines flags that describe the relationship between the adapter refresh rate and the rate at which Present operations are
completed.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum PresentInterval
Members
Me Description
mbe
r na
me
Defa Equivalent to setting One.
ult
One The driver waits for the vertical retrace period (the runtime will beam trace to prevent tearing). Present operations are n
ot affected more frequently than the screen refresh rate; the runtime completes one Present operation per adapter refre
sh period, at most. This option is always available for both windowed and full-screen swap chains.
Two The driver waits for the vertical retrace period. Present operations are not affected more frequently than every second s
creen refresh. Check the PresentInterval property to determine whether the driver supports this option.
Thre The driver waits for the vertical retrace period. Present operations are not affected more frequently than every third scr
e een refresh. Check the PresentInterval property to determine whether the driver supports this option.
Four The driver waits for the vertical retrace period. Present operations are not affected more frequently than every fourth sc
reen refresh. Check the PresentInterval property to determine whether the driver supports this option.
Imm The runtime updates the window client area immediately, and might do so more than once during the adapter refresh p
edia eriod. Present operations might be affected immediately. This option is always available for both windowed and full-scr
te een swap chains.
See Also
Reference
GraphicsDeviceCapabilities.PresentInterval Property
PresentationParameters.PresentationInterval Property
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PresentOptions Enumeration
Defines flags that control the behavior of the back buffer and depth buffer.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[FlagsAttribute]
public enum PresentOptions
Members
Member Description
name
DeviceCl Clips a windowed Present blit into the window client area, within the monitor screen area of the video adapter that
ip created the Microsoft Direct3D device. This flag works only on Microsoft Windows 2000 and Windows XP.
Discard
DepthSt Enables depth-buffer discarding if set when the device or swap chain is created. When this flag is set, the contents o
encil f the depth stencil buffer are invalid after either Present or DepthStencilBuffer is called.
Discarding depth-buffer data can increase performance and is dependent on the driver. The debug runtime enforce
s discarding by clearing the depth-buffer to some constant value after calling either Present or DepthStencilBuffer
with a different depth surface.
Discarding depth-buffer data is illegal for all lockable formats, DepthFormat.Depth16Lockable, and
DepthFormat.D32Lockable. Using the GraphicsDevice constructor to specify a lockable format and depth-buffer dis
carding will result in failure.
None Use no presentation flags.
Video Informs the driver that the back buffers contain video data.
See Also
Reference
PresentationParameters.PresentOptions Property
DepthFormat Enumeration
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
PrimitiveType Enumeration
Defines how data in a vertex stream is interpreted during a draw call.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum PrimitiveType
Members
Member Description
name
LineList Renders the vertices as a list of isolated straight line segments; the count may be any positive integer.
LineStri Renders the vertices as a single polyline; the count may be any positive integer.
p
PointLis Renders the vertices as a collection of isolated points. This value is unsupported for indexed primitives.
t
Triangle Renders the vertices as a triangle fan.
Fan
Triangle Renders the specified vertices as a sequence of isolated triangles. Each group of three vertices defines a separate tri
List angle. Back-face culling is affected by the current winding-order render state.
Triangle Renders the vertices as a triangle strip. The back-face culling flag is flipped automatically on even-numbered triangl
Strip es.
RemarksUsing triangle strips or triangle fans is often more efficient than using triangle lists because fewer vertices are
duplicated.
See Also
Tasks
How To: Draw Points, Lines, and Other 3D Primitives
Reference
GraphicsDevice.DrawIndexedPrimitives Method
GraphicsDevice.DrawPrimitives Method
GraphicsDevice.DrawUserIndexedPrimitives Method
GraphicsDevice.DrawUserPrimitives Generic Method
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
QueryUsages Enumeration
Defines options for querying device resource formats.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[FlagsAttribute]
public enum QueryUsages
Members
Member name Description
Filter Query the resource format to see if it supports texture filter types other than TextureFilter.Point (which is al
ways supported).
None No option specified.
PostPixelShader Query the resource to verify support for post pixel shader blending support, including alpha test, pixel fog,
Blending render-target blending, color write enable, and dithering.
SrgbRead Query the resource to verify if a texture supports gamma correction during a read operation.
SrgbWrite Query the resource to verify if a texture supports gamma correction during a write operation.
VertexTexture Query the resource to verify support for vertex shader texture sampling.
WrapAndMip Query the resource to verify support for texture wrapping and mipmapping.
See Also
Tasks
How To: Load Content
Reference
GraphicsDeviceManager.DeviceReset Event
GraphicsAdapter.CheckDeviceFormat Method
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RasterStatus Structure
Describes the raster status.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public struct RasterStatus
See Also
Reference
RasterStatus Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RasterStatus Members
The following tables list the members exposed by the RasterStatus type.
Public Properties
Name Description
InVerticalBlank Gets the status of the vertical blank period.
ScanLine Gets a value that roughly corresponds to the current scan line painted by the raster.
Public Methods
Name Description
Equals (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
RasterStatus Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
RasterStatus Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
RasterStatus Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
RasterStatus.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
RasterStatus Structure
RasterStatus Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RasterStatus Properties
Public Properties
Name Description
InVerticalBlank Gets the status of the vertical blank period.
ScanLine Gets a value that roughly corresponds to the current scan line painted by the raster.
See Also
Reference
RasterStatus Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
RasterStatus.InVerticalBlank Property
Gets the status of the vertical blank period.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool InVerticalBlank { get; }
Property Value
true if the raster is in the vertical blank period; false otherwise.
See Also
Reference
RasterStatus Structure
RasterStatus Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RasterStatus.ScanLine Property
Gets a value that roughly corresponds to the current scan line painted by the raster.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int ScanLine { get; }
Property Value
Integer that roughly corresponds to the current scan line to set or retrieve.
Remarks
If InVerticalBlank is false, this property's value is an integer that roughly corresponds to the current scan line painted by the
raster. Scan lines are numbered in the same way as Microsoft Direct3D surface coordinates: 0 is the top of the primary surface,
extending to the value (height of the surface − 1) at the bottom of the display.
If InVerticalBlank is true, this value is set to 0 and can be ignored.
See Also
Reference
RasterStatus Structure
RasterStatus Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState Class
Defines the render state of a graphics device.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class RenderState
RemarksThe render state of the device may also be changed by setting the render state in an effect file. For more information,
please see Effect States.
See Also
Reference
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState Members
The following tables list the members exposed by the RenderState type.
Public Properties
Name Description
AlphaBlendEnable Gets or sets a value to enable alpha-blended transparency. The default value is fals
e.
AlphaBlendOperation Gets or sets the arithmetic operation applied to separate alpha blending. The defau
lt is BlendFunction.Add.
AlphaDestinationBlend Gets or sets the separate alpha channel blending factor. This factor represents a de
stination value by which to multiply the alpha channel only. The default is
Blend.One.
AlphaFunction Gets or sets the comparison function for the alpha test. The default is
CompareFunction.Always.
AlphaSourceBlend Gets or sets the separate alpha channel blending factor. This factor represents a val
ue by which to multiply the alpha channel only. The default is Blend.One.
AlphaTestEnable Gets or sets a render state that enables a per-pixel alpha test. The default value is f
alse.
BlendFactor Gets or sets the color used for a constant-blend factor during alpha blending. The
default is Color.White.
BlendFunction Gets or sets a value to select the arithmetic operation to apply to the source and de
stination pixel components when AlphaBlendEnable is set to true. The default is
BlendFunction.Add.
ColorWriteChannels Gets or sets a value that enables a per-channel write for the render target color buf
fer. The default value is ColorWriteChannels.None.
ColorWriteChannels1 Gets or sets a value that enables a per-channel write for the render target color buf
fer. The default value is ColorWriteChannels.None.
ColorWriteChannels2 Gets or sets a value that enables a per-channel write for the render target color buf
fer. The default value is ColorWriteChannels.None.
ColorWriteChannels3 Gets or sets a value that enables a per-channel write for the render target color buf
fer. The default value is ColorWriteChannels.None.
CounterClockwiseStencilDepthBufferFail Gets or sets the stencil operation to perform if the stencil test passes and the depth
-buffer test fails for a counterclockwise triangle. The default is
StencilOperation.Keep.
CounterClockwiseStencilFail Gets or sets the stencil operation to perform if the stencil test fails for a counterclo
ckwise triangle. The default is StencilOperation.Keep.
CounterClockwiseStencilFunction Gets or sets the comparison function to use for counterclockwise stencil tests. The
default is CompareFunction.Always.
CounterClockwiseStencilPass Gets or sets the stencil operation to perform if the stencil and z-tests pass for a cou
nterclockwise triangle. The default is StencilOperation.Keep.
CullMode Specifies how back-facing triangles are culled, if at all. The default value is
CullMode.CounterClockwise.
DepthBias Sets or retrieves the depth bias for polygons. The default value is 0.
DepthBufferEnable Enables or disables depth buffering. The default is true.
DepthBufferFunction Gets or sets the comparison function for the depth-buffer test. The default is
CompareFunction.LessEqual
DepthBufferWriteEnable Enables or disables writing to the depth buffer. The default is true.
DestinationBlend Gets or sets the color blending factor. This factor represents a value by which to m
ultiply the destination pixel color before adding it to the source pixel to produce a c
olor that is a blend of the two. The default is Blend.Zero.
FillMode Represents the fill mode. The default is FillMode.Solid.
FogColor Gets or sets the fog color. The default value is Color.TransparentBlack.
FogDensity Gets or sets the fog density for pixel or vertex fog used in exponential fog modes. T
he default value is 1.0f.
FogEnable Enables or disables fog blending. The default is false.
FogEnd Gets or sets the depth at which pixel or vertex fog effects end for linear fog mode.
The default value is 1.0f.
FogStart Gets or sets the depth at which pixel or vertex fog effects begin for linear fog mode
. The default value is 0.0f.
FogTableMode Gets or sets the fog formula to use for pixel fog. The default is None.
FogVertexMode Gets or sets the fog formula to use for vertex fog. The default is FogMode.None.
MultiSampleAntiAlias Enables or disables multisample antialiasing. The default is true.
MultiSampleMask Gets or sets a bitmask controlling modification of the samples in a multisample re
nder target. The default is 0xffffffff.
PointSize Gets or sets the size to use for point size computation in cases where point size is
not specified for each vertex. The default value is the value a driver returns. If a driv
er returns 0 or 1, the default value is 64, which allows software point size emulatio
n.
PointSizeMax Gets or sets the maximum size of point primitives. The default is 64.0f.
PointSizeMin Gets or sets the minimum size of point primitives. The default is 1.0f.
PointSpriteEnable Enables or disables full texture mapping on each point. The default is false.
RangeFogEnable Gets or sets enabling of range-based vertex fog. The default value is false.
ReferenceAlpha Specifies a reference alpha value against which pixels are tested when alpha testin
g is enabled. The default value is 0.
ReferenceStencil Specifies a reference value to use for the stencil test. The default is 0.
ScissorTestEnable Enables or disables scissor testing. The default is false.
SeparateAlphaBlendEnabled Enables or disables the separate blend mode for the alpha channel. The default is f
alse.
SlopeScaleDepthBias Gets or sets a value used to determine how much bias can be applied to coplanar
primitives to reduce flimmering z-fighting. The default is 0.
SourceBlend Gets or sets the color blending factor. This factor represents a value by which to m
ultiply the source pixel color before adding it to the destination pixel to produce a c
olor that is a blend of the two. The default is Blend.One.
StencilDepthBufferFail Gets or sets the stencil operation to perform if the stencil test passes and the depth
-test fails. The default is StencilOperation.Keep.
StencilEnable Gets or sets stencil enabling. The default is false.
StencilFail Gets or sets the stencil operation to perform if the stencil test fails. The default is
StencilOperation.Keep.
StencilFunction Gets or sets the comparison function for the stencil test. The default is
CompareFunction.Always.
StencilMask Gets or sets the mask applied to the reference value and each stencil buffer entry t
o determine the significant bits for the stencil test. The default mask is Int32.MaxVa
lue.
StencilPass Gets or sets the stencil operation to perform if the stencil test passes. The default is
StencilOperation.Keep.
StencilWriteMask Gets or sets the write mask applied to values written into the stencil buffer. The def
ault mask is Int32.MaxValue.
TwoSidedStencilMode Enables or disables two-sided stenciling. The default is false.
Wrap0 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap1 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap10 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap11 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap12 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap13 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap14 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap15 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap2 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap3 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap4 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap5 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap6 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap7 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap8 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap9 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
RenderState Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
RenderState Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
RenderState Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
RenderState.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState Properties
Public Properties
Name Description
AlphaBlendEnable Gets or sets a value to enable alpha-blended transparency. The default value is fals
e.
AlphaBlendOperation Gets or sets the arithmetic operation applied to separate alpha blending. The defau
lt is BlendFunction.Add.
AlphaDestinationBlend Gets or sets the separate alpha channel blending factor. This factor represents a de
stination value by which to multiply the alpha channel only. The default is
Blend.One.
AlphaFunction Gets or sets the comparison function for the alpha test. The default is
CompareFunction.Always.
AlphaSourceBlend Gets or sets the separate alpha channel blending factor. This factor represents a val
ue by which to multiply the alpha channel only. The default is Blend.One.
AlphaTestEnable Gets or sets a render state that enables a per-pixel alpha test. The default value is f
alse.
BlendFactor Gets or sets the color used for a constant-blend factor during alpha blending. The
default is Color.White.
BlendFunction Gets or sets a value to select the arithmetic operation to apply to the source and de
stination pixel components when AlphaBlendEnable is set to true. The default is
BlendFunction.Add.
ColorWriteChannels Gets or sets a value that enables a per-channel write for the render target color buf
fer. The default value is ColorWriteChannels.None.
ColorWriteChannels1 Gets or sets a value that enables a per-channel write for the render target color buf
fer. The default value is ColorWriteChannels.None.
ColorWriteChannels2 Gets or sets a value that enables a per-channel write for the render target color buf
fer. The default value is ColorWriteChannels.None.
ColorWriteChannels3 Gets or sets a value that enables a per-channel write for the render target color buf
fer. The default value is ColorWriteChannels.None.
CounterClockwiseStencilDepthBufferFail Gets or sets the stencil operation to perform if the stencil test passes and the depth
-buffer test fails for a counterclockwise triangle. The default is
StencilOperation.Keep.
CounterClockwiseStencilFail Gets or sets the stencil operation to perform if the stencil test fails for a counterclo
ckwise triangle. The default is StencilOperation.Keep.
CounterClockwiseStencilFunction Gets or sets the comparison function to use for counterclockwise stencil tests. The
default is CompareFunction.Always.
CounterClockwiseStencilPass Gets or sets the stencil operation to perform if the stencil and z-tests pass for a cou
nterclockwise triangle. The default is StencilOperation.Keep.
CullMode Specifies how back-facing triangles are culled, if at all. The default value is
CullMode.CounterClockwise.
DepthBias Sets or retrieves the depth bias for polygons. The default value is 0.
DepthBufferEnable Enables or disables depth buffering. The default is true.
DepthBufferFunction Gets or sets the comparison function for the depth-buffer test. The default is
CompareFunction.LessEqual
DepthBufferWriteEnable Enables or disables writing to the depth buffer. The default is true.
DestinationBlend Gets or sets the color blending factor. This factor represents a value by which to m
ultiply the destination pixel color before adding it to the source pixel to produce a c
olor that is a blend of the two. The default is Blend.Zero.
FillMode Represents the fill mode. The default is FillMode.Solid.
FogColor Gets or sets the fog color. The default value is Color.TransparentBlack.
FogDensity Gets or sets the fog density for pixel or vertex fog used in exponential fog modes. T
he default value is 1.0f.
FogEnable Enables or disables fog blending. The default is false.
FogEnd Gets or sets the depth at which pixel or vertex fog effects end for linear fog mode.
The default value is 1.0f.
FogStart Gets or sets the depth at which pixel or vertex fog effects begin for linear fog mode
. The default value is 0.0f.
FogTableMode Gets or sets the fog formula to use for pixel fog. The default is None.
FogVertexMode Gets or sets the fog formula to use for vertex fog. The default is FogMode.None.
MultiSampleAntiAlias Enables or disables multisample antialiasing. The default is true.
MultiSampleMask Gets or sets a bitmask controlling modification of the samples in a multisample re
nder target. The default is 0xffffffff.
PointSize Gets or sets the size to use for point size computation in cases where point size is
not specified for each vertex. The default value is the value a driver returns. If a driv
er returns 0 or 1, the default value is 64, which allows software point size emulatio
n.
PointSizeMax Gets or sets the maximum size of point primitives. The default is 64.0f.
PointSizeMin Gets or sets the minimum size of point primitives. The default is 1.0f.
PointSpriteEnable Enables or disables full texture mapping on each point. The default is false.
RangeFogEnable Gets or sets enabling of range-based vertex fog. The default value is false.
ReferenceAlpha Specifies a reference alpha value against which pixels are tested when alpha testin
g is enabled. The default value is 0.
ReferenceStencil Specifies a reference value to use for the stencil test. The default is 0.
ScissorTestEnable Enables or disables scissor testing. The default is false.
SeparateAlphaBlendEnabled Enables or disables the separate blend mode for the alpha channel. The default is f
alse.
SlopeScaleDepthBias Gets or sets a value used to determine how much bias can be applied to coplanar
primitives to reduce flimmering z-fighting. The default is 0.
SourceBlend Gets or sets the color blending factor. This factor represents a value by which to m
ultiply the source pixel color before adding it to the destination pixel to produce a c
olor that is a blend of the two. The default is Blend.One.
StencilDepthBufferFail Gets or sets the stencil operation to perform if the stencil test passes and the depth
-test fails. The default is StencilOperation.Keep.
StencilEnable Gets or sets stencil enabling. The default is false.
StencilFail Gets or sets the stencil operation to perform if the stencil test fails. The default is
StencilOperation.Keep.
StencilFunction Gets or sets the comparison function for the stencil test. The default is
CompareFunction.Always.
StencilMask Gets or sets the mask applied to the reference value and each stencil buffer entry t
o determine the significant bits for the stencil test. The default mask is Int32.MaxVa
lue.
StencilPass Gets or sets the stencil operation to perform if the stencil test passes. The default is
StencilOperation.Keep.
StencilWriteMask Gets or sets the write mask applied to values written into the stencil buffer. The def
ault mask is Int32.MaxValue.
TwoSidedStencilMode Enables or disables two-sided stenciling. The default is false.
Wrap0 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap1 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap10 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap11 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap12 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap13 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap14 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap15 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap2 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap3 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap4 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap5 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap6 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap7 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap8 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
Wrap9 Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates.
The default value for this render state is TextureWrapCoordinates.Zero (wrapping
disabled in all directions).
See Also
Reference
RenderState Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
RenderState.AlphaBlendEnable Property
Gets or sets a value to enable alpha-blended transparency. The default value is false.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool AlphaBlendEnable { get; set; }
Property Value
true if alpha-blended transparency is enabled; false otherwise.
Remarks
The alpha value of a color controls its transparency. Enabling alpha blending with AlphaBlendEnable allows colors, materials,
and textures on a surface to be blended with transparency onto another surface.
Alpha blending is determined by the SourceBlend and DestinationBlend properties. With the default BlendFunction, the source
pixel times the SourceBlend is added to the destination pixel (the pixel on the back buffer) times the DestinationBlend to
produce a color that is a blend of the two pixel colors. The BlendFunction determines the operation used on the outcome of the
source blend and destination blend components.
Example
The following short code snippet sets the render state to use additive alpha blending prior to a draw call.
C#
graphics.GraphicsDevice.RenderState.AlphaBlendEnable = true;
graphics.GraphicsDevice.RenderState.SourceBlend = Blend.One;
graphics.GraphicsDevice.RenderState.DestinationBlend = Blend.One;
graphics.GraphicsDevice.RenderState.BlendFunction = BlendFunction.Add;
// TODO: Place the drawing calls that should be alpha blended here.
See Also
Reference
SourceBlend
DestinationBlend
BlendFunction
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.AlphaBlendOperation Property
Gets or sets the arithmetic operation applied to separate alpha blending. The default is BlendFunction.Add.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public BlendFunction AlphaBlendOperation { get; set; }
Property Value
A value from the BlendFunction enumeration.
Remarks
This value is ignored unless SeparateAlphaBlendEnabled is true.
Caution
This value is used for blending the alpha channel only, not for alpha blending of the entire pixel. For setting the blending mo
de for alpha blending operation, see BlendFunction.
See Also
Reference
RenderState.BlendFunction Property
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.AlphaDestinationBlend Property
Gets or sets the separate alpha channel blending factor. This factor represents a destination value by which to multiply the
alpha channel only. The default is Blend.One.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Blend AlphaDestinationBlend { get; set; }
Property Value
A value from the Blend enumeration. BothSourceAlpha and BothInverseSourceAlpha are not supported on Xbox 360.
Remarks
This value is ignored unless SeparateAlphaBlendEnabled is true.
Caution
This value is used for blending the alpha channel only, not for alpha blending of the entire pixel. For setting the blending mo
de for alpha blending of the destination color, see DestinationBlend.
See Also
Reference
RenderState.DestinationBlend Property
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.AlphaFunction Property
Gets or sets the comparison function for the alpha test. The default is CompareFunction.Always.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public CompareFunction AlphaFunction { get; set; }
Property Value
A member of the CompareFunction enumeration that represents the comparison function to set or get.
See Also
Reference
RenderState Class
RenderState Members
AlphaTestEnable
ReferenceAlpha
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.AlphaSourceBlend Property
Gets or sets the separate alpha channel blending factor. This factor represents a value by which to multiply the alpha channel
only. The default is Blend.One.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Blend AlphaSourceBlend { get; set; }
Property Value
A value from the Blend enumeration.
Remarks
Caution
This value is used for blending the alpha channel only, not for alpha blending of the entire pixel. For setting the blending mo
de for alpha blending of the source color, see SourceBlend.
RenderState.AlphaTestEnable Property
Gets or sets a render state that enables a per-pixel alpha test. The default value is false.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool AlphaTestEnable { get; set; }
Property Value
true if per-pixel alpha blending is enabled; false otherwise.
Remarks
If the test passes, the pixel is processed by the frame buffer. Otherwise, all frame-buffer processing is skipped for the pixel. The
test is done by comparing the incoming alpha value with the reference alpha value, using the comparison function provided by
AlphaFunction. The reference alpha value is determined by the value set for ReferenceAlpha.
See Also
Reference
RenderState Class
AlphaFunction
ReferenceAlpha
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.BlendFactor Property
Gets or sets the color used for a constant-blend factor during alpha blending. The default is Color.White.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Color BlendFactor { get; set; }
Property Value
The color used for a constant-blend factor during alpha blending.
Remarks
Blend factoring during alpha blending is available if SupportsBlendFactor or SupportsBlendFactor is true.
See Also
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.BlendFunction Property
Gets or sets a value to select the arithmetic operation to apply to the source and destination pixel components when
AlphaBlendEnable is set to true. The default is BlendFunction.Add.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public BlendFunction BlendFunction { get; set; }
Property Value
The blending operation to set or get.
Remarks
The alpha value of a color controls its transparency. Enabling alpha blending with AlphaBlendEnable allows colors, materials,
and textures on a surface to be blended with transparency onto another surface.
Alpha blending is determined by the SourceBlend and DestinationBlend properties. With the default BlendFunction, the source
pixel times the SourceBlend is added to the destination pixel (the pixel on the back buffer) times the DestinationBlend to
produce a color that is a blend of the two pixel colors. The BlendFunction determines the operation used on the outcome of the
source blend and destination blend components.
Example
The following short code snippet sets the render state to use additive alpha blending prior to a draw call.
C#
graphics.GraphicsDevice.RenderState.AlphaBlendEnable = true;
graphics.GraphicsDevice.RenderState.SourceBlend = Blend.One;
graphics.GraphicsDevice.RenderState.DestinationBlend = Blend.One;
graphics.GraphicsDevice.RenderState.BlendFunction = BlendFunction.Add;
// TODO: Place the drawing calls that should be alpha blended here.
See Also
Reference
AlphaBlendEnable
SourceBlend
DestinationBlend
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.ColorWriteChannels Property
Gets or sets a value that enables a per-channel write for the render target color buffer. The default value is
ColorWriteChannels.None.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ColorWriteChannels ColorWriteChannels { get; set; }
Property Value
Value of the ColorWriteChannels enumeration that specifies the color channel to set or get.
Remarks
Color writing is available if SupportsColorWrite is true.
See Also
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.ColorWriteChannels1 Property
Gets or sets a value that enables a per-channel write for the render target color buffer. The default value is
ColorWriteChannels.None.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ColorWriteChannels ColorWriteChannels1 { get; set; }
Property Value
Value of the ColorWriteChannels enumeration that specifies the color channel to set or get.
Remarks
This property works in addition to the ColorWriteChannels property. Color writing is available if SupportsColorWrite is true.
See Also
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.ColorWriteChannels2 Property
Gets or sets a value that enables a per-channel write for the render target color buffer. The default value is
ColorWriteChannels.None.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ColorWriteChannels ColorWriteChannels2 { get; set; }
Property Value
Value of the ColorWriteChannels enumeration that specifies the color channel to set or get.
Remarks
This property works in addition to the ColorWriteChannels property. Color writing is available if SupportsColorWrite is true.
See Also
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.ColorWriteChannels3 Property
Gets or sets a value that enables a per-channel write for the render target color buffer. The default value is
ColorWriteChannels.None.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ColorWriteChannels ColorWriteChannels3 { get; set; }
Property Value
Value of the ColorWriteChannels enumeration that specifies the color channel to set or get.
Remarks
This property works in addition to the ColorWriteChannels property. Color writing is available if SupportsColorWrite is true.
See Also
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.CounterClockwiseStencilDepthBufferFail Property
Gets or sets the stencil operation to perform if the stencil test passes and the depth-buffer test fails for a counterclockwise
triangle. The default is StencilOperation.Keep.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public StencilOperation CounterClockwiseStencilDepthBufferFail { get; set; }
Property Value
The stencil operation to perform.
See Also
Reference
RenderState Class
RenderState Members
CounterClockwiseStencilFunction
CounterClockwiseStencilPass
CounterClockwiseStencilFail
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.CounterClockwiseStencilFail Property
Gets or sets the stencil operation to perform if the stencil test fails for a counterclockwise triangle. The default is
StencilOperation.Keep.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public StencilOperation CounterClockwiseStencilFail { get; set; }
Property Value
The stencil operation to perform.
See Also
Reference
RenderState Class
RenderState Members
CounterClockwiseStencilFunction
CounterClockwiseStencilPass
CounterClockwiseStencilDepthBufferFail
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.CounterClockwiseStencilFunction Property
Gets or sets the comparison function to use for counterclockwise stencil tests. The default is CompareFunction.Always.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public CompareFunction CounterClockwiseStencilFunction { get; set; }
Property Value
A CompareFunction value indicating which test to perform.
See Also
Reference
RenderState Class
RenderState Members
CounterClockwiseStencilPass
CounterClockwiseStencilFail
CounterClockwiseStencilDepthBufferFail
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.CounterClockwiseStencilPass Property
Gets or sets the stencil operation to perform if the stencil and z-tests pass for a counterclockwise triangle. The default is
StencilOperation.Keep.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public StencilOperation CounterClockwiseStencilPass { get; set; }
Property Value
The stencil operation to perform.
See Also
Reference
RenderState Class
RenderState Members
CounterClockwiseStencilFunction
CounterClockwiseStencilFail
CounterClockwiseStencilDepthBufferFail
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.CullMode Property
Specifies how back-facing triangles are culled, if at all. The default value is CullMode.CounterClockwise.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public CullMode CullMode { get; set; }
Property Value
The culling mode to set or get.
Remarks
When drawing sprites, SpriteBatch.Begin does not save your current render state, and will change certain render state
properties that may make 3D objects render incorrectly. This includes setting CullMode to
CullMode.CullCounterClockwiseFace. You can choose to either reset the render state yourself after the call to SpriteBatch.End,
or call SpriteBatch.Begin and pass in SaveStateMode.SaveState, which will restore the render state after sprites are drawn.
See Also
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.DepthBias Property
Sets or retrieves the depth bias for polygons. The default value is 0.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float DepthBias { get; set; }
Property Value
Depth bias for polygons.
Remarks
This property specifies a value in the range of 0 through 16 (inclusive). This value is used to make polygons that are physically
coplanar appear separate.
Polygons with a high z-bias value appear in front of polygons with a lower value, without requiring sorting for drawing order.
For example, polygons with a value of 1 appear in front of polygons with a value of 0.
See Also
Reference
RenderState Class
RenderState Members
SlopeScaleDepthBias
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.DepthBufferEnable Property
Enables or disables depth buffering. The default is true.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool DepthBufferEnable { get; set; }
Property Value
true if depth buffering is enabled; false otherwise.
See Also
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.DepthBufferFunction Property
Gets or sets the comparison function for the depth-buffer test. The default is CompareFunction.LessEqual
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public CompareFunction DepthBufferFunction { get; set; }
Property Value
Value of a CompareFunction that represents the comparison function to set or get.
Remarks
The depth value of the pixel is compared to the depth-buffer value. If the depth value of the pixel passes the comparison
function, the pixel is written.
See Also
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.DepthBufferWriteEnable Property
Enables or disables writing to the depth buffer. The default is true.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool DepthBufferWriteEnable { get; set; }
Property Value
true if writing to the depth buffer is enabled; false otherwise.
Remarks
This property enables an application to prevent the system from updating the depth buffer with new depth values.
If false, depth comparisons are still made according to the render state DepthBufferFunction, assuming that depth buffering is
taking place, but depth values are not written to the buffer.
See Also
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.DestinationBlend Property
Gets or sets the color blending factor. This factor represents a value by which to multiply the destination pixel color before
adding it to the source pixel to produce a color that is a blend of the two. The default is Blend.Zero.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Blend DestinationBlend { get; set; }
Property Value
A Blend factor to set or get for the destination pixel.
Remarks
The alpha value of a color controls its transparency. Enabling alpha blending with AlphaBlendEnable allows colors, materials,
and textures on a surface to be blended with transparency onto another surface.
Alpha blending is determined by the SourceBlend and DestinationBlend properties. With the default BlendFunction, the source
pixel times the SourceBlend is added to the destination pixel (the pixel on the back buffer) times the DestinationBlend to
produce a color that is a blend of the two pixel colors. The BlendFunction determines the operation used on the outcome of the
source blend and destination blend components.
Example
The following short code snippet sets the render state to use additive alpha blending prior to a draw call.
C#
graphics.GraphicsDevice.RenderState.AlphaBlendEnable = true;
graphics.GraphicsDevice.RenderState.SourceBlend = Blend.One;
graphics.GraphicsDevice.RenderState.DestinationBlend = Blend.One;
graphics.GraphicsDevice.RenderState.BlendFunction = BlendFunction.Add;
// TODO: Place the drawing calls that should be alpha blended here.
See Also
Reference
AlphaBlendEnable
SourceBlend
BlendFunction
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.FillMode Property
Represents the fill mode. The default is FillMode.Solid.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public FillMode FillMode { get; set; }
Property Value
Value of a FillMode that specifies the fill mode to set or get.
See Also
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.FogColor Property
Gets or sets the fog color. The default value is Color.TransparentBlack.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Color FogColor { get; set; }
Property Value
A color that specifies the fog color to set or get.
See Also
Reference
RenderState Class
RenderState Members
FogStart
FogEnd
FogEnable
FogDensity
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.FogDensity Property
Gets or sets the fog density for pixel or vertex fog used in exponential fog modes. The default value is 1.0f.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float FogDensity { get; set; }
Property Value
Value that represents the fog density to set or get.
Remarks
Valid fog density values range from 0.0 through 1.0.
See Also
Reference
RenderState Class
RenderState Members
FogStart
FogEnd
FogEnable
FogColor
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.FogEnable Property
Enables or disables fog blending. The default is false.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool FogEnable { get; set; }
Property Value
true if fog blending is enabled; false otherwise.
See Also
Reference
RenderState Class
RenderState Members
FogColor
FogVertexMode
FogStart
FogEnd
FogDensity
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.FogEnd Property
Gets or sets the depth at which pixel or vertex fog effects end for linear fog mode. The default value is 1.0f.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float FogEnd { get; set; }
Property Value
Value that represents the ending depth to set or get.
Remarks
Depth is specified in world space for vertex fog, and in either device space [0.0, 1.0] or world space for pixel fog. For pixel fog,
these values are in device space when the system uses z for fog calculations, or in world space when the system uses eye-
relative fog (w-fog).
See Also
Reference
RenderState Class
RenderState Members
FogStart
FogEnable
FogColor
FogDensity
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.FogStart Property
Gets or sets the depth at which pixel or vertex fog effects begin for linear fog mode. The default value is 0.0f.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float FogStart { get; set; }
Property Value
Value that represents the beginning depth to set or get.
Remarks
Depth is specified in world space for vertex fog, and in either device space [0.0, 1.0] or world space for pixel fog. For pixel fog,
these values are in device space when the system uses z for fog calculations, or in world space when the system uses eye-
relative fog (w-fog).
See Also
Reference
RenderState Class
RenderState Members
FogEnd
FogEnable
FogColor
FogDensity
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.FogTableMode Property
Gets or sets the fog formula to use for pixel fog. The default is None.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public FogMode FogTableMode { get; set; }
Property Value
Value of a FogMode that specifies the fog mode to set or get.
See Also
Reference
RenderState Class
RenderState Members
FogStart
FogEnd
FogEnable
FogColor
FogDensity
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.FogVertexMode Property
Gets or sets the fog formula to use for vertex fog. The default is FogMode.None.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public FogMode FogVertexMode { get; set; }
Property Value
Value of a FogMode that specifies the fog mode to set or get.
See Also
Reference
RenderState Class
RenderState Members
FogStart
FogEnd
FogEnable
FogColor
FogDensity
RangeFogEnable
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.MultiSampleAntiAlias Property
Enables or disables multisample antialiasing. The default is true.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool MultiSampleAntiAlias { get; set; }
Property Value
true to enable multisample antialiasing; false otherwise.
Remarks
When multisample antialiasing is enabled, the multiple samples are computed so that full-scene antialiasing is performed by
sampling at different sample positions for each multiple sample. When disabled, the multiple samples are all written with the
same sample value, sampled at the pixel center, which allows non-antialiased rendering to a multisample buffer. This render
state has no effect when rendering to a single sample buffer.
See Also
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.MultiSampleMask Property
Gets or sets a bitmask controlling modification of the samples in a multisample render target. The default is 0xffffffff.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int MultiSampleMask { get; set; }
Property Value
A bitmask value controlling write enables for the samples. Each bit in this mask, starting at the least-significant bit, controls
modification of one of the samples in a multisample render target. Thus, for an 8-sample render target, the low byte contains
the eight write enables for each of the eight samples. This render state has no effect when rendering to a single sample buffer.
Remarks
This render state enables use of a multisample buffer as an accumulation buffer, doing multipass rendering of geometry where
each pass updates a subset of samples.
Given n multisamples and k enabled samples, the resulting intensity of the rendered image should be k/n. Each component
RGB of every pixel is factored by k/n.
See Also
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.PointSize Property
Gets or sets the size to use for point size computation in cases where point size is not specified for each vertex. The default
value is the value a driver returns. If a driver returns 0 or 1, the default value is 64, which allows software point size emulation.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float PointSize { get; set; }
Property Value
This value is in world space units.
See Also
Tasks
How To: Draw Point Sprites
Reference
RenderState Class
RenderState Members
PointSpriteEnable
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.PointSizeMax Property
Gets or sets the maximum size of point primitives. The default is 64.0f.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float PointSizeMax { get; set; }
Property Value
The maximum size of point primitives. Must be less than or equal to Capabilities.MaxPointSize and greater than or equal to
PointSizeMin.
See Also
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.PointSizeMin Property
Gets or sets the minimum size of point primitives. The default is 1.0f.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float PointSizeMin { get; set; }
Property Value
The minimum size of point primitives.
Remarks
Point primitives are clamped to this size during rendering. Setting this to values smaller than 1.0 results in points dropping out
when the point does not cover a pixel center and antialiasing is disabled or, when antialiasing is enabled, being rendered with
reduced intensity.
See Also
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.PointSpriteEnable Property
Enables or disables full texture mapping on each point. The default is false.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool PointSpriteEnable { get; set; }
Property Value
true to set texture coordinates of point primitives so that full textures are mapped on each point; false otherwise. When false,
the vertex texture coordinates are used for the entire point.
See Also
Tasks
How To: Draw Point Sprites
Reference
RenderState Class
RenderState Members
PointSize
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.RangeFogEnable Property
Gets or sets enabling of range-based vertex fog. The default value is false.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool RangeFogEnable { get; set; }
Property Value
true if range-based vertex fog is enabled; false otherwise. If false, depth-based fog is used.
Remarks
In range-based fog, the distance of an object from the viewer is used to compute fog effects, not the depth of the object in the
scene. In range-based fog, all fog methods work as usual, except that they use range instead of depth in the computations.
Range is the correct factor to use for fog computations, but depth is commonly used instead because range is time-consuming
to compute and depth is generally already available. Using depth to calculate fog has the undesirable effect of having the
fogginess of peripheral objects change as the viewer's eye moves - in this case, the depth changes and the range remains
constant.
Because no hardware currently supports per-pixel range-based fog, range correction is offered only for vertex fog.
See Also
Reference
RenderState Class
RenderState Members
FogStart
FogEnd
FogEnable
FogColor
FogDensity
FogVertexMode
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.ReferenceAlpha Property
Specifies a reference alpha value against which pixels are tested when alpha testing is enabled. The default value is 0.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int ReferenceAlpha { get; set; }
Property Value
Integer that specifies the reference alpha value to set or get. This is an 8-bit value placed in the low 8 bits of the DWORD
render-state value. Values can range from 0x00000000 through 0x000000FF.
See Also
Reference
RenderState Class
RenderState Members
AlphaTestEnable
AlphaFunction
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.ReferenceStencil Property
Specifies a reference value to use for the stencil test. The default is 0.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int ReferenceStencil { get; set; }
Property Value
Integer that specifies the stencil test value to set or get.
Remarks
The reference value is compared, by the comparison function specified by the StencilFunction property, to the stencil buffer
entry of a pixel. This can be illustrated by a simple equation:
ReferenceStencil StencilFunction (stencil buffer entry)
This comparison applies only to the bits in the reference value and stencil buffer entry that are set in the stencil mask by this
property. If the comparison is true, the stencil test passes and the pass operation (specified by the StencilPass property) is
performed.
See Also
Reference
RenderState Class
RenderState Members
StencilEnable
StencilFunction
StencilMask
StencilWriteMask
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.ScissorTestEnable Property
Enables or disables scissor testing. The default is false.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool ScissorTestEnable { get; set; }
Property Value
true to enable scissor testing; false otherwise.
Remarks
With scissor testing enabled, the graphics device will only draw onto parts of the screen that fall within the specified
ScissorRectangle.
See Also
Reference
RenderState Class
RenderState Members
ScissorRectangle
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.SeparateAlphaBlendEnabled Property
Enables or disables the separate blend mode for the alpha channel. The default is false.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool SeparateAlphaBlendEnabled { get; set; }
Property Value
true to enable the separate blend mode for the alpha channel; false otherwise.
Remarks
When set to false, the render-target blending factors and operations applied to alpha are forced to be the same as those
defined for color. This mode is effectively hard-wired to false on implementations that don't set SupportsSeparateAlphaBlend
to true.
The AlphaSourceBlend and AlphaDestinationBlend render states determine the type of separate alpha blending.
See Also
Reference
AlphaSourceBlend
AlphaDestinationBlend
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.SlopeScaleDepthBias Property
Gets or sets a value used to determine how much bias can be applied to coplanar primitives to reduce flimmering z-fighting.
The default is 0.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float SlopeScaleDepthBias { get; set; }
Property Value
Value that specifies the slope scale bias to apply.
Remarks
Polygons that are coplanar in your 3D space can be made to appear as if they are not coplanar by adding a z-bias to each one.
An application can help ensure that coplanar polygons are rendered properly by adding a bias to the z-values that the system
uses when rendering sets of coplanar polygons.
The following formula shows how to calculate the bias to be applied to coplanar primitives.
bias = (m × SlopeScaleDepthBias) + DepthBias
Where m is the maximum depth slope of the triangle being rendered, defined as:
m = max( abs(delta z / delta x), abs(delta z / delta y) )
See Also
Reference
RenderState Class
RenderState Members
DepthBias
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.SourceBlend Property
Gets or sets the color blending factor. This factor represents a value by which to multiply the source pixel color before adding it
to the destination pixel to produce a color that is a blend of the two. The default is Blend.One.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Blend SourceBlend { get; set; }
Property Value
A Blend factor to set or get for the source pixel.
Remarks
The alpha value of a color controls its transparency. Enabling alpha blending with AlphaBlendEnable allows colors, materials,
and textures on a surface to be blended with transparency onto another surface.
Alpha blending is determined by the SourceBlend and DestinationBlend properties. With the default BlendFunction, the source
pixel times the SourceBlend is added to the destination pixel (the pixel on the back buffer) times the DestinationBlend to
produce a color that is a blend of the two pixel colors. The BlendFunction determines the operation used on the outcome of the
source blend and destination blend components.
Example
The following short code snippet sets the render state to use additive alpha blending prior to a draw call.
C#
graphics.GraphicsDevice.RenderState.AlphaBlendEnable = true;
graphics.GraphicsDevice.RenderState.SourceBlend = Blend.One;
graphics.GraphicsDevice.RenderState.DestinationBlend = Blend.One;
graphics.GraphicsDevice.RenderState.BlendFunction = BlendFunction.Add;
// TODO: Place the drawing calls that should be alpha blended here.
See Also
Reference
AlphaBlendEnable
DestinationBlend
BlendFunction
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.StencilDepthBufferFail Property
Gets or sets the stencil operation to perform if the stencil test passes and the depth-test fails. The default is
StencilOperation.Keep.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public StencilOperation StencilDepthBufferFail { get; set; }
Property Value
The stencil operation to perform.
See Also
Concepts
What Is a Stencil Buffer?
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.StencilEnable Property
Gets or sets stencil enabling. The default is false.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool StencilEnable { get; set; }
Property Value
true if stenciling is enabled; false otherwise.
See Also
Concepts
What Is a Stencil Buffer?
Reference
RenderState Class
RenderState Members
StencilFunction
StencilMask
StencilWriteMask
ReferenceStencil
StencilPass
StencilFail
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.StencilFail Property
Gets or sets the stencil operation to perform if the stencil test fails. The default is StencilOperation.Keep.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public StencilOperation StencilFail { get; set; }
Property Value
The stencil operation to perform.
See Also
Concepts
What Is a Stencil Buffer?
Reference
RenderState Class
RenderState Members
StencilEnable
StencilFunction
StencilMask
StencilWriteMask
ReferenceStencil
StencilPass
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.StencilFunction Property
Gets or sets the comparison function for the stencil test. The default is CompareFunction.Always.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public CompareFunction StencilFunction { get; set; }
Property Value
Value of a CompareFunction that represents the comparison function to set or get.
Remarks
The comparison function is used to compare the reference value (stored in the ReferenceStencil property) to the stencil buffer
entry of a pixel. This can be illustrated by a simple equation:
ReferenceStencil StencilFunction (stencil buffer entry)
This comparison applies only to the bits in the reference value and stencil buffer entry that are set in the stencil mask by this
property. If the comparison is true, the stencil test passes and the pass operation (specified by the StencilPass property) is
performed.
See Also
Concepts
What Is a Stencil Buffer?
Reference
RenderState Class
RenderState Members
StencilEnable
StencilMask
StencilWriteMask
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.StencilMask Property
Gets or sets the mask applied to the reference value and each stencil buffer entry to determine the significant bits for the
stencil test. The default mask is Int32.MaxValue.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int StencilMask { get; set; }
Property Value
Value that represents the mask to set or get.
See Also
Concepts
What Is a Stencil Buffer?
Reference
RenderState Class
RenderState Members
StencilEnable
StencilFunction
StencilWriteMask
ReferenceStencil
StencilPass
StencilFail
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.StencilPass Property
Gets or sets the stencil operation to perform if the stencil test passes. The default is StencilOperation.Keep.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public StencilOperation StencilPass { get; set; }
Property Value
The stencil operation to perform.
See Also
Concepts
What Is a Stencil Buffer?
Reference
RenderState Class
RenderState Members
StencilEnable
StencilFunction
StencilMask
StencilWriteMask
ReferenceStencil
StencilFail
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.StencilWriteMask Property
Gets or sets the write mask applied to values written into the stencil buffer. The default mask is Int32.MaxValue.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int StencilWriteMask { get; set; }
Property Value
Value that represents the write mask to set or get.
See Also
Concepts
What Is a Stencil Buffer?
Reference
RenderState Class
RenderState Members
StencilEnable
StencilFunction
StencilMask
ReferenceStencil
StencilPass
StencilFail
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.TwoSidedStencilMode Property
Enables or disables two-sided stenciling. The default is false.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool TwoSidedStencilMode { get; set; }
Property Value
true to enable two-sided stenciling; false otherwise.
Remarks
The application should set CullMode to CullMode.None to enable two-sided stencil mode. If the triangle winding order is
clockwise, the StencilFunction will be used. If the winding order is counterclockwise, the CounterClockwiseStencilFunction will
be used.
See Also
Concepts
What Is a Stencil Buffer?
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.Wrap0 Property
Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates. The default value for this render state is
TextureWrapCoordinates.Zero (wrapping disabled in all directions).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureWrapCoordinates Wrap0 { get; set; }
Property Value
Combination of values from TextureWrapCoordinates to set or get.
Remarks
Valid values for this render state can be Zero, One, or both. These cause the system to wrap in the direction of the first, second,
third, and fourth dimensions, sometimes referred to as the s, t, r, and q directions, for a given texture.
See Also
Concepts
What Is Texture Mapping?
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.Wrap1 Property
Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates. The default value for this render state is
TextureWrapCoordinates.Zero (wrapping disabled in all directions).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureWrapCoordinates Wrap1 { get; set; }
Property Value
Combination of values from TextureWrapCoordinates to set or get.
Remarks
Valid values for this render state can be Zero, One, or both. These cause the system to wrap in the direction of the first, second,
third, and fourth dimensions, sometimes referred to as the s, t, r, and q directions, for a given texture.
See Also
Concepts
What Is Texture Mapping?
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.Wrap10 Property
Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates. The default value for this render state is
TextureWrapCoordinates.Zero (wrapping disabled in all directions).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureWrapCoordinates Wrap10 { get; set; }
Property Value
Combination of values from TextureWrapCoordinates to set or get.
Remarks
Valid values for this render state can be Zero, One, or both. These cause the system to wrap in the direction of the first, second,
third, and fourth dimensions, sometimes referred to as the s, t, r, and q directions, for a given texture.
See Also
Concepts
What Is Texture Mapping?
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.Wrap11 Property
Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates. The default value for this render state is
TextureWrapCoordinates.Zero (wrapping disabled in all directions).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureWrapCoordinates Wrap11 { get; set; }
Property Value
Combination of values from TextureWrapCoordinates to set or get.
Remarks
Valid values for this render state can be Zero, One, or both. These cause the system to wrap in the direction of the first, second,
third, and fourth dimensions, sometimes referred to as the s, t, r, and q directions, for a given texture.
See Also
Concepts
What Is Texture Mapping?
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.Wrap12 Property
Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates. The default value for this render state is
TextureWrapCoordinates.Zero (wrapping disabled in all directions).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureWrapCoordinates Wrap12 { get; set; }
Property Value
Combination of values from TextureWrapCoordinates to set or get.
Remarks
Valid values for this render state can be Zero, One, or both. These cause the system to wrap in the direction of the first, second,
third, and fourth dimensions, sometimes referred to as the s, t, r, and q directions, for a given texture.
See Also
Concepts
What Is Texture Mapping?
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.Wrap13 Property
Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates. The default value for this render state is
TextureWrapCoordinates.Zero (wrapping disabled in all directions).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureWrapCoordinates Wrap13 { get; set; }
Property Value
Combination of values from TextureWrapCoordinates to set or get.
Remarks
Valid values for this render state can be Zero, One, or both. These cause the system to wrap in the direction of the first, second,
third, and fourth dimensions, sometimes referred to as the s, t, r, and q directions, for a given texture.
See Also
Concepts
What Is Texture Mapping?
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.Wrap14 Property
Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates. The default value for this render state is
TextureWrapCoordinates.Zero (wrapping disabled in all directions).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureWrapCoordinates Wrap14 { get; set; }
Property Value
Combination of values from TextureWrapCoordinates to set or get.
Remarks
Valid values for this render state can be Zero, One, or both. These cause the system to wrap in the direction of the first, second,
third, and fourth dimensions, sometimes referred to as the s, t, r, and q directions, for a given texture.
See Also
Concepts
What Is Texture Mapping?
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.Wrap15 Property
Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates. The default value for this render state is
TextureWrapCoordinates.Zero (wrapping disabled in all directions).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureWrapCoordinates Wrap15 { get; set; }
Property Value
Combination of values from TextureWrapCoordinates to set or get.
Remarks
Valid values for this render state can be Zero, One, or both. These cause the system to wrap in the direction of the first, second,
third, and fourth dimensions, sometimes referred to as the s, t, r, and q directions, for a given texture.
See Also
Concepts
What Is Texture Mapping?
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.Wrap2 Property
Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates. The default value for this render state is
TextureWrapCoordinates.Zero (wrapping disabled in all directions).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureWrapCoordinates Wrap2 { get; set; }
Property Value
Combination of values from TextureWrapCoordinates to set or get.
Remarks
Valid values for this render state can be Zero, One, or both. These cause the system to wrap in the direction of the first, second,
third, and fourth dimensions, sometimes referred to as the s, t, r, and q directions, for a given texture.
See Also
Concepts
What Is Texture Mapping?
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.Wrap3 Property
Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates. The default value for this render state is
TextureWrapCoordinates.Zero (wrapping disabled in all directions).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureWrapCoordinates Wrap3 { get; set; }
Property Value
Combination of values from TextureWrapCoordinates to set or get.
Remarks
Valid values for this render state can be Zero, One, or both. These cause the system to wrap in the direction of the first, second,
third, and fourth dimensions, sometimes referred to as the s, t, r, and q directions, for a given texture.
See Also
Concepts
What Is Texture Mapping?
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.Wrap4 Property
Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates. The default value for this render state is
TextureWrapCoordinates.Zero (wrapping disabled in all directions).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureWrapCoordinates Wrap4 { get; set; }
Property Value
Combination of values from TextureWrapCoordinates to set or get.
Remarks
Valid values for this render state can be Zero, One, or both. These cause the system to wrap in the direction of the first, second,
third, and fourth dimensions, sometimes referred to as the s, t, r, and q directions, for a given texture.
See Also
Concepts
What Is Texture Mapping?
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.Wrap5 Property
Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates. The default value for this render state is
TextureWrapCoordinates.Zero (wrapping disabled in all directions).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureWrapCoordinates Wrap5 { get; set; }
Property Value
Combination of values from TextureWrapCoordinates to set or get.
Remarks
Valid values for this render state can be Zero, One, or both. These cause the system to wrap in the direction of the first, second,
third, and fourth dimensions, sometimes referred to as the s, t, r, and q directions, for a given texture.
See Also
Concepts
What Is Texture Mapping?
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.Wrap6 Property
Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates. The default value for this render state is
TextureWrapCoordinates.Zero (wrapping disabled in all directions).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureWrapCoordinates Wrap6 { get; set; }
Property Value
Combination of values from TextureWrapCoordinates to set or get.
Remarks
Valid values for this render state can be Zero, One, or both. These cause the system to wrap in the direction of the first, second,
third, and fourth dimensions, sometimes referred to as the s, t, r, and q directions, for a given texture.
See Also
Concepts
What Is Texture Mapping?
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.Wrap7 Property
Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates. The default value for this render state is
TextureWrapCoordinates.Zero (wrapping disabled in all directions).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureWrapCoordinates Wrap7 { get; set; }
Property Value
Combination of values from TextureWrapCoordinates to set or get.
Remarks
Valid values for this render state can be Zero, One, or both. These cause the system to wrap in the direction of the first, second,
third, and fourth dimensions, sometimes referred to as the s, t, r, and q directions, for a given texture.
See Also
Concepts
What Is Texture Mapping?
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.Wrap8 Property
Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates. The default value for this render state is
TextureWrapCoordinates.Zero (wrapping disabled in all directions).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureWrapCoordinates Wrap8 { get; set; }
Property Value
Combination of values from TextureWrapCoordinates to set or get.
Remarks
Valid values for this render state can be Zero, One, or both. These cause the system to wrap in the direction of the first, second,
third, and fourth dimensions, sometimes referred to as the s, t, r, and q directions, for a given texture.
See Also
Concepts
What Is Texture Mapping?
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderState.Wrap9 Property
Gets or sets the texture-wrapping behavior for multiple sets of texture coordinates. The default value for this render state is
TextureWrapCoordinates.Zero (wrapping disabled in all directions).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureWrapCoordinates Wrap9 { get; set; }
Property Value
Combination of values from TextureWrapCoordinates to set or get.
Remarks
Valid values for this render state can be Zero, One, or both. These cause the system to wrap in the direction of the first, second,
third, and fourth dimensions, sometimes referred to as the s, t, r, and q directions, for a given texture.
See Also
Concepts
What Is Texture Mapping?
Reference
RenderState Class
RenderState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderTarget Class
Represents a resource that will be written to at the end of a render pass. This is the base class for RenderTarget2D and
RenderTargetCube.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public abstract class RenderTarget : IDisposable
Remarks
After a render pass the render target contains the color information of a rendered image.
Render targets represent a linear area of display memory and usually reside in the display memory of the display card.
Because of this, RenderTarget objects must be recreated when the device is reset.
To use a RenderTarget, you must:
1. Create the RenderTarget.
C#
shadowRenderTarget = GfxComponent.CreateRenderTarget(GraphicsDevice,
1, SurfaceFormat.Single);
C#
public static RenderTarget2D CreateRenderTarget(GraphicsDevice device, int numberLevel
s,
SurfaceFormat surface)
{
if (!GraphicsAdapter.DefaultAdapter.CheckDeviceFormat(DeviceType.Hardware,
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Format, TextureUsage.None,
QueryUsages.None, ResourceType.RenderTarget, surface))
{
// Fall back to current display format
surface = device.DisplayMode.Format;
}
return new RenderTarget2D(device,
device.PresentationParameters.BackBufferWidth,
device.PresentationParameters.BackBufferHeight,
numberLevels, surface,
device.PresentationParameters.MultiSampleType,
device.PresentationParameters.MultiSampleQuality);
4. Reset the original RenderTarget. null as the default render target - i.e. the back buffer.
C#
// Set render target back to the back buffer
GraphicsDevice.SetRenderTarget(0, null);
See Also
Concepts
Displays, Client Bounds, Viewports, and Back Buffers
What Is a Render Target?
Tasks
How To: Load Content
How To: Create a Depth Texture
How To: Implement Shadow Mapping
Reference
SetRenderTarget
RenderTarget2D
RenderTargetCube
GraphicsDeviceManager.DeviceReset Event
RenderTarget Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderTarget Members
The following tables list the members exposed by the RenderTarget type.
Public Properties
Name Description
Format Gets the format of the render target.
GraphicsDevice Gets the graphics device associated with this render target resource.
Height Gets the height, in pixels, of this render target.
IsContentLost Gets the current state of the content on a device.
IsDisposed Gets a value that indicates whether the object is disposed.
MultiSampleQuality Gets the number of quality stops available for a given multisample type.
MultiSampleType Gets the levels of full-scene multisampling that the device can apply.
Name Gets the name of this render-target resource.
RenderTargetUsage Gets or sets render target usage flags.
Tag Gets the resource tags for this render target.
Width Gets the width, in pixels, of this render target.
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_ContentLost Occurs when content is about to be lost on a GraphicsDevice.
raise_Disposing Raises the Disposing event when called from within a derived class.
Public Events
Name Description
ContentLost Occurs when resources are lost (for example, when the current device is lost).
Disposing Occurs when RenderTarget.Dispose Method is called or when this object is finalized and collected by the garba
ge collector of the Microsoft .NET common language runtime.
See Also
Reference
RenderTarget Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
RenderTarget Methods
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_ContentLost Occurs when content is about to be lost on a GraphicsDevice.
raise_Disposing Raises the Disposing event when called from within a derived class.
See Also
Reference
RenderTarget Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
RenderTarget.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
RenderTarget.Dispose () Immediately releases the unmanaged resources used by this object.
RenderTarget.Dispose (Boolean) Releases the unmanaged resources used by the RenderTarget and optionally releases the ma
naged resources.
See Also
Reference
RenderTarget Class
RenderTarget Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
RenderTarget.Dispose Method ()
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
See Also
Reference
RenderTarget Class
RenderTarget Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
Remarks
This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean)
method with the disposing parameter set to true. Finalize invokes Dispose(Boolean) with disposing set to false.
When the disposing parameter is true, this method releases all resources held by any managed objects that this RenderTarget
references. This method invokes the Dispose method of each referenced object.
Note
Notes to Inheritors
Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects
disposed of in an earlier call to Dispose.
See Also
Reference
RenderTarget Class
RenderTarget Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderTarget.Finalize Method
Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the
object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void Finalize ()
Remarks
This method overrides System.Object.Finalize. Application code should not call this method; an object's Finalize method is
automatically invoked during garbage collection, unless a call to the GC.SuppressFinalize method has disabled finalization by
the garbage collector.
See Also
Reference
RenderTarget Class
RenderTarget Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderTarget.raise_ContentLost Method
Occurs when content is about to be lost on a GraphicsDevice.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected virtual void raise_ContentLost (
Object value0,
EventArgs value1
)
Parameters
value0
The source of this event.
value1
The event arguments that are associated with the action that raised the event.
See Also
Reference
RenderTarget Class
RenderTarget Members
ContentLost
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderTarget.raise_Disposing Method
Raises the Disposing event when called from within a derived class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected void raise_Disposing (
Object value0,
EventArgs value1
)
Parameters
value0
Invoking object reference; should be this object.
value1
Arguments to pass to the event handler.
See Also
Reference
RenderTarget Class
RenderTarget Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderTarget Properties
Public Properties
Name Description
Format Gets the format of the render target.
GraphicsDevice Gets the graphics device associated with this render target resource.
Height Gets the height, in pixels, of this render target.
IsContentLost Gets the current state of the content on a device.
IsDisposed Gets a value that indicates whether the object is disposed.
MultiSampleQuality Gets the number of quality stops available for a given multisample type.
MultiSampleType Gets the levels of full-scene multisampling that the device can apply.
Name Gets the name of this render-target resource.
RenderTargetUsage Gets or sets render target usage flags.
Tag Gets the resource tags for this render target.
Width Gets the width, in pixels, of this render target.
See Also
Reference
RenderTarget Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
RenderTarget.Format Property
Gets the format of the render target.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public SurfaceFormat Format { get; }
Property Value
The format of the render target.
See Also
Reference
RenderTarget Class
RenderTarget Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderTarget.GraphicsDevice Property
Gets the graphics device associated with this render target resource.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GraphicsDevice GraphicsDevice { get; }
Property Value
The graphics device associated with this render target resource.
See Also
Reference
RenderTarget Class
RenderTarget Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderTarget.Height Property
Gets the height, in pixels, of this render target.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Height { get; }
Property Value
The height, in pixels, of this render target.
See Also
Reference
RenderTarget Class
RenderTarget Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderTarget.IsContentLost Property
Gets the current state of the content on a device.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public virtual bool IsContentLost { get; }
Property Value
true if content was lost due to device lost or similar event; otherwise false.
See Also
Reference
RenderTarget Class
RenderTarget Members
ContentLost
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderTarget.IsDisposed Property
Gets a value that indicates whether the object is disposed.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsDisposed { get; }
Property Value
true if the object is disposed; false otherwise.
See Also
Reference
RenderTarget Class
RenderTarget Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderTarget.MultiSampleQuality Property
Gets the number of quality stops available for a given multisample type.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int MultiSampleQuality { get; }
Property Value
The number of quality stops available for a given multisample type.
See Also
Reference
RenderTarget Class
RenderTarget Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderTarget.MultiSampleType Property
Gets the levels of full-scene multisampling that the device can apply.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public MultiSampleType MultiSampleType { get; }
Property Value
The levels of full-scene multisampling that the device can apply.
See Also
Reference
RenderTarget Class
RenderTarget Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderTarget.Name Property
Gets the name of this render-target resource.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Name { get; set; }
Property Value
The name of this render-target resource.
See Also
Reference
RenderTarget Class
RenderTarget Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderTarget.RenderTargetUsage Property
Gets or sets render target usage flags.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public RenderTargetUsage RenderTargetUsage { get; }
Property Value
Usage flags for the render target.
See Also
Reference
RenderTarget Class
RenderTarget Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderTarget.Tag Property
Gets the resource tags for this render target.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Object Tag { get; set; }
Property Value
The resource tags for this render target.
See Also
Reference
RenderTarget Class
RenderTarget Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderTarget.Width Property
Gets the width, in pixels, of this render target.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Width { get; }
Property Value
The width, in pixels, of this render target.
See Also
Reference
RenderTarget Class
RenderTarget Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderTarget Events
Public Events
Name Description
ContentLost Occurs when resources are lost (for example, when the current device is lost).
Disposing Occurs when RenderTarget.Dispose Method is called or when this object is finalized and collected by the garba
ge collector of the Microsoft .NET common language runtime.
See Also
Reference
RenderTarget Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
RenderTarget.ContentLost Event
Occurs when resources are lost (for example, when the current device is lost).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public virtual event EventHandler ContentLost
Remarks
When ContentLost fires, IsContentLost is set to true. This property resets when the content is restored through a call to a
SetData method or the rendering of a render target.
See Also
Reference
RenderTarget Class
RenderTarget Members
raise_ContentLost
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderTarget.Disposing Event
Occurs when RenderTarget.Dispose Method is called or when this object is finalized and collected by the garbage collector of
the Microsoft .NET common language runtime.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public event EventHandler Disposing
See Also
Reference
RenderTarget Class
RenderTarget Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderTarget2D Class
Represents a 2D texture resource that will be written to at the end of a render pass.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class RenderTarget2D : RenderTarget
Remarks
After a render pass the render target contains the color information of a rendered image.
Render targets represent a linear area of display memory and usually reside in the display memory of the display card.
Because of this, RenderTarget2D objects must be recreated when the device is reset.
To use a RenderTarget2D, you must:
1. Create the RenderTarget2D.
C#
shadowRenderTarget = GfxComponent.CreateRenderTarget(GraphicsDevice,
1, SurfaceFormat.Single);
C#
public static RenderTarget2D CreateRenderTarget(GraphicsDevice device, int numberLevel
s,
SurfaceFormat surface)
{
if (!GraphicsAdapter.DefaultAdapter.CheckDeviceFormat(DeviceType.Hardware,
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Format, TextureUsage.None,
QueryUsages.None, ResourceType.RenderTarget, surface))
{
// Fall back to current display format
surface = device.DisplayMode.Format;
}
return new RenderTarget2D(device,
device.PresentationParameters.BackBufferWidth,
device.PresentationParameters.BackBufferHeight,
numberLevels, surface,
device.PresentationParameters.MultiSampleType,
device.PresentationParameters.MultiSampleQuality);
See Also
Concepts
Displays, Client Bounds, Viewports, and Back Buffers
What Is a Render Target?
Tasks
How To: Load Content
How To: Create a Depth Texture
How To: Implement Shadow Mapping
Reference
SetRenderTarget
GraphicsDeviceManager.DeviceReset Event
RenderTarget2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderTarget2D Members
The following tables list the members exposed by the RenderTarget2D type.
Public Constructors
Name Description
RenderTarget2D Overloaded. Initializes a new instance of this class.
Public Properties
Name Description
Format (Inherited from RenderTarget.)
GraphicsDevice (Inherited from RenderTarget.)
Height (Inherited from RenderTarget.)
IsContentLost (Inherited from RenderTarget.)
IsDisposed (Inherited from RenderTarget.)
MultiSampleQuality (Inherited from RenderTarget.)
MultiSampleType (Inherited from RenderTarget.)
Name (Inherited from RenderTarget.)
RenderTargetUsage (Inherited from RenderTarget.)
Tag (Inherited from RenderTarget.)
Width (Inherited from RenderTarget.)
Public Methods
Name Description
Dispose (Inherited from RenderTarget.)
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetTexture Gets a copy of the 2D texture associated with this render target.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
MemberwiseClone (Inherited from Object.)
raise_ContentLost (Inherited from RenderTarget.)
raise_Disposing (Inherited from RenderTarget.)
Public Events
Name Description
ContentLost (Inherited from RenderTarget.)
Disposing (Inherited from RenderTarget.)
See Also
Reference
RenderTarget2D Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
RenderTarget2D Constructor
Initializes a new instance of this class.
Overload List
Name Descriptio
n
RenderTarget2D (GraphicsDevice, Int32, Int32, Int32, SurfaceFormat) Initializes a
new instan
ce of this cl
ass.
RenderTarget2D (GraphicsDevice, Int32, Int32, Int32, SurfaceFormat, MultiSampleType, Int32) Initializes a
new instan
ce of this cl
ass.
RenderTarget2D (GraphicsDevice, Int32, Int32, Int32, SurfaceFormat, MultiSampleType, Int32, RenderTargetUsage) Initializes a
new instan
ce of Rend
erTarget2
D with the
specified va
lues.
RenderTarget2D (GraphicsDevice, Int32, Int32, Int32, SurfaceFormat, RenderTargetUsage) Initializes a
new instan
ce of Rend
erTarget2
D with the
specified va
lues.
Remarks
After a render pass the render target contains the color information of a rendered image.
Render targets represent a linear area of display memory and usually reside in the display memory of the display card.
Because of this, RenderTarget2D objects must be recreated when the device is reset.
To use a RenderTarget2D, you must:
1. Create the RenderTarget2D.
C#
shadowRenderTarget = GfxComponent.CreateRenderTarget(GraphicsDevice,
1, SurfaceFormat.Single);
C#
public static RenderTarget2D CreateRenderTarget(GraphicsDevice device, int numberLevel
s,
SurfaceFormat surface)
{
if (!GraphicsAdapter.DefaultAdapter.CheckDeviceFormat(DeviceType.Hardware,
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Format, TextureUsage.None,
QueryUsages.None, ResourceType.RenderTarget, surface))
{
// Fall back to current display format
surface = device.DisplayMode.Format;
}
return new RenderTarget2D(device,
device.PresentationParameters.BackBufferWidth,
device.PresentationParameters.BackBufferHeight,
numberLevels, surface,
device.PresentationParameters.MultiSampleType,
device.PresentationParameters.MultiSampleQuality);
4. Reset the original RenderTarget2D. null as the default render target - i.e. the back buffer.
C#
// Set render target back to the back buffer
GraphicsDevice.SetRenderTarget(0, null);
See Also
Tasks
How To: Load Content
Reference
GraphicsDeviceManager.DeviceReset Event
RenderTarget2D Class
RenderTarget2D Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to associate with this render target resource.
width
Width, in pixels, of the render target. You can use graphicsDevice.PresentationParameters.BackBufferWidth to get the
current screen width.
height
Height, in pixels, of the render target. You can use graphicsDevice.PresentationParameters.BackBufferHeight to get the
current screen height.
numberLevels
The number of downsampled surfaces to create when preprocessing the texture. These smaller versions of the texture,
known as mip levels, are used when the texture is minified to fit a smaller area than the original texture size. The chain of
downsampled surfaces associated with a texture is sometimes called a mipmap chain.
If this is zero, all texture sublevels down to 1×1 pixels will be generated for hardware that supports mipmapped textures.
format
Surface format of the render target. Use CheckDeviceFormat to determine if a particular surface format is usable in a render
target.
Exceptions
Exception type Condition
ArgumentException
One of the following conditions is true:
width is larger than MaxTextureWidth.
height is larger than MaxTextureHeight.
The graphics device does not support creating a render target of type format.
CheckDeviceFormat may be used to verify if a surface format is supported.
format is SurfaceFormat.Unknown. Textures cannot be created using
SurfaceFormat.Unknown.
numberLevels is greater than 32. Textures have a maximum of 32 levels.
ArgumentNullException graphicsDevice is null.
ArgumentOutOfRangeException width or height is less than or equal to zero. width and height must be greater than zero.
InvalidOperationException Unable to create this RenderTarget2D resource on the graphics device.
Remarks
After a render pass the render target contains the color information of a rendered image.
Render targets represent a linear area of display memory and usually reside in the display memory of the display card.
Because of this, RenderTarget2D objects must be recreated when the device is reset.
To use a RenderTarget2D, you must:
1. Create the RenderTarget2D.
C#
shadowRenderTarget = GfxComponent.CreateRenderTarget(GraphicsDevice,
1, SurfaceFormat.Single);
C#
public static RenderTarget2D CreateRenderTarget(GraphicsDevice device, int numberLevel
s,
SurfaceFormat surface)
{
if (!GraphicsAdapter.DefaultAdapter.CheckDeviceFormat(DeviceType.Hardware,
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Format, TextureUsage.None,
QueryUsages.None, ResourceType.RenderTarget, surface))
{
// Fall back to current display format
surface = device.DisplayMode.Format;
}
return new RenderTarget2D(device,
device.PresentationParameters.BackBufferWidth,
device.PresentationParameters.BackBufferHeight,
numberLevels, surface,
device.PresentationParameters.MultiSampleType,
device.PresentationParameters.MultiSampleQuality);
4. Reset the original RenderTarget2D. null as the default render target - i.e. the back buffer.
C#
// Set render target back to the back buffer
GraphicsDevice.SetRenderTarget(0, null);
See Also
Tasks
How To: Load Content
How To: Create a Depth Texture
How To: Implement Shadow Mapping
Reference
GraphicsDeviceManager.DeviceReset Event
RenderTarget2D Class
RenderTarget2D Members
CheckDeviceFormat
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to associate with this render target resource.
width
Width, in pixels, of the render target. You can use graphicsDevice.PresentationParameters.BackBufferWidth to get the
current screen width.
height
Height, in pixels, of the render target. You can use graphicsDevice.PresentationParameters.BackBufferHeight to get the
current screen height.
numberLevels
The number of downsampled surfaces to create when preprocessing the texture. These smaller versions of the texture,
known as mip levels, are used when the texture is minified to fit a smaller area than the original texture size. The chain of
downsampled surfaces associated with a texture is sometimes called a mipmap chain.
If this is zero, all texture sublevels down to 1×1 pixels will be generated for hardware that supports mipmapped textures.
format
Surface format of the render target. Use CheckDeviceFormat to determine if a particular surface format is usable in a render
target.
multiSampleType
The levels of full-scene multisampling that the device can apply. You can use
graphicsDevice.PresentationParameters.MultiSampleType to get the MultiSampleType of the back buffer.
multiSampleQuality
The number of quality stops available for a given multisample type. You can use
graphicsDevice.PresentationParameters.MultiSampleQuality to get the multisample quality of the back buffer.
Exceptions
Exception type Condition
ArgumentException
One of the following conditions is true:
width is larger than MaxTextureWidth.
height is larger than MaxTextureHeight.
The graphics device does not support creating a render target of type format.
CheckDeviceFormat may be used to verify if a surface format is supported.
format is SurfaceFormat.Unknown. Textures cannot be created using
SurfaceFormat.Unknown.
numberLevels is greater than 32. Textures have a maximum of 32 levels.
ArgumentNullException graphicsDevice is null.
ArgumentOutOfRangeException width or height is less than or equal to zero. width and height must be greater than zero.
InvalidOperationException Unable to create this RenderTarget2D resource on the graphics device.
Remarks
After a render pass the render target contains the color information of a rendered image.
Render targets represent a linear area of display memory and usually reside in the display memory of the display card.
Because of this, RenderTarget2D objects must be recreated when the device is reset.
To use a RenderTarget2D, you must:
1. Create the RenderTarget2D.
C#
shadowRenderTarget = GfxComponent.CreateRenderTarget(GraphicsDevice,
1, SurfaceFormat.Single);
C#
public static RenderTarget2D CreateRenderTarget(GraphicsDevice device, int numberLevel
s,
SurfaceFormat surface)
{
if (!GraphicsAdapter.DefaultAdapter.CheckDeviceFormat(DeviceType.Hardware,
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Format, TextureUsage.None,
QueryUsages.None, ResourceType.RenderTarget, surface))
{
// Fall back to current display format
surface = device.DisplayMode.Format;
}
return new RenderTarget2D(device,
device.PresentationParameters.BackBufferWidth,
device.PresentationParameters.BackBufferHeight,
numberLevels, surface,
device.PresentationParameters.MultiSampleType,
device.PresentationParameters.MultiSampleQuality);
4. Reset the original RenderTarget2D. null as the default render target - i.e. the back buffer.
C#
// Set render target back to the back buffer
GraphicsDevice.SetRenderTarget(0, null);
See Also
Tasks
How To: Load Content
How To: Create a Depth Texture
How To: Implement Shadow Mapping
Reference
GraphicsDeviceManager.DeviceReset Event
RenderTarget2D Class
RenderTarget2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to associate with this render target resource.
width
Width, in pixels, of the render target. You can use graphicsDevice.PresentationParameters.BackBufferWidth to get the
current screen width.
height
Height, in pixels, of the render target. You can use graphicsDevice.PresentationParameters.BackBufferHeight to get the
current screen height.
numberLevels
The number of downsampled surfaces to create when preprocessing the texture. These smaller versions of the texture,
known as mipmap levels, are used when the texture is minified to fit a smaller area than the original texture size. The chain of
downsampled surfaces associated with a texture is sometimes called a mipmap chain.
If this is zero, all texture sublevels down to 1×1 pixels will be generated for hardware that supports mipmapped textures.
format
Surface format of the render target. Use CheckDeviceFormat to determine if a particular surface format is usable in a render
target.
multiSampleType
The levels of full-scene multisampling that the device can apply. You can use
graphicsDevice.PresentationParameters.MultiSampleType to get the MultiSampleType of the back buffer.
multiSampleQuality
The number of quality stops available for a given multisample type. You can use
graphicsDevice.PresentationParameters.MultiSampleQuality to get the multisample quality of the back buffer.
usage
Options identifying the behaviors of this render target resource.
See Also
Tasks
How To: Load Content
How To: Create a Depth Texture
How To: Implement Shadow Mapping
Reference
RenderTarget2D Class
RenderTarget2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to associate with this render target resource.
width
Width, in pixels, of the render target. You can use graphicsDevice.PresentationParameters.BackBufferWidth to get the
current screen width.
height
Height, in pixels, of the render target. You can use graphicsDevice.PresentationParameters.BackBufferHeight to get the
current screen height.
numberLevels
The number of downsampled surfaces to create when preprocessing the texture. These smaller versions of the texture,
known as mipmap levels, are used when the texture is minified to fit a smaller area than the original texture size. The chain of
downsampled surfaces associated with a texture is sometimes called a mipmap chain.
If this is zero, all texture sublevels down to 1×1 pixels will be generated for hardware that supports mipmapped textures.
format
Surface format of the render target. Use CheckDeviceFormat to determine if a particular surface format is usable in a render
target.
usage
Options identifying the behaviors of this render target resource.
See Also
Tasks
How To: Load Content
How To: Create a Depth Texture
How To: Implement Shadow Mapping
Reference
RenderTarget2D Class
RenderTarget2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderTarget2D Methods
Public Methods
Name Description
Dispose (Inherited from RenderTarget.)
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetTexture Gets a copy of the 2D texture associated with this render target.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
MemberwiseClone (Inherited from Object.)
raise_ContentLost (Inherited from RenderTarget.)
raise_Disposing (Inherited from RenderTarget.)
See Also
Reference
RenderTarget2D Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
RenderTarget2D.GetTexture Method
Gets a copy of the 2D texture associated with this render target.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Texture2D GetTexture ()
Return Value
A copy of the 2D texture associated with this render target.
Exceptions
Exception type Condition
InvalidOperationException A render target must be resolved (for example, setting the index to null or a different index) before
calling GetTexture.
Example
C#
// Create a new render target to receive the drawn data.
renderTarget = new RenderTarget2D(
graphics.GraphicsDevice,
// In this case, we are creating
// a render target to match half of a split screen:
leftViewPort.Width,
leftViewPort.Height,
// Number of levels in the render target:
1,
// Use the same surface format as the back buffer.
graphics.GraphicsDevice.PresentationParameters.BackBufferFormat);
// Call GetTexture to retrieve the render target data and save it to a texture.
capturedTexture = renderTarget.GetTexture();
See Also
Reference
RenderTarget2D Class
RenderTarget2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderTarget2D Properties
Public Properties
Name Description
Format (Inherited from RenderTarget.)
GraphicsDevice (Inherited from RenderTarget.)
Height (Inherited from RenderTarget.)
IsContentLost (Inherited from RenderTarget.)
IsDisposed (Inherited from RenderTarget.)
MultiSampleQuality (Inherited from RenderTarget.)
MultiSampleType (Inherited from RenderTarget.)
Name (Inherited from RenderTarget.)
RenderTargetUsage (Inherited from RenderTarget.)
Tag (Inherited from RenderTarget.)
Width (Inherited from RenderTarget.)
See Also
Reference
RenderTarget2D Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
RenderTarget2D Events
Public Events
Name Description
ContentLost (Inherited from RenderTarget.)
Disposing (Inherited from RenderTarget.)
See Also
Reference
RenderTarget2D Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
RenderTargetCube Class
Represents a cubic texture resource that will be written to at the end of a render pass.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class RenderTargetCube : RenderTarget
Remarks
After a render pass the render target contains the color information of a rendered image.
Render targets represent a linear area of display memory and usually reside in the display memory of the display card.
Because of this, RenderTargetCube objects must be recreated when the device is reset.
To use a RenderTargetCube, you must:
1. Create the RenderTargetCube.
C#
shadowRenderTarget = GfxComponent.CreateRenderTarget(GraphicsDevice,
1, SurfaceFormat.Single);
C#
public static RenderTarget2D CreateRenderTarget(GraphicsDevice device, int numberLevel
s,
SurfaceFormat surface)
{
if (!GraphicsAdapter.DefaultAdapter.CheckDeviceFormat(DeviceType.Hardware,
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Format, TextureUsage.None,
QueryUsages.None, ResourceType.RenderTarget, surface))
{
// Fall back to current display format
surface = device.DisplayMode.Format;
}
return new RenderTarget2D(device,
device.PresentationParameters.BackBufferWidth,
device.PresentationParameters.BackBufferHeight,
numberLevels, surface,
device.PresentationParameters.MultiSampleType,
device.PresentationParameters.MultiSampleQuality);
See Also
Concepts
Displays, Client Bounds, Viewports, and Back Buffers
What Is a Render Target?
Tasks
How To: Load Content
Reference
SetRenderTarget
GraphicsDeviceManager.DeviceReset Event
RenderTargetCube Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderTargetCube Members
The following tables list the members exposed by the RenderTargetCube type.
Public Constructors
Name Description
RenderTargetCube Overloaded. Initializes a new instance of this class.
Public Properties
Name Description
Format (Inherited from RenderTarget.)
GraphicsDevice (Inherited from RenderTarget.)
Height (Inherited from RenderTarget.)
IsContentLost (Inherited from RenderTarget.)
IsDisposed (Inherited from RenderTarget.)
MultiSampleQuality (Inherited from RenderTarget.)
MultiSampleType (Inherited from RenderTarget.)
Name (Inherited from RenderTarget.)
RenderTargetUsage (Inherited from RenderTarget.)
Tag (Inherited from RenderTarget.)
Width (Inherited from RenderTarget.)
Public Methods
Name Description
Dispose (Inherited from RenderTarget.)
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetTexture Gets a copy of the cube texture associated with this render target.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
MemberwiseClone (Inherited from Object.)
raise_ContentLost (Inherited from RenderTarget.)
raise_Disposing (Inherited from RenderTarget.)
Public Events
Name Description
ContentLost (Inherited from RenderTarget.)
Disposing (Inherited from RenderTarget.)
See Also
Reference
RenderTargetCube Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
RenderTargetCube Constructor
Initializes a new instance of this class.
Overload List
Name Description
RenderTargetCube (GraphicsDevice, Int32, Int32, SurfaceFormat) Initializes a ne
w instance of t
his class.
RenderTargetCube (GraphicsDevice, Int32, Int32, SurfaceFormat, MultiSampleType, Int32) Initializes a ne
w instance of t
his class.
RenderTargetCube (GraphicsDevice, Int32, Int32, SurfaceFormat, MultiSampleType, Int32, RenderTargetUsage) Initializes a ne
w instance of R
enderTargetC
ube.
RenderTargetCube (GraphicsDevice, Int32, Int32, SurfaceFormat, RenderTargetUsage) Initializes a ne
w instance of t
his class.
Remarks
After a render pass the render target contains the color information of a rendered image.
Render targets represent a linear area of display memory and usually reside in the display memory of the display card.
Because of this, RenderTargetCube objects must be recreated when the device is reset.
To use a RenderTargetCube, you must:
1. Create the RenderTargetCube.
C#
shadowRenderTarget = GfxComponent.CreateRenderTarget(GraphicsDevice,
1, SurfaceFormat.Single);
C#
public static RenderTarget2D CreateRenderTarget(GraphicsDevice device, int numberLevel
s,
SurfaceFormat surface)
{
if (!GraphicsAdapter.DefaultAdapter.CheckDeviceFormat(DeviceType.Hardware,
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Format, TextureUsage.None,
QueryUsages.None, ResourceType.RenderTarget, surface))
{
// Fall back to current display format
surface = device.DisplayMode.Format;
}
return new RenderTarget2D(device,
device.PresentationParameters.BackBufferWidth,
device.PresentationParameters.BackBufferHeight,
numberLevels, surface,
device.PresentationParameters.MultiSampleType,
device.PresentationParameters.MultiSampleQuality);
4. Reset the original RenderTargetCube. null as the default render target - i.e. the back buffer.
C#
// Set render target back to the back buffer
GraphicsDevice.SetRenderTarget(0, null);
See Also
Tasks
How To: Load Content
Reference
GraphicsDeviceManager.DeviceReset Event
RenderTargetCube Class
RenderTargetCube Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to associate with this render target resource.
size
The width and height of this cube texture resource, in pixels.
numberLevels
The number of downsampled surfaces to create when preprocessing the texture. These smaller versions of the texture,
known as mip levels, are used when the texture is minified to fit a smaller area than the original texture size. The chain of
downsampled surfaces associated with a texture is sometimes called a mipmap chain.
If this is zero, all texture sublevels down to 1×1 pixels will be generated for hardware that supports mipmapped textures.
format
Surface format of the render target.
Exceptions
Exception type Condition
ArgumentException
One of the following conditions is true:
The graphics device does not support creating a render target of type format.
size is larger than MaxTextureWidth or MaxTextureHeight.
format is SurfaceFormat.Unknown. Textures cannot be created using
SurfaceFormat.Unknown.
numberLevels is greater than 32. Textures have a maximum of 32 levels.
ArgumentNullException graphicsDevice is null.
ArgumentOutOfRangeException size is less than or equal to zero. size must be greater than zero.
InvalidOperationException Unable to create this RenderTargetCube resource on the graphics device.
Remarks
After a render pass the render target contains the color information of a rendered image.
Render targets represent a linear area of display memory and usually reside in the display memory of the display card.
Because of this, RenderTargetCube objects must be recreated when the device is reset.
To use a RenderTargetCube, you must:
1. Create the RenderTargetCube.
C#
shadowRenderTarget = GfxComponent.CreateRenderTarget(GraphicsDevice,
1, SurfaceFormat.Single);
C#
public static RenderTarget2D CreateRenderTarget(GraphicsDevice device, int numberLevel
s,
SurfaceFormat surface)
{
if (!GraphicsAdapter.DefaultAdapter.CheckDeviceFormat(DeviceType.Hardware,
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Format, TextureUsage.None,
QueryUsages.None, ResourceType.RenderTarget, surface))
{
// Fall back to current display format
surface = device.DisplayMode.Format;
}
return new RenderTarget2D(device,
device.PresentationParameters.BackBufferWidth,
device.PresentationParameters.BackBufferHeight,
numberLevels, surface,
device.PresentationParameters.MultiSampleType,
device.PresentationParameters.MultiSampleQuality);
4. Reset the original RenderTargetCube. null as the default render target - i.e. the back buffer.
C#
// Set render target back to the back buffer
GraphicsDevice.SetRenderTarget(0, null);
See Also
Reference
RenderTargetCube Class
RenderTargetCube Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to associate with this render target resource.
size
The width and height of this cube texture resource, in pixels.
numberLevels
The number of downsampled surfaces to create when preprocessing the texture. These smaller versions of the texture,
known as mip levels, are used when the texture is minified to fit a smaller area than the original texture size. The chain of
downsampled surfaces associated with a texture is sometimes called a mipmap chain.
format
Surface format of the render target.
multiSampleType
The levels of full-scene multisampling that the device can apply.
multiSampleQuality
The number of quality stops available for a given multisample type.
Exceptions
Exception type Condition
ArgumentException
One of the following conditions is true:
The graphics device does not support creating a render target of type format.
size is larger than MaxTextureWidth or MaxTextureHeight.
format is SurfaceFormat.Unknown. Textures cannot be created using
SurfaceFormat.Unknown.
numberLevels is greater than 32. Textures have a maximum of 32 levels.
ArgumentNullException graphicsDevice is null.
ArgumentOutOfRangeException size is less than or equal to zero. size must be greater than zero.
InvalidOperationException Unable to create this RenderTargetCube resource on the graphics device.
Remarks
After a render pass the render target contains the color information of a rendered image.
Render targets represent a linear area of display memory and usually reside in the display memory of the display card.
Because of this, RenderTargetCube objects must be recreated when the device is reset.
To use a RenderTargetCube, you must:
1. Create the RenderTargetCube.
C#
shadowRenderTarget = GfxComponent.CreateRenderTarget(GraphicsDevice,
1, SurfaceFormat.Single);
C#
public static RenderTarget2D CreateRenderTarget(GraphicsDevice device, int numberLevel
s,
SurfaceFormat surface)
{
if (!GraphicsAdapter.DefaultAdapter.CheckDeviceFormat(DeviceType.Hardware,
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Format, TextureUsage.None,
QueryUsages.None, ResourceType.RenderTarget, surface))
{
// Fall back to current display format
surface = device.DisplayMode.Format;
}
return new RenderTarget2D(device,
device.PresentationParameters.BackBufferWidth,
device.PresentationParameters.BackBufferHeight,
numberLevels, surface,
device.PresentationParameters.MultiSampleType,
device.PresentationParameters.MultiSampleQuality);
4. Reset the original RenderTargetCube. null as the default render target - i.e. the back buffer.
C#
// Set render target back to the back buffer
GraphicsDevice.SetRenderTarget(0, null);
See Also
Reference
RenderTargetCube Class
RenderTargetCube Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to associate with this render target resource.
size
The width and height of this cube texture resource, in pixels.
numberLevels
The number of downsampled surfaces to create when preprocessing the texture. These smaller versions of the texture,
known as mip levels, are used when the texture is minified to fit a smaller area than the original texture size. The chain of
downsampled surfaces associated with a texture is sometimes called a mipmap chain.
format
Surface format of the render target.
multiSampleType
Levels of full-scene multisampling that the device can apply.
multiSampleQuality
Number of quality stops available for a given multisample type.
usage
Options identifying the behaviors of this texture resource.
See Also
Reference
RenderTargetCube Class
RenderTargetCube Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to associate with this render target resource.
size
The width and height of this cube texture resource, in pixels.
numberLevels
The number of downsampled surfaces to create when preprocessing the texture. These smaller versions of the texture,
known as mip levels, are used when the texture is minified to fit a smaller area than the original texture size. The chain of
downsampled surfaces associated with a texture is sometimes called a mipmap chain.
format
Surface format of the render target.
usage
Options identifying the behaviors of this texture resource.
Exceptions
Exception type Condition
ArgumentException
One of the following conditions is true:
The graphics device does not support creating a render target of type format.
size is larger than MaxTextureWidth or MaxTextureHeight.
format is SurfaceFormat.Unknown. Textures cannot be created using
SurfaceFormat.Unknown.
numberLevels is greater than 32. Textures have a maximum of 32 levels.
ArgumentNullException graphicsDevice is null.
ArgumentOutOfRangeException size is less than or equal to zero. size must be greater than zero.
InvalidOperationException Unable to create this RenderTargetCube resource on the graphics device.
Remarks
After a render pass the render target contains the color information of a rendered image.
Render targets represent a linear area of display memory and usually reside in the display memory of the display card.
Because of this, RenderTargetCube objects must be recreated when the device is reset.
To use a RenderTargetCube, you must:
1. Create the RenderTargetCube.
C#
shadowRenderTarget = GfxComponent.CreateRenderTarget(GraphicsDevice,
1, SurfaceFormat.Single);
C#
public static RenderTarget2D CreateRenderTarget(GraphicsDevice device, int numberLevel
s,
SurfaceFormat surface)
{
if (!GraphicsAdapter.DefaultAdapter.CheckDeviceFormat(DeviceType.Hardware,
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Format, TextureUsage.None,
QueryUsages.None, ResourceType.RenderTarget, surface))
{
// Fall back to current display format
surface = device.DisplayMode.Format;
}
return new RenderTarget2D(device,
device.PresentationParameters.BackBufferWidth,
device.PresentationParameters.BackBufferHeight,
numberLevels, surface,
device.PresentationParameters.MultiSampleType,
device.PresentationParameters.MultiSampleQuality);
4. Reset the original RenderTargetCube. null as the default render target - i.e. the back buffer.
C#
// Set render target back to the back buffer
GraphicsDevice.SetRenderTarget(0, null);
See Also
Reference
RenderTargetCube Class
RenderTargetCube Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderTargetCube Methods
Public Methods
Name Description
Dispose (Inherited from RenderTarget.)
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetTexture Gets a copy of the cube texture associated with this render target.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
MemberwiseClone (Inherited from Object.)
raise_ContentLost (Inherited from RenderTarget.)
raise_Disposing (Inherited from RenderTarget.)
See Also
Reference
RenderTargetCube Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
RenderTargetCube.GetTexture Method
Gets a copy of the cube texture associated with this render target.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureCube GetTexture ()
Return Value
A copy of the cube texture associated with this render target.
Exceptions
Exception type Condition
InvalidOperationException A render target must be resolved (e.g. setting the index to null or a different index) before calling G
etTexture.
Example
C#
// Create a new render target to receive the drawn data.
renderTarget = new RenderTarget2D(
graphics.GraphicsDevice,
// In this case, we are creating
// a render target to match half of a split screen:
leftViewPort.Width,
leftViewPort.Height,
// Number of levels in the render target:
1,
// Use the same surface format as the back buffer.
graphics.GraphicsDevice.PresentationParameters.BackBufferFormat);
// Call GetTexture to retrieve the render target data and save it to a texture.
capturedTexture = renderTarget.GetTexture();
See Also
Reference
RenderTargetCube Class
RenderTargetCube Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
RenderTargetCube Properties
Public Properties
Name Description
Format (Inherited from RenderTarget.)
GraphicsDevice (Inherited from RenderTarget.)
Height (Inherited from RenderTarget.)
IsContentLost (Inherited from RenderTarget.)
IsDisposed (Inherited from RenderTarget.)
MultiSampleQuality (Inherited from RenderTarget.)
MultiSampleType (Inherited from RenderTarget.)
Name (Inherited from RenderTarget.)
RenderTargetUsage (Inherited from RenderTarget.)
Tag (Inherited from RenderTarget.)
Width (Inherited from RenderTarget.)
See Also
Reference
RenderTargetCube Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
RenderTargetCube Events
Public Events
Name Description
ContentLost (Inherited from RenderTarget.)
Disposing (Inherited from RenderTarget.)
See Also
Reference
RenderTargetCube Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
RenderTargetUsage Enumeration
Determines how render target data is used once a new render target is set.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum RenderTargetUsage
Members
Member Description
name
DiscardC Always clears the render target data.
ontents
Platform Either clears or keeps the data, depending on the current platform. On Xbox 360, the render target will discard cont
Contents ents. On PC, the render target will discard if multisampling is enabled, and preserve the contents if not.
Preserve Always keeps the render target data.
Contents
See Also
Concepts
What Is a Render Target?
Reference
SetRenderTarget
GetTexture
GetTexture
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ResolveTexture2D Class
Represents a 2D grid of texels. Use this class as a resolve target for a back buffer.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class ResolveTexture2D : Texture2D, IGraphicsResource, IDynamicGraphicsResource
See Also
Reference
ResolveTexture2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ResolveTexture2D Members
The following tables list the members exposed by the ResolveTexture2D type.
Public Constructors
Name Description
ResolveTexture2D Initializes an empty instance of ResolveTexture2D.
Public Properties
Name Description
Format (Inherited from Texture2D.)
GraphicsDevice (Inherited from GraphicsResource.)
Height (Inherited from Texture2D.)
IsContentLost Determines if the render target data has been lost due to a lost device event.
IsDisposed (Inherited from GraphicsResource.)
LevelCount (Inherited from Texture.)
LevelOfDetail (Inherited from Texture.)
Name (Inherited from GraphicsResource.)
Priority (Inherited from GraphicsResource.)
ResourceType (Inherited from GraphicsResource.)
Tag (Inherited from GraphicsResource.)
TextureUsage (Inherited from Texture2D.)
Width (Inherited from Texture2D.)
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
FromFile (Inherited from Texture.)
GenerateMipMaps (Inherited from Texture.)
GetCreationParameters (Inherited from Texture.)
GetData (Inherited from Texture2D.)
GetHashCode (Inherited from Object.)
GetTextureInformation (Inherited from Texture.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Save (Inherited from Texture.)
SetData (Inherited from Texture2D.)
ToString (Inherited from Object.)
Protected Methods
Name Description
MemberwiseClone (Inherited from Object.)
raise_ContentLost Occurs after content is lost from a graphics device failure, allowing an application to re-create all resourc
es.
raise_Disposing (Inherited from GraphicsResource.)
Public Events
Name Description
ContentLost Occurs when the render target data is lost due to a lost device event.
Disposing (Inherited from GraphicsResource.)
See Also
Reference
ResolveTexture2D Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ResolveTexture2D Constructor
Initializes an empty instance of ResolveTexture2D.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ResolveTexture2D (
GraphicsDevice graphicsDevice,
int width,
int height,
int numberLevels,
SurfaceFormat format
)
Parameters
graphicsDevice
The GraphicsDevice used to display the texture.
width
The width of the texture, in pixels. This value must be a power of two if the RequiresPower2 property of graphicsDevice is
true. If this value is 0, width is set to 1.
height
The height of the texture, in pixels. This value must be a power of two if the RequiresPower2 property of graphicsDevice is
true. If this value is 0, height is set to 1.
numberLevels
The number of downsampled surfaces to create when preprocessing the texture. These smaller versions of the texture,
known as mip levels, are used when the texture is minified to fit a smaller area than the original texture size. The chain of
downsampled surfaces associated with a texture is sometimes called a mipmap chain.
If numberLevels is zero, all texture sublevels down to 1×1 pixels will be generated for hardware that supports mipmapped
textures. Use LevelCount to see the number of levels generated.
format
A SurfaceFormat value specifying the requested pixel format for the texture. The returned texture may be of a different
format if the device does not support the requested format. Applications should check the format of the returned texture to
ensure that it matches the requested format.
Exceptions
Exception type Condition
ArgumentNullException graphicsDevice is null.
ArgumentException
One of the following conditions is true:
width is larger than MaxTextureWidth.
height is larger than MaxTextureHeight.
numberLevels is greater than 32. Textures have a maximum of 32 levels.
format is SurfaceFormat.Unknown. Textures cannot be created using
SurfaceFormat.Unknown.
The parameters specified are not compatible:
format and numberLevels are incompatible. Multi-element textures of type
SurfaceFormat.Multi2Bgra32 cannot be mipmapped, set numberLevels to 1.
The format requested is not supported by the graphics device. The device does not sup
port creating a texture of the given format with the given TextureUsage.
ArgumentOutOfRangeException width or height is less than or equal to zero; width and height must be greater than zero.
OutOfVideoMemoryException Unable to create this resource on the graphics device.
See Also
Reference
ResolveTexture2D Class
ResolveTexture2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ResolveTexture2D Methods
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
FromFile (Inherited from Texture.)
GenerateMipMaps (Inherited from Texture.)
GetCreationParameters (Inherited from Texture.)
GetData (Inherited from Texture2D.)
GetHashCode (Inherited from Object.)
GetTextureInformation (Inherited from Texture.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Save (Inherited from Texture.)
SetData (Inherited from Texture2D.)
ToString (Inherited from Object.)
Protected Methods
Name Description
MemberwiseClone (Inherited from Object.)
raise_ContentLost Occurs after content is lost from a graphics device failure, allowing an application to re-create all resourc
es.
raise_Disposing (Inherited from GraphicsResource.)
See Also
Reference
ResolveTexture2D Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ResolveTexture2D.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
ResolveTexture2D.Dispose (Boolean) Immediately releases the unmanaged resources used by this object.
ResolveTexture2D.Dispose () (Inherited from GraphicsResource.)
See Also
Reference
ResolveTexture2D Class
ResolveTexture2D Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
See Also
Reference
ResolveTexture2D Class
ResolveTexture2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ResolveTexture2D.raise_ContentLost Method
Occurs after content is lost from a graphics device failure, allowing an application to re-create all resources.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected virtual void raise_ContentLost (
Object value0,
EventArgs value1
)
Parameters
value0
The source of this event.
value1
The event arguments that are associated with the action that raised the event.
See Also
Reference
ResolveTexture2D Class
ResolveTexture2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ResolveTexture2D Properties
Public Properties
Name Description
Format (Inherited from Texture2D.)
GraphicsDevice (Inherited from GraphicsResource.)
Height (Inherited from Texture2D.)
IsContentLost Determines if the render target data has been lost due to a lost device event.
IsDisposed (Inherited from GraphicsResource.)
LevelCount (Inherited from Texture.)
LevelOfDetail (Inherited from Texture.)
Name (Inherited from GraphicsResource.)
Priority (Inherited from GraphicsResource.)
ResourceType (Inherited from GraphicsResource.)
Tag (Inherited from GraphicsResource.)
TextureUsage (Inherited from Texture2D.)
Width (Inherited from Texture2D.)
See Also
Reference
ResolveTexture2D Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ResolveTexture2D.IsContentLost Property
Determines if the render target data has been lost due to a lost device event.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public virtual bool IsContentLost { get; }
Property Value
true if the content was lost; false otherwise.
See Also
Reference
ResolveTexture2D Class
ResolveTexture2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ResolveTexture2D Events
Public Events
Name Description
ContentLost Occurs when the render target data is lost due to a lost device event.
Disposing (Inherited from GraphicsResource.)
See Also
Reference
ResolveTexture2D Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ResolveTexture2D.ContentLost Event
Occurs when the render target data is lost due to a lost device event.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public virtual event EventHandler ContentLost
See Also
Reference
ResolveTexture2D Class
ResolveTexture2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ResourceCreatedEventArgs Class
Contains event data.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class ResourceCreatedEventArgs : EventArgs
See Also
Reference
ResourceCreatedEventArgs Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ResourceCreatedEventArgs Members
The following tables list the members exposed by the ResourceCreatedEventArgs type.
Public Properties
Name Description
Resource The object raising the event.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ResourceCreatedEventArgs Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ResourceCreatedEventArgs Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ResourceCreatedEventArgs Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ResourceCreatedEventArgs Properties
Public Properties
Name Description
Resource The object raising the event.
See Also
Reference
ResourceCreatedEventArgs Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ResourceCreatedEventArgs.Resource Property
The object raising the event.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Object Resource { get; }
Property Value
The object raising the event.
See Also
Reference
ResourceCreatedEventArgs Class
ResourceCreatedEventArgs Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ResourceDestroyedEventArgs Class
Arguments for a ResourceDestroyed event.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class ResourceDestroyedEventArgs : EventArgs
See Also
Reference
ResourceDestroyedEventArgs Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ResourceDestroyedEventArgs Members
The following tables list the members exposed by the ResourceDestroyedEventArgs type.
Public Properties
Name Description
Name Gets the name of the destroyed resource.
Tag Gets the resource manager tag of the destroyed resource.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ResourceDestroyedEventArgs Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ResourceDestroyedEventArgs Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ResourceDestroyedEventArgs Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ResourceDestroyedEventArgs Properties
Public Properties
Name Description
Name Gets the name of the destroyed resource.
Tag Gets the resource manager tag of the destroyed resource.
See Also
Reference
ResourceDestroyedEventArgs Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ResourceDestroyedEventArgs.Name Property
Gets the name of the destroyed resource.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Name { get; }
Property Value
The name of the destroyed resource.
See Also
Reference
ResourceDestroyedEventArgs Class
ResourceDestroyedEventArgs Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ResourceDestroyedEventArgs.Tag Property
Gets the resource manager tag of the destroyed resource.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Object Tag { get; }
Property Value
The resource manager tag of the destroyed resource.
See Also
Reference
ResourceDestroyedEventArgs Class
ResourceDestroyedEventArgs Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ResourceType Enumeration
Defines resource types.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum ResourceType
Members
Member name Description
DepthStencilBuffer A depth stencil buffer resource.
IndexBuffer An index buffer resource.
RenderTarget A render target resource.
Texture2D A 2-dimensional texture resource.
Texture3D A 3-dimensional texture resource.
Texture3DVolume A 3-D volume texture resource.
TextureCube A cube texture resource.
VertexBuffer A vertex buffer resource.
See Also
Reference
GraphicsAdapter.CheckDeviceFormat Method
GraphicsResource.ResourceType Property
TextureInformation.ResourceType Property
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SamplerState Class
Contains sampler states for the device.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class SamplerState
See Also
Reference
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SamplerState Members
The following tables list the members exposed by the SamplerState type.
Public Properties
Name Description
AddressU Gets or sets the texture-address mode for the u-coordinate.
AddressV Gets or sets the texture-address mode for the v-coordinate.
AddressW Gets or sets the texture-address mode for the w-coordinate.
BorderColor Gets or sets the border color.
MagFilter Gets or sets a magnification filter.
MaxAnisotropy Gets or sets the maximum anisotropy. The default value is 0.
MaxMipLevel Gets or sets the level of detail (LOD) index of the largest map to use.
MinFilter Gets or sets a minification filter.
MipFilter Gets or sets a mipmap filter to use during minification.
MipMapLevelOfDetailBias Gets or sets the mipmap level of detail (LOD) bias. The default value is 0.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
SamplerState Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
SamplerState Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
SamplerState Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
SamplerState.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
SamplerState Class
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SamplerState Properties
Public Properties
Name Description
AddressU Gets or sets the texture-address mode for the u-coordinate.
AddressV Gets or sets the texture-address mode for the v-coordinate.
AddressW Gets or sets the texture-address mode for the w-coordinate.
BorderColor Gets or sets the border color.
MagFilter Gets or sets a magnification filter.
MaxAnisotropy Gets or sets the maximum anisotropy. The default value is 0.
MaxMipLevel Gets or sets the level of detail (LOD) index of the largest map to use.
MinFilter Gets or sets a minification filter.
MipFilter Gets or sets a mipmap filter to use during minification.
MipMapLevelOfDetailBias Gets or sets the mipmap level of detail (LOD) bias. The default value is 0.
See Also
Reference
SamplerState Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
SamplerState.AddressU Property
Gets or sets the texture-address mode for the u-coordinate.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureAddressMode AddressU { get; set; }
Property Value
Texture-address mode to set or get.
See Also
Reference
SamplerState Class
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SamplerState.AddressV Property
Gets or sets the texture-address mode for the v-coordinate.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureAddressMode AddressV { get; set; }
Property Value
Texture-address mode to set or get.
See Also
Reference
SamplerState Class
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SamplerState.AddressW Property
Gets or sets the texture-address mode for the w-coordinate.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureAddressMode AddressW { get; set; }
Property Value
Texture-address mode to set or get.
See Also
Reference
SamplerState Class
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SamplerState.BorderColor Property
Gets or sets the border color.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Color BorderColor { get; set; }
Property Value
Border color to set or get.
See Also
Reference
SamplerState Class
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SamplerState.MagFilter Property
Gets or sets a magnification filter.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureFilter MagFilter { get; set; }
Property Value
The magnification filter to set or get.
See Also
Reference
SamplerState Class
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SamplerState.MaxAnisotropy Property
Gets or sets the maximum anisotropy. The default value is 0.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int MaxAnisotropy { get; set; }
Property Value
The maximum anisotropy value to set or get.
See Also
Reference
SamplerState Class
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SamplerState.MaxMipLevel Property
Gets or sets the level of detail (LOD) index of the largest map to use.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int MaxMipLevel { get; set; }
Property Value
The maximum LOD to set or get. This index value can range from 0 to (n − 1), where n is the largest map.
See Also
Reference
SamplerState Class
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SamplerState.MinFilter Property
Gets or sets a minification filter.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureFilter MinFilter { get; set; }
Property Value
The minification filter to set or get.
See Also
Reference
SamplerState Class
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SamplerState.MipFilter Property
Gets or sets a mipmap filter to use during minification.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureFilter MipFilter { get; set; }
Property Value
The minification filter to set or get.
See Also
Reference
SamplerState Class
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SamplerState.MipMapLevelOfDetailBias Property
Gets or sets the mipmap level of detail (LOD) bias. The default value is 0.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float MipMapLevelOfDetailBias { get; set; }
Property Value
The mipmap bias to set or get.
See Also
Reference
SamplerState Class
SamplerState Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SamplerStateCollection Class
Collection of SamplerState objects.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class SamplerStateCollection
See Also
Reference
SamplerStateCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SamplerStateCollection Members
The following tables list the members exposed by the SamplerStateCollection type.
Public Properties
Name Description
Item Gets a specific SamplerState object using an index value.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
SamplerStateCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
SamplerStateCollection Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
SamplerStateCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
SamplerStateCollection Properties
Public Properties
Name Description
Item Gets a specific SamplerState object using an index value.
See Also
Reference
SamplerStateCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
SamplerStateCollection.Item Property
Gets a specific SamplerState object using an index value.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public SamplerState this [
int index
] { get; }
Property Value
The SamplerState object at the requested index.
Exceptions
Exception type Condition
InvalidOperationException The index for this vertex stream is invalid.
See Also
Reference
SamplerStateCollection Class
SamplerStateCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SaveStateMode Enumeration
Defines options for saving the graphics device state before and after an effect technique is applied.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum SaveStateMode
Members
Member name Description
None No device state is saved when calling Begin or restored when calling End.
SaveState Save all device state when calling Begin and restore device state when calling End.
See Also
Reference
Effect.Begin Method
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SetDataOptions Enumeration
Describes whether existing buffer data will be overwritten or discarded during a SetData operation.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[FlagsAttribute]
public enum SetDataOptions
Members
Mem Description
ber na
me
Discar
d The SetData operation will discard all existing buffer data.
The operation will overwrite (with a write-only operation) every location within the locked surface. This is a valid optio
n when using dynamic textures, dynamic vertex buffers, and dynamic index buffers. You may not use this option to up
date a portion of a surface.
For vertex and index buffers, the SetData operation will discard the entire buffer. A pointer to a new memory area is r
eturned so that the direct memory access (DMA) and rendering from the previous area do not stall.
For textures, the SetData operation will overwrite (with a write-only operation) every location within the region being
locked.
None Portions of existing data in the buffer may be overwritten during this operation.
NoOv The SetData operation will not overwrite existing data in the vertex and index buffers. Specifying this option allows th
erwrit e driver to return immediately from a SetData operation and continue rendering.
e
Remarks
Note
Discard is not valid on Xbox 360, but dynamic geometry may be rendered on the Xbox 360 by using DrawUserPrimitives.
See Also
Reference
GraphicsDevice.DrawUserPrimitives Generic Method
IndexBuffer.SetData Method
Texture2D.SetData Method
Texture3D.SetData Method
TextureCube.SetData Method
VertexBuffer.SetData Method
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderCompiler Class
Compiles and decompiles high-level shader language (HLSL) shaders.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static class ShaderCompiler
See Also
Reference
ShaderCompiler Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderCompiler Members
The following tables list the members exposed by the ShaderCompiler type.
Public Methods
Name Description
AssembleFromFile Overloaded. Compiles a shader from a file or stream containing shader assembly code (ASM).
AssembleFromSource Compiles a shader from a string containing shader assembly code (ASM).
CompileFromFile Overloaded. Compiles a shader from a file or stream containing shader source code.
CompileFromSource Compiles a shader from a string containing the shader source code.
Disassemble Disassembles a shader.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ShaderCompiler Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ShaderCompiler Methods
Public Methods
Name Description
AssembleFromFile Overloaded. Compiles a shader from a file or stream containing shader assembly code (ASM).
AssembleFromSource Compiles a shader from a string containing shader assembly code (ASM).
CompileFromFile Overloaded. Compiles a shader from a file or stream containing shader source code.
CompileFromSource Compiles a shader from a string containing the shader source code.
Disassemble Disassembles a shader.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ShaderCompiler Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ShaderCompiler.AssembleFromFile Method
Compiles a shader from a file or stream containing shader assembly code (ASM).
Overload List
Name D
e
s
cr
i
p
ti
o
n
ShaderCompiler.AssembleFromFile (Stream, CompilerMacro[], CompilerIncludeHandler, CompilerOptions, TargetPlatform) C
o
m
pi
le
s
a
s
h
a
d
er
fr
o
m
a
st
re
a
m
c
o
nt
ai
ni
n
g
s
h
a
d
er
a
ss
e
m
bl
y
c
o
d
e
(
A
S
M
).
ShaderCompiler.AssembleFromFile (Stream, Int32, CompilerMacro[], CompilerIncludeHandler, CompilerOptions, TargetPlatform) C
o
m
m
pi
le
s
a
s
h
a
d
er
fr
o
m
a
st
re
a
m
c
o
nt
ai
ni
n
g
s
h
a
d
er
a
ss
e
m
bl
y
c
o
d
e
(
A
S
M
),
s
p
e
ci
fy
in
g
th
e
n
u
m
b
er
of
b
yt
e
s
in
th
e
st
re
a
m
.
ShaderCompiler.AssembleFromFile (String, CompilerMacro[], CompilerIncludeHandler, CompilerOptions, TargetPlatform) C
o
m
pi
le
s
a
s
h
a
d
er
fr
o
m
a
fil
e
c
o
nt
ai
ni
n
g
s
h
a
d
er
a
ss
e
m
bl
y
c
o
d
e
(
A
S
M
).
See Also
Reference
ShaderCompiler Class
ShaderCompiler Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
shaderSourceCode
Stream that contains the shader data.
preprocessorDefines
Describes preprocessor definitions used by an effect object.
includeHandler
User-implemented interface to provide callbacks for #include directives during shader compilation.
options
Compilation optimization options.
platform
Target platform for the compilation.
Return Value
The compiled shader.
Exceptions
Exception type Condition
ArgumentNullException shaderSourceCode is null. The stream passed into this method cannot be null.
NotSupportedException shaderSourceCode is not readable. Streams passed into this method must be readable.
EndOfStreamException shaderSourceCode does not contain enough data to support this call.
See Also
Reference
ShaderCompiler Class
ShaderCompiler Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
shaderSourceCode
Stream that contains the shader data.
numberBytes
The number of bytes in shaderSourceCode.
preprocessorDefines
Describes preprocessor definitions used by an effect object.
includeHandler
User-implemented interface to provide callbacks for #include directives during shader compilation.
options
Compilation optimization options.
platform
Target platform for the compilation.
Return Value
The compiled shader.
Exceptions
Exception type Condition
ArgumentNullException shaderSourceCode is null. The stream passed into this method cannot be null.
NotSupportedException shaderSourceCode is not readable. Streams passed into this method must be readable.
EndOfStreamException shaderSourceCode does not contain enough data to support this call.
See Also
Reference
ShaderCompiler Class
ShaderCompiler Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
shaderFileName
Name of the file containing the compiled shader data.
preprocessorDefines
Describes preprocessor definitions used by an effect object.
includeHandler
User-implemented interface to provide callbacks for #include directives during shader compilation.
options
Compilation optimization options.
platform
Target platform for the compilation.
Return Value
The compiled shader.
Exceptions
Exception type Condition
ArgumentException shaderFileName is a zero-length string, contains only white space, or contains one or more inva
lid characters as defined by InvalidPathChars.
ArgumentNullException shaderFileName is null.
PathTooLongException The specified path, file name, or both exceed the system-defined maximum length. For example,
on Windows-based platforms, paths must be less than 248 characters, and file names must be l
ess than 260 characters.
DirectoryNotFoundException The specified path is invalid (for example, it is on an unmapped drive).
UnauthorizedAccessException The shaderFileName parameter specifies a directory, or the caller does not have the required pe
rmission to access the file specified by filename.
FileNotFoundException The file specified in shaderFileName was not found.
NotSupportedException shaderFileName is in an invalid format.
See Also
Reference
ShaderCompiler Class
ShaderCompiler Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderCompiler.AssembleFromSource Method
Compiles a shader from a string containing shader assembly code (ASM).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static CompiledShader AssembleFromSource (
string shaderSourceCode,
CompilerMacro[] preprocessorDefines,
CompilerIncludeHandler includeHandler,
CompilerOptions options,
TargetPlatform platform
)
Parameters
shaderSourceCode
String that contains the shader data.
preprocessorDefines
Describes preprocessor definitions used by an effect object.
includeHandler
User-implemented interface to provide callbacks for #include directives during shader compilation.
options
Compilation optimization options.
platform
Target platform for compilation.
Return Value
The compiled shader.
See Also
Reference
ShaderCompiler Class
ShaderCompiler Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderCompiler.CompileFromFile Method
Compiles a shader from a file or stream containing shader source code.
Overload List
Name D
e
s
cr
i
p
ti
o
n
ShaderCompiler.CompileFromFile (Stream, CompilerMacro[], CompilerIncludeHandler, CompilerOptions, String, ShaderProfile, TargetPlatform) C
o
m
pi
le
s
a
s
h
a
d
er
fr
o
m
a
st
re
a
m
c
o
nt
ai
ni
n
g
th
e
s
h
a
d
er
s
o
u
rc
e
c
o
d
e.
ShaderCompiler.CompileFromFile (Stream, Int32, CompilerMacro[], CompilerIncludeHandler, CompilerOptions, String, ShaderProfile, TargetPlatform) C
o
m
pi
le
s
a
s
h
a
d
er
fr
o
m
a
st
re
a
m
c
o
nt
ai
ni
n
g
th
e
s
h
a
d
er
s
o
u
rc
e
c
o
d
e,
s
p
e
ci
fy
in
g
th
e
n
u
m
b
er
of
b
yt
e
s
in
th
e
st
re
a
m
.
ShaderCompiler.CompileFromFile (String, CompilerMacro[], CompilerIncludeHandler, CompilerOptions, String, ShaderProfile, TargetPlatform) C
o
m
pi
le
s
a
s
h
a
d
er
fr
o
m
fil
e
c
o
nt
ai
ni
n
g
th
e
s
h
a
d
er
s
o
u
rc
e
c
o
d
e.
See Also
Reference
ShaderCompiler Class
ShaderCompiler Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
shaderSourceCode
Stream that contains the shader source code.
preprocessorDefines
Describes preprocessor definitions used by an effect object.
includeHandler
User-implemented interface to provide callbacks for #include directives during shader compilation.
options
Compilation optimization options.
functionName
The function to be compiled.
profile
A shader profile that determines the shader instruction set.
platform
The target platform for compilation.
Return Value
The compiled shader.
Exceptions
Exception type Condition
ArgumentNullException shaderSourceCode is null. The stream passed into this method cannot be null.
NotSupportedException shaderSourceCode is not readable. Streams passed into this method must be readable.
EndOfStreamException shaderSourceCode does not contain enough data to support this call.
See Also
Reference
ShaderCompiler Class
ShaderCompiler Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
shaderSourceCode
Stream that contains the shader source code.
numberBytes
The number of bytes in shaderSourceCode.
preprocessorDefines
Describes preprocessor definitions used by an effect object.
includeHandler
User-implemented interface to provide callbacks for #include directives during shader compilation.
options
Compilation optimization options.
functionName
The function to be compiled.
profile
A shader profile that determines the shader instruction set.
platform
The target platform for compilation.
Return Value
The compiled shader.
Exceptions
Exception type Condition
ArgumentNullException shaderSourceCode is null. The stream passed into this method cannot be null.
NotSupportedException shaderSourceCode is not readable. Streams passed into this method must be readable.
EndOfStreamException shaderSourceCode does not contain enough data to support this call.
See Also
Reference
ShaderCompiler Class
ShaderCompiler Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
shaderFileName
Name of the file containing the shader source code.
preprocessorDefines
Describes preprocessor definitions used by an effect object.
includeHandler
User-implemented interface to provide callbacks for #include directives during shader compilation.
options
Compilation optimization options.
functionName
The function to be compiled.
profile
A shader profile that determines the shader instruction set.
platform
The target platform for compilation.
Return Value
The compiled shader.
Exceptions
Exception type Condition
ArgumentException shaderFileName is a zero-length string, contains only white space, or contains one or more inva
lid characters as defined by InvalidPathChars.
ArgumentNullException shaderFileName is null.
PathTooLongException The specified path, file name, or both exceed the system-defined maximum length. For example,
on Windows-based platforms, paths must be less than 248 characters, and file names must be l
ess than 260 characters.
DirectoryNotFoundException The specified path is invalid (for example, it is on an unmapped drive).
UnauthorizedAccessException The shaderFileName parameter specifies a directory, or the caller does not have the required pe
rmission to access the file specified by filename.
FileNotFoundException The file specified in shaderFileName was not found.
NotSupportedException shaderFileName is in an invalid format.
See Also
Reference
ShaderCompiler Class
ShaderCompiler Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderCompiler.CompileFromSource Method
Compiles a shader from a string containing the shader source code.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static CompiledShader CompileFromSource (
string shaderSourceCode,
CompilerMacro[] preprocessorDefines,
CompilerIncludeHandler includeHandler,
CompilerOptions options,
string functionName,
ShaderProfile profile,
TargetPlatform platform
)
Parameters
shaderSourceCode
String that contains the shader source code.
preprocessorDefines
Describes preprocessor definitions used by an effect object.
includeHandler
User-implemented interface to provide callbacks for #include directives during shader compilation.
options
Compilation optimization options.
functionName
The function to be compiled.
profile
A shader profile that determines the shader instruction set.
platform
Target platform for compilation.
Return Value
The compiled shader.
See Also
Reference
ShaderCompiler Class
ShaderCompiler Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderCompiler.Disassemble Method
Disassembles a shader.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static string Disassemble (
byte[] shaderCode,
bool enableColorCode,
string comments
)
Parameters
shaderCode
The shader byte code to disassemble.
enableColorCode
[MarshalAsAttribute(U1)] Specifies whether to enable color coding to make the disassembly easier to read.
comments
A comment string to include at the top of the shader.
Return Value
The disassembled shader.
See Also
Reference
ShaderCompiler Class
ShaderCompiler Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstant Class
Describes a shader constant.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class ShaderConstant
See Also
Reference
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstant Members
The following tables list the members exposed by the ShaderConstant type.
Public Properties
Name Description
ColumnCount Gets the number of columns in the ShaderConstant.
ElementCount Gets the number of elements in the ShaderConstant.
Name Gets the name of the ShaderConstant.
ParameterClass Gets the EffectParameterClass of the ShaderConstant.
ParameterType Gets the EffectParameterType of the ShaderConstant.
RegisterCount Gets the number of registers that contain data.
RegisterIndex Gets the index of the ShaderConstant in the constant table.
RegisterSet Gets the data type of the shader register.
RowCount Gets the number of rows in the ShaderConstant.
SamplerIndex Gets the sampler index number of the ShaderConstant from the constant table.
StructureMemberCount Gets the number of structure member subparameters.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
SetValue Overloaded. Sets the value of a ShaderConstant.
SetValueTranspose Overloaded. Sets the value of a ShaderConstant to an array.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ShaderConstant Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ShaderConstant Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
SetValue Overloaded. Sets the value of a ShaderConstant.
SetValueTranspose Overloaded. Sets the value of a ShaderConstant to an array.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ShaderConstant Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ShaderConstant.SetValue Method
Sets the value of a ShaderConstant.
Overload List
Name Description
ShaderConstant.SetValue (GraphicsDevice, Boolean) Sets the value of a ShaderConstant to a Boolean.
ShaderConstant.SetValue (GraphicsDevice, Boolean[]) Sets the value of a ShaderConstant to an array of Boolean objects.
ShaderConstant.SetValue (GraphicsDevice, Int32) Sets the value of a ShaderConstant to an Int32.
ShaderConstant.SetValue (GraphicsDevice, Int32[]) Sets the value of a ShaderConstant to an array of Int32 objects.
ShaderConstant.SetValue (GraphicsDevice, Matrix) Sets the value of a ShaderConstant to a Matrix.
ShaderConstant.SetValue (GraphicsDevice, Matrix[]) Sets the value of a ShaderConstant to an array of Matrix objects.
ShaderConstant.SetValue (GraphicsDevice, Quaternion) Sets the value of a ShaderConstant to a Quaternion.
ShaderConstant.SetValue (GraphicsDevice, Quaternion[]) Sets the value of a ShaderConstant to an array of Quaternion objects.
ShaderConstant.SetValue (GraphicsDevice, Single) Sets the value of a ShaderConstant to a Single.
ShaderConstant.SetValue (GraphicsDevice, Single[]) Sets the value of a ShaderConstant to an array of Single objects.
ShaderConstant.SetValue (GraphicsDevice, Vector2) Sets the value of a ShaderConstant to a Vector2
ShaderConstant.SetValue (GraphicsDevice, Vector2[]) Sets the value of a ShaderConstant to an array of Vector2 objects.
ShaderConstant.SetValue (GraphicsDevice, Vector3) Sets the value of a ShaderConstant to a Vector3.
ShaderConstant.SetValue (GraphicsDevice, Vector3[]) Sets the value of a ShaderConstant to an array of Vector3 objects.
ShaderConstant.SetValue (GraphicsDevice, Vector4) Sets the value of a ShaderConstant to a Vector4.
ShaderConstant.SetValue (GraphicsDevice, Vector4[]) Sets the value of a ShaderConstant to an array of Vector4 objects.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
graphicsDevice
The GraphicsDevice associated with the ShaderConstant.
value
[MarshalAsAttribute(U1)] Value to assign to the ShaderConstant.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The GraphicsDevice associated with the ShaderConstant.
value
Value to assign to the ShaderConstant.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The GraphicsDevice associated with the ShaderConstant.
value
Value to assign to the ShaderConstant.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The GraphicsDevice associated with the ShaderConstant.
value
Value to assign to the ShaderConstant.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The GraphicsDevice associated with the ShaderConstant.
value
Value to assign to the ShaderConstant.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The GraphicsDevice associated with the ShaderConstant.
value
Value to assign to the ShaderConstant.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The GraphicsDevice associated with the ShaderConstant.
value
Value to assign to the ShaderConstant.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The GraphicsDevice associated with the ShaderConstant.
value
Value to assign to the ShaderConstant.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The GraphicsDevice associated with the ShaderConstant.
value
Value to assign to the ShaderConstant.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The GraphicsDevice associated with the ShaderConstant.
value
Value to assign to the ShaderConstant.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The GraphicsDevice associated with the ShaderConstant.
value
Value to assign to the ShaderConstant.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The GraphicsDevice associated with the ShaderConstant.
value
Value to assign to the ShaderConstant.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The GraphicsDevice associated with the ShaderConstant.
value
Value to assign to the ShaderConstant.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The GraphicsDevice associated with the ShaderConstant.
value
Value to assign to the ShaderConstant/
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The GraphicsDevice associated with the ShaderConstant.
value
Value to assign to the ShaderConstant.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The GraphicsDevice associated with the ShaderConstant.
value
Value to assign to the ShaderConstant.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstant.SetValueTranspose Method
Sets the value of a ShaderConstant to an array.
Overload List
Name Description
ShaderConstant.SetValueTranspose (GraphicsDevice, Matrix) Sets the value of a ShaderConstant to an matrix.
ShaderConstant.SetValueTranspose (GraphicsDevice, Matrix[]) Sets the value of a ShaderConstant to an array of matrices.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
graphicsDevice
The GraphicsDevice associated with the ShaderConstant.
value
The matrix to set the ShaderConstant to.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The GraphicsDevice associated with the ShaderConstant.
value
The array of values to set the ShaderConstant to.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstant Properties
Public Properties
Name Description
ColumnCount Gets the number of columns in the ShaderConstant.
ElementCount Gets the number of elements in the ShaderConstant.
Name Gets the name of the ShaderConstant.
ParameterClass Gets the EffectParameterClass of the ShaderConstant.
ParameterType Gets the EffectParameterType of the ShaderConstant.
RegisterCount Gets the number of registers that contain data.
RegisterIndex Gets the index of the ShaderConstant in the constant table.
RegisterSet Gets the data type of the shader register.
RowCount Gets the number of rows in the ShaderConstant.
SamplerIndex Gets the sampler index number of the ShaderConstant from the constant table.
StructureMemberCount Gets the number of structure member subparameters.
See Also
Reference
ShaderConstant Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ShaderConstant.ColumnCount Property
Gets the number of columns in the ShaderConstant.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int ColumnCount { get; }
Property Value
The number of columns in the ShaderConstant.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstant.ElementCount Property
Gets the number of elements in the ShaderConstant.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int ElementCount { get; }
Property Value
The number of elements in the ShaderConstant.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstant.Name Property
Gets the name of the ShaderConstant.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Name { get; }
Property Value
The name of the ShaderConstant.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstant.ParameterClass Property
Gets the EffectParameterClass of the ShaderConstant.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public EffectParameterClass ParameterClass { get; }
Property Value
The EffectParameterClass of the ShaderConstant.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstant.ParameterType Property
Gets the EffectParameterType of the ShaderConstant.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public EffectParameterType ParameterType { get; }
Property Value
The EffectParameterType of the ShaderConstant.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstant.RegisterCount Property
Gets the number of registers that contain data.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int RegisterCount { get; }
Property Value
The number of registers that contain data.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstant.RegisterIndex Property
Gets the index of the ShaderConstant in the constant table.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int RegisterIndex { get; }
Property Value
The index of the ShaderConstant in the constant table.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstant.RegisterSet Property
Gets the data type of the shader register.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ShaderRegisterSet RegisterSet { get; }
Property Value
The data type of the shader register.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstant.RowCount Property
Gets the number of rows in the ShaderConstant.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int RowCount { get; }
Property Value
The number of rows in the ShaderConstant.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstant.SamplerIndex Property
Gets the sampler index number of the ShaderConstant from the constant table.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int SamplerIndex { get; }
Property Value
The sampler index number of the ShaderConstant from the constant table.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstant.StructureMemberCount Property
Gets the number of structure member subparameters.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int StructureMemberCount { get; }
Property Value
The number of structure member subparameters.
See Also
Reference
ShaderConstant Class
ShaderConstant Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstantCollection Class
Manipulates a collection of ShaderConstant objects.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class ShaderConstantCollection : IEnumerable<ShaderConstant>
See Also
Reference
ShaderConstantCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstantCollection Members
The following tables list the members exposed by the ShaderConstantCollection type.
Public Properties
Name Description
Count Gets the number of ShaderConstant objects in this ShaderConstantCollection.
Item Overloaded. Gets a specific ShaderConstant object.
Public Methods
Name Description
Equals (Inherited from Object.)
GetEnumerator Returns an enumerator that can iterate through the ShaderConstantCollection.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ShaderConstantCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ShaderConstantCollection Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetEnumerator Returns an enumerator that can iterate through the ShaderConstantCollection.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ShaderConstantCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ShaderConstantCollection.GetEnumerator Method
Returns an enumerator that can iterate through the ShaderConstantCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public IEnumerator<ShaderConstant> GetEnumerator ()
Return Value
The iterator.
See Also
Reference
ShaderConstantCollection Class
ShaderConstantCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstantCollection Properties
Public Properties
Name Description
Count Gets the number of ShaderConstant objects in this ShaderConstantCollection.
Item Overloaded. Gets a specific ShaderConstant object.
See Also
Reference
ShaderConstantCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ShaderConstantCollection.Count Property
Gets the number of ShaderConstant objects in this ShaderConstantCollection.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Count { get; }
Property Value
The number of ShaderConstant objects in this ShaderConstantCollection.
See Also
Reference
ShaderConstantCollection Class
ShaderConstantCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstantCollection.Item Property
Gets a specific ShaderConstant object.
Overload List
Name Description
ShaderConstantCollection.Item (Int32) Gets a specific ShaderConstant object using an index value.
ShaderConstantCollection.Item (String) Gets a specific ShaderConstant object using an index value.
See Also
Reference
ShaderConstantCollection Class
ShaderConstantCollection Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Property Value
The ShaderConstant object at the specified index.
See Also
Reference
ShaderConstantCollection Class
ShaderConstantCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Property Value
The ShaderConstant object specified by name.
See Also
Reference
ShaderConstantCollection Class
ShaderConstantCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstantTable Class
Contains the variables that are used by high-level language shaders and effects.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class ShaderConstantTable : IDisposable
See Also
Reference
ShaderConstantTable Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstantTable Members
The following tables list the members exposed by the ShaderConstantTable type.
Public Constructors
Name Description
ShaderConstantTable Initializes a new instance of the ShaderConstantTable class.
Public Properties
Name Description
Constants Gets a collection of the constants in the ShaderConstantTable.
Creator Gets the name of the constant table creator.
IsDisposed Gets a value that indicates whether the object is disposed.
Version Gets the shader version.
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
SetDefaults Sets the constants in the ShaderConstantTable to their default values. The default values are declared in th
e variable declarations in the shader.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_Disposing Raises the Disposing event when called from within a derived class.
Public Events
Name Description
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micro
soft .NET common language runtime (CLR).
See Also
Reference
ShaderConstantTable Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ShaderConstantTable Constructor
Initializes a new instance of the ShaderConstantTable class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ShaderConstantTable (
byte[] code
)
Parameters
code
The shader byte code.
Exceptions
Exception type Condition
ArgumentException The array code must have a length that is a multiple of four.
ArgumentNullException code is null.
InvalidOperationException Unable to create the ShaderConstantTable.
See Also
Reference
ShaderConstantTable Class
ShaderConstantTable Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstantTable Methods
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
SetDefaults Sets the constants in the ShaderConstantTable to their default values. The default values are declared in th
e variable declarations in the shader.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_Disposing Raises the Disposing event when called from within a derived class.
See Also
Reference
ShaderConstantTable Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ShaderConstantTable.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
ShaderConstantTable.Dispose () Immediately releases the unmanaged resources used by this object.
ShaderConstantTable.Dispose (Boolean) Releases the unmanaged resources used by the ShaderConstantTable and optionally r
eleases the managed resources.
See Also
Reference
ShaderConstantTable Class
ShaderConstantTable Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ShaderConstantTable.Dispose Method ()
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
See Also
Reference
ShaderConstantTable Class
ShaderConstantTable Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
Remarks
This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean)
method with the disposing parameter set to true. Finalize invokes Dispose(Boolean) with disposing set to false.
When the disposing parameter is true, this method releases all resources held by any managed objects that this
ShaderConstantTable references. This method invokes the Dispose method of each referenced object.
Note
Notes to Inheritors
Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects
disposed of in an earlier call to Dispose.
See Also
Reference
ShaderConstantTable Class
ShaderConstantTable Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstantTable.Finalize Method
Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the
object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void Finalize ()
See Also
Reference
ShaderConstantTable Class
ShaderConstantTable Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstantTable.raise_Disposing Method
Raises the Disposing event when called from within a derived class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected void raise_Disposing (
Object value0,
EventArgs value1
)
Parameters
value0
Invoking object reference; should be this object.
value1
Arguments to pass to the event handler.
See Also
Reference
ShaderConstantTable Class
ShaderConstantTable Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstantTable.SetDefaults Method
Sets the constants in the ShaderConstantTable to their default values. The default values are declared in the variable
declarations in the shader.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void SetDefaults (
GraphicsDevice device
)
Parameters
device
The GraphicsDevice associated with the ShaderConstantTable.
See Also
Reference
ShaderConstantTable Class
ShaderConstantTable Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstantTable Properties
Public Properties
Name Description
Constants Gets a collection of the constants in the ShaderConstantTable.
Creator Gets the name of the constant table creator.
IsDisposed Gets a value that indicates whether the object is disposed.
Version Gets the shader version.
See Also
Reference
ShaderConstantTable Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ShaderConstantTable.Constants Property
Gets a collection of the constants in the ShaderConstantTable.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ShaderConstantCollection Constants { get; }
Property Value
The collection of constants in the ShaderConstantTable.
See Also
Reference
ShaderConstantTable Class
ShaderConstantTable Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstantTable.Creator Property
Gets the name of the constant table creator.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Creator { get; }
Property Value
The name of the constant table creator.
See Also
Reference
ShaderConstantTable Class
ShaderConstantTable Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstantTable.IsDisposed Property
Gets a value that indicates whether the object is disposed.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsDisposed { get; }
Property Value
true if the object is disposed; false otherwise.
See Also
Reference
ShaderConstantTable Class
ShaderConstantTable Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstantTable.Version Property
Gets the shader version.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Version Version { get; }
Property Value
The shader version.
See Also
Reference
ShaderConstantTable Class
ShaderConstantTable Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderConstantTable Events
Public Events
Name Description
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micro
soft .NET common language runtime (CLR).
See Also
Reference
ShaderConstantTable Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ShaderConstantTable.Disposing Event
Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET
common language runtime (CLR).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public event EventHandler Disposing
See Also
Reference
ShaderConstantTable Class
ShaderConstantTable Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderProfile Enumeration
Defines vertex and pixel shader versions.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum ShaderProfile
Members
Mem Description
ber na
me
PS_1_ Pixel shader version ps_1_1.
1
PS_1_ Pixel shader version ps_1_2.
2
PS_1_ Pixel shader version ps_1_3.
3
PS_1_ Pixel shader version ps_1_4.
4
PS_2_ Pixel shader version ps_2_0.
0
PS_2_ Pixel shader version ps_2_a.
A
PS_2_ Pixel shader version ps_2_b.
B
PS_2_ Pixel software shader version ps_2_sw.
SW
PS_3_ Pixel shader version ps_3_0.
0
Unkn Unknown pixel shader version.
own
VS_1_ Vertex shader version v_1_1.
1
VS_2_ Vertex shader version v_2_0.
0
VS_2_ Vertex shader version v_2_a.
A
VS_2_ Vertex software shader version v_2_sw.
SW
VS_3_ Vertex shader version vs_3_0.
0
XPS_3 Xbox microcode assembly pixel shader version xps_3_0. Microcode assembly language supports a superset of the ps_
_0 3_0 and vs_3_0 specifications defined by Direct3D 9.0 for Windows. It does not support earlier Direct3D vertex and pix
el shader specifications.
XVS_3 Xbox microcode assembly vertex shader version xvs_3_0. Microcode assembly language supports a superset of the ps
_0 _3_0 and vs_3_0 specifications defined by Direct3D 9.0 for Windows. It does not support earlier Direct3D vertex and pi
xel shader specifications.
Remarks
These pixel shader versions identify the assembly-level shader model compilation target the HLSL compiler should use to
express the final shader code. When shader compilation is completed at runtime, an application might query the using
MaxVertexShaderProfile or MaxPixelShaderProfile to select a compilation target to match the capabilities of the graphics
device.
See Also
Tasks
How To: Check for Shader Model 2.0 Support
Reference
GraphicsDeviceCapabilities.MaxPixelShaderProfile Property
GraphicsDeviceCapabilities.MaxVertexShaderProfile Property
ShaderCompiler.CompileFromFile Method
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderRegisterSet Enumeration
Defines the data type of a shader register.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum ShaderRegisterSet
Members
Member name Description
Boolean Boolean value.
Float4 4D floating-point number.
Int4 4D integer number.
Sampler The register contains 4D sampler data.
See Also
Reference
ShaderConstant.RegisterSet Property
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderSemantic Structure
Semantics map a parameter to vertex or pixel shader registers. They can also be optional descriptive strings attached to non-
register parameters.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public struct ShaderSemantic
RemarksSemantics are required for vertex and pixel shader, input and output registers.
See Also
Reference
ShaderSemantic Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderSemantic Members
The following tables list the members exposed by the ShaderSemantic type.
Public Properties
Name Description
UsageIndex Gets or sets options that modify how the usage is interpreted. The usage and usage index make up a v
ertex declaration.
VertexElementUsage Gets or sets options that identify how resources are used.
Public Methods
Name Description
Equals (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ShaderSemantic Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ShaderSemantic Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
ShaderSemantic Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ShaderSemantic.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
ShaderSemantic Structure
ShaderSemantic Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderSemantic Properties
Public Properties
Name Description
UsageIndex Gets or sets options that modify how the usage is interpreted. The usage and usage index make up a v
ertex declaration.
VertexElementUsage Gets or sets options that identify how resources are used.
See Also
Reference
ShaderSemantic Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
ShaderSemantic.UsageIndex Property
Gets or sets options that modify how the usage is interpreted. The usage and usage index make up a vertex declaration.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int UsageIndex { get; set; }
Property Value
Options that modify how the usage is interpreted. The usage and usage index make up a vertex declaration.
See Also
Reference
ShaderSemantic Structure
ShaderSemantic Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ShaderSemantic.VertexElementUsage Property
Gets or sets options that identify how resources are used.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public VertexElementUsage VertexElementUsage { get; set; }
Property Value
Options that identify how resources are used.
See Also
Reference
ShaderSemantic Structure
ShaderSemantic Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SpriteBatch Class
Enables a group of sprites to be drawn using the same settings.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class SpriteBatch : IDisposable
See Also
Concepts
2D Graphics Overview
Reference
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SpriteBatch Members
The following tables list the members exposed by the SpriteBatch type.
Public Constructors
Name Description
SpriteBatch Initializes a new instance of the class, which enables a group of sprites to be drawn using the same settings.
Public Properties
Name Description
GraphicsDevice Gets the graphics device associated with this SpriteBatch.
IsDisposed Gets a value that indicates whether the object is disposed.
Name Gets or sets the name of this sprite batch.
Tag Gets or sets an object that uniquely identifies this sprite batch.
Public Methods
Name Description
Begin Overloaded. Prepares the graphics device for drawing sprites.
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Draw Overloaded. Adds a sprite to the batch of sprites to be rendered.
DrawString Overloaded. Adds a sprite string to the batch of sprites to be rendered.
End Flushes the sprite batch and restores the device state to how it was before Begin was called.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Public Events
Name Description
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micro
soft .NET common language runtime.
See Also
Concepts
2D Graphics Overview
Reference
SpriteBatch Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
SpriteBatch Constructor
Initializes a new instance of the class, which enables a group of sprites to be drawn using the same settings.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public SpriteBatch (
GraphicsDevice graphicsDevice
)
Parameters
graphicsDevice
The graphics device where sprites will be drawn.
Exceptions
Exception type Condition
ArgumentNullException graphicsDevice is null.
See Also
Tasks
How To: Draw a Sprite
Concepts
2D Graphics Overview
Reference
SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SpriteBatch Methods
Public Methods
Name Description
Begin Overloaded. Prepares the graphics device for drawing sprites.
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Draw Overloaded. Adds a sprite to the batch of sprites to be rendered.
DrawString Overloaded. Adds a sprite string to the batch of sprites to be rendered.
End Flushes the sprite batch and restores the device state to how it was before Begin was called.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
SpriteBatch Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
SpriteBatch.Begin Method
Prepares the graphics device for drawing sprites.
Unexpected behavior can result when rendering sprites and 3D objects on the same graphics device. For more information, see
Render States and the Graphics Device.
Overload List
Name Description
SpriteBatch.Begin () Prepares the graphics device for drawing sprite
s.
SpriteBatch.Begin (SpriteBlendMode) Prepares the graphics device for drawing sprite
s with specified blending options.
SpriteBatch.Begin (SpriteBlendMode, SpriteSortMode, SaveStateMode) Prepares the graphics device for drawing sprite
s with specified blending, sorting, and render st
ate options.
SpriteBatch.Begin (SpriteBlendMode, SpriteSortMode, SaveStateMode, Matrix) Prepares the graphics device for drawing sprite
s with specified blending, sorting, and render st
ate options, and a global transform matrix.
See Also
Tasks
How To: Draw a Sprite
Concepts
2D Graphics Overview
Reference
SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
SpriteBatch.Begin Method ()
Prepares the graphics device for drawing sprites.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Begin ()
Exceptions
Exception type Condition
InvalidOperationException Begin has been called before calling End after the last call to Begin. Begin cannot be called again u
ntil End has been successfully called.
Remarks
This method must be called before any calls to Draw. When all the sprites have been drawn, call End.
Begin sets the following render states:
CullMode
DepthBufferEnable
AlphaBlendEnable
AlphaTestEnable
AlphaBlendOperation
SourceBlend
DestinationBlend
SeparateAlphaBlendEnabled
AlphaFunction
ReferenceAlpha
Begin sets the following sampler states:
AddressU
AddressV
MagFilter
MinFilter
MipFilter
MipMapLevelOfDetailBias
MaxMipLevel
This version of Begin sets SpriteBlendMode to AlphaBlend, SpriteSortMode to Deferred, and SaveStateMode to None.
When SaveStateMode is set to None, the caller must reset the render and sampler states if they are used elsewhere.
See Also
Tasks
How To: Draw a Sprite
Concepts
2D Graphics Overview
Reference
SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
blendMode
Blending options to use when rendering.
Exceptions
Exception type Condition
InvalidOperationException Begin has been called before calling End after the last call to Begin. Begin cannot be called again u
ntil End has been successfully called.
Remarks
This method must be called before any calls to Draw. When all the sprites have been drawn, call End.
Begin sets the following render states:
CullMode
DepthBufferEnable
AlphaBlendEnable
AlphaTestEnable
AlphaBlendOperation
SourceBlend
DestinationBlend
SeparateAlphaBlendEnabled
AlphaFunction
ReferenceAlpha
Begin sets the following sampler states:
AddressU
AddressV
MagFilter
MinFilter
MipFilter
MipMapLevelOfDetailBias
MaxMipLevel
This version of Begin sets SpriteSortMode to Deferred, and SaveStateMode to None. When SaveStateMode is set to None,
the caller must reset the render and sampler states if they are used elsewhere.
See Also
Tasks
How To: Draw a Sprite
Concepts
2D Graphics Overview
Reference
SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
blendMode
Blending options to use when rendering.
sortMode
Sorting options to use when rendering.
stateMode
Rendering state options.
Exceptions
Exception type Condition
InvalidOperationException Begin has been called before calling End after the last call to Begin. Begin cannot be called again u
ntil End has been successfully called.
Remarks
This method must be called before any calls to Draw. When all the sprites have been drawn, call End.
Begin sets the following render states:
CullMode
DepthBufferEnable
AlphaBlendEnable
AlphaTestEnable
AlphaBlendOperation
SourceBlend
DestinationBlend
SeparateAlphaBlendEnabled
AlphaFunction
ReferenceAlpha
Begin sets the following sampler states:
AddressU
AddressV
MagFilter
MinFilter
MipFilter
MipMapLevelOfDetailBias
MaxMipLevel
If Begin is called with SaveStateMode set to None, the caller must reset these states must be reset if they are used elsewhere.
Calling Begin with SaveStateMode set to SaveState will reset these values properly, but performance may be adversely
affected.
See Also
Tasks
How To: Draw a Sprite
Concepts
2D Graphics Overview
Reference
SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
blendMode
Blending options to use when rendering.
sortMode
Sorting options to use when rendering.
stateMode
Rendering state options.
transformMatrix
A matrix to apply to position, rotation, scale, and depth data passed to Draw.
Remarks
This method must be called before any calls to Draw. When all the sprites have been drawn, call End.
Begin sets the following render states.
CullMode
DepthBufferEnable
AlphaBlendEnable
AlphaTestEnable
AlphaBlendOperation
SourceBlend
DestinationBlend
SeparateAlphaBlendEnabled
AlphaFunction
ReferenceAlpha
Begin sets the following sampler states.
AddressU
AddressV
MagFilter
MinFilter
MipFilter
MipMapLevelOfDetailBias
MaxMipLevel
If Begin is called with SaveStateMode set to None, then these states must be reset by the caller if they are used elsewhere.
Calling Begin with SaveStateMode set to SaveState will reset these values properly, but may adversely affect performance.
Use transformMatrix to apply the same transformation to all sprites drawn by this SpriteBatch. This matrix can be any
combination of translation, scaling, or rotation operations. This matrix is applied to the position, rotation, scale, and depth
values provided to Draw.
See Also
Tasks
How To: Draw a Sprite
Concepts
2D Graphics Overview
Reference
SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SpriteBatch.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
SpriteBatch.Dispose () Immediately releases the unmanaged resources used by this object.
SpriteBatch.Dispose (Boolean) Immediately releases the unmanaged resources used by this object.
See Also
Reference
SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
SpriteBatch.Dispose Method ()
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
See Also
Reference
SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
disposing
true to release both managed and unmanaged resources; false to release only unmanaged resources.
See Also
Reference
SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SpriteBatch.Draw Method
Adds a sprite to the batch of sprites to be rendered.
Overload List
Name Description
SpriteBatch.Draw (Texture2D, Rectangle, Color) Adds a sprit
e to the batc
h of sprites t
o be rendere
d, specifying
the texture,
destination r
ectangle, an
d color tint.
SpriteBatch.Draw (Texture2D, Rectangle, Nullable<Rectangle>, Color) Adds a sprit
e to the batc
h of sprites t
o be rendere
d, specifying
the texture,
destination a
nd source re
ctangles, an
d color tint.
SpriteBatch.Draw (Texture2D, Rectangle, Nullable<Rectangle>, Color, Single, Vector2, SpriteEffects, Single) Adds a sprit
e to the batc
h of sprites t
o be rendere
d, specifying
the texture,
destination,
and source r
ectangles, co
lor tint, rotat
ion, origin, e
ffects, and s
ort depth.
SpriteBatch.Draw (Texture2D, Vector2, Color) Adds a sprit
e to the batc
h of sprites t
o be rendere
d, specifying
the texture, s
creen positio
n, and color
tint.
SpriteBatch.Draw (Texture2D, Vector2, Nullable<Rectangle>, Color) Adds a sprit
e to the batc
h of sprites t
o be rendere
d, specifying
the texture, s
creen positio
n, source rec
tangle, and c
olor tint.
SpriteBatch.Draw (Texture2D, Vector2, Nullable<Rectangle>, Color, Single, Vector2, Single, SpriteEffects, Single) Adds a sprit
e to the batc
h of sprites t
o be rendere
d, specifying
the texture, s
creen positio
n, optional s
ource rectan
gle, color tin
t, rotation, or
igin, scale, ef
fects, and so
rt depth.
SpriteBatch.Draw (Texture2D, Vector2, Nullable<Rectangle>, Color, Single, Vector2, Vector2, SpriteEffects, Single) Adds a sprit
e to the batc
h of sprites t
o be rendere
d, specifying
the texture, s
creen positio
n, source rec
tangle, color
tint, rotation,
origin, scale,
effects, and s
ort depth.
See Also
Tasks
How To: Draw a Sprite
Concepts
2D Graphics Overview
Reference
SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
texture
The sprite texture.
destinationRectangle
A rectangle specifying, in screen coordinates, where the sprite will be drawn. If this rectangle is not the same size as
sourcerectangle, the sprite is scaled to fit.
color
The color channel modulation to use. Use Color.White for full color with no tinting.
Exceptions
Exception type Condition
ArgumentNullException texture is null.
InvalidOperationException Draw was called, but Begin has not yet been called. Begin must be called successfully before Draw
can be called.
Remarks
Before any calls to Draw, you must call Begin. Once all calls to Draw are complete, call End.
See Also
Tasks
How To: Draw a Sprite
Concepts
2D Graphics Overview
Reference
SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
texture
The sprite texture.
destinationRectangle
A rectangle specifying, in screen coordinates, where the sprite will be drawn. If this rectangle is not the same size as
sourcerectangle the sprite will be scaled to fit.
sourceRectangle
A rectangle specifying, in texels, which section of the rectangle to draw. Use null to draw the entire texture.
color
The color channel modulation to use. Use Color.White for full color with no tinting.
Exceptions
Exception type Condition
ArgumentNullException texture is null.
InvalidOperationException Draw was called, but Begin has not yet been called. Begin must be called successfully before Draw
can be called.
Remarks
Before any calls to Draw, you must call Begin. Once all calls to Draw are complete, call End.
See Also
Tasks
How To: Draw a Sprite
Concepts
2D Graphics Overview
Reference
SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
texture
The sprite texture.
destinationRectangle
A rectangle specifying, in screen coordinates, where the sprite will be drawn. If this rectangle is not the same size as
sourceRectangle, the sprite is scaled to fit.
sourceRectangle
A rectangle specifying, in texels, which section of the rectangle to draw. Use null to draw the entire texture.
color
The color channel modulation to use. Use Color.White for full color with no tinting.
rotation
The angle, in radians, to rotate the sprite around the origin.
origin
The origin of the sprite. Specify (0,0) for the upper-left corner.
effects
Rotations to apply prior to rendering.
layerDepth
The sorting depth of the sprite, between 0 (front) and 1 (back).
You must specify either SpriteSortMode.FrontToBack or SpriteSortMode.BackToFront for this parameter to affect sprite
drawing.
Exceptions
Exception type Condition
ArgumentNullException texture is null.
InvalidOperationException Draw was called, but Begin has not yet been called. Begin must be called successfully before you ca
n call Draw.
Remarks
Before making any calls to Draw, you must call Begin. Once all calls to Draw are complete, call End.
See Also
Tasks
How To: Draw a Sprite
Concepts
2D Graphics Overview
Reference
SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
texture
The sprite texture.
position
The location, in screen coordinates, where the sprite will be drawn.
color
The color channel modulation to use. Use Color.White for full color with no tinting.
Exceptions
Exception type Condition
ArgumentNullException texture is null.
InvalidOperationException Draw was called, but Begin has not yet been called. Begin must be called successfully before Draw
can be called.
Remarks
Before any calls to Draw, you must call Begin. Once all calls to Draw are complete, call End.
See Also
Tasks
How To: Draw a Sprite
Concepts
2D Graphics Overview
Reference
SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
texture
The sprite texture.
position
The location, in screen coordinates, where the sprite will be drawn.
sourceRectangle
A rectangle specifying, in texels, which section of the rectangle to draw. Use null to draw the entire texture.
color
The color channel modulation to use. Use Color.White for full color with no tinting.
Exceptions
Exception type Condition
ArgumentNullException texture is null.
InvalidOperationException Draw was called, but Begin has not yet been called. Begin must be called successfully before Draw
can be called.
Remarks
Before any calls to Draw, you must call Begin. Once all calls to Draw are complete, call End.
See Also
Tasks
How To: Draw a Sprite
Concepts
2D Graphics Overview
Reference
SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
texture
The sprite texture.
position
The location, in screen coordinates, where the sprite will be drawn.
sourceRectangle
A rectangle specifying, in texels, which section of the rectangle to draw. Use null to draw the entire texture.
color
The color channel modulation to use. Use Color.White for full color with no tinting.
rotation
The angle, in radians, to rotate the sprite around the origin.
origin
The origin of the sprite. Specify (0,0) for the upper-left corner.
scale
Uniform multiple by which to scale the sprite width and height.
effects
Rotations to apply prior to rendering.
layerDepth
The sorting depth of the sprite, between 0 (front) and 1 (back).
You must specify either SpriteSortMode.FrontToBack or SpriteSortMode.BackToFront for this parameter to affect sprite
drawing.
Exceptions
Exception type Condition
ArgumentNullException texture is null.
InvalidOperationException Draw was called, but Begin has not yet been called. Begin must be called successfully before you ca
n call Draw.
Remarks
Before making any calls to Draw, you must call Begin. Once all calls to Draw are complete, call End.
See Also
Tasks
How To: Draw a Sprite
Concepts
2D Graphics Overview
Reference
SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
texture
The sprite texture.
position
The location, in screen coordinates, where the sprite will be drawn.
sourceRectangle
A rectangle specifying, in texels, which section of the rectangle to draw. Use null to draw the entire texture.
color
The color channel modulation to use. Use Color.White for full color with no tinting.
rotation
The angle, in radians, to rotate the sprite around the origin.
origin
The origin of the sprite. Specify (0,0) for the upper-left corner.
scale
Vector containing separate scalar multiples for the x- and y-axes of the sprite.
effects
Rotations to apply before rendering.
layerDepth
The sorting depth of the sprite, between 0 (front) and 1 (back).
You must specify either SpriteSortMode.FrontToBack or SpriteSortMode.BackToFront for this parameter to affect sprite
drawing.
Exceptions
Exception type Condition
ArgumentNullException texture is null.
InvalidOperationException Draw was called, but Begin has not yet been called. Begin must be called successfully before you ca
n call Draw.
Remarks
Before making any calls to Draw, you must call Begin. Once all calls to Draw are complete, call End.
See Also
Tasks
How To: Draw a Sprite
Concepts
2D Graphics Overview
Reference
SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SpriteBatch.DrawString Method
Adds a sprite string to the batch of sprites to be rendered.
Overload List
Name Description
SpriteBatch.DrawString (SpriteFont, String, Vector2, Color) Adds a sprite string to
the batch of sprites to
be rendered, specifyin
g the font, output text,
screen position, and c
olor tint.
SpriteBatch.DrawString (SpriteFont, String, Vector2, Color, Single, Vector2, Single, SpriteEffects, Single) Adds a sprite string to
the batch of sprites to
be rendered, specifyin
g the font, output text,
screen position, color
tint, rotation, origin, s
cale, and effects.
SpriteBatch.DrawString (SpriteFont, String, Vector2, Color, Single, Vector2, Vector2, SpriteEffects, Single) Adds a sprite string to
the batch of sprites to
be rendered, specifyin
g the font, output text,
screen position, color
tint, rotation, origin, s
cale, effects, and dept
h.
See Also
Reference
SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
spriteFont
The sprite font.
text
The string to draw.
position
The location, in screen coordinates, where the text will be drawn.
color
The desired color of the text.
Exceptions
Exception type Condition
ArgumentException There is a character in text that was not imported by the SpriteFont. You must include all the charact
ers in the character regions in the sprite font file. For more information, see
How To: Extend the Font Description Processor to Support Additional Characters.
ArgumentNullException spriteFont or text is null.
InvalidOperationException DrawString was called, but Begin has not yet been called. Begin must be called successfully before
DrawString can be called.
Remarks
SpriteFont objects are loaded from the Content Manager. See the SpriteFont class for more information.
Before any calls to DrawString, you must call Begin. Once all calls to DrawString are complete, call End.
Use a newline character (\n) to draw more than one line of text.
See Also
Tasks
How To: Draw Text
Concepts
2D Graphics Overview
Reference
SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
spriteFont
The sprite font.
text
The string to draw.
position
The location, in screen coordinates, where the text will be drawn.
color
The desired color of the text.
rotation
The angle, in radians, to rotate the text around the origin.
origin
The origin of the string. Specify (0,0) for the upper-left corner.
scale
Uniform multiple by which to scale the sprite width and height.
effects
Rotations to apply prior to rendering.
layerDepth
The sorting depth of the sprite, between 0 (front) and 1 (back).
Exceptions
Exception type Condition
ArgumentException There is a character in text that was not imported by the SpriteFont. You must include all the charact
ers in the character regions in the sprite font file. For more information, see
How To: Extend the Font Description Processor to Support Additional Characters.
ArgumentNullException spriteFont or text is null.
InvalidOperationException DrawString was called, but Begin has not yet been called. Begin must be called successfully before
DrawString can be called.
Remarks
SpriteFont objects are loaded from the Content Manager. See the SpriteFont class for more information.
Before any calls to DrawString, you must call Begin. Once all calls to DrawString are complete, call End.
Use a newline character (\n) to draw more than one line of text.
See Also
Tasks
How To: Draw Text
Concepts
2D Graphics Overview
Reference
SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
spriteFont
The sprite font.
text
The string to draw.
position
The location, in screen coordinates, where the text will be drawn.
color
The desired color of the text.
rotation
The angle, in radians, to rotate the text around the origin.
origin
The origin of the string. Specify (0,0) for the upper-left corner.
scale
Vector containing separate scalar multiples for the x- and y-axes of the sprite.
effects
Rotations to apply prior to rendering.
layerDepth
The sorting depth of the sprite, between 0 (front) and 1 (back).
Exceptions
Exception type Condition
ArgumentException There is a character in text that was not imported by the SpriteFont. You must include all the charact
ers in the character regions in the sprite font file. For more information, see
How To: Extend the Font Description Processor to Support Additional Characters.
ArgumentNullException spriteFont or text is null.
InvalidOperationException DrawString was called, but Begin has not yet been called. Begin must be called successfully before
DrawString can be called.
Remarks
SpriteFont objects are loaded from the Content Manager. See the SpriteFont class for more information.
Before any calls to DrawString, you must call Begin. Once all calls to DrawString are complete, call End.
Use a newline character (\n) to draw more than one line of text.
See Also
Tasks
How To: Draw Text
Concepts
2D Graphics Overview
Reference
SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SpriteBatch.End Method
Flushes the sprite batch and restores the device state to how it was before Begin was called.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void End ()
Exceptions
Exception type Condition
InvalidOperationException End was called, but Begin has not yet been called. You must call Begin successfully before you can c
all End.
Remarks
Call End after all calls to Draw are complete.
Unexpected behavior can result when rendering sprites and 3D objects on the same graphics device. For more information, see
Render States and the Graphics Device.
See Also
Tasks
How To: Draw a Sprite
Concepts
2D Graphics Overview
Reference
SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SpriteBatch Properties
Public Properties
Name Description
GraphicsDevice Gets the graphics device associated with this SpriteBatch.
IsDisposed Gets a value that indicates whether the object is disposed.
Name Gets or sets the name of this sprite batch.
Tag Gets or sets an object that uniquely identifies this sprite batch.
See Also
Reference
SpriteBatch Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
SpriteBatch.GraphicsDevice Property
Gets the graphics device associated with this SpriteBatch.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GraphicsDevice GraphicsDevice { get; }
Property Value
The graphics device associated with this SpriteBatch.
See Also
Reference
SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SpriteBatch.IsDisposed Property
Gets a value that indicates whether the object is disposed.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsDisposed { get; }
Property Value
true if the object is disposed; false otherwise.
See Also
Reference
SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SpriteBatch.Name Property
Gets or sets the name of this sprite batch.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Name { get; set; }
Property Value
The name of this sprite batch.
See Also
Reference
SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SpriteBatch.Tag Property
Gets or sets an object that uniquely identifies this sprite batch.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Object Tag { get; set; }
Property Value
An object that uniquely identifies this sprite batch.
See Also
Reference
SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SpriteBatch Events
Public Events
Name Description
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micro
soft .NET common language runtime.
See Also
Reference
SpriteBatch Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
SpriteBatch.Disposing Event
Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET
common language runtime.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public event EventHandler Disposing
See Also
Reference
SpriteBatch Class
SpriteBatch Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SpriteBlendMode Enumeration
The following flags are used to specify sprite blending rendering options to the flags parameter in Begin:
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum SpriteBlendMode
Members
Member name Description
Additive Enable additive blending.
AlphaBlend Enable alpha blending.
None No blending specified.
See Also
Tasks
How To: Draw a Masked Sprite over a Background
Reference
SpriteBatch.Begin Method
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SpriteEffects Enumeration
Defines sprite rotation options.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[FlagsAttribute]
public enum SpriteEffects
Members
Member name Description
FlipHorizontally Rotate 180 degrees about the Y axis before rendering.
FlipVertically Rotate 180 degrees about the X axis before rendering.
None No rotations specified.
See Also
Reference
SpriteBatch.Draw Method (Texture2D, Rectangle, Nullable<Rectangle>, Color, Single, Vector2, SpriteEffects, Single)
SpriteBatch.Draw Method (Texture2D, Vector2, Nullable<Rectangle>, Color, Single, Vector2, Single, SpriteEffects, Single)
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SpriteFont Class
Represents a font texture.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class SpriteFont
Remarks
To load a SpriteFont, click Sprite Font on the Add New Item menu. This adds an XML file to your project describing how to
build a texture map for your font. At build time, XNA Game Studio creates a texture with the image of the characters of the font
you specify, with the specified font point size.
At run time, load the font using ContentManager.Load, and pass it to SpriteBatch.DrawString when drawing text.
Note
As with most types of software, font files are licensed rather than sold. Font licenses vary from vendor to vendor, but most d
on't allow redistribution of the fonts, and that includes redistribution of reproductions such as bitmaps containing the rasteri
zed character set. This is even true of many of the licenses covering fonts that Microsoft supplies with applications and Wind
ows. Be careful, therefore, to ensure that you have the required license rights to redistribute any font you include as a bitmap
containing the rasterized character set in your game!
See Also
Reference
SpriteFont Members
ContentManager.Load
SpriteBatch.DrawString
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SpriteFont Members
The following tables list the members exposed by the SpriteFont type.
Public Properties
Name Description
LineSpacing The line spacing, in pixels, of this font.
Spacing Gets or sets the spacing of the font characters.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
MeasureString Returns the height and width of a given string as a Vector2.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
SpriteFont Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
SpriteFont Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
MeasureString Returns the height and width of a given string as a Vector2.
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
SpriteFont Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
SpriteFont.MeasureString Method
Returns the height and width of a given string as a Vector2.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector2 MeasureString (
string text
)
Parameters
text
The string to measure.
Return Value
The height and width, in pixels, of text, when it is rendered.
Exceptions
Exception type Condition
ArgumentNullException text cannot be null.
ArgumentException There is a character in text that was not imported by the SpriteFont. You must include all the character
s in the character regions in the sprite font file. For more information see
How To: Extend the Font Description Processor to Support Additional Characters.
See Also
Reference
SpriteFont Class
SpriteFont Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SpriteFont Properties
Public Properties
Name Description
LineSpacing The line spacing, in pixels, of this font.
Spacing Gets or sets the spacing of the font characters.
See Also
Reference
SpriteFont Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
SpriteFont.LineSpacing Property
The line spacing, in pixels, of this font.
The line spacing is the vertical distance between the base lines of two consecutive lines of text. Thus, it includes the blank space
between lines as well as the height of the characters.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int LineSpacing { get; }
Property Value
The height of one line, in pixels.
See Also
Reference
SpriteFont Class
SpriteFont Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SpriteFont.Spacing Property
Gets or sets the spacing of the font characters.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float Spacing { get; set; }
Property Value
The spacing, in pixels, of the font characters.
See Also
Reference
SpriteFont Class
SpriteFont Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SpriteSortMode Enumeration
Defines sprite sort-rendering options.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum SpriteSortMode
Members
Me Description
mbe
r na
me
Back
ToFr Same as Deferred mode, except sprites are sorted by depth in back-to-front order prior to drawing. This procedure is r
ont ecommended when drawing transparent sprites of varying depths.
Defe
rred Sprites are not drawn until End is called. End will apply graphics device settings and draw all the sprites in one batch, in
the same order calls to Draw were received. This mode allows Draw calls to two or more instances of SpriteBatch witho
ut introducing conflicting graphics device settings. SpriteBatch defaults to Deferred mode.
Fron
tToB Same as Deferred mode, except sprites are sorted by depth in front-to-back order prior to drawing. This procedure is r
ack ecommended when drawing opaque sprites of varying depths.
Imm
edia Begin will apply new graphics device settings, and sprites will be drawn within each Draw call. In Immediate mode the
te re can only be one active SpriteBatch instance without introducing conflicting device settings. Immediate mode is faste
r than Deferred mode.
Text
ure Same as Deferred mode, except sprites are sorted by texture prior to drawing. This can improve performance when dr
awing non-overlapping sprites of uniform depth.
See Also
Reference
SpriteBatch.Begin Method
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
StateBlock Class
Encapsulates render states.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class StateBlock : IDisposable
StateBlock Members
The following tables list the members exposed by the StateBlock type.
Public Constructors
Name Description
StateBlock Initializes a new instance of the StateBlock class.
Public Properties
Name Description
GraphicsDevice Gets the GraphicsDevice associated with this StateBlock.
IsContentLost Gets the current state of the content on a device.
IsDisposed Gets a value that indicates whether the object is disposed.
Name Gets or sets the name of the StateBlock.
Tag Gets or sets the resource manager tag for the StateBlock.
Public Methods
Name Description
Apply Applies the state block to the current GraphicsDevice.
Capture Captures the current value of states that are included in a state block.
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_ContentLost Occurs when content is about to be lost due to a device reset.
raise_Disposing Raises the Disposing event when called from within a derived class.
Public Events
Name Description
ContentLost Occurs when resources are lost (for example, when the current device is lost).
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micr
osoft .NET common language runtime (CLR).
See Also
Reference
StateBlock Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
StateBlock Constructor
Initializes a new instance of the StateBlock class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public StateBlock (
GraphicsDevice graphicsDevice
)
Parameters
graphicsDevice
The device to associate with the state block.
Exceptions
Exception type Condition
ArgumentNullException graphicsDevice is null.
InvalidOperationException Unable to create this StateBlock resource on the graphics device.
Remarks
StateBlock objects must be recreated when the device is reset.
See Also
Tasks
How To: Load Content
Reference
GraphicsDeviceManager.DeviceReset Event
StateBlock Class
StateBlock Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
StateBlock Methods
Public Methods
Name Description
Apply Applies the state block to the current GraphicsDevice.
Capture Captures the current value of states that are included in a state block.
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_ContentLost Occurs when content is about to be lost due to a device reset.
raise_Disposing Raises the Disposing event when called from within a derived class.
See Also
Reference
StateBlock Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
StateBlock.Apply Method
Applies the state block to the current GraphicsDevice.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Apply ()
See Also
Reference
StateBlock Class
StateBlock Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
StateBlock.Capture Method
Captures the current value of states that are included in a state block.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Capture ()
See Also
Reference
StateBlock Class
StateBlock Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
StateBlock.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
StateBlock.Dispose () Immediately releases the unmanaged resources used by this object.
StateBlock.Dispose (Boolean) Immediately releases the unmanaged resources used by this object.
See Also
Reference
StateBlock Class
StateBlock Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
StateBlock.Dispose Method ()
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
Remarks
Call Dispose when you are finished using the StateBlock. The Dispose method leaves the StateBlock in an unusable state. After
calling Dispose, you must release all references to the StateBlock so the garbage collector can reclaim the memory that the
StateBlock was occupying.
Note
Always call Dispose before you release your last reference to the StateBlock. Otherwise, the resources it is using will not be fr
eed until the garbage collector calls the StateBlock object's Finalize method.
See Also
Reference
StateBlock Class
StateBlock Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
Remarks
This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean)
method with the disposing parameter set to true. Finalize invokes Dispose(Boolean) with disposing set to false.
When the disposing parameter is true, this method releases all resources held by any managed objects that this StateBlock
references. This method invokes the Dispose method of each referenced object.
Note
Notes to Inheritors
Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects
disposed of in an earlier call to Dispose.
See Also
Reference
StateBlock Class
StateBlock Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
StateBlock.Finalize Method
Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the
object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void Finalize ()
Remarks
This method overrides System.Object.Finalize. Application code should not call this method; an object's Finalize method is
automatically invoked during garbage collection, unless a call to the GC.SuppressFinalize method has disabled finalization by
the garbage collector.
See Also
Reference
StateBlock Class
StateBlock Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
StateBlock.raise_ContentLost Method
Occurs when content is about to be lost due to a device reset.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected virtual void raise_ContentLost (
Object value0,
EventArgs value1
)
Parameters
value0
The source of this event.
value1
The event arguments that are associated with the action that raised the event.
See Also
Reference
StateBlock Class
StateBlock Members
ContentLost
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
StateBlock.raise_Disposing Method
Raises the Disposing event when called from within a derived class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected void raise_Disposing (
Object value0,
EventArgs value1
)
Parameters
value0
Invoking object reference; should be this object.
value1
Arguments to pass to the event handler.
See Also
Reference
StateBlock Class
StateBlock Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
StateBlock.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
StateBlock Class
StateBlock Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
StateBlock Properties
Public Properties
Name Description
GraphicsDevice Gets the GraphicsDevice associated with this StateBlock.
IsContentLost Gets the current state of the content on a device.
IsDisposed Gets a value that indicates whether the object is disposed.
Name Gets or sets the name of the StateBlock.
Tag Gets or sets the resource manager tag for the StateBlock.
See Also
Reference
StateBlock Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
StateBlock.GraphicsDevice Property
Gets the GraphicsDevice associated with this StateBlock.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GraphicsDevice GraphicsDevice { get; }
Property Value
The GraphicsDevice associated with this StateBlock.
See Also
Reference
StateBlock Class
StateBlock Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
StateBlock.IsContentLost Property
Gets the current state of the content on a device.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public virtual bool IsContentLost { get; }
Property Value
true if content was lost due to device lost or similar event; otherwise false.
See Also
Reference
StateBlock Class
StateBlock Members
ContentLost
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
StateBlock.IsDisposed Property
Gets a value that indicates whether the object is disposed.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsDisposed { get; }
Property Value
true if the object is disposed; false otherwise.
See Also
Reference
StateBlock Class
StateBlock Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
StateBlock.Name Property
Gets or sets the name of the StateBlock.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Name { get; set; }
Property Value
The name of the StateBlock.
See Also
Reference
StateBlock Class
StateBlock Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
StateBlock.Tag Property
Gets or sets the resource manager tag for the StateBlock.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Object Tag { get; set; }
Property Value
The resource manager tag for the StateBlock.
See Also
Reference
StateBlock Class
StateBlock Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
StateBlock Events
Public Events
Name Description
ContentLost Occurs when resources are lost (for example, when the current device is lost).
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micr
osoft .NET common language runtime (CLR).
See Also
Reference
StateBlock Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
StateBlock.ContentLost Event
Occurs when resources are lost (for example, when the current device is lost).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public virtual event EventHandler ContentLost
Remarks
When ContentLost fires, IsContentLost is set to true.
See Also
Reference
StateBlock Class
StateBlock Members
raise_ContentLost
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
StateBlock.Disposing Event
Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET
common language runtime (CLR).
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public event EventHandler Disposing
See Also
Reference
StateBlock Class
StateBlock Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
StencilOperation Enumeration
Defines stencil buffer operations.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum StencilOperation
Members
Member name Description
Decrement Decrements the stencil-buffer entry, wrapping to the maximum value if the new value is less than 0.
DecrementSaturation Decrements the stencil-buffer entry, clamping to 0.
Increment Increments the stencil-buffer entry, wrapping to 0 if the new value exceeds the maximum value.
IncrementSaturation Increments the stencil-buffer entry, clamping to the maximum value.
Invert Inverts the bits in the stencil-buffer entry.
Keep Does not update the stencil-buffer entry. This is the default value.
Replace Replaces the stencil-buffer entry with a reference value.
Zero Sets the stencil-buffer entry to 0.
RemarksStencil-buffer entries are integer values that range from 0 to 2n − 1, where n is the bit depth of the stencil buffer.
See Also
Concepts
What Is a Stencil Buffer?
Reference
RenderState.StencilPass Property
RenderState.StencilFail Property
RenderState.StencilDepthBufferFail Property
RenderState.CounterClockwiseStencilPass Property
RenderState.CounterClockwiseStencilFail Property
RenderState.CounterClockwiseStencilDepthBufferFail Property
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SurfaceFormat Enumeration
Defines various types of surface formats.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum SurfaceFormat
Members
Me Description
mb
er
na
me
Al (Unsigned format) 8-bit alpha only.
ph
a8
Bg (Unsigned format) 8-bit BGR texture format using 2 bits for blue, 3 bits for green, and 3 bits for red.
r23
3
Bg (Unsigned format) 24-bit BGR pixel format with 8 bits per channel.
r24
Bg (Unsigned format) 32-bit BGR pixel format, where 8 bits are reserved for each color.
r32
Bg (Unsigned format) 16-bit BGR pixel format where 4 bits are reserved for each color.
r44
4
Bg (Unsigned format) 16-bit BGR pixel format where 5 bits are reserved for each color.
r55
5
Bg (Unsigned format) 16-bit BGR pixel format with 5 bits for blue, 6 bits for green, and 5 bits for red.
r56
5
Bg (Unsigned format) 32-bit pixel format using 10 bits each for blue, green, and red; and 2 bits for alpha.
ra1
01
01
02
Bg (Unsigned format) 16-bit BGRA format using 2 bits for blue, 3 bits each for red and green; and 8 bits for alpha.
ra2
33
8
Bg (Unsigned format) 16-bit BGRA pixel format with 4 bits for each channel.
ra4
44
4
Bg (Unsigned format) 16-bit BGRA pixel format where 5 bits are reserved for each color and 1 bit is reserved for alpha.
ra5
55
1
Col (Unsigned format) 32-bit ARGB pixel format with alpha, using 8 bits per channel.
or
De (Buffer format) 16-bit depth-buffer bit depth where 15 bits are reserved for the depth channel and 1 bit is reserved for th
pt e stencil channel.
h1
5St
en
cil
1
De (Buffer format) 16-bit depth-buffer bit depth.
pt
h1
6
De (Buffer format) 32-bit depth-buffer bit depth using 24 bits for the depth channel.
pt
h2
4
De (Buffer format) 32-bit depth-buffer bit depth using 24 bits for the depth channel and 4 bits for the stencil channel.
pt
h2
4St
en
cil
4
De (Buffer format) 32-bit depth-buffer bit depth using 24 bits for the depth channel and 8 bits for the stencil channel.
pt
h2
4St
en
cil
8
De (Buffer format) A non-lockable format that contains 24 bits of depth (in a 24-bit floating-point format − 20e4) and 8 bits
pt of stencil.
h2
4St
en
cil
8Si
ngl
e
De (Buffer format) 32-bit depth-buffer bit depth.
pt
h3
2
Dx DXT1 compression texture format. The runtime will not allow an application to create a surface using a DXTn format unle
t1 ss the surface dimensions are multiples of 4. This applies to offscreen-plain surfaces, render targets, 2D textures, cube tex
tures, and volume textures.
Dx DXT2 compression texture format. The runtime will not allow an application to create a surface using a DXTn format unle
t2 ss the surface dimensions are multiples of 4. This applies to offscreen-plain surfaces, render targets, 2D textures, cube tex
tures, and volume textures.
Dx DXT3 compression texture format. The runtime will not allow an application to create a surface using a DXTn format unle
t3 ss the surface dimensions are multiples of 4. This applies to offscreen-plain surfaces, render targets, 2D textures, cube tex
tures, and volume textures.
Dx DXT4 compression texture format. The runtime will not allow an application to create a surface using a DXTn format unle
t4 ss the surface dimensions are multiples of 4. This applies to offscreen-plain surfaces, render targets, 2D textures, cube tex
tures, and volume textures.
Dx DXT5 compression texture format. The runtime will not allow an application to create a surface using a DXTn format unle
t5 ss the surface dimensions are multiples of 4. This applies to offscreen-plain surfaces, render targets, 2D textures, cube tex
tures, and volume textures.
Ha (Floating-point format) 16-bit float format using 16 bits for the red channel.
lfSi
ngl
e
Ha (Floating-point format) 32-bit float format using 16 bits for the red channel and 16 bits for the green channel.
lfV
ect
or2
Ha (Floating-point format) 64-bit float format using 16 bits for each channel (alpha, blue, green, red).
lfV
ect
or4
Lu (Unsigned format) 16-bit luminance only.
mi
na
nc
e1
6
Lu (Unsigned format) 8-bit luminance only.
mi
na
nc
e8
Lu (Unsigned format) 16-bit using 8 bits each for alpha and luminance.
mi
na
nc
eAl
ph
a1
6
Lu (Unsigned format) 8-bit using 4 bits each for alpha and luminance.
mi
na
nc
eAl
ph
a8
Mu MultiElement texture (not compressed)
lti2
Bg
ra3
2
No (Mixed format) 32-bit bump-map format using 2 bits for alpha and 10 bits each for w, v, and u.
rm
ali
ze
dA
lph
a1
01
01
02
No (Signed format) 16-bit bump-map format using 8 bits each for u and v data.
rm
ali
ze
dB
yte
2
No (Signed format) 16-bit normal compression format. The texture sampler computes the C channel from: C = sqrt(1 − U2
rm − V2).
ali
ze
dB
yte
2C
om
pu
ted
No (Signed format) 32-bit bump-map format using 8 bits for each channel.
rm
ali
ze
dB
yte
4
No (Mixed format) 16-bit bump-map format with luminance using 6 bits for luminance, and 5 bits each for v and u.
rm
ali
ze
dL
um
ina
nc
e1
6
No (Mixed format) 32-bit bump-map format with luminance using 8 bits for each channel.
rm
ali
ze
dL
um
ina
nc
e3
2
No (Signed format) 32-bit bump-map format using 16 bits for each channel.
rm
ali
ze
dS
ho
rt2
No (Signed format) 64-bit bump-map format using 16 bits for each component.
rm
ali
ze
dS
ho
rt4
Pal (Unsigned format) 8-bit color indexed.
ett
e8
Pal (Unsigned format) 8-bit color indexed with 8 bits of alpha.
ett
eAl
ph
a1
6
Rg (Unsigned format) 32-bit pixel format using 16 bits each for red and green.
32
Rg (Unsigned format) 32-bit RGB pixel format, where 8 bits are reserved for each color.
b3
2
Rg (Unsigned format) 32-bit RGBA pixel format using 10 bits for each color and 2 bits for alpha.
ba
10
10
10
2
Rg (Unsigned format) 32-bit RGBA pixel format with alpha, using 8 bits per channel.
ba
32
Rg (Unsigned format) 64-bit RGBA pixel format using 16 bits for each component.
ba
64
Sin (IEEE format) 32-bit float format using 32 bits for the red channel.
gle
Un Surface format is unknown.
kn
ow
n
Ve (IEEE format) 64-bit float format using 32 bits for the red channel and 32 bits for the green channel.
cto
r2
Ve (IEEE format) 128-bit float format using 32 bits for each channel (alpha, blue, green, red).
cto
r4
Vi A 16-bit packed RGB format analogous to VideoYuYv (U0Y0, V0Y1, U2Y2, and so on). It requires a pixel pair to properly r
de epresent the color value. The first pixel in the pair contains 8 bits of green (in the low 8 bits) and 8 bits of red (in the high
oG 8 bits). The second pixel contains 8 bits of green (in the low 8 bits) and 8 bits of blue (in the high 8 bits). Together, the two
rG pixels share the red and blue components, while each has a unique green component (R0G0, B0G1, R2G2, and so on). Th
b e texture sampler does not normalize the colors when looking up into a pixel shader; they remain in the range of 0.0f to 2
55.0f. This is true for all programmable pixel shader models. For the fixed-function pixel shader, the hardware should nor
malize to the 0.f to 1.f range and essentially treat it as the VideoUyVy texture. Hardware that exposes this format must ha
ve PixelShader1xMaxValue set to a value capable of handling that range.
Vi A 16-bit packed RGB format analogous to VideoUyVy (Y0U0, Y1V0, Y2U2, and so on). It requires a pixel pair to properly r
de epresent the color value. The first pixel in the pair contains 8 bits of green (in the high 8 bits) and 8 bits of red (in the low
oR 8 bits). The second pixel contains 8 bits of green (in the high 8 bits) and 8 bits of blue (in the low 8 bits). Together, the two
gB pixels share the red and blue components, while each has a unique green component (G0R0, G1B0, G2R2, and so on). Th
g e texture sampler does not normalize the colors when looking up into a pixel shader; they remain in the range of 0.0f to 2
55.0f. This is true for all programmable pixel shader models. For the fixed-function pixel shader, the hardware should nor
malize to the 0.f to 1.f range and essentially treat it as the VideoUyVy texture. Hardware that exposes this format must ha
ve PixelShader1xMaxValue set to a value capable of handling that range.
Vi YUY2 format (PC98 compliance)
de
oU
yV
y
Vi VideoYuYv format (PC98 compliance)
de
oY
uY
v
Remarks
In the XNA Framework, all two-dimensional (2D) images are represented by a range of memory called a surface. Within a
surface, each element holds a color value representing a small section of the image, called a pixel. An image's detail level is
defined by both the number of pixels needed to represent the image, and the number of bits needed for the image's color
spectrum. For example, an image that is 800 pixels wide by 600 pixels high with 32 bits of color for each pixel (written as
800×600×32) is more detailed than an image that is 640 pixels wide by 480 pixels tall with 16 bits of color for each pixel
(written as 640×480×16). Likewise, the more detailed image requires a larger surface to store the data. For an 800×600×32
image, the surface's array dimensions are 800×600, and each element holds a 32-bit value to represent its color.
All formats are listed from left to right, most-significant bit to least-significant bit. For example, ARGB formats are ordered from
the most-significant bit channel A (alpha), to the least-significant bit channel B (blue). When traversing surface data, the data is
stored in memory from least-significant bit to most-significant bit, which means that the channel order in memory is from
least-significant bit (blue) to most-significant bit (alpha).
The default value for formats that contain undefined channels (Rg32, Alpha8, and so on) is 1. The only exception is the Alpha8
format, which is initialized to 000 for the three color channels.
The order of the bits is from the most-significant byte first, so LuminanceAlpha16 indicates that the high byte of this 2-byte
format is alpha. Depth16 indicates a 16-bit integer value and an application-lockable surface.
Floating-point formats are also known as s10e5 formats. IEEE formats are also known as s23e8 formats. Data in mixed formats
can contain a combination of unsigned data and signed data. Data in a signed format can be both positive and negative. Signed
formats use combinations of (U), (V), (W), and (Q) data. Data in an unsigned format must be positive. Unsigned formats use
combinations of (R)ed, (G)reen, (B)lue, (A)lpha, (L)uminance, and (P)alette data. Palette data is also referred to as "color-
indexed" data because the data is used to index a color palette.
Back-Buffer or Display Formats
The following formats are the only valid formats for a back buffer or a display.
Format Back Buffer Display
Bgra1010102 × × (full-screen mode only)
Color ×
Bgr32 × ×
Bgra5551 ×
Bgr555 × ×
Bgr565 × ×
Depth-stencil Buffer Formats
Depth-stencil buffers each have unique formats. All depth-stencil formats except Depth16Lockable indicate no particular bit
ordering per pixel, and the driver is allowed to consume more than the indicated number of bits-per-depth channel (but not
stencil channel).
Caution
If the back buffer size has changed and the depth stencil must have the corresponding size, recreate the depth stencil when t
he device is reset.
DXT Compressed Texture Formats
The runtime will not allow an application to create a surface using a DXTn format unless the surface dimensions are multiples
of 4. This applies to offscreen-plain surfaces, render targets, 2D textures, cube textures, and volume textures.
Direct3D Equivalents
A mapping of each Direct3D 9 surface format name to the SurfaceFormat equivalent is listed in the following table.
Direct3D Surface Format SurfaceFormat equivalent
Floating Point
Float32 D3DFMT_R32F Single
D3DFMT_G32R32F Vector2
D3DFMT_A32B32G32R32F Vector4
Float16 D3DFMT_R16F HalfSingle
D3DFMT_G16R16F HalfVector2
D3DFMT_A16B16G16R16F HalfVector4
Unsigned Normalized
64 bpp D3DFMT_A16B16G16R16 Rgba64
32 bpp D3DFMT_A8R8G8B8 Color
D3DFMT_X8R8G8B8 Bgr32
D3DFMT_A8B8G8R8 Rgba32
D3DFMT_X8B8G8R8 Rgb32
D3DFMT_A2R10G10B10 Bgra1010102
D3DFMT_A2B10G10R10 Rgba1010102
D3DFMT_G16R16 Rg32
24 bpp D3DFMT_R8G8B8 Bgr24
16 bpp D3DFMT_R5G6B5 Bgr565
D3DFMT_A1R5G5B5 Bgra5551
D3DFMT_X1R5G5B5 Bgr555
D3DFMT_A4R4G4B4 Bgra4444
D3DFMT_X4R4G4B4 Bgr444
D3DFMT_A8R3G3B2 Bgra2338
8 bpp D3DFMT_A8 Alpha8
D3DFMT_R3G3B2 Bgr233
Signed Normalized
D3DFMT_V8U8 NormalizedByte2
D3DFMT_Q8W8V8U8 NormalizedByte4
D3DFMT_V16U16 NormalizedShort2
D3DFMT_Q16W16V16U16 NormalizedShort4
D3DFMT_CxV8U8 NormalizedByte2Computed
Block Compressed
D3DFMT_Dxt1 Dxt1
D3DFMT_Dxt2 Dxt2
D3DFMT_Dxt3 Dxt3
D3DFMT_Dxt4 Dxt4
D3DFMT_Dxt5 Dxt5
Luminance
D3DFMT_L8 Luminance8
D3DFMT_L16 Luminance16
D3DFMT_A4L4 LuminanceAlpha8
D3DFMT_A8L8 LuminanceAlpha16
Palettized
D3DFMT_P8 Palette8
D3DFMT_A8P8 PaletteAlpha16
Mixed Formats
D3DFMT_A2W10V10U10 NormalizedAlpha1010102
D3DFMT_X8L8V8U8 NormalizedLuminance32
D3DFMT_L6V5U5 NormalizedLuminance16
D3DFMT_Yuy2 VideoUyVy
D3DFMT_Uyvy VideoYuYv
D3DFMT_Multi2Argb8 Multi2Bgra32
D3DFMT_R8G8B8G8 VideoGrGb
D3DFMT_G8R8G8B8 VideoRgBg
Depth Formats
D3DFMT_D15S1 Depth15Stencil1
D3DFMT_D16 Depth16
D3DFMT_D24S8 Depth24Stencil8
D3DFMT_D24SingleS8 Depth24Stencil8Single
D3DFMT_D24X4S4 Depth24Stencil4
D3DFMT_D24X8 Depth24
D3DFMT_D32 Depth32
See Also
Concepts
Xbox 360 Surface Formats
Tasks
How To: Create a Depth Texture
Reference
DisplayMode.Format Property
DisplayModeCollection.Item Property
GraphicsAdapter.CheckDepthStencilMatch Method
GraphicsAdapter.CheckDeviceFormat Method
GraphicsAdapter.CheckDeviceFormatConversion Method
GraphicsAdapter.CheckDeviceMultiSampleType Method
GraphicsAdapter.CheckDeviceType Method
PresentationParameters.BackBufferFormat Property
Texture2D Constructor
Texture2D.Format Property
Texture3D Constructor
Texture3D.Format Property
TextureCreationParameters Constructor
TextureCreationParameters.Format Property
TextureCube Constructor
TextureCube.Format Property
TextureInformation Constructor
TextureInformation.Format Property
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
SwapEffect Enumeration
Defines how the device front buffer and back buffer are to be swapped when Present is called.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum SwapEffect
Members
M Description
e
m
be
rn
a
m
e
Co
py This swap effect can be specified only for a swap chain that comprises a single back buffer.
Whether the swap chain is windowed or full-screen, the runtime guarantees the semantics implied by a copy-based
Present operation; specifically, that the operation leaves the content of the back buffer unchanged, instead of replacing it
with the content of the front buffer as a flip-based Present operation would.
For a windowed swap chain, a Present operation causes the back buffer content to be copied immediately to the client are
a of the target window. No attempt is made to synchronize the copy with the vertical retrace period of the display adapter,
so tearing effects may be observed.
For a full-screen swap chain, the runtime uses a combination of flip and copy operations, which are supported by hidden
back buffers if necessary, to accomplish the Present operation. Accordingly, the presentation is synchronized with the disp
lay adapter's vertical retrace and its rate is constrained by the chosen presentation interval. A swap chain specified with th
e PresentInterval.Immediate flag is the only exception. (For more information, see PresentationInterval.) In this case, a
Present operation copies the back buffer content directly to the front buffer without waiting for the vertical retrace.
D The default swap effect is Discard.
ef
au
lt
Di
sc When a swap chain is created with a swap effect of Flip or Copy, the runtime guarantees that a Present operation will not
ar affect the content of any of the back buffers. However, meeting this guarantee can involve substantial video memory or pr
d ocessing overheads, especially when implementing flip semantics for a windowed swap chain or copy semantics for a full-
screen swap chain.
An application can use the Discard swap effect to avoid these overheads and to enable the display driver to choose the m
ost efficient presentation technique for the swap chain.
Discard is also the only swap effect that can be used when specifying a value other than None for MultiSampleType. Like a
swap chain that uses Flip, a swap chain that uses Discard might include more than one back buffer.
The swap chain is essentially a queue where 0 always indexes the back buffer that will be displayed by the next Present op
eration and from which buffers are discarded once they have been displayed. An application that uses this swap effect sho
uld update an entire back buffer before invoking a Present operation that displays it.
The debug version of the runtime overwrites the contents of discarded back buffers with random data, to enable develope
rs to verify that their applications are updating the entire back buffer surface correctly.
For a full-screen swap chain, the presentation rate is determined by the value assigned to PresentationInterval when the d
evice or swap chain is created. Unless this value is PresentInterval.Immediate, the presentation is synchronized with the ve
rtical sync of the monitor. For a windowed swap chain, the presentation is implemented by means of copy operations, and
always occurs immediately.
Fli
p The swap chain might include multiple back buffers and is essentially a circular queue that includes the front buffer. Withi
n this queue, the back buffers are always numbered sequentially from 0 to (n - 1), where n is the number of back buffers, s
o that 0 denotes the least recently presented buffer.
When Present is invoked, the queue is rotated so that the front buffer becomes the back buffer (n - 1), while the back buff
er 0 becomes the new front buffer.
For a full-screen swap chain, the presentation rate is determined by the value assigned to the PresentationInterval when t
he device or swap chain is created. Unless this value is PresentInterval.Immediate, the presentation is synchronized with th
e vertical sync of the monitor.
For a windowed swap chain, the flipping is implemented by means of copy operations, and the presentation always occur
s immediately.
Remarks
The state of the back buffer after a call to Present is well-defined by each of these swap effects, and whether the Microsoft
Direct3D device was created with a full-screen swap chain or a windowed swap chain has no effect on this state. In particular,
the Flip swap effect operates the same whether windowed or full-screen, and the Direct3D runtime guarantees this by creating
extra buffers. As a result, it is recommended that applications use Discard whenever possible to avoid any performance
penalties, because the current swap effect is always the most efficient in terms of memory consumption and performance.
Full-screen destination alpha will not work with applications that use Flip or Discard. This means that the DestinationBlend
render state will not work as expected because, from the driver's point of view, full-screen swap chains with these swap effects
do not have an explicit pixel format. The driver infers that it should take on the display format, which does not have an alpha
channel. To work around this, use Copy and check SupportsAlphaFullScreenFlipOrDiscard, which indicates whether the driver
can perform alpha blending when Flip or Discard is used.
See Also
Reference
PresentationParameters.SwapEffect Property
GraphicsDevice.Present Method
PresentationParameters.BackBufferCount Property
PresentationParameters.MultiSampleType Property
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture Class
Represents a texture resource.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public abstract class Texture : GraphicsResource
See Also
Tasks
How To: Create Custom Texture Effects
Reference
Texture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture Members
The following tables list the members exposed by the Texture type.
Public Properties
Name Description
GraphicsDevice (Inherited from GraphicsResource.)
IsDisposed (Inherited from GraphicsResource.)
LevelCount Gets the number of texture levels in a multilevel texture.
LevelOfDetail Gets or sets the highest level-of-detail mipmap stored for a managed texture.
Name (Inherited from GraphicsResource.)
Priority (Inherited from GraphicsResource.)
ResourceType (Inherited from GraphicsResource.)
Tag (Inherited from GraphicsResource.)
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
FromFile Overloaded. Creates a texture resource from a file.
GenerateMipMaps Request generation of mipmap sublevels for a render target texture.
GetCreationParameters Overloaded. Loads texture creation parameters from a file.
GetHashCode (Inherited from Object.)
GetTextureInformation Overloaded. Retrieves information about a given image file.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Save Saves a texture to a file.
ToString (Inherited from Object.)
Protected Methods
Name Description
MemberwiseClone (Inherited from Object.)
raise_Disposing (Inherited from GraphicsResource.)
Public Events
Name Description
Disposing (Inherited from GraphicsResource.)
See Also
Reference
Texture Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Texture Methods
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
FromFile Overloaded. Creates a texture resource from a file.
GenerateMipMaps Request generation of mipmap sublevels for a render target texture.
GetCreationParameters Overloaded. Loads texture creation parameters from a file.
GetHashCode (Inherited from Object.)
GetTextureInformation Overloaded. Retrieves information about a given image file.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Save Saves a texture to a file.
ToString (Inherited from Object.)
Protected Methods
Name Description
MemberwiseClone (Inherited from Object.)
raise_Disposing (Inherited from GraphicsResource.)
See Also
Reference
Texture Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Texture.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
Texture.Dispose (Boolean) Releases the unmanaged resources used by this object and optionally releases the managed resour
ces.
Texture.Dispose () (Inherited from GraphicsResource.)
Texture.Dispose (Boolean) (Inherited from GraphicsResource.)
See Also
Reference
Texture Class
Texture Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
Remarks
This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean)
method with the disposing parameter set to true. Finalize invokes Dispose(Boolean) with disposing set to false.
When the disposing parameter is true, this method releases all resources held by any managed objects that this Texture
references. This method invokes the Dispose method of each referenced object.
Note
Notes to Inheritors
Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects
disposed of in an earlier call to Dispose.
See Also
Reference
Texture Class
Texture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture.FromFile Method
Creates a texture resource from a file.
Overload List
Name Description
Texture.FromFile (GraphicsDevice, Stream) Creates a texture resource from a stream.
Texture.FromFile (GraphicsDevice, Stream, Int32) Creates a texture resource from a stream, specify
ing the number of bytes in the stream.
Texture.FromFile (GraphicsDevice, Stream, Int32, TextureCreationParameters) Loads a Texture from a file.
Texture.FromFile (GraphicsDevice, Stream, TextureCreationParameters) Loads a Texture from a file.
Texture.FromFile (GraphicsDevice, String) Creates a texture resource from a file.
Texture.FromFile (GraphicsDevice, String, Int32, Int32, Int32) Creates a texture resource from a file, specifying
the width, height, and depth of the texture in pix
els.
Texture.FromFile (GraphicsDevice, String, TextureCreationParameters) Creates a texture resource from a file, specifying
the parameters to be used in creation of the text
ure.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
Texture Class
Texture Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to use to create the texture resource.
textureStream
Stream that contains the texture data.
Return Value
The texture resource that has been created on the specified graphics device.
Exceptions
Exception type Condition
ArgumentNullException textureStream is null. The stream passed into this method cannot be null.
NotSupportedException textureStream is not readable. Streams passed into this method must be readable.
EndOfStreamException textureStream does not contain enough data to support this call.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
Texture Class
Texture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to use to create the texture resource.
textureStream
Stream that contains the texture data.
numberBytes
The number of bytes in textureStream.
Return Value
The texture resource that has been created on the specified graphics device.
Exceptions
Exception type Condition
ArgumentNullException textureStream is null. The stream passed into this method cannot be null.
NotSupportedException textureStream is not readable. Streams passed into this method must be readable.
EndOfStreamException textureStream does not contain enough data to support this call.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
Texture Class
Texture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The GraphicsDevice to associate the texture with.
textureStream
The stream to load the texture from.
numberBytes
The number of bytes in the stream.
creationParameters
Parameters to use when creating the Texture.
Return Value
The created Texture.
Exceptions
Exception type Condition
ArgumentNullException textureStream is null. The stream passed into this method cannot be null.
NotSupportedException textureStream is not readable. Streams passed into this method must be readable.
EndOfStreamException textureStream does not contain enough data to support this call.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
Texture Class
Texture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The GraphicsDevice to associate the texture with.
textureStream
The stream to load the texture from.
creationParameters
Parameters to use when creating the Texture.
Return Value
The created Texture.
Exceptions
Exception type Condition
ArgumentNullException textureStream is null. The stream passed into this method cannot be null.
NotSupportedException textureStream is not readable. Streams passed into this method must be readable.
EndOfStreamException textureStream does not contain enough data to support this call.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
Texture Class
Texture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to use to create the texture resource.
filename
The name of the file containing the texture.
Return Value
The texture resource that has been created on the specified graphics device.
Exceptions
Exception type Condition
ArgumentException filename is a zero-length string, contains only white space, or contains one or more invalid char
acters as defined by InvalidPathChars.
ArgumentNullException filename is null.
PathTooLongException The specified path, file name, or both exceed the system-defined maximum length. For example,
on Windows-based platforms, paths must be less than 248 characters, and file names must be l
ess than 260 characters.
DirectoryNotFoundException The specified path is invalid (for example, it is on an unmapped drive).
UnauthorizedAccessException The filename parameter specifies a directory, or the caller does not have the required permissio
n to access the file specified by filename.
FileNotFoundException The file specified in filename was not found.
NotSupportedException filename is in an invalid format.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
Texture Class
Texture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to use to create the texture resource.
filename
The name of the file containing the texture.
width
The width, in pixels, of the texture.
height
The height, in pixels, of the texture.
depth
The depth, in pixels, of the texture.
Return Value
The texture resource that has been created on the specified graphics device.
Exceptions
Exception type Condition
ArgumentException filename is a zero-length string, contains only white space, or contains one or more invalid char
acters as defined by InvalidPathChars.
ArgumentNullException filename is null.
PathTooLongException The specified path, file name, or both exceed the system-defined maximum length. For example,
on Windows-based platforms, paths must be less than 248 characters, and file names must be l
ess than 260 characters.
DirectoryNotFoundException The specified path is invalid (for example, it is on an unmapped drive).
UnauthorizedAccessException The filename parameter specifies a directory, or the caller does not have the required permissio
n to access the file specified by filename.
FileNotFoundException The file specified in filename was not found.
NotSupportedException filename is in an invalid format.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
Texture Class
Texture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to use to create the texture resource.
filename
The name of the file containing the texture.
creationParameters
The parameters to use when creating this texture.
Return Value
The texture resource that has been created on the specified graphics device.
Exceptions
Exception type Condition
ArgumentException filename is a zero-length string, contains only white space, or contains one or more invalid char
acters as defined by InvalidPathChars.
ArgumentNullException filename is null.
PathTooLongException The specified path, file name, or both exceed the system-defined maximum length. For example,
on Windows-based platforms, paths must be less than 248 characters, and file names must be l
ess than 260 characters.
DirectoryNotFoundException The specified path is invalid (for example, it is on an unmapped drive).
UnauthorizedAccessException The filename parameter specifies a directory, or the caller does not have the required permissio
n to access the file specified by filename.
FileNotFoundException The file specified in filename was not found.
NotSupportedException filename is in an invalid format.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
Texture Class
Texture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture.GenerateMipMaps Method
Request generation of mipmap sublevels for a render target texture.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void GenerateMipMaps (
TextureFilter filterType
)
Parameters
filterType
Determines how the texture will be filtered for each mipmap level.
Exceptions
Exception type Condition
NotSupportedException GenerateMipMaps is not supported on Xbox 360.
Remarks
This method is valid only if TextureUsage.AutoGenerateMipMap is set when calling the constructor for a render target texture.
Setting this flag indicates that mip levels should be generated, but not when they should be generated. For this case,
GenerateMipMaps hints to the driver that it should generate sublevels if it has not done so already.
Only the top texture level is accessible to the application, and as a result LevelCount will not be changed after a call to
GenerateMipMaps. The texture sublevels are not accessible since the driver creates them only when needed.
Example
In this example, a new Texture2D is created for use as a render target, the data is initialized with a call to ResolveBackBuffer,
and the generation of mipmaps for the resolved render target is requested.
C#
ResolveTexture2D renderTargetTexture;
renderTargetTexture = new ResolveTexture2D(
graphics.GraphicsDevice,
graphics.GraphicsDevice.PresentationParameters.BackBufferWidth,
graphics.GraphicsDevice.PresentationParameters.BackBufferHeight,
1,
graphics.GraphicsDevice.PresentationParameters.BackBufferFormat);
graphics.GraphicsDevice.ResolveBackBuffer(renderTargetTexture);
renderTargetTexture.GenerateMipMaps( TextureFilter.Linear );
See Also
Reference
Texture Class
Texture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture.GetCreationParameters Method
Loads texture creation parameters from a file.
Overload List
Name Description
Texture.GetCreationParameters (GraphicsDevice, Stream) Loads texture creation parameters from a stream.
Texture.GetCreationParameters (GraphicsDevice, Stream, Int32) Loads texture creation parameters from a stream, specifying t
he number of bytes in the stream.
Texture.GetCreationParameters (GraphicsDevice, String) Loads texture creation parameters from a file.
See Also
Reference
Texture Class
Texture Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
graphicsDevice
The GraphicsDevice to associate with the texture creation parameters.
textureStream
Stream containing the texture creation data.
Return Value
The texture creation parameters.
Exceptions
Exception type Condition
ArgumentNullException textureStream is null. The stream passed into this method cannot be null.
NotSupportedException textureStream is not readable. Streams passed into this method must be readable.
EndOfStreamException textureStream does not contain enough data to support this call.
See Also
Reference
Texture Class
Texture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The GraphicsDevice to associate with the texture creation parameters.
textureStream
Stream containing the texture data.
numberBytes
The number of bytes in textureStream
Return Value
The texture creation parameters.
Exceptions
Exception type Condition
ArgumentNullException textureStream is null. The stream passed into this method cannot be null.
NotSupportedException textureStream is not readable. Streams passed into this method must be readable.
EndOfStreamException textureStream does not contain enough data to support this call.
See Also
Reference
Texture Class
Texture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The GraphicsDevice to associate with the texture creation parameters.
filename
The name of the file to load the creation parameters from.
Return Value
The texture creation parameters.
Exceptions
Exception type Condition
ArgumentException filename is a zero-length string, contains only white space, or contains one or more invalid char
acters as defined by InvalidPathChars.
ArgumentNullException filename is null.
PathTooLongException The specified path, file name, or both exceed the system-defined maximum length. For example,
on Windows-based platforms, paths must be less than 248 characters, and file names must be l
ess than 260 characters.
DirectoryNotFoundException The specified path is invalid (for example, it is on an unmapped drive).
UnauthorizedAccessException The filename parameter specifies a directory, or the caller does not have the required permissio
n to access the file specified by filename.
FileNotFoundException The file specified in filename was not found.
NotSupportedException filename is in an invalid format.
See Also
Reference
Texture Class
Texture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture.GetTextureInformation Method
Retrieves information about a given image file.
Overload List
Name Description
Texture.GetTextureInformation (Stream) Retrieves information about a given image file stream.
Texture.GetTextureInformation (Stream, Int32) Retrieves information about a given image file stream, specifying the number o
f bytes in the stream.
Texture.GetTextureInformation (String) Retrieves information about a given image file.
See Also
Reference
Texture Class
Texture Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
textureStream
Stream containing the image data.
Return Value
A description of the data in the source file.
Exceptions
Exception type Condition
ArgumentNullException textureStream is null. The stream passed into this method cannot be null.
NotSupportedException textureStream is not readable. Streams passed into this method must be readable.
EndOfStreamException textureStream does not contain enough data to support this call.
See Also
Reference
Texture Class
Texture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
textureStream
Stream containing the image data.
numberBytes
The number of bytes in textureStream.
Return Value
A description of the data in the source file.
Exceptions
Exception type Condition
ArgumentNullException textureStream is null. The stream passed into this method cannot be null.
NotSupportedException textureStream is not readable. Streams passed into this method must be readable.
EndOfStreamException textureStream does not contain enough data to support this call.
See Also
Reference
Texture Class
Texture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
filename
File name of image.
Return Value
A description of the data in the source file.
Exceptions
Exception type Condition
ArgumentException filename is a zero-length string, contains only white space, or contains one or more invalid char
acters as defined by InvalidPathChars.
ArgumentNullException filename is null.
PathTooLongException The specified path, file name, or both exceed the system-defined maximum length. For example,
on Windows-based platforms, paths must be less than 248 characters, and file names must be l
ess than 260 characters.
DirectoryNotFoundException The specified path is invalid (for example, it is on an unmapped drive).
UnauthorizedAccessException The filename parameter specifies a directory, or the caller does not have the required permissio
n to access the file specified by filename.
FileNotFoundException The file specified in filename was not found.
NotSupportedException filename is in an invalid format.
See Also
Reference
Texture Class
Texture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture.Save Method
Saves a texture to a file.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Save (
string filename,
ImageFileFormat format
)
Parameters
filename
The file name of the destination image.
format
The file format to use when saving. This function supports saving to all ImageFileFormat formats except Portable Pixmap
(.ppm) and Targa/Truevision Graphics Adapter (.tga).
Remarks
This function handles conversion to and from compressed texture formats.
If the volume is nondynamic and located in video memory, Save will fail because this function cannot lock nondynamic
volumes located in video memory.
See Also
Reference
Texture Class
Texture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture Properties
Public Properties
Name Description
GraphicsDevice (Inherited from GraphicsResource.)
IsDisposed (Inherited from GraphicsResource.)
LevelCount Gets the number of texture levels in a multilevel texture.
LevelOfDetail Gets or sets the highest level-of-detail mipmap stored for a managed texture.
Name (Inherited from GraphicsResource.)
Priority (Inherited from GraphicsResource.)
ResourceType (Inherited from GraphicsResource.)
Tag (Inherited from GraphicsResource.)
See Also
Reference
Texture Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Texture.LevelCount Property
Gets the number of texture levels in a multilevel texture.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int LevelCount { get; }
Property Value
The number of texture levels in the multilevel texture.
See Also
Reference
Texture Class
Texture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture.LevelOfDetail Property
Gets or sets the highest level-of-detail mipmap stored for a managed texture.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int LevelOfDetail { get; set; }
Property Value
The highest level-of-detail mipmap stored for a managed texture. The default value is 0, causing loading of all mipmapped
textures.
Remarks
For example, a 512×512 texture has the following dimensions for each mipmap level: level 0 is 512×512, level 1 is 256×256,
level 2 is 128×128, level 3 is 64×64, and so on.
For this example, a value of 3 indicates that the driver only loads mipmaps of size 64×64 and smaller into video memory.
This member is ignored for games targeting the Xbox 360 platform because copying of texture data from system memory to
video memory is not permitted.
See Also
Reference
Texture Class
Texture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture2D Class
Represents a 2D grid of texels.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class Texture2D : Texture
Remarks
A texel represents the smallest unit of a texture that can be read from or written to by the GPU. A texel is composed of 1 to 4
components. Specifically, a texel may be any one of the available texture formats represented in the SurfaceFormat
enumeration.
A Texture2D resource contains a 2D grid of texels. Each texel is addressable by a u, v vector. Since it is a texture resource, it may
contain mipmap levels. Figure 1 shows a fully populated 2D texture resource.
Texture2D Members
The following tables list the members exposed by the Texture2D type.
Public Constructors
Name Description
Texture2D Creates an uninitialized Texture2D resource of the specified dimensions. To initialize a Texture2D from an existin
g file, see the static method ContentManager.Load or Texture2D.FromFile.
Public Properties
Name Description
Format Gets the pixel format of this texture resource.
GraphicsDevice (Inherited from GraphicsResource.)
Height Gets the height of this texture resource, in pixels.
IsDisposed (Inherited from GraphicsResource.)
LevelCount (Inherited from Texture.)
LevelOfDetail (Inherited from Texture.)
Name (Inherited from GraphicsResource.)
Priority (Inherited from GraphicsResource.)
ResourceType (Inherited from GraphicsResource.)
Tag (Inherited from GraphicsResource.)
TextureUsage Gets the state of the related TextureUsage enumeration.
Width Gets the width of this texture resource, in pixels.
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
FromFile Overloaded. Creates a texture resource from a file.
GenerateMipMaps (Inherited from Texture.)
GetCreationParameters (Inherited from Texture.)
GetData Overloaded. Copies texture data into an array.
GetHashCode (Inherited from Object.)
GetTextureInformation (Inherited from Texture.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Save (Inherited from Texture.)
SetData Overloaded. Copies array data to the texture.
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_Disposing (Inherited from GraphicsResource.)
Public Events
Name Description
Disposing (Inherited from GraphicsResource.)
See Also
Reference
Texture2D Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
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 or Texture2D.FromFile.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Texture2D (
GraphicsDevice graphicsDevice,
int width,
int height,
int numberLevels,
TextureUsage usage,
SurfaceFormat format
)
Parameters
graphicsDevice
The GraphicsDevice used to display the texture.
width
The width of the texture, in pixels. This value must be a power of two if the RequiresPower2 property of graphicsDevice is
true. If this value is 0, a value of 1 is used.
height
The height of the texture, in pixels. This value must be a power of two if the RequiresPower2 property of graphicsDevice is
true. If this value is 0, a value of 1 is used.
numberLevels
The number of downsampled surfaces to create when preprocessing the texture. These smaller versions of the texture,
known as mipmap levels, are used when the texture is minified to fit a smaller area than the original texture size. The chain of
downsampled surfaces associated with a texture is sometimes called a mipmap chain.
If numberLevels is zero, all texture sublevels down to 1×1 pixels will be generated for hardware that supports mipmapped
textures. Use LevelCount to see the number of levels generated.
usage
Options identifying the behaviors of this texture resource.
format
A SurfaceFormat value specifying the requested pixel format for the texture. The returned texture may be of a different
format if the device does not support the requested format. Applications should check the format of the returned texture to
ensure that it matches the requested format.
Exceptions
Exception type Condition
ArgumentNullException graphicsDevice is null.
ArgumentException
One of the following conditions is true:
width is larger than MaxTextureWidth.
height is larger than MaxTextureHeight.
numberLevels is greater than 32. Textures have a maximum of 32 levels.
usage is not a valid value. Texture resource can be created only with the following Text
ureUsage options: TextureUsage.AutoGenerateMipMap, TextureUsage.Tiled, and
TextureUsage.Linear.
format is SurfaceFormat.Unknown. Textures cannot be created using
SurfaceFormat.Unknown.
The parameters specified are not compatible:
format and numberLevels are incompatible. Multi-element textures of type
SurfaceFormat.Multi2Bgra32 cannot be mipmapped, set numberLevels to 1.
usage and numberLevels are incompatible. Textures specifying the usage
TextureUsage.AutoGenerateMipMap must set numberLevels to either 0 or 1.
The format and usage requested are not supported by the graphics device. The device d
oes not support creating a texture of the given format with the given TextureUsage.
ArgumentOutOfRangeException width or height is less than or equal to zero; width and height must be greater than zero.
OutOfVideoMemoryException Unable to create this resource on the graphics device.
Remarks
A texel represents the smallest unit of a texture that can be read from or written to by the GPU. A texel is composed of 1 to 4
components. Specifically, a texel may be any one of the available texture formats represented in the SurfaceFormat
enumeration.
A Texture2D resource contains a 2D grid of texels. Each texel is addressable by a u, v vector. Since it is a texture resource, it may
contain mipmap levels. Figure 1 shows a fully populated 2D texture resource.
See Also
Reference
ContentManager.Load Generic Method
Texture2D.FromFile Method
Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture2D Methods
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
FromFile Overloaded. Creates a texture resource from a file.
GenerateMipMaps (Inherited from Texture.)
GetCreationParameters (Inherited from Texture.)
GetData Overloaded. Copies texture data into an array.
GetHashCode (Inherited from Object.)
GetTextureInformation (Inherited from Texture.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Save (Inherited from Texture.)
SetData Overloaded. Copies array data to the texture.
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_Disposing (Inherited from GraphicsResource.)
See Also
Reference
Texture2D Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Texture2D.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
Texture2D.Dispose (Boolean) Releases the unmanaged resources used by the Texture2D and optionally releases the managed
resources.
Texture2D.Dispose () (Inherited from GraphicsResource.)
See Also
Reference
Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
Remarks
This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean)
method with the disposing parameter set to true. Finalize invokes Dispose(Boolean) with disposing set to false.
When the disposing parameter is true, this method releases all resources held by any managed objects that this Texture2D
references. This method invokes the Dispose method of each referenced object.
Note
Notes to Inheritors
Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects
disposed of in an earlier call to Dispose.
See Also
Reference
Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture2D.Finalize Method
Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the
object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void Finalize ()
Remarks
This method overrides System.Object.Finalize. Application code should not call this method; an object's Finalize method is
automatically invoked during garbage collection, unless a call to the GC.SuppressFinalize method has disabled finalization by
the garbage collector.
See Also
Reference
Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture2D.FromFile Method
Creates a texture resource from a file.
Overload List
Name Description
Texture2D.FromFile (GraphicsDevice, Stream) Creates a texture resource from a stream.
Texture2D.FromFile (GraphicsDevice, Stream, Int32) Creates a texture resource from a stream, spe
cifying the number of bytes in the stream.
Texture2D.FromFile (GraphicsDevice, Stream, Int32, TextureCreationParameters) Creates a texture resource from a stream, spe
cifying the number of bytes in the stream and
the texture creation parameters to use.
Texture2D.FromFile (GraphicsDevice, Stream, TextureCreationParameters) Creates a texture resource from a stream, spe
cifying the parameters to be used in creation
of the texture.
Texture2D.FromFile (GraphicsDevice, String) Creates a texture resource from a file.
Texture2D.FromFile (GraphicsDevice, String, Int32, Int32) Creates a texture resource from a file, specifyi
ng the width and height of the texture in pixel
s.
Texture2D.FromFile (GraphicsDevice, String, TextureCreationParameters) Creates a texture resource from a file, specifyi
ng the parameters to be used in creation of th
e texture.
Texture2D.FromFile (GraphicsDevice, String, Int32, Int32, Int32) (Inherited from Texture.)
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to use to create the texture resource.
textureStream
Stream containing the texture data.
Return Value
The texture resource that has been created on the specified graphics device.
Exceptions
Exception type Condition
ArgumentNullException textureStream is null. The stream passed into this method cannot be null.
NotSupportedException textureStream is not readable. Streams passed into this method must be readable.
EndOfStreamException textureStream does not contain enough data to support this call.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to use to create the texture resource.
textureStream
Stream containing the texture data.
numberBytes
The number of bytes in textureStream.
Return Value
The texture resource that has been created on the specified graphics device.
Exceptions
Exception type Condition
ArgumentNullException textureStream is null. The stream passed into this method cannot be null.
NotSupportedException textureStream is not readable. Streams passed into this method must be readable.
EndOfStreamException textureStream does not contain enough data to support this call.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to use to create the texture resource.
textureStream
Stream containing the volume texture data.
numberBytes
The number of bytes in textureStream.
creationParameters
The parameters to use when creating this texture.
Return Value
The texture resource that has been created on the specified graphics device.
Exceptions
Exception type Condition
ArgumentNullException textureStream is null. The stream passed into this method cannot be null.
NotSupportedException textureStream is not readable. Streams passed into this method must be readable.
EndOfStreamException textureStream does not contain enough data to support this call.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to use to create the texture resource.
textureStream
Stream containing the texture data.
creationParameters
The parameters to use when creating this texture.
Return Value
The texture resource that has been created on the specified graphics device.
Exceptions
Exception type Condition
ArgumentNullException textureStream is null. The stream passed into this method cannot be null.
NotSupportedException textureStream is not readable. Streams passed into this method must be readable.
EndOfStreamException textureStream does not contain enough data to support this call.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to use to create the texture resource.
filename
The name of the file containing the texture.
Return Value
The texture resource that has been created on the specified graphics device.
Exceptions
Exception type Condition
ArgumentException filename is a zero-length string, contains only white space, or contains one or more invalid char
acters as defined by InvalidPathChars.
ArgumentNullException filename is null.
PathTooLongException The specified path, file name, or both exceed the system-defined maximum length. For example,
on Windows-based platforms, paths must be less than 248 characters, and file names must be l
ess than 260 characters.
DirectoryNotFoundException The specified path is invalid (for example, it is on an unmapped drive).
UnauthorizedAccessException The filename parameter specifies a directory, or the caller does not have the required permissio
n to access the file specified by filename.
FileNotFoundException The file specified in filename was not found.
NotSupportedException filename is in an invalid format.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to use to create the texture resource.
filename
The name of the file containing the texture.
width
The width, in pixels, of the texture.
height
The height, in pixels, of the texture.
Return Value
The texture resource that has been created on the specified graphics device.
Exceptions
Exception type Condition
ArgumentException filename is a zero-length string, contains only white space, or contains one or more invalid char
acters as defined by InvalidPathChars.
ArgumentNullException filename is null.
PathTooLongException The specified path, file name, or both exceed the system-defined maximum length. For example,
on Windows-based platforms, paths must be less than 248 characters, and file names must be l
ess than 260 characters.
DirectoryNotFoundException The specified path is invalid (for example, it is on an unmapped drive).
UnauthorizedAccessException The filename parameter specifies a directory, or the caller does not have the required permissio
n to access the file specified by filename.
FileNotFoundException The file specified in filename was not found.
NotSupportedException filename is in an invalid format.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to use to create the texture resource.
filename
The name of the file containing the texture.
creationParameters
The parameters to use when creating this texture.
Return Value
The texture resource that has been created on the specified graphics device.
Exceptions
Exception type Condition
ArgumentException filename is a zero-length string, contains only white space, or contains one or more invalid char
acters as defined by InvalidPathChars.
ArgumentNullException filename is null.
PathTooLongException The specified path, file name, or both exceed the system-defined maximum length. For example,
on Windows-based platforms, paths must be less than 248 characters, and file names must be l
ess than 260 characters.
DirectoryNotFoundException The specified path is invalid (for example, it is on an unmapped drive).
UnauthorizedAccessException The filename parameter specifies a directory, or the caller does not have the required permissio
n to access the file specified by filename.
FileNotFoundException The file specified in filename was not found.
NotSupportedException filename is in an invalid format.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture2D.GetData Method
Copies texture data into an array.
Overload List
Name Description
Texture2D.GetData (Int32, Nullable<Rectangle>, T[], Int32, Int32) Copies texture data into an array.
Texture2D.GetData (T[]) Copies texture data into an array.
Texture2D.GetData (T[], Int32, Int32) Copies texture data into an array.
See Also
Reference
Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Type Parameters
T
The type of the elements in the array. This is usually a Microsoft.Xna.Framework.Graphics.PackedVector type which matches
the Format of the texture, but it can be any fundamental type that matches the bit size of the surface format.
Parameters
level
The mipmap level to copy from.
rect
The section of the texture to copy. null indicates the data will be copied from the entire texture.
data
The array to receive texture data.
startIndex
The index of the element in the array at which to start copying.
elementCount
The number of elements to copy.
Exceptions
Exception type Condition
ArgumentNullException data must be of sufficient length to receive the data.
InvalidOperationException The vertex stride is larger than the vertex buffer, or the vertex stride is too small for the type of data
requested.
Example
In this example, the color of the pixel beneath the mouse is retrieved from the back buffer.
C#
if (Mouse.GetState().LeftButton == ButtonState.Pressed && // If the left button is presse
d
Mouse.GetState().X > 0 && Mouse.GetState().Y > 0 && // and we are inside the game w
indow
Mouse.GetState().X < graphics.GraphicsDevice.PresentationParameters.BackBufferWidth &&
Mouse.GetState().Y < graphics.GraphicsDevice.PresentationParameters.BackBufferHeight)
{
backBufferData = new ResolveTexture2D(
graphics.GraphicsDevice,
graphics.GraphicsDevice.PresentationParameters.BackBufferWidth,
graphics.GraphicsDevice.PresentationParameters.BackBufferHeight,
1,
graphics.GraphicsDevice.PresentationParameters.BackBufferFormat);
Rectangle sourceRectangle =
new Rectangle(Mouse.GetState().X, Mouse.GetState().Y, 1, 1);
Color[] retrievedColor = new Color[1];
graphics.GraphicsDevice.ResolveBackBuffer(backBufferData);
backBufferData.GetData<Color>(
0,
sourceRectangle,
retrievedColor,
0,
1);
}
See Also
Reference
Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of the elements in the array. This is usually a Microsoft.Xna.Framework.Graphics.PackedVector type that matches
the Format of the texture, but it can be any fundamental type that matches the bit size of the surface format.
Parameters
data
The array to receive texture data.
Exceptions
Exception type Condition
ArgumentNullException data must be of sufficient length to receive the data.
InvalidOperationException The vertex stride is larger than the vertex buffer, or the vertex stride is too small for the type of data
requested.
Example
In this example, the color of the pixel beneath the mouse is retrieved from the back buffer.
C#
if (Mouse.GetState().LeftButton == ButtonState.Pressed && // If the left button is presse
d
Mouse.GetState().X > 0 && Mouse.GetState().Y > 0 && // and we are inside the game w
indow
Mouse.GetState().X < graphics.GraphicsDevice.PresentationParameters.BackBufferWidth &&
Mouse.GetState().Y < graphics.GraphicsDevice.PresentationParameters.BackBufferHeight)
{
backBufferData = new ResolveTexture2D(
graphics.GraphicsDevice,
graphics.GraphicsDevice.PresentationParameters.BackBufferWidth,
graphics.GraphicsDevice.PresentationParameters.BackBufferHeight,
1,
graphics.GraphicsDevice.PresentationParameters.BackBufferFormat);
Rectangle sourceRectangle =
new Rectangle(Mouse.GetState().X, Mouse.GetState().Y, 1, 1);
graphics.GraphicsDevice.ResolveBackBuffer(backBufferData);
backBufferData.GetData<Color>(
0,
sourceRectangle,
retrievedColor,
0,
1);
}
See Also
Reference
Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of the elements in the array. This is usually a Microsoft.Xna.Framework.Graphics.PackedVector type that matches
the Format of the texture, but it can be any fundamental type that matches the bit size of the surface format.
Parameters
data
The array to receive texture data.
startIndex
The index of the element in the array at which to start copying.
elementCount
The number of elements to copy.
Exceptions
Exception type Condition
ArgumentNullException data must be of sufficient length to receive the data.
InvalidOperationException The vertex stride is larger than the vertex buffer, or the vertex stride is too small for the type of data
requested.
Remarks An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or
SetData methods) a resource that is currently set on a graphics device.
Example
In this example, the color of the pixel beneath the mouse is retrieved from the back buffer.
C#
if (Mouse.GetState().LeftButton == ButtonState.Pressed && // If the left button is presse
d
Mouse.GetState().X > 0 && Mouse.GetState().Y > 0 && // and we are inside the game w
indow
Mouse.GetState().X < graphics.GraphicsDevice.PresentationParameters.BackBufferWidth &&
Mouse.GetState().Y < graphics.GraphicsDevice.PresentationParameters.BackBufferHeight)
{
backBufferData = new ResolveTexture2D(
graphics.GraphicsDevice,
graphics.GraphicsDevice.PresentationParameters.BackBufferWidth,
graphics.GraphicsDevice.PresentationParameters.BackBufferHeight,
1,
graphics.GraphicsDevice.PresentationParameters.BackBufferFormat);
Rectangle sourceRectangle =
new Rectangle(Mouse.GetState().X, Mouse.GetState().Y, 1, 1);
backBufferData.GetData<Color>(
0,
sourceRectangle,
retrievedColor,
0,
1);
}
See Also
Reference
Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture2D.SetData Method
Copies array data to the texture.
Overload List
Name Description
Texture2D.SetData (Int32, Nullable<Rectangle>, T[], Int32, Int32, SetDataOptions) Copies array data to the texture.
Texture2D.SetData (T[]) Copies array data to the texture at mipmap l
evel 0.
Texture2D.SetData (T[], Int32, Int32, SetDataOptions) Copies array data to the texture at mipmap l
evel 0.
Exceptions
Exception type Condition
InvalidOperationException The size of the data passed in is too large or too small for this resource.
See Also
Reference
Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Type Parameters
T
The type of data to set.
Parameters
level
The mipmap level where the data will be placed.
rect
The section of the texture where the data will be placed. null indicates the data will be copied over the entire texture.
data
The array of data to copy. If rect is null, the number of elements in the array must be equal to the size of the texture, which is
Width × Height; otherwise, the number of elements in the array should equal the size of the rectangle specified.
startIndex
The index of the element in the array at which to start copying.
elementCount
The number of elements to copy.
options
Option that specifies whether existing data in the buffer will be kept after this operation.
Exceptions
Exception type Condition
InvalidOperationException The size of the data passed in is too large or too small for this resource.
Remarks An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or
SetData methods) a resource that is currently set on a graphics device.
Caution
Here is a tip for rendering objects within the Draw method of an Xbox 360 game. Do not use SetData when writing data to v
ertex buffers, index buffers, and textures. This method may lead to graphics corruption or crashes.
This is because, in cases where the size of the back buffer and depth-stencil buffer exceed the size of the Xbox 360 10 MB of e
mbedded memory (EDRAM), predicated tiling is utilized on this platform to compensate for the additional memory requirem
ents. Predicated tiling is a process by which scene rendering is performed multiple times on subsections of the final render ta
rget dimensions.
When predicated tiling has been triggered, the drawing commands contained in the Draw function are not submitted until
Present is called. (Note that Draw implicitly calls Present at the end of this method.) In this case, these resources are not avail
able for modification until the GPU is finished with presenting the entire frame.
Example
This example demonstrates the use of the rect argument to set a single pixel in a texture.
C#
texture2D.SetData<Color>(
0,
new Rectangle(randomX, randomY, 1, 1),
new Color[] { Color.White },
0,
1,
SetDataOptions.None
);
See Also
Concepts
Predicated Tiling
Reference
Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of the elements in the array.
Parameters
data
The array of data to copy. The number of elements in the array must be equal to the size of the texture, which is Width ×
Height.
Exceptions
Exception type Condition
InvalidOperationException The size of the data passed in is too large or too small for this resource.
Remarks
Caution
Here is a tip for rendering objects within the Draw method of an Xbox 360 game. Do not use SetData when writing data to v
ertex buffers, index buffers, and textures. This method may lead to graphics corruption or crashes.
This is because, in cases where the size of the back buffer and depth-stencil buffer exceed the size of the Xbox 360 10 MB of e
mbedded memory (EDRAM), predicated tiling is utilized on this platform to compensate for the additional memory requirem
ents. Predicated tiling is a process by which scene rendering is performed multiple times on subsections of the final render ta
rget dimensions.
When predicated tiling has been triggered, the drawing commands contained in the Draw function are not submitted until
Present is called. (Note that Draw implicitly calls Present at the end of this method.) In this case, these resources are not avail
able for modification until the GPU is finished with presenting the entire frame.
An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or SetData
methods) a resource that is currently set on a graphics device.
See Also
Concepts
Predicated Tiling
Reference
Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of the elements in the array. Generally the type for this array will allow for elements in the same size as specified for
the Format property of the texture.
Parameters
data
The array of data to copy.
startIndex
The index of the element in the array at which to start copying.
elementCount
The number of elements to copy. This must be equal to the size of the texture, which is Width × Height.
options
Option that specifies whether existing data in the buffer will be kept after this operation.
Exceptions
Exception type Condition
InvalidOperationException The size of the data passed in is too large or too small for this resource.
Remarks An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or
SetData methods) a resource that is currently set on a graphics device.
Caution
Here is a tip for rendering objects within the Draw method of an Xbox 360 game. Do not use SetData when writing data to v
ertex buffers, index buffers, and textures. This method may lead to graphics corruption or crashes.
This is because, in cases where the size of the back buffer and depth-stencil buffer exceed the size of the Xbox 360 10 MB of e
mbedded memory (EDRAM), predicated tiling is utilized on this platform to compensate for the additional memory requirem
ents. Predicated tiling is a process by which scene rendering is performed multiple times on subsections of the final render ta
rget dimensions.
When predicated tiling has been triggered, the drawing commands contained in the Draw function are not submitted until
Present is called. (Note that Draw implicitly calls Present at the end of this method.) In this case, these resources are not avail
able for modification until the GPU is finished with presenting the entire frame.
See Also
Concepts
Predicated Tiling
Reference
Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture2D.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture2D Properties
Public Properties
Name Description
Format Gets the pixel format of this texture resource.
GraphicsDevice (Inherited from GraphicsResource.)
Height Gets the height of this texture resource, in pixels.
IsDisposed (Inherited from GraphicsResource.)
LevelCount (Inherited from Texture.)
LevelOfDetail (Inherited from Texture.)
Name (Inherited from GraphicsResource.)
Priority (Inherited from GraphicsResource.)
ResourceType (Inherited from GraphicsResource.)
Tag (Inherited from GraphicsResource.)
TextureUsage Gets the state of the related TextureUsage enumeration.
Width Gets the width of this texture resource, in pixels.
See Also
Reference
Texture2D Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Texture2D.Format Property
Gets the pixel format of this texture resource.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public SurfaceFormat Format { get; }
Property Value
The pixel format of this texture resource.
See Also
Reference
Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture2D.Height Property
Gets the height of this texture resource, in pixels.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Height { get; }
Property Value
The height of this texture resource, in pixels.
See Also
Reference
Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture2D.TextureUsage Property
Gets the state of the related TextureUsage enumeration.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureUsage TextureUsage { get; }
Property Value
Indicates how the application uses the texture.
See Also
Reference
Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture2D.Width Property
Gets the width of this texture resource, in pixels.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Width { get; }
Property Value
The width of this texture resource, in pixels.
See Also
Reference
Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture3D Class
Represents a 3D volume of texels.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class Texture3D : Texture
Remarks
A texel represents the smallest unit of a texture that can be read from or written to by the GPU. A texel is composed of 1 to 4
components. Specifically, a texel may be any one of the available texture formats represented in the SurfaceFormat
enumeration.
A Texture3D resource (also known as a volume texture) contains a 3D volume of texels. Since it is a texture resource, it may
contain mipmap levels. Figure 1 shows a fully populated Texture3D resource.
Texture3D Members
The following tables list the members exposed by the Texture3D type.
Public Constructors
Name Description
Texture3D Creates an uninitialized volume texture resource of the given dimensions, specifying the memory management
mode for the resource. To initialize a Texture3D from an existing file, see the static method ContentManager.Load
or FromFile.
Public Properties
Name Description
Depth Gets the depth of this volume texture resource, in pixels.
Format Gets the pixel format for this texture resource.
GraphicsDevice (Inherited from GraphicsResource.)
Height Gets the height of this texture resource, in pixels.
IsDisposed (Inherited from GraphicsResource.)
LevelCount (Inherited from Texture.)
LevelOfDetail (Inherited from Texture.)
Name (Inherited from GraphicsResource.)
Priority (Inherited from GraphicsResource.)
ResourceType (Inherited from GraphicsResource.)
Tag (Inherited from GraphicsResource.)
TextureUsage Gets the state of the related TextureUsage enumeration.
Width Gets the width of this texture resource, in pixels.
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
FromFile Overloaded. Creates a volume texture resource from a file.
GenerateMipMaps (Inherited from Texture.)
GetCreationParameters (Inherited from Texture.)
GetData Overloaded. Gets a copy of the texture data.
GetHashCode (Inherited from Object.)
GetTextureInformation (Inherited from Texture.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Save (Inherited from Texture.)
SetData Overloaded. Copies array data to the texture.
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_Disposing (Inherited from GraphicsResource.)
Public Events
Name Description
Disposing (Inherited from GraphicsResource.)
See Also
Reference
Texture3D Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Texture3D Constructor
Creates an uninitialized volume texture resource of the given dimensions, specifying the memory management mode for the
resource. To initialize a Texture3D from an existing file, see the static method ContentManager.Load or FromFile.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Texture3D (
GraphicsDevice graphicsDevice,
int width,
int height,
int depth,
int numberLevels,
TextureUsage usage,
SurfaceFormat format
)
Parameters
graphicsDevice
The GraphicsDevice that will display the volume texture.
width
The width, in pixels, of the top-level of the volume texture. This value must be a power of two if the RequiresPower2 property
of graphicsDevice is true. The pixel dimensions of subsequent levels will be the truncated value of half of the previous level's
pixel dimension (independently). Each dimension clamps at a size of 1 pixel. Thus, if the division by two results in 0 (zero), 1
will be taken instead. The maximum dimension that a driver supports (for width, height, and depth) can be found in
MaxVolumeExtent.
height
The height, in pixels, of the top-level of the volume texture. This value must be a power of two if the RequiresPower2
property of graphicsDevice is true. The pixel dimensions of subsequent levels will be the truncated value of half of the
previous level's pixel dimension (independently). Each dimension clamps at a size of 1 pixel. Thus, if the division by two
results in 0 (zero), 1 will be taken instead. The maximum dimension that a driver supports (for width, height, and depth) can
be found in MaxVolumeExtent.
depth
The depth, in pixels, of the top-level of the volume texture. This value must be a power of two if the
RequiresVolumeMapPower2 property of graphicsDevice is true. The pixel dimensions of subsequent levels will be the
truncated value of half of the previous level's pixel dimension (independently). Each dimension clamps at a size of 1 pixel.
Thus, if the division by two results in 0 (zero), 1 will be taken instead. The maximum dimension that a driver supports (for
width, height, and depth) can be found in MaxVolumeExtent.
numberLevels
The number of downsampled surfaces to create when preprocessing the texture. These smaller versions of the texture,
known as mipmap levels, are used when the texture is minified to fit a smaller area than the original texture size. The chain of
downsampled surfaces associated with a texture is sometimes called a mipmap chain.
If numberLevels is zero, all texture sublevels down to 1×1 pixels will be generated for hardware that supports mipmapped
textures. Use LevelCount to see the number of levels generated.
usage
Options identifying the behaviors of this texture resource.
format
The format of all levels in the volume texture resource.
Exceptions
Exception type Condition
ArgumentNullException graphicsDevice is null.
ArgumentOutOfRangeException width, height, or depth is less than or equal to zero. width, height and depth must be greater t
han zero.
ArgumentException
One of the following conditions is true:
numberLevels is too large for a texture cube of this size.
numberLevels is greater than 32. Textures have a maximum of 32 levels.
format is SurfaceFormat.Unknown. Textures cannot be created using
SurfaceFormat.Unknown.
usage is not a valid value. Texture resources can only be created with the following Text
ureUsage options: TextureUsage.AutoGenerateMipMap, TextureUsage.Tiled, and
TextureUsage.Linear.
The combination of width, height, and depth requested results in a resource that is too l
arge.
format and numberLevels are incompatible. Multi-element textures of type
SurfaceFormat.Multi2Bgra32 cannot be mipmapped, set numberLevels to 1.
The graphics device does not support the requested format and usage. The device does
not support creating a texture of the given format with the given TextureUsage.
Texture3D Methods
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
FromFile Overloaded. Creates a volume texture resource from a file.
GenerateMipMaps (Inherited from Texture.)
GetCreationParameters (Inherited from Texture.)
GetData Overloaded. Gets a copy of the texture data.
GetHashCode (Inherited from Object.)
GetTextureInformation (Inherited from Texture.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Save (Inherited from Texture.)
SetData Overloaded. Copies array data to the texture.
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_Disposing (Inherited from GraphicsResource.)
See Also
Reference
Texture3D Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Texture3D.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
Texture3D.Dispose (Boolean) Releases the unmanaged resources used by the Texture3D and optionally releases the managed
resources.
Texture3D.Dispose () (Inherited from GraphicsResource.)
See Also
Reference
Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
Remarks
This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean)
method with the disposing parameter set to true. Finalize invokes Dispose(Boolean) with disposing set to false.
When the disposing parameter is true, this method releases all resources held by any managed objects that this Texture3D
references. This method invokes the Dispose method of each referenced object.
Note
Notes to Inheritors
Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects
disposed of in an earlier call to Dispose.
See Also
Reference
Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture3D.Finalize Method
Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the
object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void Finalize ()
Remarks
This method overrides System.Object.Finalize. Application code should not call this method; an object's Finalize method is
automatically invoked during garbage collection, unless a call to the GC.SuppressFinalize method has disabled finalization by
the garbage collector.
See Also
Reference
Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture3D.FromFile Method
Creates a volume texture resource from a file.
Overload List
Name Description
Texture3D.FromFile (GraphicsDevice, Stream) Creates a volume texture resource from a stre
am.
Texture3D.FromFile (GraphicsDevice, Stream, Int32) Creates a volume texture resource from a stre
am, specifying the number of bytes in the stre
am.
Texture3D.FromFile (GraphicsDevice, Stream, Int32, TextureCreationParameters) Creates a volume texture resource from a stre
am, specifying the number of bytes in the stre
am and the texture creation parameters to us
e.
Texture3D.FromFile (GraphicsDevice, Stream, TextureCreationParameters) Creates a volume texture resource from a stre
am, specifying the parameters to use for the t
exture creation.
Texture3D.FromFile (GraphicsDevice, String) Creates a volume texture resource from a file.
Texture3D.FromFile (GraphicsDevice, String, Int32, Int32, Int32) Creates a volume texture resource from a file,
specifying the width, height, and depth in pixe
ls.
Texture3D.FromFile (GraphicsDevice, String, TextureCreationParameters) Creates a volume texture resource from a file,
specifying the parameters to be used in creati
on of the texture.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to use to create the texture resource.
textureStream
Stream containing the volume texture data.
Return Value
The texture resource that has been created on the specified graphics device.
Exceptions
Exception type Condition
ArgumentNullException textureStream is null. The stream passed into this method cannot be null.
NotSupportedException textureStream is not readable. Streams passed into this method must be readable.
EndOfStreamException textureStream does not contain enough data to support this call.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to use to create the texture resource.
textureStream
Stream containing the texture data.
numberBytes
The number of bytes in textureStream.
Return Value
The texture resource that has been created on the specified graphics device.
Exceptions
Exception type Condition
ArgumentNullException textureStream is null. The stream passed into this method cannot be null.
NotSupportedException textureStream is not readable. Streams passed into this method must be readable.
EndOfStreamException textureStream does not contain enough data to support this call.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to use to create the texture resource.
textureStream
Stream containing the volume texture data.
numberBytes
The number of bytes in textureStream.
creationParameters
The parameters to use when creating this texture.
Return Value
The texture resource that has been created on the specified graphics device.
Exceptions
Exception type Condition
ArgumentNullException textureStream is null. The stream passed into this method cannot be null.
NotSupportedException textureStream is not readable. Streams passed into this method must be readable.
EndOfStreamException textureStream does not contain enough data to support this call.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to use to create the texture resource.
textureStream
Stream containing the texture data.
creationParameters
Texture creation options.
Return Value
The texture resource that has been created on the specified graphics device.
Exceptions
Exception type Condition
ArgumentNullException textureStream is null. The stream passed into this method cannot be null.
NotSupportedException textureStream is not readable. Streams passed into this method must be readable.
EndOfStreamException textureStream does not contain enough data to support this call.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to use to create the texture resource.
filename
The name of the file containing the texture.
Return Value
The texture resource that has been created on the specified graphics device.
Exceptions
Exception type Condition
ArgumentException filename is a zero-length string, contains only white space, or contains one or more invalid char
acters as defined by InvalidPathChars.
ArgumentNullException filename is null.
PathTooLongException The specified path, file name, or both exceed the system-defined maximum length. For example,
on Windows-based platforms, paths must be less than 248 characters, and file names must be l
ess than 260 characters.
DirectoryNotFoundException The specified path is invalid (for example, it is on an unmapped drive).
UnauthorizedAccessException The filename parameter specifies a directory, or the caller does not have the required permissio
n to access the file specified by filename.
FileNotFoundException The file specified in filename was not found.
NotSupportedException filename is in an invalid format.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to use to create the texture resource.
filename
The name of the file containing the texture.
width
The width, in pixels, of the texture.
height
The height, in pixels, of the texture.
depth
The depth, in pixels, of the texture.
Return Value
The texture resource that has been created on the specified graphics device.
Exceptions
Exception type Condition
ArgumentException filename is a zero-length string, contains only white space, or contains one or more invalid char
acters as defined by InvalidPathChars.
ArgumentNullException filename is null.
PathTooLongException The specified path, file name, or both exceed the system-defined maximum length. For example,
on Windows-based platforms, paths must be less than 248 characters, and file names must be l
ess than 260 characters.
DirectoryNotFoundException The specified path is invalid (for example, it is on an unmapped drive).
UnauthorizedAccessException The filename parameter specifies a directory, or the caller does not have the required permissio
n to access the file specified by filename.
FileNotFoundException The file specified in filename was not found.
NotSupportedException filename is in an invalid format.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to use to create the texture resource.
filename
The name of the file containing the texture.
creationParameters
The parameters to use when creating this texture.
Return Value
The texture resource that has been created on the specified graphics device.
Exceptions
Exception type Condition
ArgumentException filename is a zero-length string, contains only white space, or contains one or more invalid char
acters as defined by InvalidPathChars.
ArgumentNullException filename is null.
PathTooLongException The specified path, file name, or both exceed the system-defined maximum length. For example,
on Windows-based platforms, paths must be less than 248 characters, and file names must be l
ess than 260 characters.
DirectoryNotFoundException The specified path is invalid (for example, it is on an unmapped drive).
UnauthorizedAccessException The filename parameter specifies a directory, or the caller does not have the required permissio
n to access the file specified by filename.
FileNotFoundException The file specified in filename was not found.
NotSupportedException filename is in an invalid format.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture3D.GetData Method
Gets a copy of the texture data.
Overload List
Name Description
Texture3D.GetData (Int32, Int32, Int32, Int32, Int32, Int32, Int32, T[], Int32, Int32) Gets a copy of the texture data, specifying the
level and dimensions of the volume texture to
copy.
Texture3D.GetData (T[]) Gets a copy of the texture data.
Texture3D.GetData (T[], Int32, Int32) Gets a copy of the texture data, specifying the
starting index and number of elements to cop
y.
See Also
Reference
Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Type Parameters
T
Type of value to return.
Parameters
level
The mipmap level where the data will be placed.
left
Position of the left side of the box on the x-axis.
top
Position of the top of the box on the y-axis.
right
Position of the right side of the box on the x-axis.
bottom
Position of the bottom of the box on the y-axis.
front
Position of the front of the box on the z-axis.
back
Position of the back of the box on the z-axis.
data
An array to fill with data.
startIndex
The index of the element in the array at which to start copying.
elementCount
The number of elements to copy.
See Also
Reference
Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
Type of value to return.
Parameters
data
An array to fill with data.
Remarks An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or
SetData methods) a resource that is currently set on a graphics device.
See Also
Reference
Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
Type of value to return.
Parameters
data
An array to fill with data.
startIndex
Index of the element in the array at which to start copying.
elementCount
The number of elements to copy.
Remarks An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or
SetData methods) a resource that is currently set on a graphics device.
See Also
Reference
Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture3D.SetData Method
Copies array data to the texture.
Overload List
Name Description
Texture3D.SetData (Int32, Int32, Int32, Int32, Int32, Int32, Int32, T[], Int32, Int32, SetDataOptions) Copies array data to the textu
re, specifying the dimensions
of the volume and the mipma
p level where the data is to be
placed.
Texture3D.SetData (T[]) Copies array data to the textu
re at mipmap level 0.
Texture3D.SetData (T[], Int32, Int32, SetDataOptions) Copies array data to the textu
re at mipmap level 0, specifyi
ng the starting index and nu
mber of elements to copy.
Exceptions
Exception type Condition
InvalidOperationException The size of the data passed in is too large or too small for this resource.
See Also
Reference
Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Type Parameters
T
The type of the elements in the array.
Parameters
level
The mipmap level where the data will be placed.
left
Position of the left side of the box on the x-axis.
top
Position of the top of the box on the y-axis.
right
Position of the right side of the box on the x-axis.
bottom
Position of the bottom of the box on the y-axis.
front
Position of the front of the box on the z-axis.
back
Position of the back of the box on the z-axis.
data
The array of data to copy. The number of elements in the array should be equal to the size of the box where the data will be
placed.
startIndex
The index of the element in the array at which to start copying.
elementCount
The number of elements to copy.
options
Option specifying whether existing data in the buffer will be kept after this operation.
Exceptions
Exception type Condition
ArgumentException data is null.
InvalidOperationException The size of the data passed in is too large or too small for this resource.
Remarks An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or
SetData methods) a resource that is currently set on a graphics device.
Caution
Here is a tip for rendering objects within the Draw method of an Xbox 360 game. Do not use SetData when writing data to v
ertex buffers, index buffers, and textures. This method may lead to graphics corruption or crashes.
This is because, in cases where the size of the back buffer and depth-stencil buffer exceed the size of the Xbox 360 10 MB of e
mbedded memory (EDRAM), predicated tiling is utilized on this platform to compensate for the additional memory requirem
ents. Predicated tiling is a process by which scene rendering is performed multiple times on subsections of the final render ta
rget dimensions.
When predicated tiling has been triggered, the drawing commands contained in the Draw function are not submitted until
Present is called. (Note that Draw implicitly calls Present at the end of this method.) In this case, these resources are not avail
able for modification until the GPU is finished with presenting the entire frame.
See Also
Concepts
Predicated Tiling
Reference
Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of the elements in the array.
Parameters
data
The array of data to copy. The number of elements in the array must be equal to the size of the texture, which is Width ×
Height × Depth.
Exceptions
Exception type Condition
ArgumentException data is null.
InvalidOperationException The size of the data passed in is too large or too small for this resource.
Remarks An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or
SetData methods) a resource that is currently set on a graphics device.
Caution
Here is a tip for rendering objects within the Draw method of an Xbox 360 game. Do not use SetData when writing data to v
ertex buffers, index buffers, and textures. This method may lead to graphics corruption or crashes.
This is because, in cases where the size of the back buffer and depth-stencil buffer exceed the size of the Xbox 360 10 MB of e
mbedded memory (EDRAM), predicated tiling is utilized on this platform to compensate for the additional memory requirem
ents. Predicated tiling is a process by which scene rendering is performed multiple times on subsections of the final render ta
rget dimensions.
When predicated tiling has been triggered, the drawing commands contained in the Draw function are not submitted until
Present is called. (Note that Draw implicitly calls Present at the end of this method.) In this case, these resources are not avail
able for modification until the GPU is finished with presenting the entire frame.
See Also
Concepts
Predicated Tiling
Reference
Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of the elements in the array.
Parameters
data
The array of data to copy.
startIndex
The index of the element in the array at which to start copying.
elementCount
The number of elements to copy. This must be equal to the size of the texture, which is Width × Height × Depth.
options
Option specifying if existing data in the buffer will be kept after this operation.
Exceptions
Exception type Condition
ArgumentException data is null.
InvalidOperationException The size of the data passed in is too large or too small for this resource.
Remarks An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or
SetData methods) a resource that is currently set on a graphics device.
Caution
Here is a tip for rendering objects within the Draw method of an Xbox 360 game. Do not use SetData when writing data to v
ertex buffers, index buffers, and textures. This method may lead to graphics corruption or crashes.
This is because, in cases where the size of the back buffer and depth-stencil buffer exceed the size of the Xbox 360 10 MB of e
mbedded memory (EDRAM), predicated tiling is utilized on this platform to compensate for the additional memory requirem
ents. Predicated tiling is a process by which scene rendering is performed multiple times on subsections of the final render ta
rget dimensions.
When predicated tiling has been triggered, the drawing commands contained in the Draw function are not submitted until
Present is called. (Note that Draw implicitly calls Present at the end of this method.) In this case, these resources are not avail
able for modification until the GPU is finished with presenting the entire frame.
See Also
Concepts
Predicated Tiling
Reference
Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture3D.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture3D Properties
Public Properties
Name Description
Depth Gets the depth of this volume texture resource, in pixels.
Format Gets the pixel format for this texture resource.
GraphicsDevice (Inherited from GraphicsResource.)
Height Gets the height of this texture resource, in pixels.
IsDisposed (Inherited from GraphicsResource.)
LevelCount (Inherited from Texture.)
LevelOfDetail (Inherited from Texture.)
Name (Inherited from GraphicsResource.)
Priority (Inherited from GraphicsResource.)
ResourceType (Inherited from GraphicsResource.)
Tag (Inherited from GraphicsResource.)
TextureUsage Gets the state of the related TextureUsage enumeration.
Width Gets the width of this texture resource, in pixels.
See Also
Reference
Texture3D Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Texture3D.Depth Property
Gets the depth of this volume texture resource, in pixels.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Depth { get; }
Property Value
The depth of this volume texture resource, in pixels.
See Also
Reference
Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture3D.Format Property
Gets the pixel format for this texture resource.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public SurfaceFormat Format { get; }
Property Value
The pixel format of this texture resource.
See Also
Reference
Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture3D.Height Property
Gets the height of this texture resource, in pixels.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Height { get; }
Property Value
The height of this texture resource, in pixels.
See Also
Reference
Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture3D.TextureUsage Property
Gets the state of the related TextureUsage enumeration.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureUsage TextureUsage { get; }
Property Value
Indicates how the application uses the related texture.
See Also
Reference
Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Texture3D.Width Property
Gets the width of this texture resource, in pixels.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Width { get; }
Property Value
The width of this texture resource, in pixels.
See Also
Reference
Texture3D Class
Texture3D Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureAddressMode Enumeration
Defines constants that describe supported texture-addressing modes.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum TextureAddressMode
Members
Me Description
mbe
r na
me
Bord Texture coordinates outside the range [0.0, 1.0] are set to the border color.
er
Cla Texture coordinates outside the range [0.0, 1.0] are set to the texture color at 0.0 or 1.0, respectively.
mp
Mirr Similar to Wrap, except that the texture is flipped at every integer junction. For u values between 0 and 1, for example, t
or he texture is addressed normally; between 1 and 2, the texture is flipped (mirrored); between 2 and 3, the texture is nor
mal again, and so on.
Mirr Similar to Mirror and Clamp. Takes the absolute value of the texture coordinate (thus, mirroring around 0), and then cl
orOn amps to the maximum value. The most common usage is for volume textures, where support for the full MirrorOnce t
ce exture-addressing mode is not necessary, but the data is symmetrical around the one axis.
Wra Tile the texture at every integer junction. For example, for u values between 0 and 3, the texture is repeated three times;
p no mirroring is performed.
See Also
Concepts
What Is Texture Mapping?
Reference
AddressU
AddressV
AddressW
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCollection Class
Represents a collection of Texture objects.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class TextureCollection
See Also
Reference
TextureCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCollection Members
The following tables list the members exposed by the TextureCollection type.
Public Properties
Name Description
Item Gets or sets the Texture at the specified sampler number.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
TextureCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
TextureCollection Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
TextureCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
TextureCollection Properties
Public Properties
Name Description
Item Gets or sets the Texture at the specified sampler number.
See Also
Reference
TextureCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
TextureCollection.Item Property
Gets or sets the Texture at the specified sampler number.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Texture this [
int index
] { get; set; }
Property Value
The Texture at the specified index.
Exceptions
Exception type Condition
InvalidOperationException The sampler number is invalid. It is either less than zero or greater than the maximum number of te
xtures available for the graphics device.
ObjectDisposedException Item was called after the GraphicsDevice was disposed.
See Also
Reference
GraphicsDevice.SamplerStates Property
GraphicsDevice.Textures Property
GraphicsDevice.VertexTextures Property
TextureCollection Class
TextureCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCreationParameters Structure
Describes the parameters to use when initializing a new instance of a texture.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public struct TextureCreationParameters
See Also
Reference
TextureCreationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCreationParameters Members
The following tables list the members exposed by the TextureCreationParameters type.
Public Constructors
Name Description
TextureCreationParameters Creates a new instance of TextureCreationParameters.
Public Properties
Name Description
ColorKey Gets or sets the color value to replace with transparent black.
Default Gets the default texture creation parameters.
Depth Gets or sets the depth to create the Texture with.
Filter Gets or sets a set of options controlling how the image is filtered.
Format Gets or sets the format of the texture to be created.
Height Gets or sets the height to create a Texture with.
MipFilter Gets or sets a set of options controlling how mipmaps are filtered.
MipLevels Gets or sets the number of mip levels to create a Texture with.
TextureUsage Gets the state of the related TextureUsage enumeration.
Width Gets or sets the width to create a Texture with.
Public Methods
Name Description
Equals Overloaded. Determines whether two instances of TextureCreationParameters are equal.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Determines whether two instances of TextureCreationParameters are equal.
op_Inequality Determines whether two instances of TextureCreationParameters are not equal.
ReferenceEquals (Inherited from Object.)
ToString Returns a String that represents the current TextureCreationParameters.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
TextureCreationParameters Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
TextureCreationParameters Constructor
Creates a new instance of TextureCreationParameters.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureCreationParameters (
int width,
int height,
int depth,
int mipLevels,
SurfaceFormat format,
TextureUsage textureUsage,
Color colorKey,
FilterOptions filter,
FilterOptions mipFilter
)
Parameters
width
Width of the texture.
height
Height of the texture.
depth
Depth of the texture.
mipLevels
Number of mip levels in the texture.
format
The format of the texture.
textureUsage
A set of options identifying the behaviors of this texture resource.
colorKey
The color key of the texture.
filter
A set of options controlling how the image is filtered.
mipFilter
A set of options controlling how mipmaps are filtered.
See Also
Tasks
How To: Load Content
Reference
GraphicsDeviceManager.DeviceReset Event
TextureCreationParameters Structure
TextureCreationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCreationParameters Methods
Public Methods
Name Description
Equals Overloaded. Determines whether two instances of TextureCreationParameters are equal.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Determines whether two instances of TextureCreationParameters are equal.
op_Inequality Determines whether two instances of TextureCreationParameters are not equal.
ReferenceEquals (Inherited from Object.)
ToString Returns a String that represents the current TextureCreationParameters.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
TextureCreationParameters Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
TextureCreationParameters.Equals Method
Determines whether two instances of TextureCreationParameters are equal.
Overload List
Name Description
TextureCreationParameters.Equals (Object) Determines whether the specified Object is equal to the
TextureCreationParameters.
TextureCreationParameters.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
TextureCreationParameters Structure
TextureCreationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
obj
The Object to compare with the current TextureCreationParameters.
Return Value
true if the specified Object is equal to the current TextureCreationParameters; false otherwise.
See Also
Reference
TextureCreationParameters Structure
TextureCreationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCreationParameters.GetHashCode Method
Gets the hash code for this instance.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
A hash code for the current TextureCreationParameters.
See Also
Reference
TextureCreationParameters Structure
TextureCreationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCreationParameters.op_Equality Method
Determines whether two instances of TextureCreationParameters are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
TextureCreationParameters left,
TextureCreationParameters right
)
Parameters
left
The object to the left of the equality operator.
right
The object to the right of the equality operator.
Return Value
true if left is equal to right; false otherwise.
See Also
Reference
TextureCreationParameters Structure
TextureCreationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCreationParameters.op_Inequality Method
Determines whether two instances of TextureCreationParameters are not equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
TextureCreationParameters left,
TextureCreationParameters right
)
Parameters
left
The object to the left of the inequality operator.
right
The object to the right of the inequality operator.
Return Value
true if left is not equal to right; false otherwise.
See Also
Reference
TextureCreationParameters Structure
TextureCreationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCreationParameters.ToString Method
Returns a String that represents the current TextureCreationParameters.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of the current TextureCreationParameters.
See Also
Reference
TextureCreationParameters Structure
TextureCreationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCreationParameters Properties
Public Properties
Name Description
ColorKey Gets or sets the color value to replace with transparent black.
Default Gets the default texture creation parameters.
Depth Gets or sets the depth to create the Texture with.
Filter Gets or sets a set of options controlling how the image is filtered.
Format Gets or sets the format of the texture to be created.
Height Gets or sets the height to create a Texture with.
MipFilter Gets or sets a set of options controlling how mipmaps are filtered.
MipLevels Gets or sets the number of mip levels to create a Texture with.
TextureUsage Gets the state of the related TextureUsage enumeration.
Width Gets or sets the width to create a Texture with.
See Also
Reference
TextureCreationParameters Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
TextureCreationParameters.ColorKey Property
Gets or sets the color value to replace with transparent black.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Color ColorKey { get; set; }
Property Value
Color value to replace with transparent black.
See Also
Reference
TextureCreationParameters Structure
TextureCreationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCreationParameters.Default Property
Gets the default texture creation parameters.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static TextureCreationParameters Default { get; }
Property Value
The default parameters.
See Also
Reference
TextureCreationParameters Structure
TextureCreationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCreationParameters.Depth Property
Gets or sets the depth to create the Texture with.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Depth { get; set; }
Property Value
The depth.
See Also
Reference
TextureCreationParameters Structure
TextureCreationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCreationParameters.Filter Property
Gets or sets a set of options controlling how the image is filtered.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public FilterOptions Filter { get; set; }
Property Value
A set of options controlling how the image is filtered.
See Also
Reference
TextureCreationParameters Structure
TextureCreationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCreationParameters.Format Property
Gets or sets the format of the texture to be created.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public SurfaceFormat Format { get; set; }
Property Value
The format of the texture to be created.
See Also
Reference
TextureCreationParameters Structure
TextureCreationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCreationParameters.Height Property
Gets or sets the height to create a Texture with.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Height { get; set; }
Property Value
The height.
See Also
Reference
TextureCreationParameters Structure
TextureCreationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCreationParameters.MipFilter Property
Gets or sets a set of options controlling how mipmaps are filtered.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public FilterOptions MipFilter { get; set; }
Property Value
A set of options controlling how mipmaps are filtered.
See Also
Reference
TextureCreationParameters Structure
TextureCreationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCreationParameters.MipLevels Property
Gets or sets the number of mip levels to create a Texture with.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int MipLevels { get; set; }
Property Value
The number of mip levels.
See Also
Reference
TextureCreationParameters Structure
TextureCreationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCreationParameters.TextureUsage Property
Gets the state of the related TextureUsage enumeration.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureUsage TextureUsage { get; set; }
Property Value
Indicates how the application uses the related texture.
See Also
Reference
TextureCreationParameters Structure
TextureCreationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCreationParameters.Width Property
Gets or sets the width to create a Texture with.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Width { get; set; }
Property Value
The width.
See Also
Reference
TextureCreationParameters Structure
TextureCreationParameters Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCube Class
Represents a set of six 2D textures, one for each face of a cube.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class TextureCube : Texture
Remarks
A texel represents the smallest unit of a texture that can be read from or written to by the GPU. A texel is composed of 1 to 4
components. Specifically, a texel may be any one of the available texture formats represented in the SurfaceFormat
enumeration.
A cube texture is a collection of six textures, one for each face of the cube. All faces must be present in the cube texture. Also, a
cube map surface must be the same pixel size in all three dimensions (x, y, and z). Figure 1 shows a fully populated texture
cube.
TextureCube Members
The following tables list the members exposed by the TextureCube type.
Public Constructors
Name Description
TextureCube Creates an uninitialized TextureCube resource of the specified dimensions. To initialize a Texture2D from an exi
sting file, see the static method ContentManager.Load or FromFile.
Public Properties
Name Description
Format Gets the pixel format for this texture resource.
GraphicsDevice (Inherited from GraphicsResource.)
IsDisposed (Inherited from GraphicsResource.)
LevelCount (Inherited from Texture.)
LevelOfDetail (Inherited from Texture.)
Name (Inherited from GraphicsResource.)
Priority (Inherited from GraphicsResource.)
ResourceType (Inherited from GraphicsResource.)
Size Gets the width and height of this texture resource, in pixels.
Tag (Inherited from GraphicsResource.)
TextureUsage Gets the state of the related TextureUsage enumeration.
Public Methods
Name Description
Dispose Overloaded. Releases the resources used by the TextureCube class.
Equals (Inherited from Object.)
FromFile Overloaded. Creates a cube texture resource from a file.
GenerateMipMaps (Inherited from Texture.)
GetCreationParameters (Inherited from Texture.)
GetData Overloaded. Returns a copy of the texture data.
GetHashCode (Inherited from Object.)
GetTextureInformation (Inherited from Texture.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Save (Inherited from Texture.)
SetData Overloaded. Copies array data to the texture.
ToString Returns a String that represents the current TextureCube.
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_Disposing (Inherited from GraphicsResource.)
Public Events
Name Description
Disposing (Inherited from GraphicsResource.)
See Also
Reference
TextureCube Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
TextureCube Constructor
Creates an uninitialized TextureCube resource of the specified dimensions. To initialize a Texture2D from an existing file, see
the static method ContentManager.Load or FromFile.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureCube (
GraphicsDevice graphicsDevice,
int edgeLength,
int numberLevels,
TextureUsage usage,
SurfaceFormat format
)
Parameters
graphicsDevice
The GraphicsDevice that will display the cube texture.
edgeLength
The size of the edges of all the top-level faces of the cube texture. The pixel dimensions of subsequent levels of each face will
be the truncated value of half of the previous level's pixel dimension (independently). Each dimension clamps at a size of 1
pixel. Thus, if the division by 2 results in 0 (zero), 1 will be taken instead.
numberLevels
The number of downsampled surfaces to create for each face of the cube texture when preprocessing the texture. These
smaller versions of the texture, known as mip levels, are used when the texture is minified to fit a smaller area than the
original texture size. The chain of downsampled surfaces associated with a texture is sometimes called a mipmap chain.
If numberLevels is zero, all cube texture sublevels down to 1×1 pixels will be generated for each face for hardware that
supports mipmapped cube textures. Use LevelCount to see the number of levels generated.
usage
A set of options identifying the behaviors of this resource.
format
The format of all levels in the cube texture.
Exceptions
Exception type Condition
ArgumentException
One of the following conditions is true:
The edgeLength requested would result in a resource too large for the graphics device.
numberLevels is too large. It is either greater than 32, or if less than 32 it would result in
a cube texture that is too large for this graphics device. Textures have a maximum of 32
levels.
usage is not a valid value. Texture resources can only be created with the following
TextureUsage options: TextureUsage.AutoGenerateMipMap, TextureUsage.Tiled, and
TextureUsage.Linear.
format is SurfaceFormat.Unknown. Textures cannot be created using
SurfaceFormat.Unknown.
The parameters specified are not compatible:
format and numberLevels are incompatible. Multi-element textures of type
SurfaceFormat.Multi2Bgra32 cannot be mipmapped, set numberLevels to 1.
usage and numberLevels are incompatible. Textures specifying the usage
TextureUsage.AutoGenerateMipMap must set numberLevels to either 0 or 1.
ArgumentNullException graphicsDevice is null.
ArgumentOutOfRangeException edgeLength is less than or equal to zero. edgeLength must be greater than or equal to zero.
Remarks
A mipmap (texture) is a collection of successively downsampled (mipmapped) surfaces. An application can discover support for
automatic generation of mipmaps in a particular format by calling CheckDeviceFormat with
TextureUsage.AutoGenerateMipMap.
A texel represents the smallest unit of a texture that can be read from or written to by the GPU. A texel is composed of 1 to 4
components. Specifically, a texel may be any one of the available texture formats represented in the SurfaceFormat
enumeration.
A cube texture is a collection of six textures, one for each face of the cube. All faces must be present in the cube texture. Also, a
cube map surface must be the same pixel size in all three dimensions (x, y, and z). Figure 1 shows a fully populated texture
cube.
TextureCube Methods
Public Methods
Name Description
Dispose Overloaded. Releases the resources used by the TextureCube class.
Equals (Inherited from Object.)
FromFile Overloaded. Creates a cube texture resource from a file.
GenerateMipMaps (Inherited from Texture.)
GetCreationParameters (Inherited from Texture.)
GetData Overloaded. Returns a copy of the texture data.
GetHashCode (Inherited from Object.)
GetTextureInformation (Inherited from Texture.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Save (Inherited from Texture.)
SetData Overloaded. Copies array data to the texture.
ToString Returns a String that represents the current TextureCube.
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_Disposing (Inherited from GraphicsResource.)
See Also
Reference
TextureCube Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
TextureCube.Dispose Method
Releases the resources used by the TextureCube class.
Overload List
Name Description
TextureCube.Dispose (Boolean) Releases the unmanaged resources used by the TextureCube and optionally releases the mana
ged resources.
TextureCube.Dispose () (Inherited from GraphicsResource.)
See Also
Reference
TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
Remarks
This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean)
method with the disposing parameter set to true. Finalize invokes Dispose(Boolean) with disposing set to false.
When the disposing parameter is true, this method releases all resources held by any managed objects that this TextureCube
references. This method invokes the Dispose method of each referenced object.
Note
Notes to Inheritors
Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects
disposed of in an earlier call to Dispose.
See Also
Reference
TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCube.Finalize Method
Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the
object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void Finalize ()
Remarks
This method overrides System.Object.Finalize. Application code should not call this method; an object's Finalize method is
automatically invoked during garbage collection, unless a call to the GC.SuppressFinalize method has disabled finalization by
the garbage collector.
See Also
Reference
TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCube.FromFile Method
Creates a cube texture resource from a file.
Overload List
Name Description
TextureCube.FromFile (GraphicsDevice, Stream) Creates a cube texture resource from a stre
am.
TextureCube.FromFile (GraphicsDevice, Stream, Int32) Creates a texture resource from a stream, s
pecifying the number of bytes in the strea
m.
TextureCube.FromFile (GraphicsDevice, Stream, Int32, TextureCreationParameters) Creates a texture resource from a stream, s
pecifying the number of bytes in the strea
m and the texture creation parameters to u
se.
TextureCube.FromFile (GraphicsDevice, Stream, TextureCreationParameters) Creates a texture resource from a stream, s
pecifying the parameters to be used in crea
tion of the texture.
TextureCube.FromFile (GraphicsDevice, String) Creates a cube texture resource from a file.
TextureCube.FromFile (GraphicsDevice, String, Int32) Creates a cube texture resource from a file,
specifying the width and height of the textu
re in pixels.
TextureCube.FromFile (GraphicsDevice, String, TextureCreationParameters) Creates a texture resource from a file, speci
fying the parameters to be used in creation
of the texture.
TextureCube.FromFile (GraphicsDevice, String, Int32, Int32, Int32) (Inherited from Texture.)
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to use to create the texture resource.
textureStream
Stream containing the texture data.
Return Value
The cube texture resource that has been created on the specified graphics device.
Exceptions
Exception type Condition
ArgumentNullException textureStream is null. The stream passed into this method cannot be null.
NotSupportedException textureStream is not readable. Streams passed into this method must be readable.
EndOfStreamException textureStream does not contain enough data to support this call.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to use to create the texture resource.
textureStream
Stream containing the texture data.
numberBytes
The number of bytes in textureStream.
Return Value
The texture resource that has been created on the specified graphics device.
Exceptions
Exception type Condition
ArgumentNullException textureStream is null. The stream passed into this method cannot be null.
NotSupportedException textureStream is not readable. Streams passed into this method must be readable.
EndOfStreamException textureStream does not contain enough data to support this call.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to use to create the texture resource.
textureStream
Stream containing the volume texture data.
numberBytes
The number of bytes in textureStream.
creationParameters
The parameters to use when creating this texture.
Return Value
The volume texture resource that has been created on the specified graphics device.
Exceptions
Exception type Condition
ArgumentNullException textureStream is null. The stream passed into this method cannot be null.
NotSupportedException textureStream is not readable. Streams passed into this method must be readable.
EndOfStreamException textureStream does not contain enough data to support this call.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to use to create the texture resource.
textureStream
Stream containing the texture data.
creationParameters
The parameters to use when creating this texture.
Return Value
The texture resource that has been created on the specified graphics device.
Exceptions
Exception type Condition
ArgumentNullException textureStream is null. The stream passed into this method cannot be null.
NotSupportedException textureStream is not readable. Streams passed into this method must be readable.
EndOfStreamException textureStream does not contain enough data to support this call.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to use to create the texture resource.
filename
The name of the file containing the texture.
Return Value
The texture resource that has been created on the specified graphics device.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
Exceptions
Exception type Condition
ArgumentException filename is a zero-length string, contains only white space, or contains one or more invalid char
acters as defined by InvalidPathChars.
ArgumentNullException filename is null.
PathTooLongException The specified path, file name, or both exceed the system-defined maximum length. For example,
on Windows-based platforms, paths must be less than 248 characters, and file names must be l
ess than 260 characters.
DirectoryNotFoundException The specified path is invalid (for example, it is on an unmapped drive).
UnauthorizedAccessException The filename parameter specifies a directory, or the caller does not have the required permissio
n to access the file specified by filename.
FileNotFoundException The file specified in filename was not found.
NotSupportedException filename is in an invalid format.
See Also
Reference
TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to use to create the texture resource.
filename
The name of the file containing the texture.
size
Width and height of the cube texture, in pixels.
Return Value
The texture resource that has been created on the specified graphics device.
Exceptions
Exception type Condition
ArgumentException filename is a zero-length string, contains only white space, or contains one or more invalid char
acters as defined by InvalidPathChars.
ArgumentNullException filename is null.
PathTooLongException The specified path, file name, or both exceed the system-defined maximum length. For example,
on Windows-based platforms, paths must be less than 248 characters, and file names must be l
ess than 260 characters.
DirectoryNotFoundException The specified path is invalid (for example, it is on an unmapped drive).
UnauthorizedAccessException The filename parameter specifies a directory, or the caller does not have the required permissio
n to access the file specified by filename.
FileNotFoundException The file specified in filename was not found.
NotSupportedException filename is in an invalid format.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to use to create the texture resource.
filename
The name of the file containing the texture.
creationParameters
The parameters to use when creating this texture.
Return Value
The texture resource that has been created on the specified graphics device.
Exceptions
Exception type Condition
ArgumentException filename is a zero-length string, contains only white space, or contains one or more invalid char
acters as defined by InvalidPathChars.
ArgumentNullException filename is null.
PathTooLongException The specified path, file name, or both exceed the system-defined maximum length. For example,
on Windows-based platforms, paths must be less than 248 characters, and file names must be l
ess than 260 characters.
DirectoryNotFoundException The specified path is invalid (for example, it is on an unmapped drive).
UnauthorizedAccessException The filename parameter specifies a directory, or the caller does not have the required permissio
n to access the file specified by filename.
FileNotFoundException The file specified in filename was not found.
NotSupportedException filename is in an invalid format.
Remarks
The supported texture image file formats are described by the ImageFileFormat enumeration.
See Also
Reference
TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCube.GetData Method
Returns a copy of the texture data.
Overload List
Name Description
TextureCube.GetData (CubeMapFace, Int32, Nullable<Rectangle>, T[], Int32, Int32) Returns a copy of the texture data, specifyin
g the start index, staring offset, number of e
lements, region to copy, and level where th
e data is to be placed.
TextureCube.GetData (CubeMapFace, T[]) Returns a copy of the texture data.
TextureCube.GetData (CubeMapFace, T[], Int32, Int32) Returns a copy of the texture data, specifyin
g the start index and number of elements in
the vertex buffer.
See Also
Reference
TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Type Parameters
T
The type of data in the texture buffer.
Parameters
faceType
The cube map face type.
level
The mipmap level where the data will be placed.
rect
The section of the texture where the data will be placed. null indicates the data will be copied over the entire texture.
data
The array into which to copy the data.
startIndex
Index in the array at which to begin the copy.
elementCount
Number of elements in the array.
Exceptions
Exception type Condition
ArgumentNullException data must be of sufficient length to receive the data.
Remarks An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or
SetData methods) a resource that is currently set on a graphics device.
See Also
Reference
TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of data in the texture buffer.
Parameters
faceType
The cube map face type.
data
The array into which to copy the data.
Exceptions
Exception type Condition
ArgumentNullException data must be of sufficient length to receive the data.
See Also
Reference
TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of data in the texture buffer.
Parameters
faceType
The cube map face type.
data
The array into which to copy the data.
startIndex
Index in the array at which to begin the copy.
elementCount
Number of elements in the array.
Exceptions
Exception type Condition
ArgumentNullException data must be of sufficient length to receive the data.
Remarks An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or
SetData methods) a resource that is currently set on a graphics device.
See Also
Reference
TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCube.SetData Method
Copies array data to the texture.
Overload List
Name Description
TextureCube.SetData (CubeMapFace, Int32, Nullable<Rectangle>, T[], Int32, Int32, SetDataOptions) Copies array data to the te
xture, specifying a start off
set, mipmap level, and sub
region to copy.
TextureCube.SetData (CubeMapFace, T[]) Copies array data to the te
xture at mipmap level 0.
TextureCube.SetData (CubeMapFace, T[], Int32, Int32, SetDataOptions) Copies array data to the te
xture at mipmap level 0, sp
ecifying a start offset.
See Also
Reference
TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Type Parameters
T
The type of the elements in the array.
Parameters
faceType
The cube map face type.
level
The mipmap level where the data will be placed.
rect
The section of the texture where the data will be placed. null indicates the data will be copied over the entire texture.
data
The array of data to copy.
startIndex
Start offset in the array.
elementCount
Number of elements in the array. The number of elements to copy must be equal to the size of the texture.
options
Option specifying if existing data in the buffer will be kept after this operation.
Remarks An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or
SetData methods) a resource that is currently set on a graphics device.
Caution
Here is a tip for rendering objects within the Draw method of an Xbox 360 game. Do not use SetData when writing data to v
ertex buffers, index buffers, and textures. This method may lead to graphics corruption or crashes.
This is because, in cases where the size of the back buffer and depth-stencil buffer exceed the size of the Xbox 360 10 MB of e
mbedded memory (EDRAM), predicated tiling is utilized on this platform to compensate for the additional memory requirem
ents. Predicated tiling is a process by which scene rendering is performed multiple times on subsections of the final render ta
rget dimensions.
When predicated tiling has been triggered, the drawing commands contained in the Draw function are not submitted until
Present is called. (Note that Draw implicitly calls Present at the end of this method.) In this case, these resources are not avail
able for modification until the GPU is finished with presenting the entire frame.
See Also
Concepts
Predicated Tiling
Reference
TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of the elements in the array.
Parameters
faceType
The cube map face type.
data
The array of data to copy. The number of elements in the array must be equal to the size of the texture.
Remarks An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or
SetData methods) a resource that is currently set on a graphics device.
Caution
Here is a tip for rendering objects within the Draw method of an Xbox 360 game. Do not use SetData when writing data to v
ertex buffers, index buffers, and textures. This method may lead to graphics corruption or crashes.
This is because, in cases where the size of the back buffer and depth-stencil buffer exceed the size of the Xbox 360 10 MB of e
mbedded memory (EDRAM), predicated tiling is utilized on this platform to compensate for the additional memory requirem
ents. Predicated tiling is a process by which scene rendering is performed multiple times on subsections of the final render ta
rget dimensions.
When predicated tiling has been triggered, the drawing commands contained in the Draw function are not submitted until
Present is called. (Note that Draw implicitly calls Present at the end of this method.) In this case, these resources are not avail
able for modification until the GPU is finished with presenting the entire frame.
See Also
Concepts
Predicated Tiling
Reference
TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of the elements in the array.
Parameters
faceType
The cube map face type.
data
The array of data to copy.
startIndex
Start offset in the array.
elementCount
Number of elements in the array. This must be equal to the size of the texture.
options
Option specifying if existing data in the buffer will be kept after this operation.
Remarks An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or
SetData methods) a resource that is currently set on a graphics device.
Caution
Here is a tip for rendering objects within the Draw method of an Xbox 360 game. Do not use SetData when writing data to v
ertex buffers, index buffers, and textures. This method may lead to graphics corruption or crashes.
This is because, in cases where the size of the back buffer and depth-stencil buffer exceed the size of the Xbox 360 10 MB of e
mbedded memory (EDRAM), predicated tiling is utilized on this platform to compensate for the additional memory requirem
ents. Predicated tiling is a process by which scene rendering is performed multiple times on subsections of the final render ta
rget dimensions.
When predicated tiling has been triggered, the drawing commands contained in the Draw function are not submitted until
Present is called. (Note that Draw implicitly calls Present at the end of this method.) In this case, these resources are not avail
able for modification until the GPU is finished with presenting the entire frame.
See Also
Concepts
Predicated Tiling
Reference
TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCube.ToString Method
Returns a String that represents the current TextureCube.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
A String that represents the current TextureCube.
See Also
Reference
TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCube Properties
Public Properties
Name Description
Format Gets the pixel format for this texture resource.
GraphicsDevice (Inherited from GraphicsResource.)
IsDisposed (Inherited from GraphicsResource.)
LevelCount (Inherited from Texture.)
LevelOfDetail (Inherited from Texture.)
Name (Inherited from GraphicsResource.)
Priority (Inherited from GraphicsResource.)
ResourceType (Inherited from GraphicsResource.)
Size Gets the width and height of this texture resource, in pixels.
Tag (Inherited from GraphicsResource.)
TextureUsage Gets the state of the related TextureUsage enumeration.
See Also
Reference
TextureCube Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
TextureCube.Format Property
Gets the pixel format for this texture resource.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public SurfaceFormat Format { get; }
Property Value
The pixel format of this texture resource.
See Also
Reference
TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCube.Size Property
Gets the width and height of this texture resource, in pixels.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Size { get; }
Property Value
The size of this texture resource, in pixels.
See Also
Reference
TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureCube.TextureUsage Property
Gets the state of the related TextureUsage enumeration.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureUsage TextureUsage { get; }
Property Value
Indicates how the application uses the related texture.
See Also
Reference
TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureFilter Enumeration
Defines how a texture will be filtered as it is minified for each mipmap level.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum TextureFilter
Members
Me Description
mbe
r na
me
Anis Anisotropic texture filtering used as a texture magnification or minification filter. This type of filtering compensates for
otro distortion caused by the difference in angle between the texture polygon and the plane of the screen.
pic
Gaus A 4-sample Gaussian filter used as a texture magnification or minification filter.
sian
Qua
d
Line Bilinear interpolation filtering used as a texture magnification or minification filter. A weighted average of a 2×2 area of
ar texels surrounding the desired pixel is used. The texture filter used between mipmap levels is trilinear mipmap interpola
tion, in which the rasterizer performs linear interpolation on pixel color, using the texels of the two nearest mipmap text
ures.
Non Mipmapping disabled. The rasterizer uses the magnification filter instead.
e
Poin Point filtering used as a texture magnification or minification filter. The texel with coordinates nearest to the desired pix
t el value is used. The texture filter used between mipmap levels is based on the nearest point; that is, the rasterizer uses t
he color from the texel of the nearest mipmap texture.
Pyra A 4-sample tent filter used as a texture magnification or minification filter.
mid
alQu
ad
Remarks
To determine whether a format supports texture filter types other than Point (which is always supported), call
CheckDeviceFormat.
Not all valid filtering modes for a device apply to volume maps. In general, Point and Linear magnification filters are
supported for volume maps. If SupportsMipVolumeMap is true (the texture capabilities can be found in TextureCapabilities),
the Point mipmap filter and the Point and Linear minification filters are supported for volume maps. The device might or
might not support the Linear mipmap filter for volume maps. Devices that support anisotropic filtering for 2D maps do not
necessarily support it for volume maps. However, applications that enable anisotropic filtering, even if they do not support it,
receive the best available filtering (probably linear).
See Also
Concepts
What Is Texture Mapping?
Reference
GraphicsDeviceCapabilities.FilterCaps Properties
SamplerState.MagFilter Property
SamplerState.MinFilter Property
SamplerState.MipFilter Property
Texture.GenerateMipMaps Method
QueryUsages Enumeration
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureInformation Structure
Encapsulates information describing texture resources.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public struct TextureInformation
See Also
Reference
TextureInformation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureInformation Members
The following tables list the members exposed by the TextureInformation type.
Public Constructors
Name Description
TextureInformation Initializes a new instance of the TextureInformation class.
Public Properties
Name Description
Depth Gets or sets the depth of a texture.
Format Gets or sets the format of the texture.
Height Gets or sets the height, in pixels, of a texture.
ImageFormat Gets the file format of the original image.
MipLevels Gets or sets the number of mip levels of a texture.
ResourceType Gets the type of this resource.
Width Gets or sets the width, in pixels, of a texture.
Public Methods
Name Description
Equals Overloaded. Determines whether two instances of TextureInformation are equal.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Determines whether two instances of TextureInformation are equal.
op_Inequality Determines whether two instances of TextureInformation are not equal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
TextureInformation Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
TextureInformation Constructor
Initializes a new instance of the TextureInformation class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TextureInformation (
int width,
int height,
int depth,
int mipLevels,
SurfaceFormat format
)
Parameters
width
Width of the texture, in pixels.
height
Height of the texture, in pixels.
depth
Depth of the texture, in pixels.
mipLevels
Number of mip levels in original image.
format
Describes the data in the original image.
See Also
Reference
TextureInformation Structure
TextureInformation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureInformation Methods
Public Methods
Name Description
Equals Overloaded. Determines whether two instances of TextureInformation are equal.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Determines whether two instances of TextureInformation are equal.
op_Inequality Determines whether two instances of TextureInformation are not equal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
TextureInformation Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
TextureInformation.Equals Method
Determines whether two instances of TextureInformation are equal.
Overload List
Name Description
TextureInformation.Equals (Object) Determines whether the specified Object is equal to the TextureInformation.
TextureInformation.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
TextureInformation Structure
TextureInformation Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
obj
The Object to compare with the current TextureInformation.
Return Value
true if the specified Object is equal to the current TextureInformation; false otherwise.
See Also
Reference
TextureInformation Structure
TextureInformation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureInformation.GetHashCode Method
Gets the hash code for this instance.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
A hash code for the current TextureInformation.
See Also
Reference
TextureInformation Structure
TextureInformation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureInformation.op_Equality Method
Determines whether two instances of TextureInformation are equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
TextureInformation left,
TextureInformation right
)
Parameters
left
The object to the left of the equality operator.
right
The object to the right of the equality operator.
Return Value
true if left is equal to right; false otherwise.
See Also
Reference
TextureInformation Structure
TextureInformation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureInformation.op_Inequality Method
Determines whether two instances of TextureInformation are not equal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
TextureInformation left,
TextureInformation right
)
Parameters
left
The object to the left of the inequality operator.
right
The object to the right of the inequality operator.
Return Value
true if left is not equal to right; false otherwise.
See Also
Reference
TextureInformation Structure
TextureInformation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureInformation.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
TextureInformation Structure
TextureInformation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureInformation Properties
Public Properties
Name Description
Depth Gets or sets the depth of a texture.
Format Gets or sets the format of the texture.
Height Gets or sets the height, in pixels, of a texture.
ImageFormat Gets the file format of the original image.
MipLevels Gets or sets the number of mip levels of a texture.
ResourceType Gets the type of this resource.
Width Gets or sets the width, in pixels, of a texture.
See Also
Reference
TextureInformation Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
TextureInformation.Depth Property
Gets or sets the depth of a texture.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Depth { get; set; }
Property Value
The depth of the texture.
See Also
Reference
TextureInformation Structure
TextureInformation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureInformation.Format Property
Gets or sets the format of the texture.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public SurfaceFormat Format { get; set; }
Property Value
The format of the texture.
See Also
Reference
TextureInformation Structure
TextureInformation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureInformation.Height Property
Gets or sets the height, in pixels, of a texture.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Height { get; set; }
Property Value
The height, in pixels, of the texture.
See Also
Reference
TextureInformation Structure
TextureInformation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureInformation.ImageFormat Property
Gets the file format of the original image.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ImageFileFormat ImageFormat { get; }
Property Value
The file format of the original image.
See Also
Reference
TextureInformation Structure
TextureInformation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureInformation.MipLevels Property
Gets or sets the number of mip levels of a texture.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int MipLevels { get; set; }
Property Value
The number of mip levels of the texture.
See Also
Reference
TextureInformation Structure
TextureInformation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureInformation.ResourceType Property
Gets the type of this resource.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ResourceType ResourceType { get; }
Property Value
The resource type, identifying this resource as a texture.
See Also
Reference
TextureInformation Structure
TextureInformation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureInformation.Width Property
Gets or sets the width, in pixels, of a texture.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Width { get; set; }
Property Value
The width, in pixels, of the texture.
See Also
Reference
TextureInformation Structure
TextureInformation Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureUsage Enumeration
Specifies special usage of the texture data.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[FlagsAttribute]
public enum TextureUsage
Members
Me Description
mb
er n
am
e
Aut The resource automatically generates mipmaps. Automatic generation of mipmaps is not supported for volume textures
oGe and depth stencil surfaces/textures.
ner
ate
Mip
Ma
p
Lin
ear (Xbox 360 only) Linear texture memory format. Linear formats are arranged in memory using a left-to-right and top-to-
bottom layout (with pixels contiguous in memory for each row, and rows contiguous except for possible alignment padd
ing). Use this format when doing dynamic CPU updates to textures where:
You do not want the overhead of translating tile addresses using the CPU.
Textures are not often referenced during the frame.
Less efficient GPU performance is not a problem.
This flag is valid only for texture creation on Xbox 360. It is ignored if used elsewhere. On Xbox, most formats are created
as Tiled if it is applicable.
No None.
ne
Tile
d (Xbox 360 only) Tiled texture memory format. Tiled formats are arranged using a memory layout designed to maximize t
he cache coherency of texture fetches and balance the access workload of the memory controllers. The exact pixel arrang
ement of tiled formats varies based on the bit depth of the format; however, pixels that are close to one another spatially
are located close to one another in memory. For example, two pixels adjacent to one another in a vertical column would
be separated in memory by an entire row of pixels for a linear format, but could be separated by only a few bytes for a ti
led format.
The tiled texture format is usually more efficient than the linear texture format.
This flag is valid only when used for texture creation on Xbox 360, and will be ignored if used elsewhere. On Xbox, most f
ormats are created as Tiled if it is applicable.
See Also
Reference
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
TextureWrapCoordinates Enumeration
Defines supported wrap coordinates.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[FlagsAttribute]
public enum TextureWrapCoordinates
Members
Member name Description
None No texture wrap coordinates specified.
Zero U texture wrapping (wrapping in the direction of the first dimension).
One V texture wrapping (wrapping in the direction of the second dimension).
Two W texture wrapping (wrapping in the direction of the third dimension).
Three Texture wrapping in the direction of the fourth dimension.
RemarksThis enumeration is used by the Wrap0 property and the Wrap1 through Wrap15 properties.
See Also
Concepts
What Is Texture Mapping?
Reference
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexBuffer Class
Represents a list of 3D vertices to be streamed to the graphics device.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class VertexBuffer : GraphicsResource
Example
The vertex stream of the graphics device must be set before any call to DrawPrimitives. The following example associates a
user created vertex buffer of type VertexPositionNormalTexture with vertex stream 0 (zero) of the graphics device.
C#
graphics.GraphicsDevice.Vertices[0].SetSource(
vertexBuffer, 0,
VertexPositionNormalTexture.SizeInBytes);
See Also
Tasks
How To: Draw Points, Lines, and Other 3D Primitives
Reference
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexBuffer Members
The following tables list the members exposed by the VertexBuffer type.
Public Constructors
Name Description
VertexBuffer Overloaded. Initializes a new instance of the VertexBuffer class.
Public Properties
Name Description
BufferUsage Gets the state of the related BufferUsage enumeration.
GraphicsDevice (Inherited from GraphicsResource.)
IsDisposed (Inherited from GraphicsResource.)
Name (Inherited from GraphicsResource.)
Priority (Inherited from GraphicsResource.)
ResourceType (Inherited from GraphicsResource.)
SizeInBytes Gets the size, in bytes, of this vertex buffer.
Tag (Inherited from GraphicsResource.)
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetData Overloaded. Returns a copy of the vertex buffer data.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
SetData Overloaded. Sets the vertex buffer data.
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
MemberwiseClone (Inherited from Object.)
raise_Disposing (Inherited from GraphicsResource.)
Public Events
Name Description
Disposing (Inherited from GraphicsResource.)
See Also
Reference
VertexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexBuffer Constructor
Initializes a new instance of the VertexBuffer class.
Overload List
Name Description
VertexBuffer (GraphicsDevice, Int32, BufferUsage) Initializes a new instance of VertexBuffer, specifying the size and usa
ge.
VertexBuffer (GraphicsDevice, Type, Int32, BufferUsage) Initializes a new instance of VertexBuffer, specifying the element cou
nt and usage.
See Also
Reference
VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to associate with this vertex buffer.
sizeInBytes
The number of bytes to allocate for this vertex buffer.
usage
Options identifying the behaviors of this vertex buffer resource.
Exceptions
Exception type Condition
ArgumentNullException The graphicsDevice cannot be null when creating new resources.
ArgumentOutOfRangeException sizeInBytes must be greater than zero.
InvalidOperationException This resource could not be created.
See Also
Reference
VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
graphicsDevice
The graphics device to associate with this vertex buffer.
vertexType
The type of vertices in this vertex buffer.
elementCount
The number of elements in this vertex buffer.
usage
Options identifying the behaviors of this vertex buffer resource.
Exceptions
Exception type Condition
ArgumentNullException The graphicsDevice cannot be null when creating new resources.
ArgumentOutOfRangeException elementCount must be greater than zero.
InvalidOperationException This resource could not be created.
See Also
Reference
VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexBuffer Methods
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetData Overloaded. Returns a copy of the vertex buffer data.
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
SetData Overloaded. Sets the vertex buffer data.
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
MemberwiseClone (Inherited from Object.)
raise_Disposing (Inherited from GraphicsResource.)
See Also
Reference
VertexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexBuffer.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
VertexBuffer.Dispose (Boolean) Immediately releases the unmanaged resources used by this object.
VertexBuffer.Dispose () (Inherited from GraphicsResource.)
Remarks
Call Dispose when you are finished using the VertexBuffer. The Dispose method leaves the VertexBuffer in an unusable state.
After calling Dispose, you must release all references to the VertexBuffer so the garbage collector can reclaim the memory that
the VertexBuffer was occupying.
Note
Always call Dispose before you release your last reference to the VertexBuffer. Otherwise, the resources it is using will not be
freed until the garbage collector calls the VertexBuffer object's Finalize method.
See Also
Reference
VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
Remarks
This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean)
method with the disposing parameter set to true. Finalize invokes Dispose(Boolean) with disposing set to false.
When the disposing parameter is true, this method releases all resources held by any managed objects that this VertexBuffer
references. This method invokes the Dispose method of each referenced object.
Note
Notes to Inheritors
Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects
disposed of in an earlier call to Dispose.
See Also
Reference
VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexBuffer.GetData Method
Returns a copy of the vertex buffer data.
Overload List
Name Description
VertexBuffer.GetData (Int32, T[], Int32, Int32, Int32) Gets a copy of the vertex buffer data, specifying the start index, starting offs
et, number of elements, and size of the vertex buffer elements.
VertexBuffer.GetData (T[]) Gets a copy of the vertex buffer data.
VertexBuffer.GetData (T[], Int32, Int32) Gets a copy of the vertex buffer data, specifying the start index and number
of elements in the vertex buffer.
See Also
Reference
VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Type Parameters
T
The type of data in the vertex buffer.
Parameters
offsetInBytes
Starting offset.
data
The array into which to copy the vertex buffer data.
startIndex
Index of the element in the array at which to start copying.
elementCount
Number of elements in the array.
vertexStride
Size, in bytes, of an element in the vertex buffer.
Exceptions
Exception type Condition
ArgumentNullException data is null. data must be of sufficient length to receive the data.
ArgumentOutOfRangeException One of the following conditions is true:
The vertex stride is larger than the vertex buffer.
The vertex stride is too small for the type of data requested.
InvalidOperationException The array is not the correct size for the amount of data requested.
NotSupportedException This VertexBuffer was created with a usage type of BufferUsage.WriteOnly. Calling GetData o
n a resource that was created with BufferUsage.WriteOnly is not supported.
See Also
Reference
VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of data in the vertex buffer.
Parameters
data
The array into which to copy the vertex buffer data.
Exceptions
Exception type Condition
ArgumentNullException data is null. data must be of sufficient length to receive the data.
ArgumentOutOfRangeException One of the following conditions is true:
The vertex stride is larger than the vertex buffer.
The vertex stride is too small for the type of data requested.
InvalidOperationException The array is not the correct size for the amount of data requested.
NotSupportedException This VertexBuffer was created with a usage type of BufferUsage.WriteOnly. Calling GetData o
n a resource that was created with BufferUsage.WriteOnly is not supported.
Remarks An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or
SetData methods) a resource that is currently set on a graphics device.
See Also
Reference
VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of data in the vertex buffer.
Parameters
data
The array into which to copy the vertex buffer data.
startIndex
Index of the element in the array at which to start copying.
elementCount
Number of elements in the array.
Exceptions
Exception type Condition
ArgumentNullException data is null. data must be of sufficient length to receive the data.
ArgumentOutOfRangeException One of the following conditions is true:
The vertex stride is larger than the vertex buffer.
The vertex stride is too small for the type of data requested.
InvalidOperationException The array is not the correct size for the amount of data requested.
NotSupportedException This VertexBuffer was created with a usage type of BufferUsage.WriteOnly. Calling GetData o
n a resource that was created with BufferUsage.WriteOnly is not supported.
Remarks An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or
SetData methods) a resource that is currently set on a graphics device.
See Also
Reference
VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexBuffer.SetData Method
Sets the vertex buffer data.
Overload List
Name Description
VertexBuffer.SetData (Int32, T[], Int32, Int32, Int32) Sets the vertex buffer data.
VertexBuffer.SetData (T[]) Sets the vertex buffer data.
VertexBuffer.SetData (T[], Int32, Int32) Sets the vertex buffer data.
See Also
Reference
VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Type Parameters
T
The type of data in the vertex buffer.
Parameters
offsetInBytes
Starting offset.
data
Array from which to copy the vertex buffer data.
startIndex
Index of the element in the array at which to start copying.
elementCount
Number of elements to copy.
vertexStride
Size, in bytes, of an element in the vertex buffer.
Exceptions
Exception type Condition
ArgumentNullException data is null.
ArgumentOutOfRangeException One of the following conditions is true:
The vertex stride is larger than the vertex buffer.
The vertex stride is too small for the type of data requested.
InvalidOperationException The array is not the correct size for the amount of data requested.
Remarks An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or
SetData methods) a resource that is currently set on a graphics device.
See Also
Reference
VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of data in the vertex buffer.
Parameters
data
The array from which to copy the vertex buffer data.
Exceptions
Exception type Condition
ArgumentNullException data is null.
ArgumentOutOfRangeException One of the following conditions is true:
The vertex stride is larger than the vertex buffer.
The vertex stride is too small for the type of data requested.
InvalidOperationException The array is not the correct size for the amount of data requested.
Remarks An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or
SetData methods) a resource that is currently set on a graphics device.
Caution
Here is a tip for rendering objects within the Draw method of an Xbox 360 game. Do not use SetData when writing data to v
ertex buffers, index buffers, and textures. This method may lead to graphics corruption or crashes. To avoid this potential issu
e, use DrawUserPrimitives, DrawUserIndexedPrimitives, or DynamicVertexBuffer as the preferred alternative to
VertexBuffer.SetData for dynamic vertex generation.
This is because, in cases where the size of the back buffer and depth stencil buffer exceed the size of the Xbox 360 10 MB of e
mbedded memory (EDRAM), predicated tiling is utilized on this platform to compensate for the additional memory requirem
ents. Predicated tiling is a process by which scene rendering is performed multiple times on subsections of the final render ta
rget dimensions.
When predicated tiling has been triggered, the drawing commands contained in the Draw function are not submitted until
Present is called. (Note that Draw implicitly calls Present at the end of this method.) In this case, these resources are not avail
able for modification until the GPU is finished with presenting the entire frame.
Example
This example demonstrates how to create a vertex buffer to hold a list of vertices and set the data for the vertex buffer to the
array of vertices.
C#
vertexBuffer = new VertexBuffer(graphics.GraphicsDevice,
VertexPositionNormalTexture.SizeInBytes * (pointList.Length),
BufferUsage.None);
// Set the vertex buffer data to the array of vertices.
vertexBuffer.SetData<VertexPositionNormalTexture>(pointList);
Prior to drawing the vertices, set the source of the vertex stream for the graphics device by setting the desired vertex stream
from GraphicsDevice.Vertices. Here, we use vertex stream zero, so GraphicsDevice.Vertices[0] is set to the vertex buffer
created in step (1).
C#
graphics.GraphicsDevice.Vertices[0].SetSource(
vertexBuffer, 0,
VertexPositionNormalTexture.SizeInBytes);
See Also
Concepts
Predicated Tiling
Tasks
How To: Draw Points, Lines, and Other 3D Primitives
Reference
VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Type Parameters
T
The type of data in the vertex buffer.
Parameters
data
Array from which to copy the vertex buffer data.
startIndex
Index of the element in the array at which to start copying.
elementCount
Number of elements to copy.
Exceptions
Exception type Condition
ArgumentNullException data is null.
ArgumentOutOfRangeException One of the following conditions is true:
The vertex stride is larger than the vertex buffer.
The vertex stride is too small for the type of data requested.
InvalidOperationException The array is not the correct size for the amount of data requested.
Remarks An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or
SetData methods) a resource that is currently set on a graphics device.
See Also
Reference
VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexBuffer.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexBuffer Properties
Public Properties
Name Description
BufferUsage Gets the state of the related BufferUsage enumeration.
GraphicsDevice (Inherited from GraphicsResource.)
IsDisposed (Inherited from GraphicsResource.)
Name (Inherited from GraphicsResource.)
Priority (Inherited from GraphicsResource.)
ResourceType (Inherited from GraphicsResource.)
SizeInBytes Gets the size, in bytes, of this vertex buffer.
Tag (Inherited from GraphicsResource.)
See Also
Reference
VertexBuffer Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexBuffer.BufferUsage Property
Gets the state of the related BufferUsage enumeration.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public BufferUsage BufferUsage { get; }
Property Value
Indicates how the application uses buffer contents.
See Also
Reference
VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexBuffer.SizeInBytes Property
Gets the size, in bytes, of this vertex buffer.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int SizeInBytes { get; }
Property Value
The size, in bytes, of the vertex buffer.
See Also
Reference
VertexBuffer Class
VertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexDeclaration Class
Represents a vertex declaration.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class VertexDeclaration : IDisposable
See Also
Reference
VertexDeclaration Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexDeclaration Members
The following tables list the members exposed by the VertexDeclaration type.
Public Constructors
Name Description
VertexDeclaration Initializes a new instance of the VertexDeclaration class.
Public Properties
Name Description
GraphicsDevice Gets the GraphicsDevice associated with this vertex declaration.
IsDisposed Gets a value that indicates whether the object is disposed.
Name Returns the name of this vertex declaration.
Tag Returns the resource tags for this vertex declaration.
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
GetVertexElements Gets the vertex shader declaration.
GetVertexStrideSize Overloaded. Gets the size of a vertex from the vertex declaration.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_Disposing Raises the Disposing event when called from within a derived class.
Public Events
Name Description
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micro
soft .NET common language runtime.
See Also
Reference
VertexDeclaration Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexDeclaration Constructor
Initializes a new instance of the VertexDeclaration class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public VertexDeclaration (
GraphicsDevice graphicsDevice,
VertexElement[] elements
)
Parameters
graphicsDevice
The GraphicsDevice associated with the vertex elements.
elements
An array of vertex elements.
Exceptions
Exception type Condition
ArgumentNullException graphicsDevice or elements is null.
ArgumentOutOfRangeException elements does not contain any elements, or is too large for the graphics device.
InvalidOperationException Unable to create this VertexDeclaration resource on the graphics device.
Remarks
VertexDeclaration objects must be recreated when the device is reset.
See Also
Tasks
How To: Load Content
Reference
GraphicsDeviceManager.DeviceReset Event
VertexDeclaration Class
VertexDeclaration Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexDeclaration Methods
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
GetVertexElements Gets the vertex shader declaration.
GetVertexStrideSize Overloaded. Gets the size of a vertex from the vertex declaration.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_Disposing Raises the Disposing event when called from within a derived class.
See Also
Reference
VertexDeclaration Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexDeclaration.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
VertexDeclaration.Dispose () Immediately releases the unmanaged resources used by this object.
VertexDeclaration.Dispose (Boolean) Immediately releases the unmanaged resources used by this object.
See Also
Reference
VertexDeclaration Class
VertexDeclaration Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexDeclaration.Dispose Method ()
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
Remarks
Call Dispose when you are finished using the VertexDeclaration. The Dispose method leaves the VertexDeclaration in an
unusable state. After calling Dispose, you must release all references to the VertexDeclaration so the garbage collector can
reclaim the memory that the VertexDeclaration was occupying.
Note
Always call Dispose before you release your last reference to the VertexDeclaration. Otherwise, the resources it is using will n
ot be freed until the garbage collector calls the VertexDeclaration object's Finalize method.
See Also
Reference
VertexDeclaration Class
VertexDeclaration Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
Remarks
This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean)
method with the disposing parameter set to true. Finalize invokes Dispose(Boolean) with disposing set to false.
When the disposing parameter is true, this method releases all resources held by any managed objects that this
VertexDeclaration references. This method invokes the Dispose method of each referenced object.
Note
Notes to Inheritors
Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects
disposed of in an earlier call to Dispose.
See Also
Reference
VertexDeclaration Class
VertexDeclaration Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexDeclaration.Finalize Method
Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the
object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void Finalize ()
Remarks
This method overrides System.Object.Finalize. Application code should not call this method; an object's Finalize method is
automatically invoked during garbage collection, unless a call to the GC.SuppressFinalize method has disabled finalization by
the garbage collector.
See Also
Reference
VertexDeclaration Class
VertexDeclaration Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexDeclaration.GetVertexElements Method
Gets the vertex shader declaration.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public VertexElement[] GetVertexElements ()
Return Value
The array of vertex elements that make up the vertex shader declaration.
See Also
Reference
VertexDeclaration Class
VertexDeclaration Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexDeclaration.GetVertexStrideSize Method
Gets the size of a vertex from the vertex declaration.
Overload List
Name Description
VertexDeclaration.GetVertexStrideSize (Int32) Gets the size of a vertex from the vertex declaration.
VertexDeclaration.GetVertexStrideSize (VertexElement[], Int32) Gets the size of a vertex from the vertex declaration.
See Also
Reference
VertexDeclaration Class
VertexDeclaration Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
stream
The zero-based stream index.
Return Value
The vertex declaration size, in bytes.
See Also
Reference
VertexDeclaration Class
VertexDeclaration Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexDeclaration.GetVertexStrideSize Method
(VertexElement[], Int32)
Gets the size of a vertex from the vertex declaration.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static int GetVertexStrideSize (
VertexElement[] elements,
int stream
)
Parameters
elements
The vertex declaration.
stream
The zero-based stream index.
Return Value
The vertex declaration size, in bytes.
See Also
Reference
VertexDeclaration Class
VertexDeclaration Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexDeclaration.raise_Disposing Method
Raises the Disposing event when called from within a derived class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected void raise_Disposing (
Object value0,
EventArgs value1
)
Parameters
value0
Invoking object reference; should be this object.
value1
Arguments to pass to the event handler.
See Also
Reference
VertexDeclaration Class
VertexDeclaration Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexDeclaration.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
VertexDeclaration Class
VertexDeclaration Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexDeclaration Properties
Public Properties
Name Description
GraphicsDevice Gets the GraphicsDevice associated with this vertex declaration.
IsDisposed Gets a value that indicates whether the object is disposed.
Name Returns the name of this vertex declaration.
Tag Returns the resource tags for this vertex declaration.
See Also
Reference
VertexDeclaration Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexDeclaration.GraphicsDevice Property
Gets the GraphicsDevice associated with this vertex declaration.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GraphicsDevice GraphicsDevice { get; }
Property Value
The GraphicsDevice associated with this vertex declaration.
See Also
Reference
VertexDeclaration Class
VertexDeclaration Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexDeclaration.IsDisposed Property
Gets a value that indicates whether the object is disposed.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsDisposed { get; }
Property Value
true if the object is disposed; false otherwise.
See Also
Reference
VertexDeclaration Class
VertexDeclaration Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexDeclaration.Name Property
Returns the name of this vertex declaration.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Name { get; set; }
Property Value
The name of this vertex declaration.
See Also
Reference
VertexDeclaration Class
VertexDeclaration Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexDeclaration.Tag Property
Returns the resource tags for this vertex declaration.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Object Tag { get; set; }
Property Value
The resource tags for this vertex declaration.
See Also
Reference
VertexDeclaration Class
VertexDeclaration Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexDeclaration Events
Public Events
Name Description
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micro
soft .NET common language runtime.
See Also
Reference
VertexDeclaration Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexDeclaration.Disposing Event
Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET
common language runtime.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public event EventHandler Disposing
See Also
Reference
VertexDeclaration Class
VertexDeclaration Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexElement Structure
Defines input vertex data to the pipeline.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public struct VertexElement
See Also
Reference
VertexElement Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexElement Members
The following tables list the members exposed by the VertexElement type.
Public Constructors
Name Description
VertexElement Initializes a new instance of the VertexElement class.
Public Properties
Name Description
Offset Retrieves or sets the offset (if any) from the beginning of the stream to the beginning of the vertex d
ata.
Stream Retrieves or sets the stream number (or index) to use.
UsageIndex Modifies the usage data to allow the user to specify multiple usage types.
VertexElementFormat Gets or sets the format of this vertex element.
VertexElementMethod Gets or sets a value indicating which vertex data to calculate during tessellation.
VertexElementUsage Gets or sets a value describing how the vertex element is to be used.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Compares two objects to determine whether they are the same.
op_Inequality Compares two objects to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
VertexElement Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexElement Constructor
Initializes a new instance of the VertexElement class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public VertexElement (
short stream,
short offset,
VertexElementFormat elementFormat,
VertexElementMethod elementMethod,
VertexElementUsage elementUsage,
byte usageIndex
)
Parameters
stream
Stream number (or index) to use.
offset
Offset (if any) from the beginning of the stream to the beginning of the vertex data.
elementFormat
One of several predefined types that define the vertex data size.
elementMethod
The tessellator processing method. These methods determine how the tessellator interprets/operates on the vertex data.
elementUsage
The intended use of the vertex data.
usageIndex
Modifies the usage data to allow the user to specify multiple usage types.
RemarksVertex data is defined using an array of VertexElement structures.
See Also
Reference
VertexElement Structure
VertexElement Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexElement Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Compares two objects to determine whether they are the same.
op_Inequality Compares two objects to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
VertexElement Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexElement.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
VertexElement.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
VertexElement.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
VertexElement Structure
VertexElement Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
obj
The Object to compare with the current VertexElement.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
VertexElement Structure
VertexElement Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexElement.GetHashCode Method
Gets the hash code for this instance.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for this object.
See Also
Reference
VertexElement Structure
VertexElement Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexElement.op_Equality Method
Compares two objects to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
VertexElement left,
VertexElement right
)
Parameters
left
Object to the left of the equality operator.
right
Object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
VertexElement Structure
VertexElement Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexElement.op_Inequality Method
Compares two objects to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
VertexElement left,
VertexElement right
)
Parameters
left
Object to the left of the inequality operator.
right
Object to the right of the inequality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
VertexElement Structure
VertexElement Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexElement.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
VertexElement Structure
VertexElement Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexElement Properties
Public Properties
Name Description
Offset Retrieves or sets the offset (if any) from the beginning of the stream to the beginning of the vertex d
ata.
Stream Retrieves or sets the stream number (or index) to use.
UsageIndex Modifies the usage data to allow the user to specify multiple usage types.
VertexElementFormat Gets or sets the format of this vertex element.
VertexElementMethod Gets or sets a value indicating which vertex data to calculate during tessellation.
VertexElementUsage Gets or sets a value describing how the vertex element is to be used.
See Also
Reference
VertexElement Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexElement.Offset Property
Retrieves or sets the offset (if any) from the beginning of the stream to the beginning of the vertex data.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public short Offset { get; set; }
Property Value
Offset, in bytes, to the start of the vertex data.
See Also
Reference
VertexElement Structure
VertexElement Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexElement.Stream Property
Retrieves or sets the stream number (or index) to use.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public short Stream { get; set; }
Property Value
Stream number (or index) to use.
See Also
Reference
VertexElement Structure
VertexElement Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexElement.UsageIndex Property
Modifies the usage data to allow the user to specify multiple usage types.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public byte UsageIndex { get; set; }
Property Value
Byte that represents the usage index.
RemarksThe UsageIndex property is used in conjunction with VertexElementUsage to specify the semantic of a vertex
element.
See Also
Reference
VertexElement Structure
VertexElement Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexElement.VertexElementFormat Property
Gets or sets the format of this vertex element.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public VertexElementFormat VertexElementFormat { get; set; }
Property Value
The format of this vertex element.
See Also
Reference
VertexElement Structure
VertexElement Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexElement.VertexElementMethod Property
Gets or sets a value indicating which vertex data to calculate during tessellation.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public VertexElementMethod VertexElementMethod { get; set; }
Property Value
A value indicating which vertex data to calculate during tessellation.
See Also
Reference
VertexElement Structure
VertexElement Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexElement.VertexElementUsage Property
Gets or sets a value describing how the vertex element is to be used.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public VertexElementUsage VertexElementUsage { get; set; }
Property Value
A value describing how the vertex element is to be used.
See Also
Reference
VertexElement Structure
VertexElement Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexElementFormat Enumeration
Defines vertex element formats.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum VertexElementFormat
Members
Member n Description
ame
Single Single-component, 32-bit floating-point, expanded to (float, 0, 0, 1).
Vector2 Two-component, 32-bit floating-point, expanded to (float, Float32 value, 0, 1).
Vector3 Three-component, 32-bit floating point, expanded to (float, float, float, 1).
Vector4 Four-component, 32-bit floating point, expanded to (float, float, float, float).
HalfVecto Two-component, 16-bit floating point expanded to (value, value, value, value). This type is valid for vertex shader
r2 version 2.0 or higher.
HalfVecto Four-component, 16-bit floating-point expanded to (value, value, value, value). This type is valid for vertex shade
r4 r version 2.0 or higher.
Rgba64 Normalized, four-component, unsigned short, expanded to (first byte/65535.0, second byte/65535.0, third byte/6
5535.0, fourth byte/65535.0). This type is valid for vertex shader version 2.0 or higher.
Color Four-component, packed, unsigned byte, mapped to 0 to 1 range. Input is in Int32 format (ARGB) expanded to (R,
G, B, A).
Rgba32 Four-component byte with each byte normalized by dividing the component with 255.0f. This type is valid for ver
tex shader version 2.0 or higher.
Rg32 Normalized, two-component, unsigned short, expanded to (first byte/65535.0, second byte/65535.0, 0, 1). This ty
pe is valid for vertex shader version 2.0 or higher.
Normalize Normalized, two-component, signed short, expanded to (first short/32767.0, second short/32767.0, 0, 1). This typ
dShort2 e is valid for vertex shader version 2.0 or higher.
Normalize Normalized, four-component, signed short, expanded to (first short/32767.0, second short/32767.0, third short/3
dShort4 2767.0, fourth short/32767.0). This type is valid for vertex shader version 2.0 or higher.
Normalize Three-component, signed, 10 10 10 format normalized and expanded to (v[0]/511.0, v[1]/511.0, v[2]/511.0, 1).
d101010
Short2 Two-component, signed short expanded to (value, value, 0, 1).
Short4 Four-component, signed short expanded to (value, value, value, value).
Byte4 Four-component, unsigned byte.
UInt10101 Three-component, unsigned, 10 10 10 format expanded to (value, value, value, 1).
0
Unused Type field in the declaration is unused. This is designed for use with VertexElementMethod.UV and
VertexElementMethod.LookUpPresampled.
Remarks
Vertex data is declared with an array of VertexElement structures. Each element in the array contains a vertex declaration
method. These values can be passed into the constructor or to the VertexElementMethod property.
A mapping of each Direct3D 9 format name to the VertexElementFormat equivalent is listed in the following table.
Direct3D 9 Vertex Format VertexElementFormat equivalent
Floating Point
Float32 D3DDECLTYPE_FLOAT1 Single
D3DDECLTYPE_FLOAT2 Vector2
D3DDECLTYPE_FLOAT3 Vector3
D3DDECLTYPE_FLOAT4 Vector4
Float16 D3DDECLTYPE_FLOAT16_2 HalfVector2
D3DDECLTYPE_FLOAT16_4 HalfVector4
Unsigned Normalized
64 bpp D3DDECLTYPE_USHORT4N Rgba64
32 bpp D3DDECLTYPE_D3DCOLOR Color
D3DDECLTYPE_UBYTE4N Rgba32
D3DDECLTYPE_USHORT2N Rg32
Signed Normalized
D3DDECLTYPE_SHORT2N NormalizedShort2
D3DDECLTYPE_SHORT4N NormalizedShort4
D3DDECLTYPE_DEC3N Normalized101010
Signed Integer
D3DDECLTYPE_SHORT2 Short2
D3DDECLTYPE_SHORT4 Short4
Unsigned Integer
D3DDECLTYPE_UBYTE4 Byte4
D3DDECLTYPE_UDEC3 UInt101010
See Also
Reference
VertexElement Constructor
VertexElement.VertexElementFormat Property
GraphicsDeviceCapabilities.DeclarationTypeCaps Properties
VertexElementMethod Enumeration
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexElementMethod Enumeration
Defines the tessellator processing method for a vertex element.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum VertexElementMethod
Members
Mem Description
ber n
ame
Defa Default value. The tessellator copies the vertex data (or the spline data if it is operating on a patch) without performing
ult additional calculations on it. The input and output types can be any value. When the tessellator is used, this element is i
nterpolated; otherwise, vertex data is copied into the input register.
Look Looks up a displacement map. The input type can be VertexElementFormat.Vector2, VertexElementFormat.Vector3, or
Up VertexElementFormat.Vector4. Only the .x and .y components are used for the texture map lookup. The output type is al
ways VertexElementFormat.Single. The device must support displacement mapping. This constant is supported only by
the programmable pipeline on N-patch data, if N-patches are enabled.
Look Looks up a presampled displacement map. The input type must be set to VertexElementFormat.Unused, and the stream
UpPr index and stream offset must be set to 0. The output type for this operation is always VertexElementFormat.Single. The
esa device must support displacement mapping. This constant is supported only by the programmable pipeline on N-patch
mple data, if N-patches are enabled.
d
UV Copies out the u and v values at a point on the rectangle or triangle patch. This results in a 2D float. The input type mus
t be set to VertexElementFormat.Unused; the output type is always VertexElementFormat.Vector2. The input stream and
offset also are unused, but must be set to 0.
Remarks
The VertexElement structure uses VertexElementMethod values to determine which vertex data to calculate during
tessellation. These values can be passed into the constructor or to the VertexElementMethod property. Mesh data should use
the default value. Patches can use any of the other implemented types.
Vertex data is declared with an array of VertexElement structures. Each element in the array contains a vertex declaration
method.
In addition to using Default, a normal mesh can use LookUp and LookUpPresampled when N-patches are enabled.
See Also
Reference
VertexElement Constructor
VertexElement.VertexElementMethod Property
VertexElementFormat Enumeration
VertexElementUsage Enumeration
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexElementUsage Enumeration
Defines usage for vertex elements.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum VertexElementUsage
Members
Memb Description
er nam
e
Binor Vertex binormal data.
mal
BlendI Blending indices data. (BlendIndices with UsageIndex = 0) specifies matrix indices for fixed-function vertex processi
ndices ng using indexed paletted skinning.
Blend Blending weight data. (BlendWeight with UsageIndex = 0) specifies the blend weights in fixed-function vertex proce
Weigh ssing.
t
Color Vertex data contains diffuse or specular color. (Color with UsageIndex = 0) specifies the diffuse color in the fixed-fun
ction vertex shader and in pixel shaders prior to ps_3_0. (Color with UsageIndex = 1) specifies the specular color in t
he fixed-function vertex shader and in pixel shaders prior to ps_3_0.
Depth Vertex data contains depth data.
Fog Vertex data contains fog data. (Fog with UsageIndex = 0) specifies a fog blend value to use after pixel shading is finis
hed. This flag applies to pixel shaders prior to version ps_3_0.
Norma Vertex normal data. (Normal with UsageIndex = 0) specifies vertex normals for fixed-function vertex processing and
l the N-patch tessellator. (Normal with UsageIndex = 1) specifies vertex normals for fixed-function vertex processing f
or skinning.
PointS Point size data. (PointSize with UsageIndex = 0) specifies the point-size attribute used by the setup engine of the ras
ize terizer to expand a point into a quad for the point-sprite functionality.
Positio Position data. (Position with UsageIndex = 0 ) specifies the nontransformed position in fixed-function vertex process
n ing and the N-patch tessellator. (Position with UsageIndex = 1) specifies the nontransformed position in the fixed-fu
nction vertex shader for skinning.
Sampl Vertex data contains sampler data. (Sample with UsageIndex = 0) specifies the displacement value to look up. This fl
e ag can be used only with VertexElementMethod.LookUpPresampled or VertexElementMethod.LookUp.
Tange Vertex tangent data.
nt
Tessell Single, positive floating-point value. (TessellateFactor with UsageIndex = 0) specifies a tessellation factor used in th
ateFac e tessellation unit to control the rate of tessellation.
tor
Textur Texture coordinate data. (TextureCoordinate, n) specifies texture coordinates in fixed-function vertex processing an
eCoor d in pixel shaders prior to ps_3_0. These coordinates can be used to pass user-defined data.
dinate
RemarksVertex data is declared with an array of VertexElement structures. Each element in the array contains a usage type.
See Also
Reference
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionColor Structure
Describes a custom vertex format structure that contains position and color information.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public struct VertexPositionColor
See Also
Reference
VertexPositionColor Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionColor Members
The following tables list the members exposed by the VertexPositionColor type.
Public Constructors
Name Description
VertexPositionColor Initializes a new instance of the VertexPositionColor class.
Public Fields
Name Description
Color The vertex color.
Position The vertex position.
VertexElements An array of two vertex elements describing the position, followed by the color, of this vertex.
Public Properties
Name Description
SizeInBytes Gets the size of the VertexPositionColor class.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Compares two objects to determine whether they are the same.
op_Inequality Compares two objects to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
VertexPositionColor Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexPositionColor Fields
Public Fields
Name Description
Color The vertex color.
Position The vertex position.
VertexElements An array of two vertex elements describing the position, followed by the color, of this vertex.
See Also
Reference
VertexPositionColor Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexPositionColor.Color Field
The vertex color.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Color Color
See Also
Reference
VertexPositionColor Structure
VertexPositionColor Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionColor.Position Field
The vertex position.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Position
See Also
Reference
VertexPositionColor Structure
VertexPositionColor Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionColor.VertexElements Field
An array of two vertex elements describing the position, followed by the color, of this vertex.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static readonly VertexElement[] VertexElements
See Also
Reference
VertexPositionColor Structure
VertexPositionColor Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionColor Constructor
Initializes a new instance of the VertexPositionColor class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public VertexPositionColor (
Vector3 position,
Color color
)
Parameters
position
The position of the vertex.
color
The color of the vertex.
See Also
Reference
VertexPositionColor Structure
VertexPositionColor Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionColor Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Compares two objects to determine whether they are the same.
op_Inequality Compares two objects to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
VertexPositionColor Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexPositionColor.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
VertexPositionColor.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified o
bject.
VertexPositionColor.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
VertexPositionColor Structure
VertexPositionColor Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
obj
The Object to compare with the current VertexPositionColor.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
VertexPositionColor Structure
VertexPositionColor Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionColor.GetHashCode Method
Gets the hash code for this instance.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for this object.
See Also
Reference
VertexPositionColor Structure
VertexPositionColor Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionColor.op_Equality Method
Compares two objects to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
VertexPositionColor left,
VertexPositionColor right
)
Parameters
left
Object to the left of the equality operator.
right
Object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
VertexPositionColor Structure
VertexPositionColor Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionColor.op_Inequality Method
Compares two objects to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
VertexPositionColor left,
VertexPositionColor right
)
Parameters
left
Object to the left of the inequality operator.
right
Object to the right of the inequality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
VertexPositionColor Structure
VertexPositionColor Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionColor.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
VertexPositionColor Structure
VertexPositionColor Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionColor Properties
Public Properties
Name Description
SizeInBytes Gets the size of the VertexPositionColor class.
See Also
Reference
VertexPositionColor Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexPositionColor.SizeInBytes Property
Gets the size of the VertexPositionColor class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static int SizeInBytes { get; }
Property Value
The size of the vertex, in bytes.
See Also
Reference
VertexPositionColor Structure
VertexPositionColor Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionColorTexture Structure
Describes a custom vertex format structure that contains position, color, and one set of texture coordinates.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public struct VertexPositionColorTexture
See Also
Reference
VertexPositionColorTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionColorTexture Members
The following tables list the members exposed by the VertexPositionColorTexture type.
Public Constructors
Name Description
VertexPositionColorTexture Initializes a new instance of the VertexPositionColorTexture class.
Public Fields
Name Description
Color The vertex color.
Position The vertex position.
TextureCoordinate The texture coordinates.
VertexElements An array of three vertex elements describing the position, texture coordinate, and color of this vertex.
Public Properties
Name Description
SizeInBytes Gets the size of the VertexPositionColorTexture class.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Compares two objects to determine whether they are the same.
op_Inequality Compares two objects to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
VertexPositionColorTexture Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexPositionColorTexture Fields
Public Fields
Name Description
Color The vertex color.
Position The vertex position.
TextureCoordinate The texture coordinates.
VertexElements An array of three vertex elements describing the position, texture coordinate, and color of this vertex.
See Also
Reference
VertexPositionColorTexture Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexPositionColorTexture.Color Field
The vertex color.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Color Color
See Also
Reference
VertexPositionColorTexture Structure
VertexPositionColorTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionColorTexture.Position Field
The vertex position.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Position
See Also
Reference
VertexPositionColorTexture Structure
VertexPositionColorTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionColorTexture.TextureCoordinate Field
The texture coordinates.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector2 TextureCoordinate
See Also
Reference
VertexPositionColorTexture Structure
VertexPositionColorTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionColorTexture.VertexElements Field
An array of three vertex elements describing the position, texture coordinate, and color of this vertex.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static readonly VertexElement[] VertexElements
See Also
Reference
VertexPositionColorTexture Structure
VertexPositionColorTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionColorTexture Constructor
Initializes a new instance of the VertexPositionColorTexture class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public VertexPositionColorTexture (
Vector3 position,
Color color,
Vector2 textureCoordinate
)
Parameters
position
Position of the vertex.
color
Color of the vertex.
textureCoordinate
Texture coordinate of the vertex.
See Also
Reference
VertexPositionColorTexture Structure
VertexPositionColorTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionColorTexture Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Compares two objects to determine whether they are the same.
op_Inequality Compares two objects to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
VertexPositionColorTexture Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexPositionColorTexture.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
VertexPositionColorTexture.Equals (Object) Returns a value that indicates whether the current instance is equal to a spe
cified object.
VertexPositionColorTexture.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
VertexPositionColorTexture Structure
VertexPositionColorTexture Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
obj
The Object to compare with the current VertexPositionColorTexture.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
VertexPositionColorTexture Structure
VertexPositionColorTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionColorTexture.GetHashCode Method
Gets the hash code for this instance.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for this object.
See Also
Reference
VertexPositionColorTexture Structure
VertexPositionColorTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionColorTexture.op_Equality Method
Compares two objects to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
VertexPositionColorTexture left,
VertexPositionColorTexture right
)
Parameters
left
Object to the left of the equality operator.
right
Object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
VertexPositionColorTexture Structure
VertexPositionColorTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionColorTexture.op_Inequality Method
Compares two objects to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
VertexPositionColorTexture left,
VertexPositionColorTexture right
)
Parameters
left
Object to the left of the inequality operator.
right
Object to the right of the inequality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
VertexPositionColorTexture Structure
VertexPositionColorTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionColorTexture.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
VertexPositionColorTexture Structure
VertexPositionColorTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionColorTexture Properties
Public Properties
Name Description
SizeInBytes Gets the size of the VertexPositionColorTexture class.
See Also
Reference
VertexPositionColorTexture Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexPositionColorTexture.SizeInBytes Property
Gets the size of the VertexPositionColorTexture class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static int SizeInBytes { get; }
Property Value
The size of the vertex, in bytes.
See Also
Reference
VertexPositionColorTexture Structure
VertexPositionColorTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionNormalTexture Structure
Describes a custom vertex format structure that contains position, normal data, and one set of texture coordinates.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public struct VertexPositionNormalTexture
See Also
Tasks
How To: Use BasicEffect
How To: Draw Points, Lines, and Other 3D Primitives
Reference
VertexPositionNormalTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionNormalTexture Members
The following tables list the members exposed by the VertexPositionNormalTexture type.
Public Constructors
Name Description
VertexPositionNormalTexture Initializes a new instance of the VertexPositionNormalTexture class.
Public Fields
Name Description
Normal The vertex normal.
Position The vertex position.
TextureCoordinate The texture coordinates.
VertexElements An array of three vertex elements describing the position, normal, and texture coordinate of this verte
x.
Public Properties
Name Description
SizeInBytes Gets the size of the VertexPositionNormalTexture class.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Compares two objects to determine whether they are the same.
op_Inequality Compares two objects to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
VertexPositionNormalTexture Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexPositionNormalTexture Fields
Public Fields
Name Description
Normal The vertex normal.
Position The vertex position.
TextureCoordinate The texture coordinates.
VertexElements An array of three vertex elements describing the position, normal, and texture coordinate of this verte
x.
See Also
Reference
VertexPositionNormalTexture Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexPositionNormalTexture.Normal Field
The vertex normal.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Normal
See Also
Reference
VertexPositionNormalTexture Structure
VertexPositionNormalTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionNormalTexture.Position Field
The vertex position.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Position
See Also
Reference
VertexPositionNormalTexture Structure
VertexPositionNormalTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionNormalTexture.TextureCoordinate Field
The texture coordinates.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector2 TextureCoordinate
See Also
Reference
VertexPositionNormalTexture Structure
VertexPositionNormalTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionNormalTexture.VertexElements Field
An array of three vertex elements describing the position, normal, and texture coordinate of this vertex.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static readonly VertexElement[] VertexElements
See Also
Reference
VertexPositionNormalTexture Structure
VertexPositionNormalTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionNormalTexture Constructor
Initializes a new instance of the VertexPositionNormalTexture class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public VertexPositionNormalTexture (
Vector3 position,
Vector3 normal,
Vector2 textureCoordinate
)
Parameters
position
Position of the vertex.
normal
The vertex normal.
textureCoordinate
The texture coordinate.
See Also
Reference
VertexPositionNormalTexture Structure
VertexPositionNormalTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionNormalTexture Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Compares two objects to determine whether they are the same.
op_Inequality Compares two objects to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
VertexPositionNormalTexture Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexPositionNormalTexture.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
VertexPositionNormalTexture.Equals (Object) Returns a value that indicates whether the current instance is equal to a s
pecified object.
VertexPositionNormalTexture.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
VertexPositionNormalTexture Structure
VertexPositionNormalTexture Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
obj
The Object to compare with the current VertexPositionNormalTexture.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
VertexPositionNormalTexture Structure
VertexPositionNormalTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionNormalTexture.GetHashCode Method
Gets the hash code for this instance.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for this object.
See Also
Reference
VertexPositionNormalTexture Structure
VertexPositionNormalTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionNormalTexture.op_Equality Method
Compares two objects to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
VertexPositionNormalTexture left,
VertexPositionNormalTexture right
)
Parameters
left
Object to the left of the equality operator.
right
Object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
VertexPositionNormalTexture Structure
VertexPositionNormalTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionNormalTexture.op_Inequality Method
Compares two objects to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
VertexPositionNormalTexture left,
VertexPositionNormalTexture right
)
Parameters
left
Object to the left of the inequality operator.
right
Object to the right of the inequality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
VertexPositionNormalTexture Structure
VertexPositionNormalTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionNormalTexture.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
VertexPositionNormalTexture Structure
VertexPositionNormalTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionNormalTexture Properties
Public Properties
Name Description
SizeInBytes Gets the size of the VertexPositionNormalTexture class.
See Also
Reference
VertexPositionNormalTexture Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexPositionNormalTexture.SizeInBytes Property
Gets the size of the VertexPositionNormalTexture class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static int SizeInBytes { get; }
Property Value
The size of the vertex, in bytes.
See Also
Reference
VertexPositionNormalTexture Structure
VertexPositionNormalTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionTexture Structure
Describes a custom vertex format structure that contains position and one set of texture coordinates.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public struct VertexPositionTexture
See Also
Tasks
How To: Create Custom Texture Effects
Reference
VertexPositionTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionTexture Members
The following tables list the members exposed by the VertexPositionTexture type.
Public Constructors
Name Description
VertexPositionTexture Initializes a new instance of the VertexPositionTexture class.
Public Fields
Name Description
Position The vertex position.
TextureCoordinate The texture coordinates.
VertexElements An array of two vertex elements describing the position, followed by the texture coordinate, of this ver
tex.
Public Properties
Name Description
SizeInBytes Gets the size of the VertexPositionTexture class.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Compares two objects to determine whether they are the same.
op_Inequality Compares two objects to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
VertexPositionTexture Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexPositionTexture Fields
Public Fields
Name Description
Position The vertex position.
TextureCoordinate The texture coordinates.
VertexElements An array of two vertex elements describing the position, followed by the texture coordinate, of this ver
tex.
See Also
Reference
VertexPositionTexture Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexPositionTexture.Position Field
The vertex position.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Position
See Also
Reference
VertexPositionTexture Structure
VertexPositionTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionTexture.TextureCoordinate Field
The texture coordinates.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector2 TextureCoordinate
See Also
Reference
VertexPositionTexture Structure
VertexPositionTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionTexture.VertexElements Field
An array of two vertex elements describing the position, followed by the texture coordinate, of this vertex.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static readonly VertexElement[] VertexElements
See Also
Reference
VertexPositionTexture Structure
VertexPositionTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionTexture Constructor
Initializes a new instance of the VertexPositionTexture class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public VertexPositionTexture (
Vector3 position,
Vector2 textureCoordinate
)
Parameters
position
Position of the vertex.
textureCoordinate
Texture coordinate of the vertex.
See Also
Reference
VertexPositionTexture Structure
VertexPositionTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionTexture Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Compares two objects to determine whether they are the same.
op_Inequality Compares two objects to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
VertexPositionTexture Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexPositionTexture.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
VertexPositionTexture.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified
object.
VertexPositionTexture.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
VertexPositionTexture Structure
VertexPositionTexture Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Parameters
obj
The Object to compare with the current VertexPositionTexture.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
VertexPositionTexture Structure
VertexPositionTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionTexture.GetHashCode Method
Gets the hash code for this instance.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for this object.
See Also
Reference
VertexPositionTexture Structure
VertexPositionTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionTexture.op_Equality Method
Compares two objects to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
VertexPositionTexture left,
VertexPositionTexture right
)
Parameters
left
Object to the left of the equality operator.
right
Object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
VertexPositionTexture Structure
VertexPositionTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionTexture.op_Inequality Method
Compares two objects to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
VertexPositionTexture left,
VertexPositionTexture right
)
Parameters
left
Object to the left of the inequality operator.
right
Object to the right of the inequality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
VertexPositionTexture Structure
VertexPositionTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionTexture.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
VertexPositionTexture Structure
VertexPositionTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexPositionTexture Properties
Public Properties
Name Description
SizeInBytes Gets the size of the VertexPositionTexture class.
See Also
Reference
VertexPositionTexture Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexPositionTexture.SizeInBytes Property
Gets the size of the VertexPositionTexture class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static int SizeInBytes { get; }
Property Value
The size of the vertex, in bytes.
See Also
Reference
VertexPositionTexture Structure
VertexPositionTexture Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexShader Class
Encapsulates the functionality of a vertex shader.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class VertexShader : IDisposable
See Also
Reference
VertexShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexShader Members
The following tables list the members exposed by the VertexShader type.
Public Constructors
Name Description
VertexShader Initializes a new instance of the VertexShader class.
Public Properties
Name Description
GraphicsDevice Gets the GraphicsDevice associated with this VertexShader.
IsDisposed Gets a value that indicates whether the object is disposed.
Name Gets the name of this vertex shader.
Tag Gets the resource tags for this vertex shader.
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetShaderCode Gets the shader byte code.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_Disposing Raises the Disposing event when called from within a derived class.
Public Events
Name Description
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micro
soft .NET common language runtime.
See Also
Reference
VertexShader Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexShader Constructor
Initializes a new instance of the VertexShader class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public VertexShader (
GraphicsDevice graphicsDevice,
byte[] shaderCode
)
Parameters
graphicsDevice
The GraphicsDevice to associate with this VertexShader.
shaderCode
The compiled byte code. An array of tokens that represents the vertex shader, including embedded debug and symbol table
information.
Exceptions
Exception type Condition
ArgumentException shaderCode must have a length that is a multiple of four.
ArgumentNullException graphicsDevice or shaderCode is null.
InvalidOperationException Unable to create this VertexShader resource on the graphics device.
See Also
Reference
VertexShader Class
VertexShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexShader Methods
Public Methods
Name Description
Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetShaderCode Gets the shader byte code.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage col
lection reclaims the object.
MemberwiseClone (Inherited from Object.)
raise_Disposing Raises the Disposing event when called from within a derived class.
See Also
Reference
VertexShader Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexShader.Dispose Method
Immediately releases the unmanaged resources used by this object.
Overload List
Name Description
VertexShader.Dispose () Immediately releases the unmanaged resources used by this object.
VertexShader.Dispose (Boolean) Immediately releases the unmanaged resources used by this object.
See Also
Reference
VertexShader Class
VertexShader Members
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexShader.Dispose Method ()
Immediately releases the unmanaged resources used by this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
Remarks
Call Dispose when you are finished using the VertexShader. The Dispose method leaves the VertexShader in an unusable state.
After calling Dispose, you must release all references to the VertexShader so the garbage collector can reclaim the memory
that the VertexShader was occupying.
Note
Always call Dispose before you release your last reference to the VertexShader. Otherwise, the resources it is using will not b
e freed until the garbage collector calls the VertexShader object's Finalize method.
See Also
Reference
VertexShader Class
VertexShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
[MarshalAsAttribute(U1)] true to release both managed and unmanaged resources; false to release only unmanaged
resources.
Remarks
This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean)
method with the disposing parameter set to true. Finalize invokes Dispose(Boolean) with disposing set to false.
When the disposing parameter is true, this method releases all resources held by any managed objects that this VertexShader
references. This method invokes the Dispose method of each referenced object.
Note
Notes to Inheritors
Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects
disposed of in an earlier call to Dispose.
See Also
Reference
VertexShader Class
VertexShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexShader.Finalize Method
Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the
object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void Finalize ()
Remarks
This method overrides System.Object.Finalize. Application code should not call this method; an object's Finalize method is
automatically invoked during garbage collection, unless a call to the GC.SuppressFinalize method has disabled finalization by
the garbage collector.
See Also
Reference
VertexShader Class
VertexShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexShader.GetShaderCode Method
Gets the shader byte code.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public byte[] GetShaderCode ()
Return Value
The shader byte code.
See Also
Reference
VertexShader Class
VertexShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexShader.raise_Disposing Method
Raises the Disposing event when called from within a derived class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected void raise_Disposing (
Object value0,
EventArgs value1
)
Parameters
value0
Invoking object reference; should be this object.
value1
Arguments to pass to the event handler.
See Also
Reference
VertexShader Class
VertexShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexShader.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
VertexShader Class
VertexShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexShader Properties
Public Properties
Name Description
GraphicsDevice Gets the GraphicsDevice associated with this VertexShader.
IsDisposed Gets a value that indicates whether the object is disposed.
Name Gets the name of this vertex shader.
Tag Gets the resource tags for this vertex shader.
See Also
Reference
VertexShader Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexShader.GraphicsDevice Property
Gets the GraphicsDevice associated with this VertexShader.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GraphicsDevice GraphicsDevice { get; }
Property Value
The GraphicsDevice associated with this VertexShader.
See Also
Reference
VertexShader Class
VertexShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexShader.IsDisposed Property
Gets a value that indicates whether the object is disposed.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsDisposed { get; }
Property Value
true if the object is disposed; false otherwise.
See Also
Reference
VertexShader Class
VertexShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexShader.Name Property
Gets the name of this vertex shader.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string Name { get; set; }
Property Value
The name of this vertex shader.
See Also
Reference
VertexShader Class
VertexShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexShader.Tag Property
Gets the resource tags for this vertex shader.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Object Tag { get; set; }
Property Value
The resource tags for this vertex shader.
See Also
Reference
VertexShader Class
VertexShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexShader Events
Public Events
Name Description
Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Micro
soft .NET common language runtime.
See Also
Reference
VertexShader Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexShader.Disposing Event
Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET
common language runtime.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public event EventHandler Disposing
See Also
Reference
VertexShader Class
VertexShader Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexStream Class
Represents a vertex stream.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class VertexStream
See Also
Tasks
How To: Draw Points, Lines, and Other 3D Primitives
Reference
VertexStream Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexStream Members
The following tables list the members exposed by the VertexStream type.
Public Properties
Name Description
OffsetInBytes Gets the starting offset of the vertex stream.
VertexBuffer Gets the vertex buffer associated with this vertex stream.
VertexStride Gets the size, in bytes, of the elements in this vertex stream.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
SetFrequency Sets the stream source frequency divider value. This may be used to draw several instances of
geometry.
SetFrequencyOfIndexData Sets the stream source frequency divider value for the index data. This may be used to draw s
everal instances of geometry.
SetFrequencyOfInstanceData Sets the stream source frequency divider value for the instance data. This may be used to dra
w several instances of geometry.
SetSource Sets the source of the vertex stream.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
VertexStream Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexStream Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
SetFrequency Sets the stream source frequency divider value. This may be used to draw several instances of
geometry.
SetFrequencyOfIndexData Sets the stream source frequency divider value for the index data. This may be used to draw s
everal instances of geometry.
SetFrequencyOfInstanceData Sets the stream source frequency divider value for the instance data. This may be used to dra
w several instances of geometry.
SetSource Sets the source of the vertex stream.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
VertexStream Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexStream.SetFrequency Method
Sets the stream source frequency divider value. This may be used to draw several instances of geometry.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void SetFrequency (
int frequency
)
Parameters
frequency
Frequency divider value.
See Also
Reference
VertexStream Class
VertexStream Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexStream.SetFrequencyOfIndexData Method
Sets the stream source frequency divider value for the index data. This may be used to draw several instances of geometry.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void SetFrequencyOfIndexData (
int frequency
)
Parameters
frequency
Frequency of index data.
See Also
Reference
VertexStream Class
VertexStream Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexStream.SetFrequencyOfInstanceData Method
Sets the stream source frequency divider value for the instance data. This may be used to draw several instances of geometry.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void SetFrequencyOfInstanceData (
int frequency
)
Parameters
frequency
Frequency of instance data.
See Also
Reference
VertexStream Class
VertexStream Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexStream.SetSource Method
Sets the source of the vertex stream.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void SetSource (
VertexBuffer vb,
int offsetInBytes,
int vertexStride
)
Parameters
vb
The vertex buffer source.
offsetInBytes
The starting offset.
vertexStride
The size, in bytes, of the elements in the vertex buffer.
Exceptions
Exception type Condition
InvalidOperationException The requested vertex stream is invalid.
ObjectDisposedException SetSource was called after the GraphicsDevice was disposed.
See Also
Reference
VertexStream Class
VertexStream Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexStream Properties
Public Properties
Name Description
OffsetInBytes Gets the starting offset of the vertex stream.
VertexBuffer Gets the vertex buffer associated with this vertex stream.
VertexStride Gets the size, in bytes, of the elements in this vertex stream.
See Also
Reference
VertexStream Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexStream.OffsetInBytes Property
Gets the starting offset of the vertex stream.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int OffsetInBytes { get; }
Property Value
Starting offset of the vertex stream.
See Also
Reference
VertexStream Class
VertexStream Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexStream.VertexBuffer Property
Gets the vertex buffer associated with this vertex stream.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public VertexBuffer VertexBuffer { get; }
Property Value
Vertex buffer associated with this vertex stream.
See Also
Reference
VertexStream Class
VertexStream Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexStream.VertexStride Property
Gets the size, in bytes, of the elements in this vertex stream.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int VertexStride { get; }
Property Value
Size, in bytes, of the elements in this vertex stream.
See Also
Reference
VertexStream Class
VertexStream Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexStreamCollection Class
Collection of VertexStream objects.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class VertexStreamCollection
See Also
Reference
VertexStreamCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
VertexStreamCollection Members
The following tables list the members exposed by the VertexStreamCollection type.
Public Properties
Name Description
Item Returns the VertexStream at the specified index.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
VertexStreamCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexStreamCollection Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
VertexStreamCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexStreamCollection Properties
Public Properties
Name Description
Item Returns the VertexStream at the specified index.
See Also
Reference
VertexStreamCollection Class
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
VertexStreamCollection.Item Property
Returns the VertexStream at the specified index.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public VertexStream this [
int index
] { get; }
Property Value
The vertex stream at the requested index.
Exceptions
Exception type Condition
InvalidOperationException The specified index is invalid.
See Also
Reference
VertexStreamCollection Class
VertexStreamCollection Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Viewport Structure
Defines the window dimensions of a render-target surface onto which a 3D volume projects.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public struct Viewport
See Also
Concepts
Displays, Client Bounds, Viewports, and Back Buffers
Reference
Viewport
Viewport Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Viewport Members
The following tables list the members exposed by the Viewport type.
Public Properties
Name Description
AspectRatio Gets the aspect ratio used by the viewport
Height Gets or sets the height dimension of the viewport on the render-target surface, in pixels.
MaxDepth Gets or sets the maximum depth of the clip volume.
MinDepth Gets or sets the minimum depth of the clip volume.
Width Gets or sets the width dimension of the viewport on the render-target surface, in pixels.
X Gets or sets the pixel coordinate of the upper-left corner of the viewport on the render-target surface.
Y Gets or sets the pixel coordinate of the upper-left corner of the viewport on the render-target surface.
Public Methods
Name Description
Equals (Inherited from Object.)
GetType (Inherited from Object.)
Project Projects a 3D vector from object space into screen space.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Unproject Projects a vector from screen space into object space.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Viewport Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Viewport Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetType (Inherited from Object.)
Project Projects a 3D vector from object space into screen space.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Unproject Projects a vector from screen space into object space.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Viewport Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Viewport.Project Method
Projects a 3D vector from object space into screen space.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Project (
Vector3 source,
Matrix projection,
Matrix view,
Matrix world
)
Parameters
source
The vector to project.
projection
The projection matrix.
view
The view matrix.
world
The world matrix.
Return Value
The vector in screen space.
See Also
Tasks
How To: Draw a Sprite Over a Model
Reference
Viewport Structure
Viewport Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Viewport.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
Viewport Structure
Viewport Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Viewport.Unproject Method
Projects a vector from screen space into object space.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 Unproject (
Vector3 source,
Matrix projection,
Matrix view,
Matrix world
)
Parameters
source
The vector to project.
projection
The projection matrix.
view
The view matrix.
world
The world matrix.
Return Value
The vector in object space.
See Also
Reference
Viewport Structure
Viewport Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Viewport Properties
Public Properties
Name Description
AspectRatio Gets the aspect ratio used by the viewport
Height Gets or sets the height dimension of the viewport on the render-target surface, in pixels.
MaxDepth Gets or sets the maximum depth of the clip volume.
MinDepth Gets or sets the minimum depth of the clip volume.
Width Gets or sets the width dimension of the viewport on the render-target surface, in pixels.
X Gets or sets the pixel coordinate of the upper-left corner of the viewport on the render-target surface.
Y Gets or sets the pixel coordinate of the upper-left corner of the viewport on the render-target surface.
See Also
Reference
Viewport Structure
Microsoft.Xna.Framework.Graphics Namespace
XNA Game Studio 2.0
Viewport.AspectRatio Property
Gets the aspect ratio used by the viewport
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float AspectRatio { get; }
Property Value
The aspect ratio of the viewport.
See Also
Reference
Viewport Structure
Viewport Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Viewport.Height Property
Gets or sets the height dimension of the viewport on the render-target surface, in pixels.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Height { get; set; }
Property Value
The height, in pixels, of the viewport to set or get.
RemarksUnless rendering is being done only to a subset of the surface, this member should be set to the height dimension of
the render target surface.
See Also
Reference
Viewport Structure
Viewport Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Viewport.MaxDepth Property
Gets or sets the maximum depth of the clip volume.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float MaxDepth { get; set; }
Property Value
The maximum depth of the clipping volume.
Remarks MaxDepth, together with MinDepth, specifies the range of depth values into which a scene is rendered. Most
applications set this value to 1.0. Clipping is performed after the projection matrix is applied.
See Also
Reference
Viewport Structure
Viewport Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Viewport.MinDepth Property
Gets or sets the minimum depth of the clip volume.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float MinDepth { get; set; }
Property Value
The minimum depth of the clipping volume.
Remarks MinDepth, together with MaxDepth, specifies the range of depth values into which a scene is rendered. Most
applications set this value to 0.0. Clipping is performed after the projection matrix is applied.
See Also
Reference
Viewport Structure
Viewport Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Viewport.Width Property
Gets or sets the width dimension of the viewport on the render-target surface, in pixels.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Width { get; set; }
Property Value
The width, in pixels, of the viewport to set or get.
RemarksUnless rendering is being done only to a subset of the surface, this member should be set to the width dimension of
the render-target surface.
See Also
Reference
Viewport Structure
Viewport Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Viewport.X Property
Gets or sets the pixel coordinate of the upper-left corner of the viewport on the render-target surface.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int X { get; set; }
Property Value
The upper-left corner of the viewport to set or get.
RemarksUnless rendering is being done only to a subset of the surface, this member can be set to 0.
See Also
Reference
Viewport Structure
Viewport Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Viewport.Y Property
Gets or sets the pixel coordinate of the upper-left corner of the viewport on the render-target surface.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Y { get; set; }
Property Value
The upper-left corner of the viewport to set or get.
RemarksUnless rendering is being done only to a subset of the surface, this member can be set to 0.
See Also
Reference
Viewport Structure
Viewport Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Represents data types with components that are not multiples of 8 bits.
Interfaces
Name Description
IPackedVector Converts packed vector types to and from Vector4 values.
IPackedVector Interface that converts packed vector types to and from Vector4 values, allowing multiple encodings to be m
anipulated in a generic way.
Structures
Name Description
Alpha8 Packed vector type containing a single 8 bit normalized W value in the range of 0 to 1.
Bgr565 Packed vector type containing unsigned normalized values ranging from 0 to 1. The x and z component
s use 5 bits, and the y component uses 6 bits.
Bgra5551 Packed vector type containing unsigned normalized values, ranging from 0 to 1, using 5 bits each for x,
y, and z, and 1 bit for w.
Byte4 Packed vector type containing four 8-bit unsigned integer values, ranging from 0 to 255.
HalfSingle Packed vector type containing a single 16 bit floating point value.
HalfVector2 Packed vector type containing two 16-bit floating-point values.
HalfVector4 Packed vector type containing four 16-bit floating-point values.
Normalized101010 Packed vector type containing signed normalized values, ranging from −1 to 1, using 10 bits each for x,
y, and z, and 2 bits for w.
NormalizedByte2 Packed vector type containing two 8-bit signed normalized values, ranging from −1 to 1.
NormalizedByte4 Packed vector type containing four 8-bit signed normalized values, ranging from −1 to 1.
NormalizedShort2 Packed vector type containing two 16-bit signed normalized values, ranging from −1 to 1.
NormalizedShort4 Packed vector type containing four 16-bit signed normalized values, ranging from −1 to 1.
Rg32 Packed vector type containing two 16-bit unsigned normalized values, ranging from 0 to 1.
Rgba1010102 Packed vector type containing unsigned normalized values, ranging from 0 to 1, using 10 bits each for x
, y, and z, and 2 bits for w.
Rgba32 Packed vector type containing four 8-bit unsigned normalized values, ranging from 0 to 1.
Rgba64 Packed vector type containing four 16-bit unsigned normalized values, ranging from 0 to 1.
Short2 Packed vector type containing two 16-bit signed integer values.
Short4 Packed vector type containing four 16-bit signed integer values.
UInt101010 Packed vector type containing unsigned integer values, using 10 bits each for x, y, and z (ranging from
0 to 1023), and 2 bits for w (ranging from 0 to 3).
XNA Game Studio 2.0
Alpha8 Structure
Packed vector type containing a single 8 bit normalized W value in the range of 0 to 1.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct Alpha8 : IPackedVector<byte>, IEquatable<Alpha8>
See Also
Reference
Alpha8 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Alpha8 Members
The following tables list the members exposed by the Alpha8 type.
Public Constructors
Name Description
Alpha8 Initializes a new instance of the Alpha8 structure.
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToAlpha Expands the packed representation to a System.Single.
ToString Returns a string representation of the current instance.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Expands the packed representation int
o a Vector4.
See Also
Reference
Alpha8 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Alpha8 Constructor
Initializes a new instance of the Alpha8 structure.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Alpha8 (
float alpha
)
Parameters
alpha
The initial value for the Alpha8 structure.
See Also
Reference
Alpha8 Structure
Alpha8 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Alpha8 Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToAlpha Expands the packed representation to a System.Single.
ToString Returns a string representation of the current instance.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Expands the packed representation int
o a Vector4.
See Also
Reference
Alpha8 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Alpha8.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
Alpha8.Equals (Alpha8) Returns a value that indicates whether the current instance is equal to a specified object.
Alpha8.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
Alpha8.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
Alpha8 Structure
Alpha8 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
other
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Alpha8 Structure
Alpha8 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
obj
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Alpha8 Structure
Alpha8 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Alpha8.GetHashCode Method
Gets the hash code for the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for the instance.
See Also
Reference
Alpha8 Structure
Alpha8 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4
Method
Sets the packed representation from a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
Vector4 vector
)
Parameters
vector
The vector to create the packed representaion from.
See Also
Reference
Alpha8 Structure
Alpha8 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4
Method
Expands the packed representation into a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private Vector4 Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 ()
Return Value
The expanded vector.
See Also
Reference
Alpha8 Structure
Alpha8 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Alpha8.op_Equality Method
Compares the current instance of a class to another instance to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
Alpha8 a,
Alpha8 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
Alpha8 Structure
Alpha8 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Alpha8.op_Inequality Method
Compares the current instance of a class to another instance to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
Alpha8 a,
Alpha8 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
Alpha8 Structure
Alpha8 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Alpha8.ToAlpha Method
Expands the packed representation to a System.Single.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float ToAlpha ()
Return Value
The expanded Alpha8.
See Also
Reference
Alpha8 Structure
Alpha8 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Alpha8.ToString Method
Returns a string representation of the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String that represents the object.
See Also
Reference
Alpha8 Structure
Alpha8 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Alpha8 Properties
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
See Also
Reference
Alpha8 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Alpha8.PackedValue Property
Directly gets or sets the packed representation of the value.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public byte PackedValue { get; set; }
Property Value
The packed representation of the value.
See Also
Reference
Alpha8 Structure
Alpha8 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Bgr565 Structure
Packed vector type containing unsigned normalized values ranging from 0 to 1. The x and z components use 5 bits, and the y
component uses 6 bits.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct Bgr565 : IPackedVector<UInt16>, IEquatable<Bgr565>
See Also
Reference
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Bgr565 Members
The following tables list the members exposed by the Bgr565 type.
Public Constructors
Name Description
Bgr565 Overloaded. Initializes a new instance of the Bgr565 class.
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector3 Expands the packed representation into a Vector3.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Expands the packed representation int
o a Vector4.
See Also
Reference
Bgr565 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Bgr565 Constructor
Initializes a new instance of the Bgr565 class.
Overload List
Name Description
Bgr565 (Single, Single, Single) Initializes a new instance of the Bgr565 class.
Bgr565 (Vector3) Initializes a new instance of the Bgr565 structure.
See Also
Reference
Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
x
Initial value for the x component.
y
Initial value for the y component.
z
Initial value for the z component.
See Also
Reference
Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector
A vector containing the initial values for the components of the Bgr565 structure.
See Also
Reference
Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Bgr565 Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector3 Expands the packed representation into a Vector3.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Expands the packed representation int
o a Vector4.
See Also
Reference
Bgr565 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Bgr565.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
Bgr565.Equals (Bgr565) Returns a value that indicates whether the current instance is equal to a specified object.
Bgr565.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
Bgr565.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
other
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
obj
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Bgr565.GetHashCode Method
Gets the hash code for the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for the instance.
See Also
Reference
Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4
Method
Sets the packed representation from a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
Vector4 vector
)
Parameters
vector
The vector to create the packed representation from.
See Also
Reference
Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4
Method
Expands the packed representation into a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private Vector4 Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 ()
Return Value
The expanded vector.
See Also
Reference
Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Bgr565.op_Equality Method
Compares the current instance of a class to another instance to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
Bgr565 a,
Bgr565 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Bgr565.op_Inequality Method
Compares the current instance of a class to another instance to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
Bgr565 a,
Bgr565 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Bgr565.ToString Method
Returns a string representation of the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String that represents the object.
See Also
Reference
Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Bgr565.ToVector3 Method
Expands the packed representation into a Vector3.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 ToVector3 ()
Return Value
The expanded vector.
See Also
Reference
Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Bgr565 Properties
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
See Also
Reference
Bgr565 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Bgr565.PackedValue Property
Directly gets or sets the packed representation of the value.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[CLSCompliantAttribute(false)]
public UInt16 PackedValue { get; set; }
Property Value
The packed representation of the value.
See Also
Reference
Bgr565 Structure
Bgr565 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Bgra5551 Structure
Packed vector type containing unsigned normalized values, ranging from 0 to 1, using 5 bits each for x, y, and z, and 1 bit for w.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct Bgra5551 : IPackedVector<UInt16>, IEquatable<Bgra5551>
See Also
Reference
Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Bgra5551 Members
The following tables list the members exposed by the Bgra5551 type.
Public Constructors
Name Description
Bgra5551 Overloaded. Initializes a new instance of the Bgra5551 class.
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector4 Expands the packed representation into a Vector4.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
See Also
Reference
Bgra5551 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Bgra5551 Constructor
Initializes a new instance of the Bgra5551 class.
Overload List
Name Description
Bgra5551 (Single, Single, Single, Single) Initializes a new instance of the Bgra5551 class.
Bgra5551 (Vector4) Initializes a new instance of the Bgra5551 structure.
See Also
Reference
Bgra5551 Structure
Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
x
Initial value for the x component.
y
Initial value for the y component.
z
Initial value for the z component.
w
Initial value for the w component.
See Also
Reference
Bgra5551 Structure
Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector
A vector containing the initial values for the components of the Bgra5551 structure.
See Also
Reference
Bgra5551 Structure
Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Bgra5551 Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector4 Expands the packed representation into a Vector4.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
See Also
Reference
Bgra5551 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Bgra5551.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
Bgra5551.Equals (Bgra5551) Returns a value that indicates whether the current instance is equal to a specified object.
Bgra5551.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
Bgra5551.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
Bgra5551 Structure
Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
other
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Bgra5551 Structure
Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
obj
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Bgra5551 Structure
Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Bgra5551.GetHashCode Method
Gets the hash code for the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for the instance.
See Also
Reference
Bgra5551 Structure
Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4
Method
Sets the packed representation from a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
Vector4 vector
)
Parameters
vector
The vector to create the packed representation from.
See Also
Reference
Bgra5551 Structure
Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Bgra5551.op_Equality Method
Compares the current instance of a class to another instance to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
Bgra5551 a,
Bgra5551 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
Bgra5551 Structure
Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Bgra5551.op_Inequality Method
Compares the current instance of a class to another instance to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
Bgra5551 a,
Bgra5551 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
Bgra5551 Structure
Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Bgra5551.ToString Method
Returns a string representation of the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String that represents the object.
See Also
Reference
Bgra5551 Structure
Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Bgra5551.ToVector4 Method
Expands the packed representation into a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector4 ToVector4 ()
Return Value
The expanded vector.
See Also
Reference
Bgra5551 Structure
Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Bgra5551 Properties
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
See Also
Reference
Bgra5551 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Bgra5551.PackedValue Property
Directly gets or sets the packed representation of the value.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[CLSCompliantAttribute(false)]
public UInt16 PackedValue { get; set; }
Property Value
The packed representation of the value.
See Also
Reference
Bgra5551 Structure
Bgra5551 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Byte4 Structure
Packed vector type containing four 8-bit unsigned integer values, ranging from 0 to 255.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct Byte4 : IPackedVector<UInt32>, IEquatable<Byte4>
See Also
Reference
Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Byte4 Members
The following tables list the members exposed by the Byte4 type.
Public Constructors
Name Description
Byte4 Overloaded. Initializes a new instance of the Byte4 class.
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector4 Expands the packed representation into a Vector4.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4
See Also
Reference
Byte4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Byte4 Constructor
Initializes a new instance of the Byte4 class.
Overload List
Name Description
Byte4 (Single, Single, Single, Single) Initializes a new instance of the Byte4 class.
Byte4 (Vector4) Initializes a new instance of the Byte4 structure.
See Also
Reference
Byte4 Structure
Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
x
Initial value for the x component.
y
Initial value for the y component.
z
Initial value for the z component.
w
Initial value for the w component.
See Also
Reference
Byte4 Structure
Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector
A vector containing the initial values for the components of the Byte4 structure.
See Also
Reference
Byte4 Structure
Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Byte4 Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector4 Expands the packed representation into a Vector4.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4
See Also
Reference
Byte4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Byte4.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
Byte4.Equals (Byte4) Returns a value that indicates whether the current instance is equal to a specified object.
Byte4.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
Byte4.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
Byte4 Structure
Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
other
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Byte4 Structure
Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
obj
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Byte4 Structure
Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Byte4.GetHashCode Method
Gets the hash code for the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for the instance.
See Also
Reference
Byte4 Structure
Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4
Method
Sets the packed representation from a Vector4
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
Vector4 vector
)
Parameters
vector
The vector to create packed representation from.
See Also
Reference
Byte4 Structure
Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Byte4.op_Equality Method
Compares the current instance of a class to another instance to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
Byte4 a,
Byte4 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
Byte4 Structure
Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Byte4.op_Inequality Method
Compares the current instance of a class to another instance to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
Byte4 a,
Byte4 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
Byte4 Structure
Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Byte4.ToString Method
Returns a string representation of the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String that represents the object.
See Also
Reference
Byte4 Structure
Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Byte4.ToVector4 Method
Expands the packed representation into a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector4 ToVector4 ()
Return Value
The expanded vector.
See Also
Reference
Byte4 Structure
Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Byte4 Properties
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
See Also
Reference
Byte4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Byte4.PackedValue Property
Directly gets or sets the packed representation of the value.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[CLSCompliantAttribute(false)]
public UInt32 PackedValue { get; set; }
Property Value
The packed representation of the value.
See Also
Reference
Byte4 Structure
Byte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HalfSingle Structure
Packed vector type containing a single 16 bit floating point value.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct HalfSingle : IPackedVector<UInt16>, IEquatable<HalfSingle>
See Also
Reference
HalfSingle Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HalfSingle Members
The following tables list the members exposed by the HalfSingle type.
Public Constructors
Name Description
HalfSingle Initializes a new instance of the HalfSingle structure.
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToSingle Expands the HalfSingle to a Single.
ToString Returns a string representation of the current instance.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Expands the packed representation int
o a Vector4.
See Also
Reference
HalfSingle Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
HalfSingle Constructor
Initializes a new instance of the HalfSingle structure.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public HalfSingle (
float value
)
Parameters
value
The initial value of the HalfSingle structure.
See Also
Reference
HalfSingle Structure
HalfSingle Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HalfSingle Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToSingle Expands the HalfSingle to a Single.
ToString Returns a string representation of the current instance.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Expands the packed representation int
o a Vector4.
See Also
Reference
HalfSingle Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
HalfSingle.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
HalfSingle.Equals (HalfSingle) Returns a value that indicates whether the current instance is equal to a specified object.
HalfSingle.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
HalfSingle.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
HalfSingle Structure
HalfSingle Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
other
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
HalfSingle Structure
HalfSingle Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
obj
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
HalfSingle Structure
HalfSingle Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HalfSingle.GetHashCode Method
Gets the hash code for the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for the instance.
See Also
Reference
HalfSingle Structure
HalfSingle Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4
Method
Sets the packed representation from a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
Vector4 vector
)
Parameters
vector
The vector to create the packed representation from.
See Also
Reference
HalfSingle Structure
HalfSingle Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4
Method
Expands the packed representation into a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private Vector4 Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 ()
Return Value
The expanded vector.
See Also
Reference
HalfSingle Structure
HalfSingle Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HalfSingle.op_Equality Method
Compares the current instance of a class to another instance to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
HalfSingle a,
HalfSingle b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
HalfSingle Structure
HalfSingle Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HalfSingle.op_Inequality Method
Compares the current instance of a class to another instance to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
HalfSingle a,
HalfSingle b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
HalfSingle Structure
HalfSingle Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HalfSingle.ToSingle Method
Expands the HalfSingle to a Single.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float ToSingle ()
Return Value
The expanded HalfSingle.
See Also
Reference
HalfSingle Structure
HalfSingle Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HalfSingle.ToString Method
Returns a string representation of the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String that represents the object.
See Also
Reference
HalfSingle Structure
HalfSingle Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HalfSingle Properties
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
See Also
Reference
HalfSingle Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
HalfSingle.PackedValue Property
Directly gets or sets the packed representation of the value.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[CLSCompliantAttribute(false)]
public UInt16 PackedValue { get; set; }
Property Value
The packed representation of the value.
See Also
Reference
HalfSingle Structure
HalfSingle Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HalfVector2 Structure
Packed vector type containing two 16-bit floating-point values.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct HalfVector2 : IPackedVector<UInt32>, IEquatable<HalfVector2>
See Also
Reference
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HalfVector2 Members
The following tables list the members exposed by the HalfVector2 type.
Public Constructors
Name Description
HalfVector2 Overloaded. Initializes a new instance of the HalfVector2 class.
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector2 Expands the HalfVector2 to a Vector2.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Expands the packed representation int
o a Vector4.
See Also
Reference
HalfVector2 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
HalfVector2 Constructor
Initializes a new instance of the HalfVector2 class.
Overload List
Name Description
HalfVector2 (Single, Single) Initializes a new instance of the HalfVector2 structure.
HalfVector2 (Vector2) Initializes a new instance of the HalfVector2 structure.
See Also
Reference
HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
x
Initial value for the x component.
y
Initial value for the y component.
See Also
Reference
HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector
A vector containing the initial values for the components of the HalfVector2 structure.
See Also
Reference
HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HalfVector2 Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector2 Expands the HalfVector2 to a Vector2.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Expands the packed representation int
o a Vector4.
See Also
Reference
HalfVector2 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
HalfVector2.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
HalfVector2.Equals (HalfVector2) Returns a value that indicates whether the current instance is equal to a specified object.
HalfVector2.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
HalfVector2.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
other
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
obj
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HalfVector2.GetHashCode Method
Gets the hash code for the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for the instance.
See Also
Reference
HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4
Method
Sets the packed representation from a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
Vector4 vector
)
Parameters
vector
The vector to create the packed representation from.
See Also
Reference
HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4
Method
Expands the packed representation into a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private Vector4 Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 ()
Return Value
The expanded vector.
See Also
Reference
HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HalfVector2.op_Equality Method
Compares the current instance of a class to another instance to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
HalfVector2 a,
HalfVector2 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HalfVector2.op_Inequality Method
Compares the current instance of a class to another instance to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
HalfVector2 a,
HalfVector2 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HalfVector2.ToString Method
Returns a string representation of the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String that represents the object.
See Also
Reference
HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HalfVector2.ToVector2 Method
Expands the HalfVector2 to a Vector2.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector2 ToVector2 ()
Return Value
The expanded HalfVector2.
See Also
Reference
HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HalfVector2 Properties
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
See Also
Reference
HalfVector2 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
HalfVector2.PackedValue Property
Directly gets or sets the packed representation of the value.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[CLSCompliantAttribute(false)]
public UInt32 PackedValue { get; set; }
Property Value
The packed representation of the value.
See Also
Reference
HalfVector2 Structure
HalfVector2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HalfVector4 Structure
Packed vector type containing four 16-bit floating-point values.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct HalfVector4 : IPackedVector<UInt64>, IEquatable<HalfVector4>
See Also
Reference
HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HalfVector4 Members
The following tables list the members exposed by the HalfVector4 type.
Public Constructors
Name Description
HalfVector4 Overloaded. Initializes a new instance of the HalfVector4 class.
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector4 Expands the packed representation into a Vector4.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
See Also
Reference
HalfVector4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
HalfVector4 Constructor
Initializes a new instance of the HalfVector4 class.
Overload List
Name Description
HalfVector4 (Single, Single, Single, Single) Initializes a new instance of the HalfVector4 class.
HalfVector4 (Vector4) Initializes a new instance of the HalfVector4 structure.
See Also
Reference
HalfVector4 Structure
HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
x
Initial value for the x component.
y
Initial value for the y component.
z
Initial value for the z component.
w
Initial value for the w component.
See Also
Reference
HalfVector4 Structure
HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector
A vector containing the initial values for the components of the HalfVector4 structure.
See Also
Reference
HalfVector4 Structure
HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HalfVector4 Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector4 Expands the packed representation into a Vector4.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
See Also
Reference
HalfVector4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
HalfVector4.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
HalfVector4.Equals (HalfVector4) Returns a value that indicates whether the current instance is equal to a specified object.
HalfVector4.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
HalfVector4.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
HalfVector4 Structure
HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
other
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
HalfVector4 Structure
HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
obj
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
HalfVector4 Structure
HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HalfVector4.GetHashCode Method
Gets the hash code for the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for the instance.
See Also
Reference
HalfVector4 Structure
HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4
Method
Sets the packed representation from a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
Vector4 vector
)
Parameters
vector
The vector to create the packed representation from.
See Also
Reference
HalfVector4 Structure
HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HalfVector4.op_Equality Method
Compares the current instance of a class to another instance to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
HalfVector4 a,
HalfVector4 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
HalfVector4 Structure
HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HalfVector4.op_Inequality Method
Compares the current instance of a class to another instance to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
HalfVector4 a,
HalfVector4 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
HalfVector4 Structure
HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HalfVector4.ToString Method
Returns a string representation of the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String that represents the object.
See Also
Reference
HalfVector4 Structure
HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HalfVector4.ToVector4 Method
Expands the packed representation into a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector4 ToVector4 ()
Return Value
The expanded vector.
See Also
Reference
HalfVector4 Structure
HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HalfVector4 Properties
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
See Also
Reference
HalfVector4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
HalfVector4.PackedValue Property
Directly gets or sets the packed representation of the value.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[CLSCompliantAttribute(false)]
public UInt64 PackedValue { get; set; }
Property Value
The packed representation of the value.
See Also
Reference
HalfVector4 Structure
HalfVector4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
See Also
Reference
IPackedVector Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IPackedVector Members
The following tables list the members exposed by the IPackedVector type.
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
See Also
Reference
IPackedVector Generic Interface
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
IPackedVector Properties
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
See Also
Reference
IPackedVector Generic Interface
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
IPackedVector.PackedValue Property
Directly gets or sets the packed representation of the value.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public abstract TPacked PackedValue { get; set; }
Property Value
The packed representation of the value.
See Also
Reference
IPackedVector Generic Interface
IPackedVector Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IPackedVector Interface
Interface that converts packed vector types to and from Vector4 values, allowing multiple encodings to be manipulated in a
generic way.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public interface IPackedVector
See Also
Reference
IPackedVector Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IPackedVector Members
The following tables list the members exposed by the IPackedVector type.
Public Methods
Name Description
PackFromVector4 Sets the packed representation from a Vector4.
ToVector4 Expands the packed representation into a Vector4.
See Also
Reference
IPackedVector Interface
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
IPackedVector Methods
Public Methods
Name Description
PackFromVector4 Sets the packed representation from a Vector4.
ToVector4 Expands the packed representation into a Vector4.
See Also
Reference
IPackedVector Interface
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
IPackedVector.PackFromVector4 Method
Sets the packed representation from a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void PackFromVector4 (
Vector4 vector
)
Parameters
vector
The vector to create the packed representation from.
See Also
Reference
IPackedVector Interface
IPackedVector Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
IPackedVector.ToVector4 Method
Expands the packed representation into a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector4 ToVector4 ()
Return Value
The expanded vector.
See Also
Reference
IPackedVector Interface
IPackedVector Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Normalized101010 Structure
Packed vector type containing signed normalized values, ranging from −1 to 1, using 10 bits each for x, y, and z, and 2 bits for
w.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct Normalized101010 : IPackedVector<UInt32>, IEquatable<Normalized101010>
See Also
Reference
Normalized101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Normalized101010 Members
The following tables list the members exposed by the Normalized101010 type.
Public Constructors
Name Description
Normalized101010 Overloaded. Initializes a new instance of the Normalized101010 class.
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector3 Expands the packed representation into a Vector3.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Expands the packed representation int
o a Vector4.
See Also
Reference
Normalized101010 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Normalized101010 Constructor
Initializes a new instance of the Normalized101010 class.
Overload List
Name Description
Normalized101010 (Single, Single, Single) Initializes a new instance of the Normalized101010 class.
Normalized101010 (Vector3) Initializes a new instance of the Normalized101010 structure.
See Also
Reference
Normalized101010 Structure
Normalized101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
x
Initial value for the x component.
y
Initial value for the y component.
z
Initial value for the z component.
See Also
Reference
Normalized101010 Structure
Normalized101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector
A vector containing the initial values for the components of the Normalized101010 structure.
See Also
Reference
Normalized101010 Structure
Normalized101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Normalized101010 Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector3 Expands the packed representation into a Vector3.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Expands the packed representation int
o a Vector4.
See Also
Reference
Normalized101010 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Normalized101010.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
Normalized101010.Equals (Normalized101010) Returns a value that indicates whether the current instance is equal to a specif
ied object.
Normalized101010.Equals (Object) Returns a value that indicates whether the current instance is equal to a specif
ied object.
Normalized101010.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
Normalized101010 Structure
Normalized101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
other
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Normalized101010 Structure
Normalized101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
obj
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Normalized101010 Structure
Normalized101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Normalized101010.GetHashCode Method
Gets the hash code for the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for the instance.
See Also
Reference
Normalized101010 Structure
Normalized101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4
Method
Sets the packed representation from a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
Vector4 vector
)
Parameters
vector
The vector to create the packed representation from.
See Also
Reference
Normalized101010 Structure
Normalized101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4
Method
Expands the packed representation into a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private Vector4 Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 ()
Return Value
The expanded vector.
See Also
Reference
Normalized101010 Structure
Normalized101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Normalized101010.op_Equality Method
Compares the current instance of a class to another instance to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
Normalized101010 a,
Normalized101010 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
Normalized101010 Structure
Normalized101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Normalized101010.op_Inequality Method
Compares the current instance of a class to another instance to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
Normalized101010 a,
Normalized101010 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
Normalized101010 Structure
Normalized101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Normalized101010.ToString Method
Returns a string representation of the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String that represents the object.
See Also
Reference
Normalized101010 Structure
Normalized101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Normalized101010.ToVector3 Method
Expands the packed representation into a Vector3.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 ToVector3 ()
Return Value
The expanded vector.
See Also
Reference
Normalized101010 Structure
Normalized101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Normalized101010 Properties
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
See Also
Reference
Normalized101010 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Normalized101010.PackedValue Property
Directly gets or sets the packed representation of the value.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[CLSCompliantAttribute(false)]
public UInt32 PackedValue { get; set; }
Property Value
The packed representation of the value.
See Also
Reference
Normalized101010 Structure
Normalized101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedByte2 Structure
Packed vector type containing two 8-bit signed normalized values, ranging from −1 to 1.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct NormalizedByte2 : IPackedVector<UInt16>, IEquatable<NormalizedByte2>
See Also
Reference
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedByte2 Members
The following tables list the members exposed by the NormalizedByte2 type.
Public Constructors
Name Description
NormalizedByte2 Overloaded. Initializes a new instance of the NormalizedByte2 class.
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector2 Expands the packed representation to a vector.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Expands the packed representation int
o a Vector4.
See Also
Reference
NormalizedByte2 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
NormalizedByte2 Constructor
Initializes a new instance of the NormalizedByte2 class.
Overload List
Name Description
NormalizedByte2 (Single, Single) Initializes a new instance of the NormalizedByte2 class.
NormalizedByte2 (Vector2) Initializes a new instance of the NormalizedByte2 structure.
See Also
Reference
NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
x
Initial value for the x component.
y
Initial value for the y component.
See Also
Reference
NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector
A vector containing the initial values for the components of the NormalizedByte2 structure.
See Also
Reference
NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedByte2 Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector2 Expands the packed representation to a vector.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Expands the packed representation int
o a Vector4.
See Also
Reference
NormalizedByte2 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
NormalizedByte2.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
NormalizedByte2.Equals (NormalizedByte2) Returns a value that indicates whether the current instance is equal to a specified
object.
NormalizedByte2.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified
object.
NormalizedByte2.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
other
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
obj
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedByte2.GetHashCode Method
Gets the hash code for the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for the instance.
See Also
Reference
NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4
Method
Sets the packed representation from a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
Vector4 vector
)
Parameters
vector
The vector to create the packed representation from.
See Also
Reference
NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4
Method
Expands the packed representation into a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private Vector4 Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 ()
Return Value
The expanded vector.
See Also
Reference
NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedByte2.op_Equality Method
Compares the current instance of a class to another instance to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
NormalizedByte2 a,
NormalizedByte2 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedByte2.op_Inequality Method
Compares the current instance of a class to another instance to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
NormalizedByte2 a,
NormalizedByte2 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedByte2.ToString Method
Returns a string representation of the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String that represents the object.
See Also
Reference
NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedByte2.ToVector2 Method
Expands the packed representation to a vector.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector2 ToVector2 ()
Return Value
The expanded NormalizedByte2.
See Also
Reference
NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedByte2 Properties
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
See Also
Reference
NormalizedByte2 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
NormalizedByte2.PackedValue Property
Directly gets or sets the packed representation of the value.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[CLSCompliantAttribute(false)]
public UInt16 PackedValue { get; set; }
Property Value
The packed representation of the value.
See Also
Reference
NormalizedByte2 Structure
NormalizedByte2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedByte4 Structure
Packed vector type containing four 8-bit signed normalized values, ranging from −1 to 1.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct NormalizedByte4 : IPackedVector<UInt32>, IEquatable<NormalizedByte4>
See Also
Reference
NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedByte4 Members
The following tables list the members exposed by the NormalizedByte4 type.
Public Constructors
Name Description
NormalizedByte4 Overloaded. Initializes a new instance of the NormalizedByte4 class.
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector4 Expands the packed representation into a Vector4.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
See Also
Reference
NormalizedByte4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
NormalizedByte4 Constructor
Initializes a new instance of the NormalizedByte4 class.
Overload List
Name Description
NormalizedByte4 (Single, Single, Single, Single) Initializes a new instance of the NormalizedByte4 class.
NormalizedByte4 (Vector4) Initializes a new instance of the NormalizedByte4 structure.
See Also
Reference
NormalizedByte4 Structure
NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
x
Initial value for the x component.
y
Initial value for the y component.
z
Initial value for the z component.
w
Initial value for the w component.
See Also
Reference
NormalizedByte4 Structure
NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector
A vector containing the initial values for the components of the NormalizedByte4 structure.
See Also
Reference
NormalizedByte4 Structure
NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedByte4 Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector4 Expands the packed representation into a Vector4.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
See Also
Reference
NormalizedByte4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
NormalizedByte4.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
NormalizedByte4.Equals (NormalizedByte4) Returns a value that indicates whether the current instance is equal to a specified
object.
NormalizedByte4.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified
object.
NormalizedByte4.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
NormalizedByte4 Structure
NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
other
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
NormalizedByte4 Structure
NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
obj
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
NormalizedByte4 Structure
NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedByte4.GetHashCode Method
Gets the hash code for the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for the instance.
See Also
Reference
NormalizedByte4 Structure
NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4
Method
Sets the packed representation from a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
Vector4 vector
)
Parameters
vector
The vector to create the packed representation from.
See Also
Reference
NormalizedByte4 Structure
NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedByte4.op_Equality Method
Compares the current instance of a class to another instance to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
NormalizedByte4 a,
NormalizedByte4 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
NormalizedByte4 Structure
NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedByte4.op_Inequality Method
Compares the current instance of a class to another instance to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
NormalizedByte4 a,
NormalizedByte4 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
NormalizedByte4 Structure
NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedByte4.ToString Method
Returns a string representation of the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String that represents the object.
See Also
Reference
NormalizedByte4 Structure
NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedByte4.ToVector4 Method
Expands the packed representation into a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector4 ToVector4 ()
Return Value
The expanded vector.
See Also
Reference
NormalizedByte4 Structure
NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedByte4 Properties
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
See Also
Reference
NormalizedByte4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
NormalizedByte4.PackedValue Property
Directly gets or sets the packed representation of the value.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[CLSCompliantAttribute(false)]
public UInt32 PackedValue { get; set; }
Property Value
The packed representation of the value.
See Also
Reference
NormalizedByte4 Structure
NormalizedByte4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedShort2 Structure
Packed vector type containing two 16-bit signed normalized values, ranging from −1 to 1.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct NormalizedShort2 : IPackedVector<UInt32>, IEquatable<NormalizedShort2>
See Also
Reference
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedShort2 Members
The following tables list the members exposed by the NormalizedShort2 type.
Public Constructors
Name Description
NormalizedShort2 Overloaded. Initializes a new instance of the NormalizedShort2 class.
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector2 Expands the packed representation to a vector.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Expands the packed representation int
o a Vector4.
See Also
Reference
NormalizedShort2 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
NormalizedShort2 Constructor
Initializes a new instance of the NormalizedShort2 class.
Overload List
Name Description
NormalizedShort2 (Single, Single) Initializes a new instance of the NormalizedShort2 class.
NormalizedShort2 (Vector2) Initializes a new instance of the NormalizedShort2 structure.
See Also
Reference
NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
x
Initial value for the x component.
y
Initial value for the y component.
See Also
Reference
NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector
A vector containing the initial values for the components of the NormalizedShort2 structure.
See Also
Reference
NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedShort2 Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector2 Expands the packed representation to a vector.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Expands the packed representation int
o a Vector4.
See Also
Reference
NormalizedShort2 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
NormalizedShort2.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
NormalizedShort2.Equals (NormalizedShort2) Returns a value that indicates whether the current instance is equal to a specifie
d object.
NormalizedShort2.Equals (Object) Returns a value that indicates whether the current instance is equal to a specifie
d object.
NormalizedShort2.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
other
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
obj
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedShort2.GetHashCode Method
Gets the hash code for the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for the instance.
See Also
Reference
NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4
Method
Sets the packed representation from a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
Vector4 vector
)
Parameters
vector
The vector to create the packed representation from.
See Also
Reference
NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4
Method
Expands the packed representation into a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private Vector4 Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 ()
Return Value
The expanded vector.
See Also
Reference
NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedShort2.op_Equality Method
Compares the current instance of a class to another instance to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
NormalizedShort2 a,
NormalizedShort2 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedShort2.op_Inequality Method
Compares the current instance of a class to another instance to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
NormalizedShort2 a,
NormalizedShort2 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedShort2.ToString Method
Returns a string representation of the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String that represents the object.
See Also
Reference
NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedShort2.ToVector2 Method
Expands the packed representation to a vector.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector2 ToVector2 ()
Return Value
The expanded NormalizedShort2.
See Also
Reference
NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedShort2 Properties
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
See Also
Reference
NormalizedShort2 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
NormalizedShort2.PackedValue Property
Directly gets or sets the packed representation of the value.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[CLSCompliantAttribute(false)]
public UInt32 PackedValue { get; set; }
Property Value
The packed representation of the value.
See Also
Reference
NormalizedShort2 Structure
NormalizedShort2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedShort4 Structure
Packed vector type containing four 16-bit signed normalized values, ranging from −1 to 1.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct NormalizedShort4 : IPackedVector<UInt64>, IEquatable<NormalizedShort4>
See Also
Reference
NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedShort4 Members
The following tables list the members exposed by the NormalizedShort4 type.
Public Constructors
Name Description
NormalizedShort4 Overloaded. Initializes a new instance of the NormalizedShort4 class.
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector4 Expands the packed representation into a Vector4.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
See Also
Reference
NormalizedShort4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
NormalizedShort4 Constructor
Initializes a new instance of the NormalizedShort4 class.
Overload List
Name Description
NormalizedShort4 (Single, Single, Single, Single) Initializes a new instance of the NormalizedShort4 class.
NormalizedShort4 (Vector4) Initializes a new instance of the NormalizedShort4 structure.
See Also
Reference
NormalizedShort4 Structure
NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
x
Initial value for the x component.
y
Initial value for the y component.
z
Initial value for the z component.
w
Initial value for the w component.
See Also
Reference
NormalizedShort4 Structure
NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector
A vector containing the initial values for the components of the NormalizedShort4 structure.
See Also
Reference
NormalizedShort4 Structure
NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedShort4 Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector4 Expands the packed representation into a Vector4.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
See Also
Reference
NormalizedShort4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
NormalizedShort4.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
NormalizedShort4.Equals (NormalizedShort4) Returns a value that indicates whether the current instance is equal to a specifie
d object.
NormalizedShort4.Equals (Object) Returns a value that indicates whether the current instance is equal to a specifie
d object.
NormalizedShort4.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
NormalizedShort4 Structure
NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
other
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
NormalizedShort4 Structure
NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
obj
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
NormalizedShort4 Structure
NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedShort4.GetHashCode Method
Gets the hash code for the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for the instance.
See Also
Reference
NormalizedShort4 Structure
NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4
Method
Sets the packed representation from a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
Vector4 vector
)
Parameters
vector
The vector to create the packed representation from.
See Also
Reference
NormalizedShort4 Structure
NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedShort4.op_Equality Method
Compares the current instance of a class to another instance to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
NormalizedShort4 a,
NormalizedShort4 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
NormalizedShort4 Structure
NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedShort4.op_Inequality Method
Compares the current instance of a class to another instance to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
NormalizedShort4 a,
NormalizedShort4 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
NormalizedShort4 Structure
NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedShort4.ToString Method
Returns a string representation of the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String that represents the object.
See Also
Reference
NormalizedShort4 Structure
NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedShort4.ToVector4 Method
Expands the packed representation into a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector4 ToVector4 ()
Return Value
The expanded vector.
See Also
Reference
NormalizedShort4 Structure
NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NormalizedShort4 Properties
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
See Also
Reference
NormalizedShort4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
NormalizedShort4.PackedValue Property
Directly gets or sets the packed representation of the value.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[CLSCompliantAttribute(false)]
public UInt64 PackedValue { get; set; }
Property Value
The packed representation of the value.
See Also
Reference
NormalizedShort4 Structure
NormalizedShort4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rg32 Structure
Packed vector type containing two 16-bit unsigned normalized values, ranging from 0 to 1.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct Rg32 : IPackedVector<UInt32>, IEquatable<Rg32>
See Also
Reference
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rg32 Members
The following tables list the members exposed by the Rg32 type.
Public Constructors
Name Description
Rg32 Overloaded. Initializes a new instance of the Rg32 class.
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector2 Expands the packed vector representation into a Vector2.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Expands the packed representation int
o a Vector4.
See Also
Reference
Rg32 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Rg32 Constructor
Initializes a new instance of the Rg32 class.
Overload List
Name Description
Rg32 (Single, Single) Initializes a new instance of the Rg32 structure.
Rg32 (Vector2) Initializes a new instance of the Rg32 structure.
See Also
Reference
Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
x
Initial value for the x component.
y
Initial value for the y component.
See Also
Reference
Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector
The vector containing the initial values for the components of the Rg32 structure.
See Also
Reference
Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rg32 Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector2 Expands the packed vector representation into a Vector2.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Expands the packed representation int
o a Vector4.
See Also
Reference
Rg32 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Rg32.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
Rg32.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
Rg32.Equals (Rg32) Returns a value that indicates whether the current instance is equal to a specified object.
Rg32.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
obj
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
other
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rg32.GetHashCode Method
Gets the hash code for the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for the instance.
See Also
Reference
Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4
Method
Sets the packed representation from a Vector4
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
Vector4 vector
)
Parameters
vector
The vector to create packed representation from.
See Also
Reference
Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4
Method
Expands the packed representation into a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private Vector4 Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 ()
Return Value
The expanded vector.
See Also
Reference
Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rg32.op_Equality Method
Compares the current instance of a class to another instance to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
Rg32 a,
Rg32 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rg32.op_Inequality Method
Compares the current instance of a class to another instance to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
Rg32 a,
Rg32 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rg32.ToString Method
Returns a string representation of the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String that represents the object.
See Also
Reference
Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rg32.ToVector2 Method
Expands the packed vector representation into a Vector2.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector2 ToVector2 ()
Return Value
The expanded vector.
See Also
Reference
Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rg32 Properties
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
See Also
Reference
Rg32 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Rg32.PackedValue Property
Directly gets or sets the packed representation of the value.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[CLSCompliantAttribute(false)]
public UInt32 PackedValue { get; set; }
Property Value
The packed representation of the value.
See Also
Reference
Rg32 Structure
Rg32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rgba1010102 Structure
Packed vector type containing unsigned normalized values, ranging from 0 to 1, using 10 bits each for x, y, and z, and 2 bits for
w.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct Rgba1010102 : IPackedVector<UInt32>, IEquatable<Rgba1010102>
See Also
Reference
Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rgba1010102 Members
The following tables list the members exposed by the Rgba1010102 type.
Public Constructors
Name Description
Rgba1010102 Overloaded. Initializes a new instance of the Rgba1010102 class.
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector4 Expands the packed representation into a Vector4.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4
See Also
Reference
Rgba1010102 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Rgba1010102 Constructor
Initializes a new instance of the Rgba1010102 class.
Overload List
Name Description
Rgba1010102 (Single, Single, Single, Single) Initializes a new instance of the Rgba1010102 class.
Rgba1010102 (Vector4) Initializes a new instance of the Rgba1010102 structure.
See Also
Reference
Rgba1010102 Structure
Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
x
Initial value for the x component.
y
Initial value for the y component.
z
Initial value for the z component.
w
Initial value for the w component.
See Also
Reference
Rgba1010102 Structure
Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector
A vector containing the initial values for the components of the Rgba1010102 structure.
See Also
Reference
Rgba1010102 Structure
Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rgba1010102 Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector4 Expands the packed representation into a Vector4.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4
See Also
Reference
Rgba1010102 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Rgba1010102.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
Rgba1010102.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
Rgba1010102.Equals (Rgba1010102) Returns a value that indicates whether the current instance is equal to a specified object.
Rgba1010102.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
Rgba1010102 Structure
Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
obj
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Rgba1010102 Structure
Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
other
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Rgba1010102 Structure
Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rgba1010102.GetHashCode Method
Gets the hash code for the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for the instance.
See Also
Reference
Rgba1010102 Structure
Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4
Method
Sets the packed representation from a Vector4
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
Vector4 vector
)
Parameters
vector
The vector to create the packed representation from.
See Also
Reference
Rgba1010102 Structure
Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rgba1010102.op_Equality Method
Compares the current instance of a class to another instance to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
Rgba1010102 a,
Rgba1010102 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the left of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
Rgba1010102 Structure
Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rgba1010102.op_Inequality Method
Compares the current instance of a class to another instance to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
Rgba1010102 a,
Rgba1010102 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
Rgba1010102 Structure
Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rgba1010102.ToString Method
Returns a string representation of the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String that represents the object.
See Also
Reference
Rgba1010102 Structure
Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rgba1010102.ToVector4 Method
Expands the packed representation into a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector4 ToVector4 ()
Return Value
The expanded vector.
See Also
Reference
Rgba1010102 Structure
Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rgba1010102 Properties
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
See Also
Reference
Rgba1010102 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Rgba1010102.PackedValue Property
Directly gets or sets the packed representation of the value.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[CLSCompliantAttribute(false)]
public UInt32 PackedValue { get; set; }
Property Value
The packed representation of the value.
See Also
Reference
Rgba1010102 Structure
Rgba1010102 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rgba32 Structure
Packed vector type containing four 8-bit unsigned normalized values, ranging from 0 to 1.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct Rgba32 : IPackedVector<UInt32>, IEquatable<Rgba32>
See Also
Reference
Rgba32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rgba32 Members
The following tables list the members exposed by the Rgba32 type.
Public Constructors
Name Description
Rgba32 Overloaded. Initializes a new instance of the Rgba32 class.
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector4 Expands the packed representation into a Vector4.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
See Also
Reference
Rgba32 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Rgba32 Constructor
Initializes a new instance of the Rgba32 class.
Overload List
Name Description
Rgba32 (Single, Single, Single, Single) Initializes a new instance of the Rgba32 class.
Rgba32 (Vector4) Initializes a new instance of the Rgba32 structure.
See Also
Reference
Rgba32 Structure
Rgba32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
x
Initial value for the x component.
y
Initial value for the y component.
z
Initial value for the z component.
w
Initial value for the w component.
See Also
Reference
Rgba32 Structure
Rgba32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector
A vector containing the initial values for the components of the Rgba32 structure.
See Also
Reference
Rgba32 Structure
Rgba32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rgba32 Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector4 Expands the packed representation into a Vector4.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
See Also
Reference
Rgba32 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Rgba32.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
Rgba32.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
Rgba32.Equals (Rgba32) Returns a value that indicates whether the current instance is equal to a specified object.
Rgba32.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
Rgba32 Structure
Rgba32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
obj
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Rgba32 Structure
Rgba32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
other
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Rgba32 Structure
Rgba32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rgba32.GetHashCode Method
Gets the hash code for the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for the instance.
See Also
Reference
Rgba32 Structure
Rgba32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4
Method
Sets the packed representation from a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
Vector4 vector
)
Parameters
vector
The vector to create the packed representation from.
See Also
Reference
Rgba32 Structure
Rgba32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rgba32.op_Equality Method
Compares the current instance of a class to another instance to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
Rgba32 a,
Rgba32 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
Rgba32 Structure
Rgba32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rgba32.op_Inequality Method
Compares the current instance of a class to another instance to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
Rgba32 a,
Rgba32 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
Rgba32 Structure
Rgba32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rgba32.ToString Method
Returns a string representation of the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String that represents the object.
See Also
Reference
Rgba32 Structure
Rgba32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rgba32.ToVector4 Method
Expands the packed representation into a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector4 ToVector4 ()
Return Value
The expanded vector.
See Also
Reference
Rgba32 Structure
Rgba32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rgba32 Properties
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
See Also
Reference
Rgba32 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Rgba32.PackedValue Property
Directly gets or sets the packed representation of the value.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[CLSCompliantAttribute(false)]
public UInt32 PackedValue { get; set; }
Property Value
The packed representation of the value.
See Also
Reference
Rgba32 Structure
Rgba32 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rgba64 Structure
Packed vector type containing four 16-bit unsigned normalized values, ranging from 0 to 1.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct Rgba64 : IPackedVector<UInt64>, IEquatable<Rgba64>
See Also
Reference
Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rgba64 Members
The following tables list the members exposed by the Rgba64 type.
Public Constructors
Name Description
Rgba64 Overloaded. Initializes a new instance of the Rgba64 class.
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector4 Expands the packed representation into a Vector4.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
See Also
Reference
Rgba64 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Rgba64 Constructor
Initializes a new instance of the Rgba64 class.
Overload List
Name Description
Rgba64 (Single, Single, Single, Single) Initializes a new instance of the Rgba64 structure.
Rgba64 (Vector4) Initializes a new instance of the Rgba64 structure.
See Also
Reference
Rgba64 Structure
Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
x
Initial value for the x component.
y
Initial value for the y component.
z
Initial value for the z component.
w
Initial value for the w component.
See Also
Reference
Rgba64 Structure
Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector
A vector containing the initial values for the components of the Rgba64 structure.
See Also
Reference
Rgba64 Structure
Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rgba64 Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector4 Expands the packed representation into a Vector4.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
See Also
Reference
Rgba64 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Rgba64.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
Rgba64.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
Rgba64.Equals (Rgba64) Returns a value that indicates whether the current instance is equal to a specified object.
Rgba64.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
Rgba64 Structure
Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
obj
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Rgba64 Structure
Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
other
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Rgba64 Structure
Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rgba64.GetHashCode Method
Gets the hash code for the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for the instance.
See Also
Reference
Rgba64 Structure
Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4
Method
Sets the packed representation from a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
Vector4 vector
)
Parameters
vector
The vector to create the packed representation from.
See Also
Reference
Rgba64 Structure
Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rgba64.op_Equality Method
Compares the current instance of a class to another instance to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
Rgba64 a,
Rgba64 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
Rgba64 Structure
Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rgba64.op_Inequality Method
Compares the current instance of a class to another instance to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
Rgba64 a,
Rgba64 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
Rgba64 Structure
Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rgba64.ToString Method
Returns a string representation of the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String that represents the object.
See Also
Reference
Rgba64 Structure
Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rgba64.ToVector4 Method
Expands the packed representation into a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector4 ToVector4 ()
Return Value
The expanded vector.
See Also
Reference
Rgba64 Structure
Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Rgba64 Properties
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
See Also
Reference
Rgba64 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Rgba64.PackedValue Property
Directly gets or sets the packed representation of the value.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[CLSCompliantAttribute(false)]
public UInt64 PackedValue { get; set; }
Property Value
The packed representation of the value.
See Also
Reference
Rgba64 Structure
Rgba64 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Short2 Structure
Packed vector type containing two 16-bit signed integer values.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct Short2 : IPackedVector<UInt32>, IEquatable<Short2>
See Also
Reference
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Short2 Members
The following tables list the members exposed by the Short2 type.
Public Constructors
Name Description
Short2 Overloaded. Initializes a new instance of the Short2 class.
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector2 Expands the packed representation to a vector.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Expands the packed representation int
o a Vector4.
See Also
Reference
Short2 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Short2 Constructor
Initializes a new instance of the Short2 class.
Overload List
Name Description
Short2 (Single, Single) Initializes a new instance of the Short2 class.
Short2 (Vector2) Initializes a new instance of the Short2 structure.
See Also
Reference
Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
x
Initial value for the x component.
y
Initial value for the y component.
See Also
Reference
Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector
A vector containing the initial values for the components of the Short2 structure.
See Also
Reference
Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Short2 Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector2 Expands the packed representation to a vector.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Expands the packed representation int
o a Vector4.
See Also
Reference
Short2 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Short2.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
Short2.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
Short2.Equals (Short2) Returns a value that indicates whether the current instance is equal to a specified object.
Short2.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
obj
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
other
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Short2.GetHashCode Method
Gets the hash code for the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for the instance.
See Also
Reference
Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4
Method
Sets the packed representation from a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
Vector4 vector
)
Parameters
vector
The vector to create the packed representation from.
See Also
Reference
Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4
Method
Expands the packed representation into a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private Vector4 Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 ()
Return Value
The expanded vector.
See Also
Reference
Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Short2.op_Equality Method
Compares the current instance of a class to another instance to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
Short2 a,
Short2 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Short2.op_Inequality Method
Compares the current instance of a class to another instance to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
Short2 a,
Short2 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Short2.ToString Method
Returns a string representation of the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String that represents the object.
See Also
Reference
Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Short2.ToVector2 Method
Expands the packed representation to a vector.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector2 ToVector2 ()
Return Value
The expanded Short2.
See Also
Reference
Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Short2 Properties
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
See Also
Reference
Short2 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Short2.PackedValue Property
Directly gets or sets the packed representation of the value.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[CLSCompliantAttribute(false)]
public UInt32 PackedValue { get; set; }
Property Value
The packed representation of the value.
See Also
Reference
Short2 Structure
Short2 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Short4 Structure
Packed vector type containing four 16-bit signed integer values.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct Short4 : IPackedVector<UInt64>, IEquatable<Short4>
See Also
Reference
Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Short4 Members
The following tables list the members exposed by the Short4 type.
Public Constructors
Name Description
Short4 Overloaded. Initializes a new instance of the Short4 class.
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector4 Expands the packed representation into a Vector4.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
See Also
Reference
Short4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Short4 Constructor
Initializes a new instance of the Short4 class.
Overload List
Name Description
Short4 (Single, Single, Single, Single) Initializes a new instance of the Short4 class.
Short4 (Vector4) Initializes a new instance of the Short4 structure.
See Also
Reference
Short4 Structure
Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
x
Initial value for the x component.
y
Initial value for the y component.
z
Initial value for the z component.
w
Initial value for the w component.
See Also
Reference
Short4 Structure
Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector
A vector containing the initial values for the components of the Short4 structure.
See Also
Reference
Short4 Structure
Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Short4 Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector4 Expands the packed representation into a Vector4.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
See Also
Reference
Short4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Short4.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
Short4.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
Short4.Equals (Short4) Returns a value that indicates whether the current instance is equal to a specified object.
Short4.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
Short4 Structure
Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
obj
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Short4 Structure
Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
other
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
Short4 Structure
Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Short4.GetHashCode Method
Gets the hash code for the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for the instance.
See Also
Reference
Short4 Structure
Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4
Method
Sets the packed representation from a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
Vector4 vector
)
Parameters
vector
The vector to create the packed representation from.
See Also
Reference
Short4 Structure
Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Short4.op_Equality Method
Compares the current instance of a class to another instance to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
Short4 a,
Short4 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
Short4 Structure
Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Short4.op_Inequality Method
Compares the current instance of a class to another instance to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
Short4 a,
Short4 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
Short4 Structure
Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Short4.ToString Method
Returns a string representation of the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String that represents the object.
See Also
Reference
Short4 Structure
Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Short4.ToVector4 Method
Expands the packed representation into a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector4 ToVector4 ()
Return Value
The expanded vector.
See Also
Reference
Short4 Structure
Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Short4 Properties
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
See Also
Reference
Short4 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Short4.PackedValue Property
Directly gets or sets the packed representation of the value.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[CLSCompliantAttribute(false)]
public UInt64 PackedValue { get; set; }
Property Value
The packed representation of the value.
See Also
Reference
Short4 Structure
Short4 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
UInt101010 Structure
Packed vector type containing unsigned integer values, using 10 bits each for x, y, and z (ranging from 0 to 1023), and 2 bits
for w (ranging from 0 to 3).
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct UInt101010 : IPackedVector<UInt32>, IEquatable<UInt101010>
See Also
Reference
UInt101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
UInt101010 Members
The following tables list the members exposed by the UInt101010 type.
Public Constructors
Name Description
UInt101010 Overloaded. Initializes a new instance of the UInt101010 class.
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector3 Expands the packed representation into a Vector3.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Expands the packed representation int
o a Vector4.
See Also
Reference
UInt101010 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
UInt101010 Constructor
Initializes a new instance of the UInt101010 class.
Overload List
Name Description
UInt101010 (Single, Single, Single) Initializes a new instance of the UInt101010 class.
UInt101010 (Vector3) Initializes a new instance of the UInt101010 class.
See Also
Reference
UInt101010 Structure
UInt101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
x
Initial value for the x component.
y
Initial value for the y component.
z
Initial value for the z component.
See Also
Reference
UInt101010 Structure
UInt101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
vector
A vector containing the initial values for the components of the UInt101010 structure.
See Also
Reference
UInt101010 Structure
UInt101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
UInt101010 Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for the current instance.
GetType (Inherited from Object.)
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
ReferenceEquals (Inherited from Object.)
ToString Returns a string representation of the current instance.
ToVector3 Expands the packed representation into a Vector3.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
Explicit Interface Implementations
Name Description
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 Sets the packed representation from a
Vector4.
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 Expands the packed representation int
o a Vector4.
See Also
Reference
UInt101010 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
UInt101010.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
UInt101010.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
UInt101010.Equals (UInt101010) Returns a value that indicates whether the current instance is equal to a specified object.
UInt101010.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
UInt101010 Structure
UInt101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
Parameters
obj
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
UInt101010 Structure
UInt101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
other
The object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
UInt101010 Structure
UInt101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
UInt101010.GetHashCode Method
Gets the hash code for the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for the instance.
See Also
Reference
UInt101010 Structure
UInt101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4
Method
Sets the packed representation from a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private void Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.PackFromVector4 (
Vector4 vector
)
Parameters
vector
The vector to create the packed representation from.
See Also
Reference
UInt101010 Structure
UInt101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4
Method
Expands the packed representation into a Vector4.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
private Vector4 Microsoft.Xna.Framework.Graphics.PackedVector.IPackedVector.ToVector4 ()
Return Value
The expanded vector.
See Also
Reference
UInt101010 Structure
UInt101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
UInt101010.op_Equality Method
Compares the current instance of a class to another instance to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
UInt101010 a,
UInt101010 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
UInt101010 Structure
UInt101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
UInt101010.op_Inequality Method
Compares the current instance of a class to another instance to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
UInt101010 a,
UInt101010 b
)
Parameters
a
The object to the left of the equality operator.
b
The object to the right of the equality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
UInt101010 Structure
UInt101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
UInt101010.ToString Method
Returns a string representation of the current instance.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String that represents the object.
See Also
Reference
UInt101010 Structure
UInt101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
UInt101010.ToVector3 Method
Expands the packed representation into a Vector3.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector3 ToVector3 ()
Return Value
The expanded vector.
See Also
Reference
UInt101010 Structure
UInt101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
UInt101010 Properties
Public Properties
Name Description
PackedValue Directly gets or sets the packed representation of the value.
See Also
Reference
UInt101010 Structure
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
XNA Game Studio 2.0
UInt101010.PackedValue Property
Directly gets or sets the packed representation of the value.
Namespace: Microsoft.Xna.Framework.Graphics.PackedVector
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[CLSCompliantAttribute(false)]
public UInt32 PackedValue { get; set; }
Property Value
The packed representation of the value.
See Also
Reference
UInt101010 Structure
UInt101010 Members
Microsoft.Xna.Framework.Graphics.PackedVector Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Input Namespace
Contains classes to receive input from keyboard, mouse, and Xbox 360 Controller devices.
Classes
Name Description
GamePad Allows retrieval of user interaction with an Xbox 360 Controller and setting of controller vibration motors.
Keyboard Allows retrieval of keystrokes from a keyboard input device.
Mouse Allows retrieval of position and button clicks from a mouse input device.
Structures
Name Description
GamePadButtons Identifies whether the buttons on an Xbox 360 Controller are pressed or released.
GamePadCapabilities Describes the capabilities of an Xbox 360 Controller, including controller type and whether the contr
oller supports voice.
GamePadDPad Identifies which directions on the directional pad of an Xbox 360 Controller are being pressed.
GamePadState Represents specific information about the state of an Xbox 360 Controller, including the current stat
e of buttons and sticks.
GamePadThumbSticks Structure that represents the position of left and right sticks (thumbsticks) on an Xbox 360 Controlle
r.
GamePadTriggers Structure that defines the position of the left and right triggers on an Xbox 360 Controller.
KeyboardState Represents a state of keystrokes recorded by a keyboard input device.
MouseState Represents the state of a mouse input device, including mouse cursor position and buttons pressed.
Enumerations
Name Description
Buttons Enumerates input device buttons.
ButtonState Identifies the state of a mouse button or Xbox 360 Controller button.
GamePadDeadZone Specifies a type of dead zone processing to apply to Xbox 360 controller analog sticks when calling
GetState.
GamePadType Describes the type of a given Xbox 360 controller.
Keys Identifies a particular key on a keyboard.
KeyState Identifies the state of a keyboard key.
See Also
Tasks
How To: Detect Whether a Controller Button Is Pressed
How To: Detect Whether a Controller Is Disconnected
How To: Get the Current Mouse Position (Windows)
How To: Detect Whether a Key Is Pressed
Concepts
Input Overview
XNA Game Studio 2.0
Buttons Enumeration
Enumerates input device buttons.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[FlagsAttribute]
public enum Buttons
Members
Member name Description
A A button
B B button
Back BACK button
DPadDown Directional pad up
DPadLeft Directional pad left
DPadRight Directional pad right
DPadUp Directional pad down
LeftShoulder Left bumper (shoulder) button
LeftStick Left stick button (pressing the left stick)
LeftThumbstickDown Left stick is towards down
LeftThumbstickLeft Left stick is towards the left
LeftThumbstickRight Left stick is towards the right
LeftThumbstickUp Left stick is towards up
LeftTrigger Left trigger
RightShoulder Right bumper (shoulder) button
RightStick Right stick button (pressing the right stick)
RightThumbstickDown Right stick is towards down
RightThumbstickLeft Right stick is towards the left
RightThumbstickRight Right stick is towards the right
RightThumbstickUp Right stick is towards up
RightTrigger Right trigger
Start START button
X X button
Y Y button
See Also
Reference
Microsoft.Xna.Framework.Input Namespace
GamePadState.IsButtonDown Method
GamePadState.IsButtonUp Method
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
ButtonState Enumeration
Identifies the state of a mouse button or Xbox 360 Controller button.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum ButtonState
Members
Member name Description
Pressed The button is pressed.
Released The button is released.
See Also
Reference
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePad Class
Allows retrieval of user interaction with an Xbox 360 Controller and setting of controller vibration motors.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static class GamePad
See Also
Tasks
How To: Detect Whether a Controller Button Is Pressed
How To: Detect Whether a Controller Is Disconnected
Concepts
Input Overview
Reference
GamePad Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePad Members
The following tables list the members exposed by the GamePad type.
Public Methods
Name Description
Equals (Inherited from Object.)
GetCapabilities Retrieves the capabilities of an Xbox 360 Controller.
GetHashCode (Inherited from Object.)
GetState Overloaded. Gets the current state of an Xbox 360 Controller, optionally specifying a dead zone processi
ng method for the analog sticks.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
SetVibration Sets the vibration motor speeds on an Xbox 360 Controller.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Tasks
How To: Detect Whether a Controller Button Is Pressed
How To: Detect Whether a Controller Is Disconnected
Concepts
Input Overview
Reference
GamePad Class
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
GamePad Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetCapabilities Retrieves the capabilities of an Xbox 360 Controller.
GetHashCode (Inherited from Object.)
GetState Overloaded. Gets the current state of an Xbox 360 Controller, optionally specifying a dead zone processi
ng method for the analog sticks.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
SetVibration Sets the vibration motor speeds on an Xbox 360 Controller.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GamePad Class
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
GamePad.GetCapabilities Method
Retrieves the capabilities of an Xbox 360 Controller.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static GamePadCapabilities GetCapabilities (
PlayerIndex playerIndex
)
Parameters
playerIndex
Index of the controller to query.
Return Value
The capabilities of the controller.
Exceptions
Exception type Condition
InvalidOperationException An unknown error has occurred. Verify that the correct playerIndex is being requested.
See Also
Reference
GamePad Class
GamePad Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePad.GetState Method
Gets the current state of an Xbox 360 Controller, optionally specifying a dead zone processing method for the analog sticks.
Overload List
Name Description
GamePad.GetState (PlayerIndex) Gets the current state of an Xbox 360 Controller.
GamePad.GetState (PlayerIndex, GamePadDeadZone) Gets the current state of an Xbox 360 Controller, using a specified dead z
one on analog stick positions.
Remarks When calling GetState, check the returned structure's IsConnected property value. If the controller has been
disconnected, this value will be false. When a controller is disconnected, values for its state will not be valid. The controller will
also not be able to receive new vibration settings.
See Also
Tasks
How To: Detect Whether a Controller Button Is Pressed
How To: Detect Whether a Controller Is Disconnected
Concepts
Input Overview
Reference
GamePad Class
GamePad Members
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
Parameters
playerIndex
Player index for the controller you want to query.
Return Value
The current state of the controller.
Exceptions
Exception type Condition
InvalidOperationException An unknown error has occurred. Verify that the correct playerIndex is being requested.
Remarks
When calling GetState, check the returned structure's IsConnected property value. If the controller has been disconnected, this
value will be false. When a controller is disconnected, values for its state will not be valid. The controller will also not be able to
receive new vibration settings.
This method uses the GamePadDeadZone.IndependentAxes dead zone to smooth the values of the analog sticks. To specify a
different dead zone type, or to specify no dead-zone processing, pass a GamePadDeadZone value to this method.
See Also
Tasks
How To: Detect Whether a Controller Button Is Pressed
How To: Detect Whether a Controller Is Disconnected
Concepts
Input Overview
Reference
GamePad Class
GamePad Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
playerIndex
Player index for the controller you want to query.
deadZoneMode
Enumerated value that specifies what dead zone type to use.
Return Value
The current state of the controller.
Exceptions
Exception type Condition
InvalidOperationException An unknown error has occurred. Verify that the correct playerIndex is being requested.
Remarks
When calling GetState, check the returned structure's IsConnected property value. If the controller has been disconnected, this
value will be false. When a controller is disconnected, values for its state will not be valid. The controller will also not be able to
receive new vibration settings.
The deadZoneMode parameter specifies the type of dead-zone processing to apply to the analog sticks on the controller. By
applying a dead zone, controller inputs will report values near the center and edges of their ranges more accurately. If you wish
to do your own dead-zone processing, use GamePadDeadZone.None.
See Also
Tasks
How To: Detect Whether a Controller Button Is Pressed
How To: Detect Whether a Controller Is Disconnected
Concepts
Input Overview
Reference
GamePad Class
GamePad Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePad.SetVibration Method
Sets the vibration motor speeds on an Xbox 360 Controller.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool SetVibration (
PlayerIndex playerIndex,
float leftMotor,
float rightMotor
)
Parameters
playerIndex
Player index that identifies the controller to set.
leftMotor
The speed of the left motor, between 0.0 and 1.0. This motor is a low-frequency motor.
rightMotor
The speed of the right motor, between 0.0 and 1.0. This motor is a high-frequency motor.
Return Value
true if the vibration motors were successfully set; false if the controller was unable to process the request.
Exceptions
Exception type Condition
InvalidOperationException An unknown error has occurred. Verify that the correct playerIndex is being requested.
Remarks
If this method returns false, it means that the controller is either disconnected or too busy to accept the new vibration settings.
It is not advisable to loop in wait for this method to return true.
See Also
Tasks
Tutorial 2: Making Your Model Move Using Input
How To: Detect Whether a Controller Button Is Pressed
Reference
GamePad Class
GamePad Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadButtons Structure
Identifies whether the buttons on an Xbox 360 Controller are pressed or released.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct GamePadButtons
See Also
Tasks
How To: Detect Whether a Controller Button Is Pressed
How To: Detect Whether a Controller Is Disconnected
Concepts
Input Overview
Reference
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadButtons Members
The following tables list the members exposed by the GamePadButtons type.
Public Constructors
Name Description
GamePadButtons Initializes a new instance of the GamePadButtons class, setting the specified buttons to pressed.
Public Properties
Name Description
A Identifies whether the A button on the Xbox 360 Controller is pressed.
B Identifies whether the B button on the Xbox 360 Controller is pressed.
Back Identifies whether the BACK button on the Xbox 360 Controller is pressed.
LeftShoulder Identifies whether the left shoulder (bumper) button on the Xbox 360 Controller is pressed.
LeftStick Identifies whether the left stick button on the Xbox 360 Controller is pressed (the stick is "clicked" in).
RightShoulder Identifies whether the right shoulder (bumper) button on the Xbox 360 Controller is pressed.
RightStick Identifies whether the right stick button on the Xbox 360 Controller is pressed (the stick is "clicked" in).
Start Identifies whether the START button on the Xbox 360 Controller is pressed.
X Identifies whether the X button on the Xbox 360 Controller is pressed.
Y Identifies whether the Y button on the Xbox 360 Controller is pressed.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Determines whether two GamePadButtons instances are equal.
op_Inequality Determines whether two GamePadButtons instances are not equal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Tasks
How To: Detect Whether a Controller Button Is Pressed
How To: Detect Whether a Controller Is Disconnected
Concepts
Input Overview
Reference
GamePadButtons Structure
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
GamePadButtons Constructor
Initializes a new instance of the GamePadButtons class, setting the specified buttons to pressed.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GamePadButtons (
Buttons buttons
)
Parameters
buttons
Buttons to initialize as pressed. Specify a single button, or combine multiple buttons using a bitwise OR operation.
Remarks
Note that GamePadButtons only stores the state of digital buttons (buttons that are pressed or unpressed, such as A or right
bumper). Trigger or stick values specified in the buttons argument are ignored.
Games normally use GetState to get the true gamepad state. This constructor is used to instead simulate gamepad input for
passing within the game's own input subsystem.
See Also
Reference
GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadButtons Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Determines whether two GamePadButtons instances are equal.
op_Inequality Determines whether two GamePadButtons instances are not equal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GamePadButtons Structure
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
GamePadButtons.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
GamePadButtons.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified obj
ect.
GamePadButtons.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
Parameters
obj
Object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadButtons.GetHashCode Method
Gets the hash code for this instance.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for this object.
See Also
Reference
GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadButtons.op_Equality Method
Determines whether two GamePadButtons instances are equal.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
GamePadButtons left,
GamePadButtons right
)
Parameters
left
Object on the left of the equal sign.
right
Object on the right of the equal sign.
Return Value
true if the instances are equal; false otherwise.
See Also
Reference
GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadButtons.op_Inequality Method
Determines whether two GamePadButtons instances are not equal.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
GamePadButtons left,
GamePadButtons right
)
Parameters
left
Object on the left of the equal sign.
right
Object on the right of the equal sign.
Return Value
true if the objects are not equal; false otherwise.
See Also
Reference
GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadButtons.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadButtons Properties
Public Properties
Name Description
A Identifies whether the A button on the Xbox 360 Controller is pressed.
B Identifies whether the B button on the Xbox 360 Controller is pressed.
Back Identifies whether the BACK button on the Xbox 360 Controller is pressed.
LeftShoulder Identifies whether the left shoulder (bumper) button on the Xbox 360 Controller is pressed.
LeftStick Identifies whether the left stick button on the Xbox 360 Controller is pressed (the stick is "clicked" in).
RightShoulder Identifies whether the right shoulder (bumper) button on the Xbox 360 Controller is pressed.
RightStick Identifies whether the right stick button on the Xbox 360 Controller is pressed (the stick is "clicked" in).
Start Identifies whether the START button on the Xbox 360 Controller is pressed.
X Identifies whether the X button on the Xbox 360 Controller is pressed.
Y Identifies whether the Y button on the Xbox 360 Controller is pressed.
See Also
Reference
GamePadButtons Structure
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
GamePadButtons.A Property
Identifies whether the A button on the Xbox 360 Controller is pressed.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ButtonState A { get; }
Property Value
ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.
See Also
Reference
GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadButtons.B Property
Identifies whether the B button on the Xbox 360 Controller is pressed.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ButtonState B { get; }
Property Value
ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.
See Also
Reference
GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadButtons.Back Property
Identifies whether the BACK button on the Xbox 360 Controller is pressed.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ButtonState Back { get; }
Property Value
ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.
See Also
Reference
GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadButtons.LeftShoulder Property
Identifies whether the left shoulder (bumper) button on the Xbox 360 Controller is pressed.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ButtonState LeftShoulder { get; }
Property Value
ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.
See Also
Reference
GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadButtons.LeftStick Property
Identifies whether the left stick button on the Xbox 360 Controller is pressed (the stick is "clicked" in).
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ButtonState LeftStick { get; }
Property Value
ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.
See Also
Reference
GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadButtons.RightShoulder Property
Identifies whether the right shoulder (bumper) button on the Xbox 360 Controller is pressed.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ButtonState RightShoulder { get; }
Property Value
ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.
See Also
Reference
GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadButtons.RightStick Property
Identifies whether the right stick button on the Xbox 360 Controller is pressed (the stick is "clicked" in).
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ButtonState RightStick { get; }
Property Value
ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.
See Also
Reference
GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadButtons.Start Property
Identifies whether the START button on the Xbox 360 Controller is pressed.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ButtonState Start { get; }
Property Value
ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.
See Also
Reference
GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadButtons.X Property
Identifies whether the X button on the Xbox 360 Controller is pressed.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ButtonState X { get; }
Property Value
ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.
See Also
Reference
GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadButtons.Y Property
Identifies whether the Y button on the Xbox 360 Controller is pressed.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ButtonState Y { get; }
Property Value
ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.
See Also
Reference
GamePadButtons Structure
GamePadButtons Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadCapabilities Structure
Describes the capabilities of an Xbox 360 Controller, including controller type and whether the controller supports voice.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct GamePadCapabilities
See Also
Reference
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadCapabilities Members
The following tables list the members exposed by the GamePadCapabilities type.
Public Properties
Name Description
GamePadType Gets the type of controller.
HasAButton Indicates whether the controller has an A button.
HasBackButton Indicates whether the controller has a BACK button.
HasBButton Indicates whether the controller has a B button.
HasDPadDownButton Indicates whether the controller has a directional pad DOWN button.
HasDPadLeftButton Indicates whether the controller has a directional pad LEFT button.
HasDPadRightButton Indicates whether the controller has a directional pad RIGHT button.
HasDPadUpButton Indicates whether the controller has a directional pad UP button.
HasLeftShoulderButton Indicates whether the controller has a left bumper button.
HasLeftStickButton Indicates whether the controller has a digital button control on the left analog stick.
HasLeftTrigger Indicates whether the controller has a left analog trigger.
HasLeftVibrationMotor Indicates whether the controller has a low-frequency vibration motor.
HasLeftXThumbStick Indicates whether the controller supports a left analog control with horizontal movement.
HasLeftYThumbStick Indicates whether the controller supports a left analog control with vertical movement.
HasRightShoulderButton Indicates whether the controller has a right bumper button.
HasRightStickButton Indicates whether the controller has a digital button control on the right analog stick.
HasRightTrigger Indicates whether the controller has a right analog trigger.
HasRightVibrationMotor Indicates whether the controller has a high-frequency vibration motor.
HasRightXThumbStick Indicates whether the controller supports a right analog control with horizontal movement.
HasRightYThumbStick Indicates whether the controller supports a right analog control with vertical movement.
HasStartButton Indicates whether the controller has a START button.
HasVoiceSupport Indicates whether the controller supports voice.
HasXButton Indicates whether the controller has an X button.
HasYButton Indicates whether the controller has a Y button.
IsConnected Indicates whether the Xbox 360 Controller is connected.
Public Methods
Name Description
Equals (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GamePadCapabilities Structure
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
GamePadCapabilities Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GamePadCapabilities Structure
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
GamePadCapabilities Properties
Public Properties
Name Description
GamePadType Gets the type of controller.
HasAButton Indicates whether the controller has an A button.
HasBackButton Indicates whether the controller has a BACK button.
HasBButton Indicates whether the controller has a B button.
HasDPadDownButton Indicates whether the controller has a directional pad DOWN button.
HasDPadLeftButton Indicates whether the controller has a directional pad LEFT button.
HasDPadRightButton Indicates whether the controller has a directional pad RIGHT button.
HasDPadUpButton Indicates whether the controller has a directional pad UP button.
HasLeftShoulderButton Indicates whether the controller has a left bumper button.
HasLeftStickButton Indicates whether the controller has a digital button control on the left analog stick.
HasLeftTrigger Indicates whether the controller has a left analog trigger.
HasLeftVibrationMotor Indicates whether the controller has a low-frequency vibration motor.
HasLeftXThumbStick Indicates whether the controller supports a left analog control with horizontal movement.
HasLeftYThumbStick Indicates whether the controller supports a left analog control with vertical movement.
HasRightShoulderButton Indicates whether the controller has a right bumper button.
HasRightStickButton Indicates whether the controller has a digital button control on the right analog stick.
HasRightTrigger Indicates whether the controller has a right analog trigger.
HasRightVibrationMotor Indicates whether the controller has a high-frequency vibration motor.
HasRightXThumbStick Indicates whether the controller supports a right analog control with horizontal movement.
HasRightYThumbStick Indicates whether the controller supports a right analog control with vertical movement.
HasStartButton Indicates whether the controller has a START button.
HasVoiceSupport Indicates whether the controller supports voice.
HasXButton Indicates whether the controller has an X button.
HasYButton Indicates whether the controller has a Y button.
IsConnected Indicates whether the Xbox 360 Controller is connected.
See Also
Reference
GamePadCapabilities Structure
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
GamePadCapabilities.GamePadType Property
Gets the type of controller.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GamePadType GamePadType { get; }
Property Value
Enumerated value describing the controller type.
See Also
Reference
GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadCapabilities.HasAButton Property
Indicates whether the controller has an A button.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool HasAButton { get; }
Property Value
true if the controller has this capability; false otherwise.
See Also
Reference
GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadCapabilities.HasBackButton Property
Indicates whether the controller has a BACK button.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool HasBackButton { get; }
Property Value
true if the controller has this capability; false otherwise.
See Also
Reference
GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadCapabilities.HasBButton Property
Indicates whether the controller has a B button.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool HasBButton { get; }
Property Value
true if the controller has this capability; false otherwise.
See Also
Reference
GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadCapabilities.HasDPadDownButton Property
Indicates whether the controller has a directional pad DOWN button.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool HasDPadDownButton { get; }
Property Value
true if the controller has this capability; false otherwise.
See Also
Reference
GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadCapabilities.HasDPadLeftButton Property
Indicates whether the controller has a directional pad LEFT button.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool HasDPadLeftButton { get; }
Property Value
true if the controller has this capability; false otherwise.
See Also
Reference
GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadCapabilities.HasDPadRightButton Property
Indicates whether the controller has a directional pad RIGHT button.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool HasDPadRightButton { get; }
Property Value
true if the controller has this capability; false otherwise.
See Also
Reference
GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadCapabilities.HasDPadUpButton Property
Indicates whether the controller has a directional pad UP button.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool HasDPadUpButton { get; }
Property Value
true if the controller has this capability; false otherwise.
See Also
Reference
GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadCapabilities.HasLeftShoulderButton Property
Indicates whether the controller has a left bumper button.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool HasLeftShoulderButton { get; }
Property Value
true if the controller has this capability; false otherwise.
See Also
Reference
GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadCapabilities.HasLeftStickButton Property
Indicates whether the controller has a digital button control on the left analog stick.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool HasLeftStickButton { get; }
Property Value
true if the controller has this capability; false otherwise.
See Also
Reference
GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadCapabilities.HasLeftTrigger Property
Indicates whether the controller has a left analog trigger.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool HasLeftTrigger { get; }
Property Value
true if the controller has this capability; false otherwise.
See Also
Reference
GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadCapabilities.HasLeftVibrationMotor Property
Indicates whether the controller has a low-frequency vibration motor.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool HasLeftVibrationMotor { get; }
Property Value
true if the controller has this capability; false otherwise.
See Also
Reference
GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadCapabilities.HasLeftXThumbStick Property
Indicates whether the controller supports a left analog control with horizontal movement.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool HasLeftXThumbStick { get; }
Property Value
true if the controller has this capability; false otherwise.
See Also
Reference
GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadCapabilities.HasLeftYThumbStick Property
Indicates whether the controller supports a left analog control with vertical movement.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool HasLeftYThumbStick { get; }
Property Value
true if the controller has this capability; false otherwise.
See Also
Reference
GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadCapabilities.HasRightShoulderButton Property
Indicates whether the controller has a right bumper button.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool HasRightShoulderButton { get; }
Property Value
true if the controller has this capability; false otherwise.
See Also
Reference
GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadCapabilities.HasRightStickButton Property
Indicates whether the controller has a digital button control on the right analog stick.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool HasRightStickButton { get; }
Property Value
true if the controller has this capability; false otherwise.
See Also
Reference
GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadCapabilities.HasRightTrigger Property
Indicates whether the controller has a right analog trigger.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool HasRightTrigger { get; }
Property Value
true if the controller has this capability; false otherwise.
See Also
Reference
GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadCapabilities.HasRightVibrationMotor Property
Indicates whether the controller has a high-frequency vibration motor.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool HasRightVibrationMotor { get; }
Property Value
true if the controller has this capability; false otherwise.
See Also
Reference
GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadCapabilities.HasRightXThumbStick Property
Indicates whether the controller supports a right analog control with horizontal movement.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool HasRightXThumbStick { get; }
Property Value
true if the controller has this capability; false otherwise.
See Also
Reference
GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadCapabilities.HasRightYThumbStick Property
Indicates whether the controller supports a right analog control with vertical movement.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool HasRightYThumbStick { get; }
Property Value
true if the controller has this capability; false otherwise.
See Also
Reference
GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadCapabilities.HasStartButton Property
Indicates whether the controller has a START button.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool HasStartButton { get; }
Property Value
true if the controller has this capability; false otherwise.
See Also
Reference
GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadCapabilities.HasVoiceSupport Property
Indicates whether the controller supports voice.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool HasVoiceSupport { get; }
Property Value
true if the controller supports voice; false otherwise.
See Also
Reference
GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadCapabilities.HasXButton Property
Indicates whether the controller has an X button.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool HasXButton { get; }
Property Value
true if the controller has this capability; false otherwise.
See Also
Reference
GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadCapabilities.HasYButton Property
Indicates whether the controller has a Y button.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool HasYButton { get; }
Property Value
true if the controller has this capability; false otherwise.
See Also
Reference
GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadCapabilities.IsConnected Property
Indicates whether the Xbox 360 Controller is connected.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsConnected { get; }
Property Value
true if the controller is connected; false otherwise.
Remarks When calling GetState or GetCapabilities, check the returned structure's IsConnected property value. If the controller
has been disconnected, this value will be false. When a controller is disconnected, values for its state and/or capabilities will
not be valid. The controller will also not be able to receive new vibration settings.
See Also
Reference
GamePadCapabilities Structure
GamePadCapabilities Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadDeadZone Enumeration
Specifies a type of dead zone processing to apply to Xbox 360 controller analog sticks when calling GetState.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum GamePadDeadZone
Members
Membe Description
r name
Circula The combined X and Y position of each stick is compared against the dead zone. This provides better control than In
r dependentAxes when the stick is used as a two-dimensional control surface, such as when controlling a character's
view in a first-person game.
Indepe The X and Y positions of each stick are compared against the dead zone independently. This setting is the default wh
ndentA en calling GetState.
xes
None The values of each stick are not processed and are returned by GetState as "raw" values. This is best if you intend to i
mplement your own dead zone processing.
See Also
Reference
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadDPad Structure
Identifies which directions on the directional pad of an Xbox 360 Controller are being pressed.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct GamePadDPad
See Also
Reference
GamePadDPad Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadDPad Members
The following tables list the members exposed by the GamePadDPad type.
Public Constructors
Name Description
GamePadDPad Initializes a new instance of the GamePadDPad class.
Public Properties
Name Description
Down Identifies whether the Down direction on the Xbox 360 Controller directional pad is pressed.
Left Identifies whether the Left direction on the Xbox 360 Controller directional pad is pressed.
Right Identifies whether the Right direction on the Xbox 360 Controller directional pad is pressed.
Up Identifies whether the Up direction on the Xbox 360 Controller directional pad is pressed.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Determines whether two GamePadDPad instances are equal.
op_Inequality Determines whether two GamePadDPad instances are not equal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GamePadDPad Structure
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
GamePadDPad Constructor
Initializes a new instance of the GamePadDPad class.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GamePadDPad (
ButtonState upValue,
ButtonState downValue,
ButtonState leftValue,
ButtonState rightValue
)
Parameters
upValue
Directional pad up button state.
downValue
Directional pad down button state.
leftValue
Directional pad left button state.
rightValue
Directional pad right button state.
Remarks
Games normally use GetState to get the true gamepad state. This constructor is used to instead simulate gamepad input for
passing within the game's own input subsystem.
See Also
Reference
GamePadDPad Structure
GamePadDPad Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadDPad Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Determines whether two GamePadDPad instances are equal.
op_Inequality Determines whether two GamePadDPad instances are not equal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GamePadDPad Structure
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
GamePadDPad.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
GamePadDPad.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
GamePadDPad.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
GamePadDPad Structure
GamePadDPad Members
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
Parameters
obj
Object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
GamePadDPad Structure
GamePadDPad Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadDPad.GetHashCode Method
Gets the hash code for this instance.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for this object.
See Also
Reference
GamePadDPad Structure
GamePadDPad Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadDPad.op_Equality Method
Determines whether two GamePadDPad instances are equal.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
GamePadDPad left,
GamePadDPad right
)
Parameters
left
Object on the left of the equal sign.
right
Object on the right of the equal sign.
Return Value
true if the instances are equal; false otherwise.
See Also
Reference
GamePadDPad Structure
GamePadDPad Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadDPad.op_Inequality Method
Determines whether two GamePadDPad instances are not equal.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
GamePadDPad left,
GamePadDPad right
)
Parameters
left
Object on the left of the equal sign.
right
Object on the right of the equal sign.
Return Value
true if the objects are not equal; false otherwise.
See Also
Reference
GamePadDPad Structure
GamePadDPad Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadDPad.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
GamePadDPad Structure
GamePadDPad Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadDPad Properties
Public Properties
Name Description
Down Identifies whether the Down direction on the Xbox 360 Controller directional pad is pressed.
Left Identifies whether the Left direction on the Xbox 360 Controller directional pad is pressed.
Right Identifies whether the Right direction on the Xbox 360 Controller directional pad is pressed.
Up Identifies whether the Up direction on the Xbox 360 Controller directional pad is pressed.
See Also
Reference
GamePadDPad Structure
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
GamePadDPad.Down Property
Identifies whether the Down direction on the Xbox 360 Controller directional pad is pressed.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ButtonState Down { get; }
Property Value
ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.
See Also
Reference
GamePadDPad Structure
GamePadDPad Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadDPad.Left Property
Identifies whether the Left direction on the Xbox 360 Controller directional pad is pressed.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ButtonState Left { get; }
Property Value
ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.
See Also
Reference
GamePadDPad Structure
GamePadDPad Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadDPad.Right Property
Identifies whether the Right direction on the Xbox 360 Controller directional pad is pressed.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ButtonState Right { get; }
Property Value
ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.
See Also
Reference
GamePadDPad Structure
GamePadDPad Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadDPad.Up Property
Identifies whether the Up direction on the Xbox 360 Controller directional pad is pressed.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ButtonState Up { get; }
Property Value
ButtonState.Pressed if the button is pressed; ButtonState.Released otherwise.
See Also
Reference
GamePadDPad Structure
GamePadDPad Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadState Structure
Represents specific information about the state of an Xbox 360 Controller, including the current state of buttons and sticks.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct GamePadState
See Also
Tasks
How To: Detect Whether a Controller Button Is Pressed
How To: Detect Whether a Controller Is Disconnected
Concepts
Input Overview
Reference
GamePadState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadState Members
The following tables list the members exposed by the GamePadState type.
Public Constructors
Name Description
GamePadState Overloaded. Initializes a new instance of the GamePadState class.
Public Properties
Name Description
Buttons Returns a structure that identifies what buttons on the Xbox 360 Controller are pressed.
DPad Returns a structure that identifies what directions of the directional pad on the Xbox 360 Controller are pres
sed.
IsConnected Indicates whether the Xbox 360 Controller is connected.
PacketNumber Gets the packet number associated with this state.
ThumbSticks Returns a structure that indicates the position of the Xbox 360 Controller sticks (thumbsticks).
Triggers Returns a structure that identifies the position of triggers on the Xbox 360 Controller.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
IsButtonDown Determines whether specified input device buttons are pressed in this GamePadState.
IsButtonUp Determines whether specified input device buttons are up (not pressed) in this GamePadState.
op_Equality Determines whether two GamePadState instances are equal.
op_Inequality Determines whether two GamePadState instances are not equal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Tasks
How To: Detect Whether a Controller Button Is Pressed
How To: Detect Whether a Controller Is Disconnected
Concepts
Input Overview
Reference
GamePadState Structure
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
GamePadState Constructor
Initializes a new instance of the GamePadState class.
Overload List
Name Description
GamePadState (GamePadThumbSticks, GamePadTriggers, GamePadButtons, GamePadDPad) Initializes a new instance of the
GamePadState class using the sp
ecified GamePadThumbSticks,
GamePadTriggers,
GamePadButtons, and
GamePadDPad.
GamePadState (Vector2, Vector2, Single, Single, Buttons[]) Initializes a new instance of the
GamePadState class with the spe
cified stick, trigger, and button v
alues.
See Also
Reference
GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
Parameters
thumbSticks
Initial stick state.
triggers
Initial trigger state.
buttons
Initial button state.
dPad
Initial directional pad state.
Remarks
Games normally use GetState to get the true gamepad state. This constructor is used to instead simulate gamepad input for
passing within the game's own input subsystem.
See Also
Reference
GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
leftThumbStick
Left stick value. Each axis is clamped between -1.0 and 1.0.
rightThumbStick
Right stick value. Each axis is clamped between -1.0 and 1.0.
leftTrigger
Left trigger value. This value is clamped between 0.0 and 1.0.
rightTrigger
Right trigger value. This value is clamped between 0.0 and 1.0.
buttons
Array or parameter list of Buttons to initialize as pressed.
Remarks
Games normally use GetState to get the true gamepad state. This constructor is used to instead simulate gamepad input for
passing within the game's own input subsystem.
See Also
Reference
GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadState Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
IsButtonDown Determines whether specified input device buttons are pressed in this GamePadState.
IsButtonUp Determines whether specified input device buttons are up (not pressed) in this GamePadState.
op_Equality Determines whether two GamePadState instances are equal.
op_Inequality Determines whether two GamePadState instances are not equal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GamePadState Structure
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
GamePadState.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
GamePadState.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
GamePadState.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
Parameters
obj
Object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadState.GetHashCode Method
Gets the hash code for this instance.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for this object.
See Also
Reference
GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadState.IsButtonDown Method
Determines whether specified input device buttons are pressed in this GamePadState.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsButtonDown (
Buttons button
)
Parameters
button
Buttons to query. Specify a single button, or combine multiple buttons using a bitwise OR operation.
Return Value
true if all specified buttons are pressed; false otherwise.
Remarks
For digital buttons (such as A, START, and right bumper) the return value indicates whether the button is pressed.
For analog inputs (triggers and thumbsticks), the return value indicates whether the input exceeds dead zone values. For
example, a trigger will not be reported as pressed until it is pulled about 12% of its full range. IsButtonDown always uses the
default dead zone processing mode, GamePadDeadZone.IndependentAxes.
If multiple buttons are specified (by combining them using the bitwise OR operator), then all must be pressed (or exceed dead
zone values) in order for IsButtonDown to return true.
See Also
Reference
GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace
GamePadState.IsButtonDown Method
GamePad.GetState Method
GamePadDeadZone
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadState.IsButtonUp Method
Determines whether specified input device buttons are up (not pressed) in this GamePadState.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsButtonUp (
Buttons button
)
Parameters
button
Buttons to query. Specify a single button, or combine multiple buttons using a bitwise OR operation.
Return Value
true if any specified buttons are up; false otherwise.
Remarks
For digital buttons (such as A, START, and right bumper) the return value indicates whether the button is up (not pressed).
For analog inputs (triggers and thumbsticks), the return value indicates whether the input exceeds dead zone values. For
example, a trigger will be reported as not pressed until it is pulled about 12% of its full range. IsButtonUp always uses the
default dead zone processing mode, GamePadDeadZone.IndependentAxes.
If multiple buttons are specified (by combining them using the bitwise OR operator), IsButtonUp returns true if any of the
specified buttons are not pressed (or do not exceed dead zone values).
See Also
Reference
GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace
GamePadState.IsButtonDown Method
GamePad.GetState Method
GamePadDeadZone
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadState.op_Equality Method
Determines whether two GamePadState instances are equal.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
GamePadState left,
GamePadState right
)
Parameters
left
Object on the left of the equal sign.
right
Object on the right of the equal sign.
Return Value
true if the instances are equal; false otherwise.
See Also
Reference
GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadState.op_Inequality Method
Determines whether two GamePadState instances are not equal.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
GamePadState left,
GamePadState right
)
Parameters
left
Object on the left of the equal sign.
right
Object on the right of the equal sign.
Return Value
true if the objects are not equal; false otherwise.
See Also
Reference
GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadState.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadState Properties
Public Properties
Name Description
Buttons Returns a structure that identifies what buttons on the Xbox 360 Controller are pressed.
DPad Returns a structure that identifies what directions of the directional pad on the Xbox 360 Controller are pres
sed.
IsConnected Indicates whether the Xbox 360 Controller is connected.
PacketNumber Gets the packet number associated with this state.
ThumbSticks Returns a structure that indicates the position of the Xbox 360 Controller sticks (thumbsticks).
Triggers Returns a structure that identifies the position of triggers on the Xbox 360 Controller.
See Also
Reference
GamePadState Structure
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
GamePadState.Buttons Property
Returns a structure that identifies what buttons on the Xbox 360 Controller are pressed.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GamePadButtons Buttons { get; }
Property Value
A structure that identifies buttons pressed on the controller.
See Also
Tasks
How To: Detect Whether a Controller Button Is Pressed
How To: Detect Whether a Controller Is Disconnected
Concepts
Input Overview
Reference
GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadState.DPad Property
Returns a structure that identifies what directions of the directional pad on the Xbox 360 Controller are pressed.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GamePadDPad DPad { get; }
Property Value
Structure that identifies what directional pad directions are pressed.
See Also
Reference
GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadState.IsConnected Property
Indicates whether the Xbox 360 Controller is connected.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsConnected { get; }
Property Value
true if the controller is connected; false otherwise.
Remarks When calling GetState or GetCapabilities, check the returned structure's IsConnected property value. If the controller
has been disconnected, this value will be false. When a controller is disconnected, values for its state and/or capabilities will
not be valid. The controller will also not be able to receive new vibration settings.
See Also
Tasks
How To: Detect Whether a Controller Button Is Pressed
How To: Detect Whether a Controller Is Disconnected
Concepts
Input Overview
Reference
GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadState.PacketNumber Property
Gets the packet number associated with this state.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int PacketNumber { get; }
Property Value
The packet number associated with this state.
Remarks You can use PacketNumber to determine whether input state has changed. If the value of PacketNumber remains the
same between two sequential calls to GetState, then there has been no change in input.
See Also
Tasks
How To: Detect Whether a Controller Button Is Pressed
How To: Detect Whether a Controller Is Disconnected
Concepts
Input Overview
Reference
GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadState.ThumbSticks Property
Returns a structure that indicates the position of the Xbox 360 Controller sticks (thumbsticks).
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GamePadThumbSticks ThumbSticks { get; }
Property Value
Structure that indicates the position of the sticks.
See Also
Reference
GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadState.Triggers Property
Returns a structure that identifies the position of triggers on the Xbox 360 Controller.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GamePadTriggers Triggers { get; }
Property Value
Structure that identifies the position of the triggers.
See Also
Reference
GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadThumbSticks Structure
Structure that represents the position of left and right sticks (thumbsticks) on an Xbox 360 Controller.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct GamePadThumbSticks
See Also
Reference
GamePadThumbSticks Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadThumbSticks Members
The following tables list the members exposed by the GamePadThumbSticks type.
Public Constructors
Name Description
GamePadThumbSticks Initializes a new instance of the GamePadThumbSticks class.
Public Properties
Name Description
Left Returns the position of the left Xbox 360 Controller stick (thumbstick) as a 2D vector.
Right Returns the position of the right Xbox 360 Controller stick (thumbstick) as a 2D vector.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Determines whether two GamePadThumbSticks instances are equal.
op_Inequality Determines whether two GamePadThumbSticks instances are not equal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GamePadThumbSticks Structure
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
GamePadThumbSticks Constructor
Initializes a new instance of the GamePadThumbSticks class.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GamePadThumbSticks (
Vector2 leftThumbstick,
Vector2 rightThumbstick
)
Parameters
leftThumbstick
Left stick value. Each axis is clamped between -1.0 and 1.0.
rightThumbstick
Right stick value. Each axis is clamped between -1.0 and 1.0.
Remarks
Games normally use GetState to get the true gamepad state. This constructor is used to instead simulate gamepad input for
passing within the game's own input subsystem.
See Also
Reference
GamePadThumbSticks Structure
GamePadThumbSticks Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadThumbSticks Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Determines whether two GamePadThumbSticks instances are equal.
op_Inequality Determines whether two GamePadThumbSticks instances are not equal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GamePadThumbSticks Structure
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
GamePadThumbSticks.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
GamePadThumbSticks.Equals (Object) Returns a value that indicates whether the current instance is equal to a specifie
d object.
GamePadThumbSticks.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
GamePadThumbSticks Structure
GamePadThumbSticks Members
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
Parameters
obj
Object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
GamePadThumbSticks Structure
GamePadThumbSticks Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadThumbSticks.GetHashCode Method
Gets the hash code for this instance.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for this object.
See Also
Reference
GamePadThumbSticks Structure
GamePadThumbSticks Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadThumbSticks.op_Equality Method
Determines whether two GamePadThumbSticks instances are equal.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
GamePadThumbSticks left,
GamePadThumbSticks right
)
Parameters
left
Object on the left of the equal sign.
right
Object on the right of the equal sign.
Return Value
true if the instances are equal; false otherwise.
See Also
Reference
GamePadThumbSticks Structure
GamePadThumbSticks Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadThumbSticks.op_Inequality Method
Determines whether two GamePadThumbSticks instances are not equal.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
GamePadThumbSticks left,
GamePadThumbSticks right
)
Parameters
left
Object on the left of the equal sign.
right
Object on the right of the equal sign.
Return Value
true if the objects are not equal; false otherwise.
See Also
Reference
GamePadThumbSticks Structure
GamePadThumbSticks Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadThumbSticks.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
GamePadThumbSticks Structure
GamePadThumbSticks Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadThumbSticks Properties
Public Properties
Name Description
Left Returns the position of the left Xbox 360 Controller stick (thumbstick) as a 2D vector.
Right Returns the position of the right Xbox 360 Controller stick (thumbstick) as a 2D vector.
See Also
Reference
GamePadThumbSticks Structure
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
GamePadThumbSticks.Left Property
Returns the position of the left Xbox 360 Controller stick (thumbstick) as a 2D vector.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector2 Left { get; }
Property Value
Two-dimensional vector that identifies the position of the left stick. Each axis is represented as a floating-point value from −1.0
to 1.0.
Remarks Each of the thumbstick axis members is a signed value describing the position of the thumbstick. A value of 0 is
centered. Negative values signify down or to the left. Positive values signify up or to the right. The controller typically does not
generate thumbstick values within a dead zone, or marginal input region around the center position.
Example
if (GamePad.GetState( PlayerIndex.One ).ThumbSticks.Left.Y == 1.0f)
{
// Player one has pressed the left thumbstick up.
}
See Also
Reference
GamePadThumbSticks Structure
GamePadThumbSticks Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadThumbSticks.Right Property
Returns the position of the right Xbox 360 Controller stick (thumbstick) as a 2D vector.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Vector2 Right { get; }
Property Value
Two-dimensional vector that identifies the position of the right stick. Each axis is represented as a floating-point value from
−1.0 to 1.0.
See Also
Reference
GamePadThumbSticks Structure
GamePadThumbSticks Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadTriggers Structure
Structure that defines the position of the left and right triggers on an Xbox 360 Controller.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct GamePadTriggers
See Also
Reference
GamePadTriggers Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadTriggers Members
The following tables list the members exposed by the GamePadTriggers type.
Public Constructors
Name Description
GamePadTriggers Initializes a new instance of the GamePadTriggers class.
Public Properties
Name Description
Left Identifies the position of the left trigger on the Xbox 360 Controller.
Right Identifies the position of the right trigger on the Xbox 360 Controller.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Determines whether two GamePadTriggers instances are equal.
op_Inequality Determines whether two GamePadTriggers instances are not equal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GamePadTriggers Structure
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
GamePadTriggers Constructor
Initializes a new instance of the GamePadTriggers class.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GamePadTriggers (
float leftTrigger,
float rightTrigger
)
Parameters
leftTrigger
Left trigger value. This value is clamped between 0.0 and 1.0.
rightTrigger
Right trigger value. This value is clamped between 0.0 and 1.0.
Remarks
Games normally use GetState to get the true gamepad state. This constructor is used to instead simulate gamepad input for
passing within the game's own input subsystem.
See Also
Reference
GamePadTriggers Structure
GamePadTriggers Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadTriggers Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Determines whether two GamePadTriggers instances are equal.
op_Inequality Determines whether two GamePadTriggers instances are not equal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GamePadTriggers Structure
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
GamePadTriggers.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
GamePadTriggers.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified obj
ect.
GamePadTriggers.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
GamePadTriggers Structure
GamePadTriggers Members
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
Parameters
obj
Object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
GamePadTriggers Structure
GamePadTriggers Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadTriggers.GetHashCode Method
Gets the hash code for this instance.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for this object.
See Also
Reference
GamePadTriggers Structure
GamePadTriggers Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadTriggers.op_Equality Method
Determines whether two GamePadTriggers instances are equal.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
GamePadTriggers left,
GamePadTriggers right
)
Parameters
left
Object on the left of the equal sign.
right
Object on the right of the equal sign.
Return Value
true if the instances are equal; false otherwise.
See Also
Reference
GamePadTriggers Structure
GamePadTriggers Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadTriggers.op_Inequality Method
Determines whether two GamePadTriggers instances are not equal.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
GamePadTriggers left,
GamePadTriggers right
)
Parameters
left
Object on the left of the equal sign.
right
Object on the right of the equal sign.
Return Value
true if the objects are not equal; false otherwise.
See Also
Reference
GamePadTriggers Structure
GamePadTriggers Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadTriggers.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
GamePadTriggers Structure
GamePadTriggers Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadTriggers Properties
Public Properties
Name Description
Left Identifies the position of the left trigger on the Xbox 360 Controller.
Right Identifies the position of the right trigger on the Xbox 360 Controller.
See Also
Reference
GamePadTriggers Structure
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
GamePadTriggers.Left Property
Identifies the position of the left trigger on the Xbox 360 Controller.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float Left { get; }
Property Value
Position of the left trigger, as a value between 0.0 and 1.0.
See Also
Reference
GamePadTriggers Structure
GamePadTriggers Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadTriggers.Right Property
Identifies the position of the right trigger on the Xbox 360 Controller.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public float Right { get; }
Property Value
Position of the right trigger, as a value between 0.0 and 1.0.
See Also
Reference
GamePadTriggers Structure
GamePadTriggers Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamePadType Enumeration
Describes the type of a given Xbox 360 controller.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum GamePadType
Members
Member name Description
ArcadeStick Controller is an arcade stick.
DancePad Controller is a dance pad.
DrumKit Controller is a drum kit.
FlightStick Controller is a flight stick.
GamePad Controller is the Xbox 360 Controller.
Guitar Controller is a guitar!
Unknown Controller is an unknown type.
Wheel Controller is a wheel.
See Also
Reference
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Keyboard Class
Allows retrieval of keystrokes from a keyboard input device.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static class Keyboard
See Also
Tasks
How To: Detect Whether a Key Is Pressed
Concepts
Input Overview
Reference
Keyboard Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Keyboard Members
The following tables list the members exposed by the Keyboard type.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetState Overloaded. Returns the current keyboard or Chatpad state.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Tasks
How To: Detect Whether a Key Is Pressed
Concepts
Input Overview
Reference
Keyboard Class
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
Keyboard Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetState Overloaded. Returns the current keyboard or Chatpad state.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Keyboard Class
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
Keyboard.GetState Method
Returns the current keyboard or Chatpad state.
Overload List
Name Description
Keyboard.GetState () Returns the current keyboard state.
Keyboard.GetState (PlayerIndex) Returns the current Chatpad state for the specified player.
See Also
Tasks
How To: Detect Whether a Key Is Pressed
Concepts
Input Overview
Reference
Keyboard Class
Keyboard Members
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
Keyboard.GetState Method ()
Returns the current keyboard state.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static KeyboardState GetState ()
Return Value
Current keyboard state.
Exceptions
Exception type Condition
InvalidOperationException An invalid operation occurred when querying the keyboard state.
Remarks
This method queries an attached USB keyboard. To query a Chatpad instead, use Keyboard.GetState (PlayerIndex).
See Also
Tasks
How To: Detect Whether a Key Is Pressed
Concepts
Input Overview
Reference
Keyboard Class
Keyboard Members
Microsoft.Xna.Framework.Input Namespace
Keyboard.GetState Method
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
playerIndex
Player index of the Chatpad to query.
Return Value
Current Chatpad state.
Exceptions
Exception type Condition
InvalidOperationException An invalid operation occurred when querying the Chatpad state.
Remarks
Each player can have their own Chatpad, which is queried as a keyboard. To query an attached USB keyboard instead, use the
GetState method that does not require a player index.
See Also
Tasks
How To: Detect Whether a Key Is Pressed
Concepts
Input Overview
Reference
Keyboard Class
Keyboard Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
KeyboardState Structure
Represents a state of keystrokes recorded by a keyboard input device.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public struct KeyboardState
See Also
Tasks
How To: Detect Whether a Key Is Pressed
Concepts
Input Overview
Reference
KeyboardState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
KeyboardState Members
The following tables list the members exposed by the KeyboardState type.
Public Constructors
Name Description
KeyboardState Initializes a new instance of the KeyboardState class.
Public Properties
Name Description
Item Returns the state of a particular key.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetPressedKeys Gets an array of values that correspond to the keyboard keys that are currently being pressed.
GetType (Inherited from Object.)
IsKeyDown Returns whether a specified key is currently being pressed.
IsKeyUp Returns whether a specified key is currently not pressed.
op_Equality Compares two objects to determine whether they are the same.
op_Inequality Compares two objects to determine whether they are different.
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Tasks
How To: Detect Whether a Key Is Pressed
Concepts
Input Overview
Reference
KeyboardState Structure
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
KeyboardState Constructor
Initializes a new instance of the KeyboardState class.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public KeyboardState (
params Keys[] keys
)
Parameters
keys
Array or parameter list of Keys to initialize as pressed.
Remarks
Games normally use GetState to get the true keyboard state. This constructor is used to instead simulate keyboard input for
passing within the game's own input subsystem.
See Also
Reference
KeyboardState Structure
KeyboardState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
KeyboardState Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetPressedKeys Gets an array of values that correspond to the keyboard keys that are currently being pressed.
GetType (Inherited from Object.)
IsKeyDown Returns whether a specified key is currently being pressed.
IsKeyUp Returns whether a specified key is currently not pressed.
op_Equality Compares two objects to determine whether they are the same.
op_Inequality Compares two objects to determine whether they are different.
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
KeyboardState Structure
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
KeyboardState.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
KeyboardState.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
KeyboardState.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
KeyboardState Structure
KeyboardState Members
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
Parameters
obj
Object to compare this object to.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
KeyboardState Structure
KeyboardState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
KeyboardState.GetHashCode Method
Gets the hash code for this instance.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for this object.
See Also
Reference
KeyboardState Structure
KeyboardState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
KeyboardState.GetPressedKeys Method
Gets an array of values that correspond to the keyboard keys that are currently being pressed.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public Keys[] GetPressedKeys ()
Return Value
The keys that are currently pressed.
See Also
Tasks
How To: Detect Whether a Key Is Pressed
Concepts
Input Overview
Reference
KeyboardState Structure
KeyboardState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
KeyboardState.IsKeyDown Method
Returns whether a specified key is currently being pressed.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsKeyDown (
Keys key
)
Parameters
key
Enumerated value that specifies the key to query.
Return Value
true if the key specified by key is being held down; false otherwise.
See Also
Tasks
How To: Detect Whether a Key Is Pressed
Concepts
Input Overview
Reference
KeyboardState Structure
KeyboardState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
KeyboardState.IsKeyUp Method
Returns whether a specified key is currently not pressed.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsKeyUp (
Keys key
)
Parameters
key
Enumerated value that specifies the key to query.
Return Value
true if the key specified by key is not pressed; false otherwise.
See Also
Tasks
How To: Detect Whether a Key Is Pressed
Concepts
Input Overview
Reference
KeyboardState Structure
KeyboardState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
KeyboardState.op_Equality Method
Compares two objects to determine whether they are the same.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
KeyboardState a,
KeyboardState b
)
Parameters
a
Object to the left of the equality operator.
b
Object to the right of the equality operator.
Return Value
true if the objects are the same; false otherwise.
See Also
Reference
KeyboardState Structure
KeyboardState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
KeyboardState.op_Inequality Method
Compares two objects to determine whether they are different.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
KeyboardState a,
KeyboardState b
)
Parameters
a
Object to the left of the inequality operator.
b
Object to the right of the inequality operator.
Return Value
true if the objects are different; false otherwise.
See Also
Reference
KeyboardState Structure
KeyboardState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
KeyboardState Properties
Public Properties
Name Description
Item Returns the state of a particular key.
See Also
Reference
KeyboardState Structure
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
KeyboardState.Item Property
Returns the state of a particular key.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public KeyState this [
Keys key
] { get; }
Property Value
The state of the key specified by key.
See Also
Tasks
How To: Detect Whether a Key Is Pressed
Concepts
Input Overview
Reference
KeyboardState Structure
KeyboardState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Keys Enumeration
Identifies a particular key on a keyboard.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum Keys
Members
Member name Description
A A key
Add Add key
Apps Applications key
Attn Attn key
B B key
Back BACKSPACE key
BrowserBack Windows 2000/XP: Browser Back key
BrowserFavorites Windows 2000/XP: Browser Favorites key
BrowserForward Windows 2000/XP: Browser Forward key
BrowserHome Windows 2000/XP: Browser Start and Home key
BrowserRefresh Windows 2000/XP: Browser Refresh key
BrowserSearch Windows 2000/XP: Browser Search key
BrowserStop Windows 2000/XP: Browser Stop key
C C key
CapsLock CAPS LOCK key
ChatPadGreen Green ChatPad key
ChatPadOrange Orange ChatPad key
Crsel CrSel key
D D key
D0 Used for miscellaneous characters; it can vary by keyboard.
D1 Used for miscellaneous characters; it can vary by keyboard.
D2 Used for miscellaneous characters; it can vary by keyboard.
D3 Used for miscellaneous characters; it can vary by keyboard.
D4 Used for miscellaneous characters; it can vary by keyboard.
D5 Used for miscellaneous characters; it can vary by keyboard.
D6 Used for miscellaneous characters; it can vary by keyboard.
D7 Used for miscellaneous characters; it can vary by keyboard.
D8 Used for miscellaneous characters; it can vary by keyboard.
D9 Used for miscellaneous characters; it can vary by keyboard.
Decimal Decimal key
Delete DEL key
Divide Divide key
Down DOWN ARROW key
E E key
End END key
Enter ENTER key
EraseEof Erase EOF key
Escape ESC key
Execute EXECUTE key
Exsel ExSel key
F F key
F1 F1 key
F10 F10 key
F11 F11 key
F12 F12 key
F13 F13 key
F14 F14 key
F15 F15 key
F16 F16 key
F17 F17 key
F18 F18 key
F19 F19 key
F2 F2 key
F20 F20 key
F21 F21 key
F22 F22 key
F23 F23 key
F24 F24 key
F3 F3 key
F4 F4 key
F5 F5 key
F6 F6 key
F7 F7 key
F8 F8 key
F9 F9 key
G G key
H H key
Help HELP key
Home HOME key
I I key
Insert INS key
J J key
K K key
L L key
LaunchApplication1 Windows 2000/XP: Start Application 1 key
LaunchApplication2 Windows 2000/XP: Start Application 2 key
LaunchMail Windows 2000/XP: Start Mail key
Left LEFT ARROW key
LeftAlt Left ALT key
LeftControl Left CONTROL key
LeftShift Left SHIFT key
LeftWindows Left Windows key
M M key
MediaNextTrack Windows 2000/XP: Next Track key
MediaPlayPause Windows 2000/XP: Play/Pause Media key
MediaPreviousTrack Windows 2000/XP: Previous Track key
MediaStop Windows 2000/XP: Stop Media key
Multiply Multiply key
N N key
None Reserved
NumLock NUM LOCK key
NumPad0 Numeric keypad 0 key
NumPad1 Numeric keypad 1 key
NumPad2 Numeric keypad 2 key
NumPad3 Numeric keypad 3 key
NumPad4 Numeric keypad 4 key
NumPad5 Numeric keypad 5 key
NumPad6 Numeric keypad 6 key
NumPad7 Numeric keypad 7 key
NumPad8 Numeric keypad 8 key
NumPad9 Numeric keypad 9 key
O O key
Oem8 Used for miscellaneous characters; it can vary by keyboard.
OemBackslash Windows 2000/XP: The OEM angle bracket or backslash key on the RT 102 key keyboard
OemClear CLEAR key
OemCloseBrackets Windows 2000/XP: The OEM close bracket key on a US standard keyboard
OemComma Windows 2000/XP: For any country/region, the ',' key
OemMinus Windows 2000/XP: For any country/region, the '-' key
OemOpenBrackets Windows 2000/XP: The OEM open bracket key on a US standard keyboard
OemPeriod Windows 2000/XP: For any country/region, the '.' key
OemPipe Windows 2000/XP: The OEM pipe key on a US standard keyboard
OemPlus Windows 2000/XP: For any country/region, the '+' key
OemQuestion Windows 2000/XP: The OEM question mark key on a US standard keyboard
OemQuotes Windows 2000/XP: The OEM singled/double quote key on a US standard keyboard
OemSemicolon Windows 2000/XP: The OEM Semicolon key on a US standard keyboard
OemTilde Windows 2000/XP: The OEM tilde key on a US standard keyboard
P P key
Pa1 PA1 key
PageDown PAGE DOWN key
PageUp PAGE UP key
Pause PAUSE key
Play Play key
Print PRINT key
PrintScreen PRINT SCREEN key
ProcessKey Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key
Q Q key
R R key
Right RIGHT ARROW key
RightAlt Right ALT key
RightControl Right CONTROL key
RightShift Right SHIFT key
RightWindows Right Windows key
S S key
Scroll SCROLL LOCK key
Select SELECT key
SelectMedia Windows 2000/XP: Select Media key
Separator Separator key
Sleep Computer Sleep key
Space SPACEBAR
Subtract Subtract key
T T key
Tab TAB key
U U key
Up UP ARROW key
V V key
VolumeDown Windows 2000/XP: Volume Down key
VolumeMute Windows 2000/XP: Volume Mute key
VolumeUp Windows 2000/XP: Volume Up key
W W key
X X key
Y Y key
Z Z key
Zoom Zoom key
See Also
Reference
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
KeyState Enumeration
Identifies the state of a keyboard key.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public enum KeyState
Members
Member name Description
Down The key is pressed.
Up The key is released.
See Also
Reference
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Mouse Class
Allows retrieval of position and button clicks from a mouse input device.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static class Mouse
See Also
Tasks
How To: Get the Current Mouse Position (Windows)
Concepts
Input Overview
Reference
Mouse Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Mouse Members
The following tables list the members exposed by the Mouse type.
Public Properties
Name Description
WindowHandle Gets or sets the window used for mouse processing. Mouse coordinates returned by GetState are relative
to the upper-left corner of this window.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetState Gets the current state of the mouse, including mouse position and buttons pressed.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
SetPosition Sets the position of the mouse cursor relative to the upper-left corner of the window.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Tasks
How To: Get the Current Mouse Position (Windows)
Concepts
Input Overview
Reference
Mouse Class
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
Mouse Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetState Gets the current state of the mouse, including mouse position and buttons pressed.
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
SetPosition Sets the position of the mouse cursor relative to the upper-left corner of the window.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
Mouse Class
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
Mouse.GetState Method
Gets the current state of the mouse, including mouse position and buttons pressed.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static MouseState GetState ()
Return Value
Current state of the mouse.
See Also
Tasks
How To: Get the Current Mouse Position (Windows)
Concepts
Input Overview
Reference
Mouse Class
Mouse Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Mouse.SetPosition Method
Sets the position of the mouse cursor relative to the upper-left corner of the window.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static void SetPosition (
int x,
int y
)
Parameters
x
The horizontal position of the mouse cursor, relative to the left edge of the game window.
y
The vertical position of the mouse cursor, relative to the upper edge of the game window.
Remarks
When using this method to take relative input, such as in a first-person game, set the position of the mouse to the center of
your game window each frame. This will allow you to read mouse movement on both axes with the greatest amount of
granularity.
See Also
Reference
Mouse Class
Mouse Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Mouse Properties
Public Properties
Name Description
WindowHandle Gets or sets the window used for mouse processing. Mouse coordinates returned by GetState are relative
to the upper-left corner of this window.
See Also
Reference
Mouse Class
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
Mouse.WindowHandle Property
Gets or sets the window used for mouse processing. Mouse coordinates returned by GetState are relative to the upper-left
corner of this window.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static IntPtr WindowHandle { get; set; }
Property Value
Handle to a window.
Remarks
By default, this property is set to the game window (Game.Window Property). To select a different window as the coordinate
reference, set WindowHandle to that window.
If the mouse is above or to the left of the reference window, the returned coordinates are negative. If the mouse is below or to
the right of the reference window, the returned coordinates are greater than the window's client area.
See Also
Tasks
How To: Get the Current Mouse Position (Windows)
Concepts
Input Overview
Reference
Mouse Class
Mouse Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MouseState Structure
Represents the state of a mouse input device, including mouse cursor position and buttons pressed.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public struct MouseState
See Also
Tasks
How To: Get the Current Mouse Position (Windows)
Concepts
Input Overview
Reference
MouseState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MouseState Members
The following tables list the members exposed by the MouseState type.
Public Constructors
Name Description
MouseState Initializes a new instance of the MouseState class.
Public Properties
Name Description
LeftButton Returns the state of the left mouse button.
MiddleButton Returns the state of the middle mouse button.
RightButton Returns the state of the right mouse button.
ScrollWheelValue Gets the cumulative mouse scroll wheel value since the game was started.
X Specifies the horizontal position of the mouse cursor.
XButton1 Returns the state of XBUTTON1.
XButton2 Returns the state of XBUTTON2.
Y Specifies the vertical position of the mouse cursor.
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Determines whether two MouseState instances are equal.
op_Inequality Determines whether two MouseState instances are not equal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Tasks
How To: Get the Current Mouse Position (Windows)
Concepts
Input Overview
Reference
MouseState Structure
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
MouseState Constructor
Initializes a new instance of the MouseState class.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public MouseState (
int x,
int y,
int scrollWheel,
ButtonState leftButton,
ButtonState middleButton,
ButtonState rightButton,
ButtonState xButton1,
ButtonState xButton2
)
Parameters
x
Horizontal mouse position.
y
Vertical mouse position.
scrollWheel
Mouse scroll wheel value.
leftButton
Left mouse button state.
middleButton
Middle mouse button state.
rightButton
Right mouse button state.
xButton1
XBUTTON1 state.
xButton2
XBUTTON2 state.
Remarks
Games normally use GetState to get the true mouse state. This constructor is used to instead simulate mouse input for passing
within the game's own input subsystem.
See Also
Reference
MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MouseState Methods
Public Methods
Name Description
Equals Overloaded. Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Gets the hash code for this instance.
GetType (Inherited from Object.)
op_Equality Determines whether two MouseState instances are equal.
op_Inequality Determines whether two MouseState instances are not equal.
ReferenceEquals (Inherited from Object.)
ToString Retrieves a string representation of this object.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
MouseState Structure
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
MouseState.Equals Method
Returns a value that indicates whether the current instance is equal to a specified object.
Overload List
Name Description
MouseState.Equals (Object) Returns a value that indicates whether the current instance is equal to a specified object.
MouseState.Equals (Object, Object) (Inherited from Object.)
See Also
Reference
MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
Parameters
obj
Object with which to make the comparison.
Return Value
true if the current instance is equal to the specified object; false otherwise.
See Also
Reference
MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MouseState.GetHashCode Method
Gets the hash code for this instance.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override int GetHashCode ()
Return Value
Hash code for this object.
See Also
Reference
MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MouseState.op_Equality Method
Determines whether two MouseState instances are equal.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Equality (
MouseState left,
MouseState right
)
Parameters
left
Object on the left of the equal sign.
right
Object on the right of the equal sign.
Return Value
true if the instances are equal; false otherwise.
See Also
Reference
MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MouseState.op_Inequality Method
Determines whether two MouseState instances are not equal.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public static bool op_Inequality (
MouseState left,
MouseState right
)
Parameters
left
Object on the left of the equal sign.
right
Object on the right of the equal sign.
Return Value
true if the objects are not equal; false otherwise.
See Also
Reference
MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MouseState.ToString Method
Retrieves a string representation of this object.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public override string ToString ()
Return Value
String representation of this object.
See Also
Reference
MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MouseState Properties
Public Properties
Name Description
LeftButton Returns the state of the left mouse button.
MiddleButton Returns the state of the middle mouse button.
RightButton Returns the state of the right mouse button.
ScrollWheelValue Gets the cumulative mouse scroll wheel value since the game was started.
X Specifies the horizontal position of the mouse cursor.
XButton1 Returns the state of XBUTTON1.
XButton2 Returns the state of XBUTTON2.
Y Specifies the vertical position of the mouse cursor.
See Also
Reference
MouseState Structure
Microsoft.Xna.Framework.Input Namespace
XNA Game Studio 2.0
MouseState.LeftButton Property
Returns the state of the left mouse button.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ButtonState LeftButton { get; }
Property Value
State of the left mouse button.
See Also
Reference
MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MouseState.MiddleButton Property
Returns the state of the middle mouse button.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ButtonState MiddleButton { get; }
Property Value
State of the middle mouse button.
See Also
Reference
MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MouseState.RightButton Property
Returns the state of the right mouse button.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ButtonState RightButton { get; }
Property Value
State of the right mouse button.
See Also
Reference
MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MouseState.ScrollWheelValue Property
Gets the cumulative mouse scroll wheel value since the game was started.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int ScrollWheelValue { get; }
Property Value
The scroll wheel value.
Remarks
Unlike standard Windows and WinForms mouse messages, which report a relative value for the scroll wheel, XNA reports the
total scroll wheel value accumulated over the length of a game's execution. To process a wheel movement, you must compare
the previous frame's wheel value to the current wheel value.
See Also
Reference
MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MouseState.X Property
Specifies the horizontal position of the mouse cursor.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int X { get; }
Property Value
Horizontal position of the mouse cursor in relation to the upper-left corner of the game window.
Remarks
If the mouse is to the left of the client area (the inside portion of the game window, excluding the borders), the returned
coordinate is negative. If the mouse is to the right of the client area, the returned coordinate is greater than the window's client
area width.
See Also
Tasks
How To: Get the Current Mouse Position (Windows)
Concepts
Input Overview
Reference
MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MouseState.XButton1 Property
Returns the state of XBUTTON1.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ButtonState XButton1 { get; }
Property Value
The state of XBUTTON1.
Remarks XBUTTON1 and XBUTTON2 are additional buttons used on many mouse devices, often for forward and backward
navigation in Web browsers. They return the same data as standard mouse buttons.
See Also
Reference
MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MouseState.XButton2 Property
Returns the state of XBUTTON2.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public ButtonState XButton2 { get; }
Property Value
The state of XBUTTON2.
Remarks XBUTTON1 and XBUTTON2 are additional buttons used on many mouse devices, often for forward and backward
navigation in Web browsers. They return the same data as standard mouse buttons.
See Also
Reference
MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
MouseState.Y Property
Specifies the vertical position of the mouse cursor.
Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int Y { get; }
Property Value
Vertical position of the mouse cursor in relation to the upper-left corner of the game window.
Remarks
If the mouse is above the client area (the inside portion of the game window, excluding the borders), the returned coordinate is
negative. If the mouse is below the client area, the returned coordinate is greater than the window's client area height.
See Also
Tasks
How To: Get the Current Mouse Position (Windows)
Concepts
Input Overview
Reference
MouseState Structure
MouseState Members
Microsoft.Xna.Framework.Input Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Microsoft.Xna.Framework.Net Namespace
Contains classes that implement support for Xbox LIVE, multiplayer, and networking for XNA Framework games.
Classes
Name Description
AvailableNetworkSession Describes a multiplayer session that can be joined.
AvailableNetworkSessionCollection Represents a collection of sessions available for joining.
GameEndedEventArgs Represents the arguments passed to a GameEnded event.
GamerJoinedEventArgs Represents the arguments passed to a GamerJoined event.
GamerLeftEventArgs Represents the arguments passed to a GamerLeft event.
GameStartedEventArgs Represents the arguments passed to a GameStarted event.
HostChangedEventArgs Represents the arguments passed to a HostChanged event.
LocalNetworkGamer Represents a local player in a network session.
NetworkException Thrown if there is a network communication failure.
NetworkGamer Represents a player in a network session.
NetworkMachine Represents a physical machine (such as single Xbox 360 console or Windows-based co
mputer) that is participating in a multiplayer session. It can be used to detect when mor
e than one NetworkGamer is playing on the same actual machine.
NetworkSession Represents a multiplayer game session.
NetworkSessionEndedEventArgs Represents the arguments passed to a SessionEnded event. These arguments are passe
d to event handlers when a session ends.
NetworkSessionJoinException Thrown if an error was encountered while joining a session.
NetworkSessionProperties Describes custom, game-specific information about a NetworkSession object.
PacketReader Provides common functionality for efficiently reading incoming network packets.
PacketWriter Provides common functionality for efficiently formatting outgoing network packets.
QualityOfService Describes the quality of the network connection between this machine and the host of a
multiplayer session that was discovered with a matchmaking query.
Enumerations
Name Description
NetworkSessionEndReason Defines the reason a session ended.
NetworkSessionJoinError Contains additional data about a NetworkSessionJoinException.
NetworkSessionState Defines the different states of a multiplayer session.
NetworkSessionType Defines the different types of a multiplayer session.
SendDataOptions Defines options for network packet transmission.
See Also
Concepts
Getting Started With Networked Games
XNA Game Studio 2.0
AvailableNetworkSession Class
Describes a multiplayer session that can be joined.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class AvailableNetworkSession
Remarks
Use the NetworkSession class to get a list of AvailableNetworkSession instances. Typically, the results populate some type of
user interface, displayed by the game. The user then chooses a session, and the game adds the player to the chosen session
with a call to Join.
See Also
Tasks
How To: Find and Join a Network Session
Reference
AvailableNetworkSession Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AvailableNetworkSession Members
The following tables list the members exposed by the AvailableNetworkSession type.
Public Properties
Name Description
CurrentGamerCount Gets the number of gamers in the session.
HostGamertag Gets the gamertag of the session host.
OpenPrivateGamerSlots Gets the number of private player slots.
OpenPublicGamerSlots Gets the number of public player slots.
QualityOfService Gets an estimate of the quality of network service between this local machine and the remote sessi
on.
SessionProperties Gets any custom properties that have been attached to the session.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Tasks
How To: Find and Join a Network Session
Reference
AvailableNetworkSession Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
AvailableNetworkSession Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
AvailableNetworkSession Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
AvailableNetworkSession Properties
Public Properties
Name Description
CurrentGamerCount Gets the number of gamers in the session.
HostGamertag Gets the gamertag of the session host.
OpenPrivateGamerSlots Gets the number of private player slots.
OpenPublicGamerSlots Gets the number of public player slots.
QualityOfService Gets an estimate of the quality of network service between this local machine and the remote sessi
on.
SessionProperties Gets any custom properties that have been attached to the session.
See Also
Reference
AvailableNetworkSession Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
AvailableNetworkSession.CurrentGamerCount Property
Gets the number of gamers in the session.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int CurrentGamerCount { get; }
Property Value
Number of gamers currently in the session.
See Also
Reference
AvailableNetworkSession Class
AvailableNetworkSession Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AvailableNetworkSession.HostGamertag Property
Gets the gamertag of the session host.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public string HostGamertag { get; }
Property Value
Name of the gamertag.
See Also
Reference
AvailableNetworkSession Class
AvailableNetworkSession Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AvailableNetworkSession.OpenPrivateGamerSlots Property
Gets the number of private player slots. These slots are reserved for people joining by invitation or friend presence.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int OpenPrivateGamerSlots { get; }
Property Value
Number of reserved private slots.
See Also
Reference
AvailableNetworkSession Class
AvailableNetworkSession Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AvailableNetworkSession.OpenPublicGamerSlots Property
Gets the number of public player slots. These slots are reserved for people joining by a matchmaking service.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public int OpenPublicGamerSlots { get; }
Property Value
Number of public slots.
See Also
Reference
AvailableNetworkSession Class
AvailableNetworkSession Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AvailableNetworkSession.QualityOfService Property
Gets an estimate of the quality of network service between this local machine and the remote session.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public QualityOfService QualityOfService { get; }
Property Value
An estimate of the quality of network service between this local machine and the remote session. Initially the IsAvailable
property will be set to false, and all the other properties of the returned QualityOfService instance will be zero, but after the
probing finishes this will become true and the other properties will be filled in with some actual data.
Remarks This measurement can take some time to complete, so the data may not be available when the search result is first
returned to you.
See Also
Reference
AvailableNetworkSession Class
AvailableNetworkSession Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AvailableNetworkSession.SessionProperties Property
Gets any custom properties that have been attached to the session.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public NetworkSessionProperties SessionProperties { get; }
Property Value
Any custom properties that have been attached to the session.
See Also
Reference
AvailableNetworkSession Class
AvailableNetworkSession Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AvailableNetworkSessionCollection Class
Represents a collection of sessions available for joining.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class AvailableNetworkSessionCollection : ReadOnlyCollection<AvailableNetwork
Session>, IDisposable
See Also
Tasks
How To: Find and Join a Network Session
Reference
AvailableNetworkSessionCollection Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AvailableNetworkSessionCollection Members
The following tables list the members exposed by the AvailableNetworkSessionCollection type.
Public Properties
Name Description
Count (Inherited from ReadOnlyCollection.)
IsDisposed Gets a value that indicates whether the object is disposed.
Item (Inherited from ReadOnlyCollection.)
Protected Properties
Name Description
Items (Inherited from ReadOnlyCollection.)
Public Methods
Name Description
Contains (Inherited from ReadOnlyCollection.)
CopyTo (Inherited from ReadOnlyCollection.)
Dispose Immediately releases the collection.
Equals (Inherited from Object.)
GetEnumerator (Inherited from ReadOnlyCollection.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
IndexOf (Inherited from ReadOnlyCollection.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows Finalize to attempt to free resources and perform other cleanup operations before garbage collec
tion reclaims the object.
MemberwiseClone (Inherited from Object.)
See Also
Tasks
How To: Find and Join a Network Session
Reference
AvailableNetworkSessionCollection Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
AvailableNetworkSessionCollection Methods
Public Methods
Name Description
Contains (Inherited from ReadOnlyCollection.)
CopyTo (Inherited from ReadOnlyCollection.)
Dispose Immediately releases the collection.
Equals (Inherited from Object.)
GetEnumerator (Inherited from ReadOnlyCollection.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
IndexOf (Inherited from ReadOnlyCollection.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize Allows Finalize to attempt to free resources and perform other cleanup operations before garbage collec
tion reclaims the object.
MemberwiseClone (Inherited from Object.)
See Also
Reference
AvailableNetworkSessionCollection Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
AvailableNetworkSessionCollection.Dispose Method
Immediately releases the collection.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void Dispose ()
See Also
Reference
AvailableNetworkSessionCollection Class
AvailableNetworkSessionCollection Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AvailableNetworkSessionCollection.Finalize Method
Allows Finalize to attempt to free resources and perform other cleanup operations before garbage collection reclaims the
object.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
protected override void Finalize ()
See Also
Reference
AvailableNetworkSessionCollection Class
AvailableNetworkSessionCollection Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
AvailableNetworkSessionCollection Properties
Public Properties
Name Description
Count (Inherited from ReadOnlyCollection.)
IsDisposed Gets a value that indicates whether the object is disposed.
Item (Inherited from ReadOnlyCollection.)
Protected Properties
Name Description
Items (Inherited from ReadOnlyCollection.)
See Also
Reference
AvailableNetworkSessionCollection Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
AvailableNetworkSessionCollection.IsDisposed Property
Gets a value that indicates whether the object is disposed.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsDisposed { get; }
Property Value
true if the object is disposed; false otherwise.
See Also
Reference
AvailableNetworkSessionCollection Class
AvailableNetworkSessionCollection Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameEndedEventArgs Class
Represents the arguments passed to a GameEnded event. These arguments are passed to event handlers when a game ends.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class GameEndedEventArgs : EventArgs
See Also
Reference
GameEndedEventArgs Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameEndedEventArgs Members
The following tables list the members exposed by the GameEndedEventArgs type.
Public Constructors
Name Description
GameEndedEventArgs Creates an instance of GameEndedEventArgs.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GameEndedEventArgs Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
GameEndedEventArgs Constructor
Creates an instance of GameEndedEventArgs.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GameEndedEventArgs ()
See Also
Reference
GameEndedEventArgs Class
GameEndedEventArgs Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameEndedEventArgs Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GameEndedEventArgs Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
GamerJoinedEventArgs Class
Represents the arguments passed to a GamerJoined event. These arguments are passed to event handlers when a new gamer
joins a network session. This class contains the NetworkGamer instance that recently joined the network session.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class GamerJoinedEventArgs : EventArgs
See Also
Reference
GamerJoinedEventArgs Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerJoinedEventArgs Members
The following tables list the members exposed by the GamerJoinedEventArgs type.
Public Constructors
Name Description
GamerJoinedEventArgs Creates an instance of GamerJoined.
Public Properties
Name Description
Gamer Gets the gamer who just joined the session.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GamerJoinedEventArgs Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
GamerJoinedEventArgs Constructor
Creates an instance of GamerJoined.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GamerJoinedEventArgs (
NetworkGamer gamer
)
Parameters
gamer
The gamer who just joined the session.
See Also
Reference
GamerJoinedEventArgs Class
GamerJoinedEventArgs Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerJoinedEventArgs Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GamerJoinedEventArgs Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
GamerJoinedEventArgs Properties
Public Properties
Name Description
Gamer Gets the gamer who just joined the session.
See Also
Reference
GamerJoinedEventArgs Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
GamerJoinedEventArgs.Gamer Property
Gets the gamer who just joined the session.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public NetworkGamer Gamer { get; }
Property Value
The gamer who just joined the session.
See Also
Reference
GamerJoinedEventArgs Class
GamerJoinedEventArgs Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerLeftEventArgs Class
Represents the arguments passed to a GamerLeft event. These arguments are passed to event handlers when a gamer leaves a
network session. This class contains the NetworkGamer instance that recently left the network session.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class GamerLeftEventArgs : EventArgs
See Also
Reference
GamerLeftEventArgs Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerLeftEventArgs Members
The following tables list the members exposed by the GamerLeftEventArgs type.
Public Constructors
Name Description
GamerLeftEventArgs Creates an instance of GamerLeftEventArgs.
Public Properties
Name Description
Gamer Gets the gamer who just left the session.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GamerLeftEventArgs Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
GamerLeftEventArgs Constructor
Creates an instance of GamerLeftEventArgs.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GamerLeftEventArgs (
NetworkGamer gamer
)
Parameters
gamer
The gamer who just left the session.
See Also
Reference
GamerLeftEventArgs Class
GamerLeftEventArgs Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GamerLeftEventArgs Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GamerLeftEventArgs Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
GamerLeftEventArgs Properties
Public Properties
Name Description
Gamer Gets the gamer who just left the session.
See Also
Reference
GamerLeftEventArgs Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
GamerLeftEventArgs.Gamer Property
Gets the gamer who just left the session.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public NetworkGamer Gamer { get; }
Property Value
The gamer who just left the session.
See Also
Reference
GamerLeftEventArgs Class
GamerLeftEventArgs Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameStartedEventArgs Class
Represents the arguments passed to a GameStarted event. These arguments are passed to event handlers when a game starts.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class GameStartedEventArgs : EventArgs
See Also
Reference
GameStartedEventArgs Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameStartedEventArgs Members
The following tables list the members exposed by the GameStartedEventArgs type.
Public Constructors
Name Description
GameStartedEventArgs Creates an instance of GameStartedEventArgs.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GameStartedEventArgs Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
GameStartedEventArgs Constructor
Creates an instance of GameStartedEventArgs.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public GameStartedEventArgs ()
See Also
Reference
GameStartedEventArgs Class
GameStartedEventArgs Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
GameStartedEventArgs Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
GameStartedEventArgs Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
HostChangedEventArgs Class
Represents the arguments passed to a HostChanged event. These arguments are passed to event handlers when the host
changes for a multiplayer session. This class contains the NetworkGamer instance that is the new host of the multiplayer
session.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class HostChangedEventArgs : EventArgs
See Also
Reference
HostChangedEventArgs Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HostChangedEventArgs Members
The following tables list the members exposed by the HostChangedEventArgs type.
Public Constructors
Name Description
HostChangedEventArgs Creates an instance of HostChangedEventArgs.
Public Properties
Name Description
NewHost Gets the new host of the session.
OldHost Gets the player who was the previous session host.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
HostChangedEventArgs Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
HostChangedEventArgs Constructor
Creates an instance of HostChangedEventArgs.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public HostChangedEventArgs (
NetworkGamer oldHost,
NetworkGamer newHost
)
Parameters
oldHost
The player who was the previous session host.
newHost
The player who is the new host of the multiplayer session.
See Also
Reference
HostChangedEventArgs Class
HostChangedEventArgs Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HostChangedEventArgs Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
HostChangedEventArgs Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
HostChangedEventArgs Properties
Public Properties
Name Description
NewHost Gets the new host of the session.
OldHost Gets the player who was the previous session host.
See Also
Reference
HostChangedEventArgs Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
HostChangedEventArgs.NewHost Property
Gets the new host of the session.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public NetworkGamer NewHost { get; }
Property Value
The player who is the new host of the multiplayer session.
See Also
Reference
HostChangedEventArgs Class
HostChangedEventArgs Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
HostChangedEventArgs.OldHost Property
Gets the player who was the previous session host.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public NetworkGamer OldHost { get; }
Property Value
The player who was the previous session host.
See Also
Reference
HostChangedEventArgs Class
HostChangedEventArgs Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
LocalNetworkGamer Class
Represents a local player in a network session.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class LocalNetworkGamer : NetworkGamer
See Also
Reference
SignedInGamer
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
LocalNetworkGamer Members
The following tables list the members exposed by the LocalNetworkGamer type.
Public Properties
Name Description
Gamertag (Inherited from Gamer.)
HasVoice (Inherited from NetworkGamer.)
IsDataAvailable Determines if there is incoming packet data for this player.
IsDisposed (Inherited from Gamer.)
IsHost (Inherited from NetworkGamer.)
IsLocal (Inherited from NetworkGamer.)
IsMutedByLocalUser (Inherited from NetworkGamer.)
IsPrivateSlot (Inherited from NetworkGamer.)
IsReady (Inherited from NetworkGamer.)
IsTalking (Inherited from NetworkGamer.)
Machine (Inherited from NetworkGamer.)
RoundtripTime (Inherited from NetworkGamer.)
Session (Inherited from NetworkGamer.)
SignedInGamer Gets the SignedInGamer instance for this SignedInGamer object.
SignedInGamers (Inherited from Gamer.)
Tag (Inherited from Gamer.)
Public Methods
Name Description
BeginGetProfile (Inherited from Gamer.)
EnableSendVoice Specifies whether voice data should be sent to, or received from, the specified remote gamer.
EndGetProfile (Inherited from Gamer.)
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetProfile (Inherited from Gamer.)
GetType (Inherited from Object.)
ReceiveData Overloaded. Reads the next incoming packet.
ReferenceEquals (Inherited from Object.)
SendData Overloaded. Broadcasts a network packet to all the gamers in the session.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
LocalNetworkGamer Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
LocalNetworkGamer Methods
Public Methods
Name Description
BeginGetProfile (Inherited from Gamer.)
EnableSendVoice Specifies whether voice data should be sent to, or received from, the specified remote gamer.
EndGetProfile (Inherited from Gamer.)
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetProfile (Inherited from Gamer.)
GetType (Inherited from Object.)
ReceiveData Overloaded. Reads the next incoming packet.
ReferenceEquals (Inherited from Object.)
SendData Overloaded. Broadcasts a network packet to all the gamers in the session.
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
LocalNetworkGamer Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
LocalNetworkGamer.EnableSendVoice Method
Specifies whether voice data should be sent to, or received from, the specified remote gamer.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public void EnableSendVoice (
NetworkGamer remoteGamer,
bool enable
)
Parameters
remoteGamer
A remote gamer in the session.
enable
true if voice is enabled; false otherwise.
Exceptions
Exception type Condition
ArgumentException This NetworkGamer belongs to a different network session.
ArgumentNullException remoteGamer is null.
ObjectDisposedException This NetworkGamer is no longer valid. The gamer may have left the session.
Remarks
Call this method for local gamer instances only.
By default, voice is enabled for all gamers but can be selectively turned off to enable features such as team chat, or dynamically
adjusted depending on location in the game world to achieve a proximity voice effect.
See Also
Reference
LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
LocalNetworkGamer.ReceiveData Method
Reads the next incoming packet.
Overload List
Name Description
LocalNetworkGamer.ReceiveData (Byte[], Int32, NetworkGamer) Reads the next incoming packet using the specified values.
LocalNetworkGamer.ReceiveData (Byte[], NetworkGamer) Reads the next incoming packet using the specified values.
LocalNetworkGamer.ReceiveData (PacketReader, NetworkGamer) Reads the next incoming packet and copies the packet data i
nto the specified reader object.
Example
Be sure to call ReceiveData for all incoming data for all local gamers, even if the data is to be discarded. Any time data is sent
to a local network gamer, the incoming data queue will grow until the data is read. If the data is not read using ReceiveData
the performance of the application will degrade as the data queue grows in size.
C#
foreach (LocalNetworkGamer gamer in session.LocalGamers)
{
// Keep reading while packets are available.
while (gamer.IsDataAvailable)
{
NetworkGamer sender;
See Also
Tasks
How To: Receive Data
Reference
LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
Parameters
data
Storage for the network packet data.
offset
Offset, in bytes, to begin reading data.
sender
[OutAttribute] Gamer who sent this packet.
Return Value
Number of bytes read from the network packet. Returns 0 if no packet is available.
Exceptions
Exception type Condition
ArgumentException The specified array is too small to receive the incoming network packet.
ArgumentNullException data is null.
ArgumentOutOfRangeException offset cannot be larger than the amount of data available for storage.
Example
Be sure to call ReceiveData for all incoming data for all local gamers, even if the data is to be discarded. Any time data is sent
to a local network gamer, the incoming data queue will grow until the data is read. If the data is not read using ReceiveData
the performance of the application will degrade as the data queue grows in size.
C#
foreach (LocalNetworkGamer gamer in session.LocalGamers)
{
// Keep reading while packets are available.
while (gamer.IsDataAvailable)
{
NetworkGamer sender;
// Read a single packet.
gamer.ReceiveData(packetReader, out sender);
// Discard the data, or use packetReader.Read* to process the data.
}
gamer.SendData(packetWriter, SendDataOptions.None);
Remarks
ReceiveData copies the packet data into the array specified by data, returning the number of bytes read. If several
independent packets are available, only one is returned for each ReceiveData call.
See Also
Tasks
How To: Receive Data
Reference
LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
data
Storage for the network packet data.
sender
[OutAttribute] Gamer who sent this packet.
Return Value
Number of bytes read from the network packet. Returns 0 if no packet is available.
Exceptions
Exception type Condition
ArgumentException The specified array is too small to receive the incoming network packet.
ArgumentNullException data is null.
Example
Be sure to call ReceiveData for all incoming data for all local gamers, even if the data is to be discarded. Any time data is sent
to a local network gamer, the incoming data queue will grow until the data is read. If the data is not read using ReceiveData
the performance of the application will degrade as the data queue grows in size.
C#
foreach (LocalNetworkGamer gamer in session.LocalGamers)
{
// Keep reading while packets are available.
while (gamer.IsDataAvailable)
{
NetworkGamer sender;
// Read a single packet.
gamer.ReceiveData(packetReader, out sender);
// Discard the data, or use packetReader.Read* to process the data.
}
gamer.SendData(packetWriter, SendDataOptions.None);
Remarks
ReceiveData copies the packet data into the array specified by data, returning the number of bytes read. If several
independent packets are available, only one is returned for each ReceiveData call.
See Also
Tasks
How To: Receive Data
Reference
LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
data
Network packet data.
sender
[OutAttribute] Gamer who sent this packet.
Return Value
Number of bytes read from the network packet. Returns 0 if no packet is available.
Exceptions
Exception type Condition
ArgumentException The specified array is too small to receive the incoming network packet.
ArgumentNullException data is null.
Example
Be sure to call ReceiveData for all incoming data for all local gamers, even if the data is to be discarded. Any time data is sent
to a local network gamer, the incoming data queue will grow until the data is read. If the data is not read using ReceiveData
the performance of the application will degrade as the data queue grows in size.
C#
foreach (LocalNetworkGamer gamer in session.LocalGamers)
{
// Keep reading while packets are available.
while (gamer.IsDataAvailable)
{
NetworkGamer sender;
// Read a single packet.
gamer.ReceiveData(packetReader, out sender);
// Discard the data, or use packetReader.Read* to process the data.
}
gamer.SendData(packetWriter, SendDataOptions.None);
RemarksIf several independent packets are available, only one will be returned on each call to ReceiveData.
See Also
Tasks
How To: Receive Data
Reference
LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
LocalNetworkGamer.SendData Method
Broadcasts a network packet to all the gamers in the session. This includes the gamer sending the packet.
Overload List
Name Description
LocalNetworkGamer.SendData (Byte[], Int32, Int32, SendDataOptions) Sends a network packet to all gamers i
n a session.
LocalNetworkGamer.SendData (Byte[], Int32, Int32, SendDataOptions, NetworkGamer) Sends a network packet to the specified
gamer.
LocalNetworkGamer.SendData (Byte[], SendDataOptions) Sends a network packet to all gamers i
n a session.
LocalNetworkGamer.SendData (Byte[], SendDataOptions, NetworkGamer) Sends a network packet to the specified
gamer.
LocalNetworkGamer.SendData (PacketWriter, SendDataOptions) Sends a network packet to all gamers i
n a session.
LocalNetworkGamer.SendData (PacketWriter, SendDataOptions, NetworkGamer) Sends a network packet to the specified
gamer in a session.
See Also
Tasks
How To: Send Data
Reference
LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
Parameters
data
Byte array containing session data.
offset
Offset, in bytes, to the start of the data.
count
Amount, in bytes, of data sent.
options
Enumeration containing data send options.
Exceptions
Exception type Condition
ArgumentNullException data is null.
ArgumentOutOfRangeException offset must be greater than zero, and no larger than the amount of data available.
count must be greater than zero, and offset + count must be no larger than the amount
of data available.
ObjectDisposedException The NetworkGamer sending this message is no longer valid. The gamer may have left the ses
sion.
See Also
Tasks
How To: Send Data
Reference
LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
data
Byte array containing session data.
offset
Offset, in bytes, to the start of the data.
count
Amount, in bytes, of data sent.
options
Enumeration containing data send options.
recipient
Gamer to receive the data packet.
Exceptions
Exception type Condition
ArgumentException The NetworkGamer specified as the recipient does not belong to this network session.
ArgumentNullException data or recipient is null.
ArgumentOutOfRangeException offset must be greater than zero, and no larger than the amount of data available.
count must be greater than zero, and offset + count must be no larger than the amount
of data available.
ObjectDisposedException The NetworkGamer specified as either the sender or the recipient is no longer valid. The gam
er may have left the session.
See Also
Tasks
How To: Send Data
Reference
LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
data
Byte array containing session data.
options
Enumeration containing data send options.
Exceptions
Exception type Condition
ArgumentNullException data is null.
ObjectDisposedException The NetworkGamer sending this message is no longer valid. The gamer may have left the session.
See Also
Tasks
How To: Send Data
Reference
LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
data
Byte array containing session data.
options
Enumeration containing data send options.
recipient
Gamer to receive the data packet.
Exceptions
Exception type Condition
ArgumentException The NetworkGamer specified as the recipient does not belong to this network session.
ArgumentNullException data or recipient is null.
ObjectDisposedException The NetworkGamer specified as either the sender or the recipient is no longer valid. The gamer may
have left the session.
See Also
Tasks
How To: Send Data
Reference
LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
data
Byte array containing session data.
options
Enumeration containing data send options.
Exceptions
Exception type Condition
ArgumentNullException data is null.
ObjectDisposedException The NetworkGamer sending this message is no longer valid. The gamer may have left the session.
See Also
Tasks
How To: Send Data
Reference
LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
data
Byte array containing session data.
options
Enumeration containing data send options.
recipient
Gamer receiving the data.
Exceptions
Exception type Condition
ArgumentException The NetworkGamer specified as the recipient does not belong to this network session.
ArgumentNullException data or recipient is null.
ObjectDisposedException The NetworkGamer specified as either the sender or the recipient is no longer valid. The gamer may
have left the session.
See Also
Tasks
How To: Send Data
Reference
LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
LocalNetworkGamer Properties
Public Properties
Name Description
Gamertag (Inherited from Gamer.)
HasVoice (Inherited from NetworkGamer.)
IsDataAvailable Determines if there is incoming packet data for this player.
IsDisposed (Inherited from Gamer.)
IsHost (Inherited from NetworkGamer.)
IsLocal (Inherited from NetworkGamer.)
IsMutedByLocalUser (Inherited from NetworkGamer.)
IsPrivateSlot (Inherited from NetworkGamer.)
IsReady (Inherited from NetworkGamer.)
IsTalking (Inherited from NetworkGamer.)
Machine (Inherited from NetworkGamer.)
RoundtripTime (Inherited from NetworkGamer.)
Session (Inherited from NetworkGamer.)
SignedInGamer Gets the SignedInGamer instance for this SignedInGamer object.
SignedInGamers (Inherited from Gamer.)
Tag (Inherited from Gamer.)
See Also
Reference
LocalNetworkGamer Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
LocalNetworkGamer.IsDataAvailable Property
Determines if there is incoming packet data for this player.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsDataAvailable { get; }
Property Value
true if there are one or more packets waiting; otherwise false.
See Also
Reference
LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
LocalNetworkGamer.SignedInGamer Property
Gets the SignedInGamer instance for this SignedInGamer object.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public SignedInGamer SignedInGamer { get; }
Property Value
The related SignedInGamer instance.
See Also
Reference
LocalNetworkGamer Class
LocalNetworkGamer Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NetworkException Class
Thrown if there is a network communication failure.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
[SerializableAttribute]
public class NetworkException : Exception
See Also
Reference
NetworkException Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NetworkException Members
The following tables list the members exposed by the NetworkException type.
Public Constructors
Name Description
NetworkException Overloaded. Creates an instance of NetworkException.
Public Properties
Name Description
Data (Inherited from Exception.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
NetworkException Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
NetworkException Constructor
Creates an instance of NetworkException.
Overload List
Name Description
NetworkException () Creates an empty instance of NetworkException.
NetworkException (SerializationInfo, StreamingContext) Initializes a new instance of NetworkException with the specified strea
ming context.
NetworkException (String) Initializes a new instance of NetworkException with the specified error
message.
NetworkException (String, Exception) Initializes a new instance of NetworkException with the specified error
message and the inner exception.
See Also
Reference
NetworkException Class
NetworkException Members
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
NetworkException Constructor ()
Creates an empty instance of NetworkException.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public NetworkException ()
See Also
Reference
NetworkException Class
NetworkException Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
info
Describes the network data being sent or received when the exception occurred.
context
Describes the stream where the exception occurred.
See Also
Reference
NetworkException Class
NetworkException Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
message
A message that describes the error.
See Also
Reference
NetworkException Class
NetworkException Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
Parameters
message
A message that describes the error.
innerException
The inner exception related to this exception.
See Also
Reference
NetworkException Class
NetworkException Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NetworkException Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetBaseException (Inherited from Exception.)
GetHashCode (Inherited from Object.)
GetObjectData (Inherited from Exception.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
NetworkException Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
NetworkException Properties
Public Properties
Name Description
Data (Inherited from Exception.)
HelpLink (Inherited from Exception.)
InnerException (Inherited from Exception.)
Message (Inherited from Exception.)
Source (Inherited from Exception.)
StackTrace (Inherited from Exception.)
TargetSite (Inherited from Exception.)
Protected Properties
Name Description
HResult (Inherited from Exception.)
See Also
Reference
NetworkException Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
NetworkGamer Class
Represents a player in a network session.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public class NetworkGamer : Gamer
RemarksThe NetworkSession class maintains a list of players in a network session. Some of the players may also be local
players, which are represented LocalNetworkGamer.
See Also
Reference
NetworkGamer Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NetworkGamer Members
The following tables list the members exposed by the NetworkGamer type.
Public Properties
Name Description
Gamertag (Inherited from Gamer.)
HasVoice Determines if the player has a voice headset.
IsDisposed (Inherited from Gamer.)
IsHost Determines if the player is the host of the multiplayer session.
IsLocal Determines if the player is playing on a local machine.
IsMutedByLocalUser Determines if the player is muted by one or more local users.
IsPrivateSlot Determines if the player occupies a reserved private session slot.
IsReady Determines whether the gamer is ready to leave the lobby screen and begin gameplay.
IsTalking Determines whether the gamer is currently sending voice data.
Machine Gets an object representing the physical gaming machine this NetworkGamer is playing on.
RoundtripTime Gets an estimate of the network latency involved in sending a packet round trip from the local machin
e to this gamer and back again.
Session Gets the multiplayer session of the gamer.
SignedInGamers (Inherited from Gamer.)
Tag (Inherited from Gamer.)
Public Methods
Name Description
BeginGetProfile (Inherited from Gamer.)
EndGetProfile (Inherited from Gamer.)
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetProfile (Inherited from Gamer.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
NetworkGamer Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
NetworkGamer Methods
Public Methods
Name Description
BeginGetProfile (Inherited from Gamer.)
EndGetProfile (Inherited from Gamer.)
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetProfile (Inherited from Gamer.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
NetworkGamer Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
NetworkGamer Properties
Public Properties
Name Description
Gamertag (Inherited from Gamer.)
HasVoice Determines if the player has a voice headset.
IsDisposed (Inherited from Gamer.)
IsHost Determines if the player is the host of the multiplayer session.
IsLocal Determines if the player is playing on a local machine.
IsMutedByLocalUser Determines if the player is muted by one or more local users.
IsPrivateSlot Determines if the player occupies a reserved private session slot.
IsReady Determines whether the gamer is ready to leave the lobby screen and begin gameplay.
IsTalking Determines whether the gamer is currently sending voice data.
Machine Gets an object representing the physical gaming machine this NetworkGamer is playing on.
RoundtripTime Gets an estimate of the network latency involved in sending a packet round trip from the local machin
e to this gamer and back again.
Session Gets the multiplayer session of the gamer.
SignedInGamers (Inherited from Gamer.)
Tag (Inherited from Gamer.)
See Also
Reference
NetworkGamer Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
NetworkGamer.HasVoice Property
Determines if the player has a voice headset.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool HasVoice { get; }
Property Value
true if a headset is present; false otherwise.
See Also
Reference
NetworkGamer Class
NetworkGamer Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NetworkGamer.IsHost Property
Determines if the player is the host of the multiplayer session.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsHost { get; }
Property Value
true if the player is the host; false otherwise.
See Also
Reference
NetworkGamer Class
NetworkGamer Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NetworkGamer.IsLocal Property
Determines if the player is playing on a local machine.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsLocal { get; }
Property Value
true if the player is local; false otherwise.
See Also
Reference
NetworkGamer Class
NetworkGamer Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NetworkGamer.IsMutedByLocalUser Property
Determines if the player is muted by one or more local users.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsMutedByLocalUser { get; }
Property Value
true if the player is muted by one or more players in the session; false otherwise.
See Also
Reference
NetworkGamer Class
NetworkGamer Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NetworkGamer.IsPrivateSlot Property
Determines if the player occupies a reserved private session slot.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsPrivateSlot { get; }
Property Value
true if the player occupies a reserved private session slot; false otherwise.
See Also
Reference
NetworkGamer Class
NetworkGamer Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NetworkGamer.IsReady Property
Determines whether the gamer is ready to leave the lobby screen and begin gameplay.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsReady { get; set; }
Property Value
true if the gamer is ready to start playing; false otherwise.
Exceptions
Exception type Condition
InvalidOperationException This operation is only valid when the session state is NetworkSessionState.Lobby.
This method cannot be called on remote gamer instances. It is only valid when
NetworkGamer.IsLocal is true. If you are looping over the contents of the
NetworkSession.AllGamers collection, consider using NetworkSession.LocalGamers instead.
ObjectDisposedException This NetworkGamer is no longer valid. The gamer may have left the session.
Remarks
The host of a multiplayer session can use the IsEveryoneReady property to detect when all players have marked themselves
ready, and then call StartGame to kick off the game.
See Also
Tasks
How To: Manage Player Movement Between Lobby and Gameplay Modes
Reference
NetworkGamer Class
NetworkGamer Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NetworkGamer.IsTalking Property
Determines whether the gamer is currently sending voice data.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public bool IsTalking { get; }
Property Value
true if the gamer is sending voice data; false otherwise.
See Also
Reference
NetworkGamer Class
NetworkGamer Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NetworkGamer.Machine Property
Gets an object representing the physical gaming machine this NetworkGamer is playing on.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public NetworkMachine Machine { get; set; }
Property Value
An object representing the physical gaming machine this NetworkGamer is playing on.
Remarks If there are several gamers all playing on the same gaming machine, they will all share a single value for the
Machine property.
See Also
Reference
NetworkGamer Class
NetworkGamer Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NetworkGamer.RoundtripTime Property
Gets an estimate of the network latency involved in sending a packet round trip from the local machine to this gamer and back
again.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public TimeSpan RoundtripTime { get; }
Property Value
An estimate of the network latency involved in sending a packet round trip from the local machine to this gamer and back
again.
Remarks This value does not include latency introduced via the MultiplayerSession.SimulateLatency property.
See Also
Reference
NetworkGamer Class
NetworkGamer Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NetworkGamer.Session Property
Gets the multiplayer session of the gamer.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public NetworkSession Session { get; }
Property Value
Session that contains the gamer.
See Also
Reference
NetworkGamer Class
NetworkGamer Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NetworkMachine Class
Represents a physical machine (such as single Xbox 360 console or Windows-based computer) that is participating in a
multiplayer session. It can be used to detect when more than one NetworkGamer is playing on the same actual machine.
Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
C#
public sealed class NetworkMachine
See Also
Reference
NetworkMachine Members
Microsoft.Xna.Framework.Net Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista
XNA Game Studio 2.0
NetworkMachine Members
The following tables list the members exposed by the NetworkMachine type.
Public Properties
Name Description
Gamers Gets a collection of all the gamers who are playing on this machine.
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
RemoveFromSession Forcibly removes this machine from the session.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
NetworkMachine Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
NetworkMachine Methods
Public Methods
Name Description
Equals (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetType (Inherited from Object.)
ReferenceEquals (Inherited from Object.)
RemoveFromSession Forcibly removes this machine from the session.
ToString (Inherited from Object.)
Protected Methods
Name Description
Finalize (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
See Also
Reference
NetworkMachine Class
Microsoft.Xna.Framework.Net Namespace
XNA Game Studio 2.0
NetworkMachine.RemoveFromSession Method
Forcibly removes this machine from the session.
Namespace: Microsoft.Xna.Framework.Net