Subscribe

RSS Feed (xml)

Powered By

Powered by Blogger

Google
 
xnahelp.blogspot.com

Kamis, 03 April 2008

Installing Visual C# Express

To get started, we must have the software installed. Let’s start by installing Visual C#
Express. Visual C# Express is the IDE that is required to run XNA Game Studio Express.
XNA requires C# due to how the Content Pipeline is used. There are some people who
have successfully created demos using other languages such as VB.NET and even F#.
However, this is not supported by Microsoft currently and won’t be discussed in this
book. This book assumes you have a good understanding of C#. If you know C++, Java, or
VB.NET, you should be able to pick up C# pretty quickly.
I am going to be detailed in the steps to make sure that anyone who has not worked with
Visual C# Express will be able to get it installed with no issues. Feel free to skip this
section if you already have Visual C# Express installed.
To install Visual C# Express, follow these steps:
1. You will need to be connected to the Internet to install the application. The application
can be downloaded by browsing to
http://msdn.microsoft.com/vstudio/express/downloads/ and clicking the Visual C#
Express Go button to download the vcssetup.exe setup program.
2. Optional. On the Welcome to Setup screen select the check box to send data about
your setup experience to Microsoft. This way if something goes awry, Microsoft can
get the data and try to make the experience better the next time around. This
screen is shown in Figure 1.1.
11
1
Installing Visual C# Express
FIGURE 1.1 Select the check box if you want the system to provide feedback to Microsoft
about your installation experience.
3. Click Next to continue.
4. The next screen is the End-User License Agreement. If you accept the terms, select
the check box and click Next.
5. The following screen, shown in Figure 1.2, has two installation options you can
check. Neither of these options is required to utilize XNA.
FIGURE 1.2 Neither of these options is required to utilize XNA.
CHAPTER 1 Introducing the XNA Framewor12 k
6. Click Next to continue.
7. The next screen, shown in Figure 1.3, asks where we would like to install Visual C#
Express. It is going to install other required applications including Microsoft .NET
Framework 2.0. This is required, as C# runs on the .NET Framework. You will also
notice it requires more than 300MB of space.
8. Click Next to continue.
FIGURE 1.3 Specify which directory you want Visual C# Express to be installed in.
9. Now we are looking at the Installation Progress screen where we will be able to
monitor the progress of the installation.
10. Finally, on the Setup Complete screen we can see the Windows Update link we can
click on to get any of the latest service packs for Visual C# Express.
11. Click Exit to complete the installation.
We have successfully installed the first piece of the pie to start creating excellent games
with XNA! Before we continue to the next piece of software, we need to open up Visual
C# Express. It might take a couple of minutes to launch the first time the application is
loaded. Once the Visual C# Express is loaded we should see the Start Page as shown in
Figure 1.4.
Installing Visual C# Express 13
1
FIGURE 1.4 This is the Start Page inside of Visual C# Express.
The following procedure is optional, but it does ensure that everything is working
correctly on our machine.
1. In the Recent Projects section, find Create Project and click the link. You can also
create a new project under the File menu.
2. Visual C# Express installed several default templates that we can choose from. Select
the Windows Application template as displayed in Figure 1.5.
3. You can leave the name set to WindowsApplication1 as we will just be discarding
this project when we are done.
FIGURE 1.5 The New Project dialog box allows you to choose from the default templates to
create an application.
CHAPTER 1 Introducing the XNA Framewor14 k
4. Click OK to create the application.
At this point a new project should have been created and we should be looking at a blank
Windows Form called Form1.
5. Press Ctrl+F5 or click Start Without Debugging on the Debug menu.
If everything compiled correctly, the form we just saw in design mode should actually
be running. Granted, it doesn’t do anything, but it does prove that we can compile and
run C# through Visual C# Express. The end result can be seen in Figure 1.6. Let’s close
down the application we just created as well as Visual C# Express. Feel free to discard
the application.
FIGURE 1.6 This is a C# Windows Form application after compiling and running the default
template.
Installing the DirectX Runtime
We also need the DirectX 9 runtime if it isn’t already on the machine. To get started,
follow these steps:
1. Run the dxwebsetup.exe file from Microsoft’s website. This can be found by clicking
on the DirectX Runtime Web Installer link at the bottom of the Creator’s Club
Resources—Essentials web page http://creators.xna.com/Resources/Essentials.aspx.
This file contains the redistribution package of the February 2007 DirectX 9.
You will need to be connected to the Internet so it can completely install the
application.
2. We are greeted with the End-User License Agreement. Handle with care.
3. The next screen is a dialog box asking where we would like the installation files to
be stored. We can pick any directory we want as long as we remember it so we can
actually install the runtime—we are simply extracting the files needed to install the
runtime.
4. Click OK to continue.
5. We will be prompted to create that directory if the directory entered doesn’t exist.
Click Yes to continue.
6. Wait for the dialog box with the progress bar to finish unpacking the files.
Now we can actually install the runtime by following these steps:
1. Browse to the folder where we installed the files and run the dxsetup.exe file to
actually install DirectX 9 onto the machine.
2. The welcome screen we see includes the End-User License Agreement. Select the
appropriate radio button to continue.
3. Following the agreement is a screen stating that it will install DirectX—click Next.
4. Once it finishes installing (a progress bar will be visible while it is installing the
files) we will be presented with the Installation Complete screen.
5. Simply click Finish to exit the setup.
Now, we can move on to installing XNA Game Studio Express.
Installing XNA Game Studio Express
To use XNA Game Studio Express we must use Visual C# Express. We cannot use Visual
Studio .NET Professional nor can we use any other IDE. Although there are people who
have successfully been able to run XNA and even get the Content Pipeline (which we talk
about in Part III of the book) to work in Visual Studio .NET Professional, it is not officially
supported by Microsoft and is not covered in this book.
WARNING
You must run the Visual C# Express IDE at least one time before installing XNA Game
Studio Express. If this is not done, not all of the functionality will be installed. If XNA
Game Studio Express was installed prematurely, you will need to uninstall XNA Game
Studio Express and run Visual C# Express and then exit the IDE. Then you will be able
to reinstall XNA Game Studio Express.
To get started complete the following steps:
1. Run the xnagse_setup.msi file from Microsoft’s website. The file can be downloaded
by clicking on the top link of the Creator’s Club Resources—Essentials web site
http://creators.xna.com/Resources/Essentials.aspx.
2. Click Next to get past the setup welcome screen.
3. The next screen is the End-User License Agreement. If you accept the terms, select
the check box and click Next.
4. This will open up a notification dialog box that explains that the Windows Firewall
will have a rule added to it to allow communication between the computer and the
Xbox 360. This can be seen in Figure 1.7.
Installing XNA Game Studio Express 15
1
FIGURE 1.7 XNA Game Studio Express modifies the Windows Firewall so an Xbox 360 and
the PC can talk to each other.
5. Click Install to continue. The next screen shows the progress of the installation.
6. Once it has completed installing all of the required files we will be presented with
the completion dialog box. Simply click Finish to exit the setup.
After we have installed XNA Game Studio Express, we can go to the Start menu and see it
added a few more items than those contained in the IDE. Make sure to take time and read
through some of the XNA Game Studio Express documentation. There is also a Tools
folder that contains a couple of tools we will be looking at later. We will be discussing the
XACT tool in Chapter 6, “Loading and Texturing 3D Objects,” and the XNA Framework
Remote Performance Monitor for Xbox 360 application in Chapter 3, “Performance
Considerations.” Go ahead and open the IDE by clicking XNA Game Studio Express on
the Start menu.
Hmm, this looks identical to the Visual C# Express IDE. There is a good reason for this—it
is the same application! When we installed XNA Game Studio Express it added properties
to Visual C# Express to allow it to behave differently under certain circumstances. Mainly
it added some templates, which we will look at shortly, and it added the ability for Visual
C# Express to handle content via the XNA Content Pipeline. It also added a way for us to
send data to our Xbox 360, as we will see in the next chapter.

0 komentar: