Graphics Reference
In-Depth Information
Inconsistent state. Notice that the mouse events are serviced as soon as they are
triggered. This is in contrast with Tutorial 5.1, where the effects of user actions to
the circle radius controls were delayed until the periodic timer events. However,
in both cases, redraw of application window only occurs at the timer event. In this
case, after the user causes changes to the circle and before the timer event trig-
gers, the application window will be showing an out-of-date circle. The graphics
display and the application state may be inconsistent. However, once again, we
emphasize that the timer events will trigger every 25 msec. This means that the
maximum period of inconsistency will be less than 25 msec. This is undetectable
by the user.
UWBGL_D3D_Lib2
Change summary. See p. 511
for a summary of changes to
the library.
Tutorial 5.2 is linked with version 2 of the UWB D3D library ( UWB _ D3D _ Lib2 ).
There are two changes between versions 1 and 2.
1. WindowHandler::HardwareToDevice() . As we saw in Listing 5.15,
this function transforms points with origin at upper-left corner (hardware
coordinate) to origin located at lower-left corner (device coordinate).
2. UWB _ EchoToStatusArea(const char * ) function.
This is a general-
UWB_EchoToStatusArea().
The implementation of this
function can be found in the
UWB _ D3D _ Lib2 project in files
uwbgl _ Utility1.h/.cpp in
the Common folder.
purpose function that is capable of echoing string messages to a designated
status area. We, as the programmer, must create the GUI element to repre-
sent the designated status area and connect the appropriate control variable
for this function to operate properly.
(a) During the layout of GUI elements, create a GUI element with GUI
ID of IDC _ STATUS in the main application window ( CTutorialDlg ).
(b) During initialization of CTutorialDlg ,inthe OnInitDialog() func-
tion, connect the GUI element to UWB _ hEchoWindow control variable
with the following code.
Source file.
TutorialDlg.cpp
in
the
// obtain the reference to the GUI element
CWnd * pWnd = GetDlgItem(IDC _ STATUS);
// connect the GUI element to control variable
if (pWnd) UWB _ hEchoWindow = pWnd->m _ hWnd;
// at this point the function
UWB _ EchoToStatusArea( "OnInitDialog _ Complete" );
// will echo the message to the GUI element
Source Files
folder
of
the
D3D _ MouseInput project.
Search WWH ::




Custom Search