Testing the tools

Once the programs are on your system (they should be on the labn machines), we can see if we can build a program - even if we do not lnow much about that, yet!

Here is what we need to do:

Start a new project

Open up Visual Studio. Here is what it should look like:

../../_images/VSstart.png

Select File -> New -> Project, This window should pop up:

../../_images/NewProject.png

Click on Dark GDK 2D Game and give the project a name. (It will have a default name already filled in.), You should pick a place on your system that is easy to find and keep all projects in that place.

Note

I store all programs I write for a course in a directory set up for the class, and in a subdirectory for each project. This allow me to keep everything around for use later - either for reference of incorporate into a new project.

The systenm will build a new set of files for this demo project for you. Here is what you will see in the left side of the VS window:

../../_images/InitialFiles.png

Build the program

Since the system set up our files for us, let’s try to build the program.

CLick on Build ‣ Build Solution and see what happens. You should see a series of messages scroll by in the bottom window. The system is complaining that it cannot find the DarkGDK.h file needed to process the program. We need to set this up manually.

If you installed files as shown earlier, this is the layout you should have (minus the save folder).

../../_images/ClassDirectory.png

Adding DarkGDK support to the project

We need to tell the system where the dARKgdk.h. If you followed these noted, the file is located in c:\GSP115\DarkGDK\include directory. We add this location to the project by using the project properties window. You get here by clicking on Project --> Properties on the top menu:

../../_images/ProjectProperties.png

Here, I have click on the small arrows to open up the list of properties. We need to make entries under the C/C++ -> General`` property. Make you entry look like this:

Second Try

With these changes, let’s try again. This time, we get closer, but still we have problems:

../../_images/SecondTry.png

We need to tell the system about one more set of files.

Adding DirectX support to the project

Add the DirectX include directory to the C\C++ --> General area, and the DirectX lib directory to the Linker --> General properties. You just click in the line below the existing entries to add another entry.

Third time is the charm!

With these changes, we should get a clean build - one with no errtors. Be sure to look at what is shown in the bottom panel.

We can run this program by selecting Debug –> Start Debuggiung`. After a few seconds, you should see something pretty neat!

../../_images/RunningGame.png

So, we are done, right?

Hardly, we do not have a clue what we just did, and that is what we will learn in this course! But, we have the tools we need to do the job running, and that is just what we want for starters!