
2779.5. Message Dialog
// Initialize messageDialog
messageDialog = new MessageDialog();
messageDialog->initialize(graphics, input, hwnd);
Listing 9.20. Initializing the MessageDialog object.
input->readControllers(); // Read state of controllers
messageDialog->update(); // Check for button clicks
audio->run(); // Perform periodic sound engine tasks
Listing 9.21. Checking for button clicks.
e MessageDialog is initialized in the Game::initialize function (Listing 9.20).
We need to call the dialog’s update method to check for a button click. e code is added to
the run function in the Game class (Listing 9.21). A call to the dialog’s draw method ...