Game Development Reference
In-Depth Information
Create a new Windows Forms Application project. I've called the project
Shooter, but feel free to choose whatever name you want. You are probably
familiar with how to set up a project, but here is a quick overview. The solution
will be set up in a very similar way to the EngineTest project in the previous
chapters. The Shooter project uses the following references: Tao.DevIL, Tao.
OpenGL, Tao.Platform.Windows, and System.Drawing. It will also need a
reference to the Engine project. To do this, the Engine project should be added to
the solution (right-click the Solution folder, choose Add
>
Existing Project,
find the Engine project, and select it). Once the Engine project exists in the
solution then the Shooter project can add it as a reference. To add the Engine
project as a reference right-click the Shooter project references folder and choose
Add Reference, navigate to the Projects tab, and choose the Engine project.
The Shooter project will use OpenGL, so in the Form editor, drag and drop a
SimpleOpenGLControl onto the form and set its Dock property to ''Fill.''
Right-click the Form1.cs and choose View Code. This file needs a game loop and
initialization code added, which is supplied below.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Engine;
using Engine.Input;
using Tao.OpenGl;
using Tao.DevIl;
namespace Shooter
{
public partial class Form1 : Form
{
¼ false;
bool
_fullscreen
FastLoop _fastLoop;
StateSystem _system ¼ new StateSystem();
Input _input ¼ new Input();
TextureManager _textureManager ¼ new TextureManager();
SoundManager
_soundManager
¼ new SoundManager();
 
Search WWH ::




Custom Search