compilation fixes

some modifications for compiling under Windows XP with DirectX 9 SDK (D3DX_SDK_VERSION=9) and Microsoft SDK 7.0.
and add auto-detection of 'old DirectX' in cmake.