Graphics Reference
In-Depth Information
class
CDrawHandler :
public
UWBD3D
_
WindowHandler {
public
:
DrawGraphics();
// To draw the application window
protected
:
// The application window in MFC
WBMFC
_
UIWindow m
_
Window;
To remind ourselves:
// the following are defined in the super classes:
// UWB
_
WindowHandler and UWBD3D
_
WindowHandler
A:
// This is the link to the D3D Device
Source file.
Pseudocode; no
corresponding source file.
LPDIRECT3DDEVICE9
m
_
pD3DDevice;
.
// The WC Window bounds
B:
UWB
_
BoundingBox m
_
WCWindow;
// Computes and Loads:
M
w
2
n
to
M
V
C:
D:
LoadW2NDCXForm( ... );
// Transform points from DC to WC
DeviceToWorld( ... );
}
CDrawHandler::DrawGraphics() {
.
// initialized to
I
4
E:
D3DXMATRIX
identity; D3DXMatrixIdentity(&identity);
//
M
W
←−
I
4
(initialize OC to WC transform)
m
_
pD3DDevice->SetTransform(D3DTS
_
WORLD,&identity);
//
M
V
←−
M
w
2
n
(WC to NDC)
LoadW2NDCXform();
// Clears the hardware buffer
m
_
pD3DDevice->Clear( ... );
// draws the scene with models defined by
SceneNode
and
Primitive
F:
theApp.GetModel().DrawModel();
.
}
Listing 15.1.
The pseudocode of a typical 2D
WindowHandler
.
Search WWH ::
Custom Search