Introduction to Game Programming with C++ (Wordware Game Developers Library)
4.5 Projects
When a programmer sits down to write a new program in an IDE, he creates a new project. This project will contain all the instruction text files written in C++ and any other files deemed to be relevant. C++ files typically have the file extensions .c, .cpp, .h, and .hpp. When the time comes to assemble the program into an executable form, all the files contained in a project are typically compiled together by the compiler, and then the program can be run. If there's a problem with the program, programmers can go back and edit the source code, compile again, and run to see the new program with changes included.
Creating a new project is the first step to perform when preparing to write a new program. The procedure for doing this will be slightly different depending on which IDE the reader has selected.
4.5.1 Starting a New Visual C++ Project
To create a new project in Visual Studio .NET, perform the following:
-
Click File | New | Project.
-
In the New Project dialog, select Visual C++ Projects from the Project Types tree view.
Figure 4.4 -
In the Templates box, a number of different project types for C++ are listed. Any kind can be selected, but I recommend starting with Win32 Console Application.
-
In the Name and Location edit boxes beneath, select a name for the project and a location where it is to be saved.
-
Click OK.
-
A wizard dialog appears in which application settings can be customized. To start, it's probably sensible to accept the defaults.
Figure 4.5 -
Click Finish.
-
A new project is then ready to begin.
4.5.2 Starting a New Code::Blocks Project
To create a new project in Code::Blocks, perform the following:
-
Click File | New | Project.
-
A number of different project types for C++ are listed in the large box. Any kind can be selected, but I recommend starting with Console Application.
Figure 4.6 -
Click Go.
-
A wizard dialog appears where users can enter a project name and a location where the project will be saved. Click Next.
Figure 4.7 -
The next wizard dialog gives the user some configuration options. Unless you have specific requirements, you can simply click Next.
Figure 4.8 -
A new project is then ready to begin.
4.5.3 Starting a New Dev C++ Project
To create a new project in Dev C++, perform the following:
-
Click File | New | Project.
-
A number of different project types for C++ are listed in the New project dialog. Any kind can be selected, but I recommend starting with Console Application.
Figure 4.9 -
Click OK.
-
A dialog appears in which users can enter a location where the project will be saved.
-
A new project is then ready to begin.
Категории