Implement A New Command

Case Study: LODCullEnable

This is a very simple command that performs a very specific action and then terminates. This command instructs the rendering pipeline to toggle the level-of-detail culling flag. The result of this command is that level-of-detail culling is enabled or disabled depending on the current state.

Source Code

Please download the following source code for each example.

Explanation

This command is separated into three key sections:

Header/Includes

The header and includes determine the module to which the command is linked and the module responsible for presenting the command. The command header and includes are as follows:

This is a picture of the command header.

Command Declaration

The command declaration registers the command as a "command" and contains a GUID used by the shell to distinguish the command from all others. The command declaration is as follows:

This is a picture of the command declaration.

Command Implementation

The command Implementation implements the command. This section starts with the command source name, command category, and icon specification. The command implementation is as follows:

This is a picture of the command implementation.