Phoenix, Creating the main project files.

Monday, April 11 2005

Creating the Main Project Files

For this project I started using the VS2003 system and C# as the main language for the code but after a while I have started to convert the code and project to run under the VS2005 Express editions. One of my main deciding points for this is that I am a hobby programmer and the project that I am working on will also be targeted at hobby programmers. Please note that as we go along I am still learning the IDE for the express editions and how it reacts.

To summarize the Development systems I will be using...

  • Visual C# 2005 Express Edition (Latest Beta Release)
  • DirectX SDK Apr 2005 Release


Ok to get started lets open up the Visual C# Express edition, and create a new Windows Application Project. Looking at the solution explorer the IDE has created a new node on the solution explorer for the project. This node is called Properties; this contains the AssemblyInfo.cs and a Resource file for you to add resources to (Images, sounds, etc). The next thing that I did notice is that the class structure for a default windows form application had changed. In the older IDE we had all of the forms code inside the main class for the form, for example the main function, and the forms design code was there. When you look into the new default windows form application you will notice that the forms code is now separated into three class files.

  • You now have a class for your form, which will at the moment have nothing inside it other then the main InitializeComponent call.
  • The second class is a program class, this holds the main call, and from there starts the application and main form. To me this is going to help as I remember all of the questions on the newsgroups on how do we create a splash screen for their application... Well here is where you would do it.
  • The third code file that is added is by default hidden from view. To find the file you can both go to the explorer and browse to your projects directory, or by going to your solution explorer inside the IDE and select any of the items inside the project tab. Now that you have done this you will see a toolbar button on the solution explorer that looks like a group of files one on top of the other. This button will show all the files and directories that are hidden from the default view. Ok back to the file... expand the Form1.cs file and it will show another file that is called Form1.designer.cs, this file is used to hold all of the automatic code that is used to display the form on the screen and it's controls.

Adding the DirectX References

To start with as we are going to be using Managed DirectX we will need to add the references to the directx libraries. To do this we will need to go to the solution explorer and right click on the references node in the tree view, once done select Add references. From here make sure that you add the latest versions of the assemblies for the following, Microsoft.DirectX, Microsoft.DirectX.Direct3D, and Microsoft.DirectX.Direct3DX.

To finish up this post for the moment and also to clean up the default project pages we can rename the form1 file and call it MainForm.cs. I remember when we used to do this in the VS2003 IDE and then we would have to backtrack and change the references to Form1 to the new name. In the newer IDE this is done for us.

In the next post I will start creating the DirectX application.

kick it on DotNetKicks.com kick it on gamedevkicks.com

Similar Posts

  1. Phoenix, Drawing the Main Background for the Project
  2. Phoenix, Setting up the DirectX Device
  3. Phoenix, Drawing Text on the Screen
Clicky Web Analytics