The code for direct3dx