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 ...
Get Beginning 3D Game Programming now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.