8.
Direct3D
DirectX TK (Toolkit)
There is a collection of helper classes united under the name of DirectX Tool Kit [4] - or in
short DirectX TK - started by Shawn Hargreaves. This library contains convenience classes
that help write code that uses Direct X. It also contains a tool called MakeSpriteFont that
can create fonts to be used in game.
Download link: http://directxtk.codeplex.com/releases/view/98986

19.
Face and Vertex Normal Vectors
• Each face in a mesh has a perpendicular unit
normal vector
• The vector's direction is determined by the order
in which the vertices are defined and by whether
the coordinate system is right- or left-handed
• The face normal points away from the front side
of the face
• In Direct3D, only the front of a face is visible
• A front face is one in which vertices are defined in
clockwise order.

26.
Texture Mapping
0 (0,0) 1 (300,0)
2 (300,300)3 (0,300)
0.0 1.0
1.0
U
V
• Texturing allows adding photographs and other images onto polygon faces
• The format of the textures are Direct Draw Surface (.dds) files
• In the texel coordinate system, the width value is named "U" and the height value is named "V“:
• The width goes from 0.0 on the left to 1.0 on the right
• The height goes from 0.0 on the top to 1.0 on the bottom
Texel Coordinate System

28.
Choosing the right project template for your game
Direct3D
Direct3D
with XAML
XAML with
Direct3D
UI (XAML) No Yes Yes
Exclusive Features No Yes Yes
Acts as a XAML
control (can be
placed anywhere on
the screen, above or
next to other XAML
controls)
No No Yes
Features
Exclusive Features:
• Background Agents
• Browser Control
• Map Control
• Background Transfer Service
• Live Tiles
• Push Notifications
• The Windows Phone Ad Control
• Localized resources
• XAML controls

31.
Direct3D with XAML app
Uses the DrawingSurfaceBackgroundGrid control
• Render graphics that are displayed across the entire background of your app, behind any XAML
controls in your UI
• Must be the root element of the XAML tree and is always the full size of the screen
Structure
• Made up of two components: a XAML-based Windows Phone app and a component that’s based on
the Windows Phone Runtime
• The XAML engine creates and maintains a Direct3D graphics device. Once per frame, the XAML
engine passes the graphics device and an associated render target to the Windows Phone Runtime
component
Main classes
• MainPage: hosts your XAML-based UI and your managed code
• CubeRenderer: where the actual drawing to the shared texture is performed
• PhoneDirect3DXamlAppComponent: contains touch input handling

33.
XAML with Direct3D app
Uses the DrawingSurface control
• Render graphics that are displayed behind or inline with XAML controls and content
• The size and layout of your DrawingSurface are handled just as they are with other XAML controls
Structure
• Made up of two components: a XAML-based Windows Phone app and a component that’s based on
the Windows Phone Runtime
• The Windows Phone Runtime component creates a Direct3D graphics device, which it uses to create
a Texture that is shared with the XAML app. The Windows Phone Runtime component uses Direct3D
to draw onto the Texture. The XAML engine maintains a swap chain that copies the texture to the
screen within the bounds of the DrawingSurface control
Main classes
• MainPage: hosts your XAML-based UI and your managed code
• CubeRenderer: where the actual drawing to the shared texture is performed
• Direct3DInterop: contains touch input handling

47.
mcpp preprocessor
http://mcpp.sourceforge.net/
• Implements all ofC90, C99 and C++98 specifications.
• Provides a validation suite to test C/C++ preprocessor's conformance and
quality comprehensively.When this validation suite is applied, mcpp
distinguishesitself among many existing preprocessors.
• Has plentiful and on-target diagnostics to check all the preprocessing
problems such as latent bug or lack of portability in source code.
• Has #pragma directives to output debugging information.
• Is portable and has been ported to many compiler-systems, includingGCC
andVisual C++, on UNIX-like systems andWindows.
• Has various behavior modes.
• Can be built either as a compiler-specificpreprocessor to replace the
resident preprocessor of a particular compiler system, or as a compiler-
independent command, or even as a subroutine called from some other
main program.
• Provides comprehensive documents both in Japanese and in English.
• Is an open source software released under BSD-style-license.