examples/dx9/dx9.cpp
// this function initializes and prepares Direct3D for use

this function initializes and prepares Direct3D for use
this function initializes and prepares Direct3D for use
void initD3D(HWND hWnd)
{
    d3d = Direct3DCreate9(D3D_SDK_VERSION);    
    D3DPRESENT_PARAMETERS d3dpp;    
    ZeroMemory(&d3dpp, sizeof(d3dpp));    
    d3dpp.Windowed = TRUE;    
    d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;    
    d3dpp.hDeviceWindow = hWnd;    
    d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8;    
    d3dpp.BackBufferWidth = SCREEN_WIDTH;    
    d3dpp.BackBufferHeight = SCREEN_HEIGHT;    
    d3d->CreateDevice(
        D3DADAPTER_DEFAULT,
        D3DDEVTYPE_HAL,
        hWnd,
        D3DCREATE_SOFTWARE_VERTEXPROCESSING,
        &d3dpp,
        &d3ddev);
}
void initD3D ( HWND hWnd ) { d3d = Direct3DCreate9 ( D3D_SDK_VERSION ) ; D3DPRESENT_PARAMETERS d3dpp ; ZeroMemory ( & d3dpp , sizeof ( d3dpp ) ) ; d3dpp . Windowed = TRUE ; d3dpp . SwapEffect = D3DSWAPEFFECT_DISCARD ; d3dpp . hDeviceWindow = hWnd ; d3dpp . BackBufferFormat = D3DFMT_X8R8G8B8 ; d3dpp . BackBufferWidth = SCREEN_WIDTH ; d3dpp . BackBufferHeight = SCREEN_HEIGHT ; d3d -> CreateDevice ( D3DADAPTER_DEFAULT , D3DDEVTYPE_HAL , hWnd , D3DCREATE_SOFTWARE_VERTEXPROCESSING , & d3dpp , & d3ddev ) ; }
this function initializes and prepares Direct3D for use
this function initializes and prepares Direct3D for use
// create the Direct3D interface
 // create a struct to hold various device information
 // clear out the struct for use
 // program windowed, not fullscreen
 // discard old frames
 // set the window to be used by Direct3D
 // set the back buffer format to 32-bit
 // set the width of the buffer
 // set the height of the buffer
 // create a device class using this information and information from the d3dpp stuct
