O'Reilly logo

Beginning 3D Game Programming by Tom Miller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Enumerating All Device Options

Now you're ready to have the framework start enumerating the devices on your system. First, declare a constructor for the game engine class, and pass in the sample framework's instance you've created from main. See Listing 3.3.

Listing 3.3. Adding a Constructor
private Framework sampleFramework = null; // Framework for samples
/// <summary>Create a new instance of the class</summary>
public GameEngine(Framework f)
{
    // Store framework
    sampleFramework = f;
}

The constructor doesn't do anything other than store the sample framework instance because that is required for almost everything that happens within the game. One of the first things the sample framework does after you invoke it is try to enumerate all the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required