Table of Contents
Introduction 1
Part I Get Up and Running with XNA on Your PC and Xbox 360
1 Introducing XNA and XNA Game Studio Express 7
What Is the XNA Framework?............................................................7
The Foundation of the XNA Framework.......................................8
XNA Today.............................................................................9
Installing Visual C# Express.............................................................10
Installing the DirectX Runtime.........................................................14
Installing XNA Game Studio Express.................................................15
Creating Spacewar Windows Project..................................................17
Compiling and Running Spacewar....................................................17
Summary......................................................................................17
2 XNA and the Xbox 360 19
Creating Spacewar Xbox 360 Project.................................................19
Buying the XNA Creators Club Subscription.......................................20
Connecting the Xbox 360 to the PC..................................................22
Deploying on the Xbox 360.............................................................23
Debugging on the Xbox 360............................................................25
Creating a Test Demo for the Xbox 360.............................................25
Programming for Dual Platforms......................................................28
The .NET Compact Framework on the Xbox 360.................................33
Summary......................................................................................33
3 Performance Considerations 35
Measure, Measure, Measure..............................................................35
The 80-20 Rule......................................................................36
Creating a Benchmark.............................................................37
Monitoring Performance on the Xbox 360 .................................39
Managing Memory.........................................................................40
Understanding the Garbage Collector................................................41
On the .NET Framework (Windows)..........................................41
On the .NET Compact Framework (Xbox 360).............................42
Optimization Suggestions................................................................43
Creating a Micro-Benchmark Framework....................................43
Sealing Virtual Methods..........................................................53
Collections............................................................................53
Summary......................................................................................54
Part II Understanding XNA Basics
4 Creating 3D Objects 59
Vertices........................................................................................59
Vectors.........................................................................................59
Matrices.......................................................................................60
Transformations.............................................................................60
Translation............................................................................60
Scaling.................................................................................60
Rotation...............................................................................60
Transformations Reloaded...............................................................60
Creating a Camera.........................................................................61
Projection.............................................................................61
View....................................................................................62
World...................................................................................63
Vertex Buffers................................................................................63
Effects..........................................................................................66
Textures........................................................................................68
Index Buffers.................................................................................69
XNA Game Components.................................................................72
Checking Performance....................................................................75
Transformations Revolutions............................................................79
Summary......................................................................................83
5 Input Devices and Cameras 85
Creating a Game Service..................................................................85
Starting a Library...........................................................................88
Working with Input Devices............................................................91
Keyboard..............................................................................91
Game Pad.............................................................................95
Mouse (Windows Only)...........................................................98
Creating a Stationary Camera.........................................................100
Creating a First Person Camera.......................................................103
Creating a Split Screen..................................................................106
Summary....................................................................................110
Post a comment