Graphics Reference
In-Depth Information
2. If the application gets busy (e.g., bursts of user activity) and is short on
idle time, there is a chance that the simulation may lag behind real-time,
resulting in an inconsistent display.
In practice, modern machines are fast enough that idle cycles are almost always
available. Many commercial applications are developed with updates during the
OnIdle events. For dependable and predictable update rates, we have chosen to
compute simulations during the application-programmed OnTimer events.
2.6
Tutorials and Code Base
Modern GUI APIs are highly sophisticated, often with steep initial learning curves.
When learning to work with a GUI API, we should constantly remind ourselves
that ultimately, we are interested in building interactive graphics programs. Our
goal is not to become an expert in GUI programming. Rather, we are interested
in understanding the principles of working with the GUI API such that we can
start building graphics applications. In this section, we use MFC to experience
the different aspects of event programming studied. It is important to understand
the underlying concepts behind the APIs and then be comfortable with using one
of the APIs. The important lesson we should learn from the short history of our
discipline is that APIs change and evolve rapidly; we must always be ready to
learn new ones.
The tutorials from this section serve two purposes, to demonstrate how to
work with a GUI API and how to work with MFC. In the beginning of each
tutorial, explicit goal and approach statements identify the key ideas that will be
demonstrated in the tutorial. These are API-independent statements, where to
work with any GUI API, one must understand how to accomplish these tasks.
Typically the procedures involved in programming with different GUI APIs may
be different, but the end results contain similar elements (e.g., control variables
with appropriate data types, event service routines via object-oriented override
and/or via callback function registration, etc.).
In the following tutorials, we describe the results of working with MFC and
relate these results to what we learned from earlier sections. For a detailed step-
by-step how-to for working with the MFC resource editor and the details of
building every tutorial in this chapter, see the MFC guide on the accompany-
ing CD by William Frankhouser. To demonstrate the concepts presented are in-
deed language- and GUI API-independent, the following tutorials are also im-
plemented in C# and the WinForm API. The corresponding detailed step-by-step
Search WWH ::




Custom Search