Share via


Step 4: Set Up Notifications

The last bit of DirectMusic code inside the InitializeGame function is a request for notification when playback of the primary segment reaches a beat boundary or the end of the segment. As you will see later in this tutorial, the notification mechanism is used to limit the number of blowup motifs that can be played at the same time.

The following code adds the notification types. Note that the notification GUIDs have to be placed in a variable, because they are passed by reference.

GUID guid;
guid = GUID_NOTIFICATION_SEGMENT;
gpPerformance->AddNotificationType( guid );
guid = GUID_NOTIFICATION_MEASUREANDBEAT;
gpPerformance->AddNotificationType( guid );

Next: Step 5: Create the Primary Segments

 Last updated on Monday, April 12, 2004

© 1992-2002 Microsoft Corporation. All rights reserved.