DirectX errors mean the graphics runtime or driver needs attention.
Install the latest graphics driver from NVIDIA, AMD or Intel.
Run Windows Update to get the current DirectX components.
Verify/repair the game files.