I've installed DirectX 9 and 10 and the error still occurs. I'm attaching my system settings, if it's any help.
I have no idea how to check if my version of DirectX isn't corrupt, but I thought that reinstalling it would fix the problem. Unfortunately it didn't.