Added a second perspective projection function.
Fixed possible crash when setting render targets in D3D9 backend.