Graphics Reference
In-Depth Information
- (C) Controller component. These are GUI window element mouse
events; these routines report the status of the mouse when it is inside
the GUI drawing area.
uwbgl _ WindowHandler1.h/.cpp (in Common Files/WindowHandler
subfolder).
UWB _ WindowHandler .
Notice
This is a subclass of and defines an API-independent imple-
that
in
this
case,
mentation of the pure virtual IWindowHandler . As illustrated in Figure 5.6,
the WindowHandler is meant to be subclassed by each application to cus-
tomize view/controller functionality. We will discuss the functions declared
here in detail as we encounter their implementation in the tutorials.
UWB _ WindowHandler
does
not have the I .
There are two files in the Header Files folder.
uwbgl _ D3DDefines.h . This include file defines compilation parameters.
We will not change this file.
class: IWindowHandler
Core behavior
Pure abstract
uwbgl _ D3D _ Lib1.h . This is the complement of the uwbgl _ MFC _ Lib1.h
header file. When developing programs based on this library, we must in-
clude this header file in our source file.
class: WindowHandler
API independent
implementation
Reference to UIWindow
There are eight files in the D3D Files folder.
class: D3D_WindowHandler
D3D specific
implementation
Reference to D3D RC
uwbgl _ D3DCircleGeom1.h/.cpp and uwbgl _ D3DRectangleGeom1.h/
.cpp (in D3D_Geoms subfolder). These four files define the basic func-
tionality for drawing of circles and rectangles. We saw the details of these
classes in Tutorial 3.3 and Tutorial 3.5.
class: DrawOnlyHandler
applicaiton specific
implementation
Instance of UIWindow
uwbgl _ D3DGraphicsSystem1.h/.cpp (in D3D_GraphicsSystem sub-
folder). These two files implement the interface to the graphics API (see
Figure 5.4 ) . We developed the earlier version of this class in Tutorial 4.3.
The major difference here is that we have delegated the drawing function-
ality BeginDraw() and EndDrawAndShow() to the WindowHandler class.
Figure 5.6. The Win
dowHandler hierarchy.
uwbgl _ D3D _ Lib.h
uwbgl _ MFC _ Lib.h . In all tu-
torials, these two files are in-
cluded by the StdAfx.h file.
Since all of our source files
must include StfAfx.h for
a precompiled header, these
two library header files are in-
cluded by all of our source
files.
uwbgl _ D3DWindowHandler1.h/.cpp (in D3D_WindowHandler subfold-
er). These two files implement the UWBD3D _ WindowHandler class. As
illustrated in Figure 5.6, this is the D3D API-specific implementation of the
WindowHandler . This class establishes the reference to the D3D device and
supports D3D-specific BeginDraw() and EndDrawAndShow() functions.
The ModelView Project
With the support from the above two libraries, the actual project source code is
relatively straightforward. There are two classes we should pay attention to.
Search WWH ::




Custom Search