Introduction - If you have any usage issues, please Google them yourself
DirectXbool Direct3D::InitDirect()
{
IDirect3D9* d3d9
d3d9=Direct3DCreate9(D3D_SDK_VERSION)
D3DPRESENT_PARAMETERS d3dpp
ZeroMemory(&d3dpp,sizeof(d3dpp))
d3dpp.BackBufferHeight=m_fHeight
d3dpp.BackBufferWidth= m_fWidth
d3dpp.BackBufferCount=1
d3dpp.Windowed= m_bWindowed
d3dpp.hDeviceWindow=m_hWnd
d3dpp.BackBufferFormat= D3DFMT_A8R8G8B8
d3dpp.AutoDepthStencilFormat= D3DFMT_D24S8
d3dpp.MultiSampleType= D3DMULTISAMPLE_NONE
d3dpp.EnableAutoDepthStencil= true
d3dpp.Flags=0
d3dpp.SwapEffect=D3DSWAPEFFECT_DISCARD
if(d3d9)
{
HRESULT hr=d3d9->CreateDevice(D3DADAPTER_DEFAULT,m_d3dType,m_hWnd,D3DCREATE_SOFTWARE_VERTEXPROCESSING,&d3dpp,&m_d3dDevice)
if(FAILED(hr))
return false
}
return true
}