Game Development Reference
In-Depth Information
BehaviorFlags —Specify either D3DCREATE_HARDWARE_
VERTEXPROCESSING or D3DCREATE_SOFTWARE_VERTEX-
PROCESSING for this parameter
pPresentationParameters —Specifies an initialized
D3DPRESENT_PARAMETERS instance that defines some of the
characteristics of the device
ppReturnedDeviceInterface —Returns the created device
Example call:
IDirect3DDevice9* device = 0;
hr = d3d9->CreateDevice(
D3DADAPTER_DEFAULT, // primary adapter
D3DDEVTYPE_HAL, // device type
hwnd, // window associated with device
D3DCREATE_HARDWARE_VERTEXPROCESSING, // vertex processing type
&d3dpp,
// present parameters
&device);
// returned created device
if( FAILED(hr) )
{
::MessageBox(0, "CreateDevice() - FAILED", 0, 0);
return 0;
}
1.5 Sample Application: Initializing Direct3D
For this chapter's sample, we initialize a Direct3D application and clear
the screen to black (see Figure 1.7).
Figure 1.7:
Screen shot of
the sample for
this chapter
Search WWH ::




Custom Search