Skip to Content
Programming 2D Games
book

Programming 2D Games

by Charles Kelly
June 2012
Beginner
438 pages
15h 26m
English
A K Peters/CRC Press
Content preview from Programming 2D Games
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning 3D Game Programming

Beginning 3D Game Programming

Tom Miller

Publisher Resources

ISBN: 9781466508705