Fixed crash on context lost.

This fixes the crash on lost context for vista and windows 7 if suitable drivers are available. It now uses D3D9Ex when available and this only reports lost contexts for hardware failures and suchlike.

Testing procedure was:
- run simple_vertex_shader without this change.
- ctrl+alt+del to lock machine.
- return to desktop.
- observe that simple_vertex_shader crashes.
- repeat with this change and check that simple_vertex_shader is still animating.
- simulate the code path that an XP machine would take using the debugger and check that old behavior is preserved.

I decided to load D3D9.DLL at runtime for a couple of reasons. First, I didn't want to assume that older implementations of D3D9 would have the Direct3DCreate9Ex entry point. Second, it might be advantageous for some applications to not have a load time dependency on D3D9. I didn't address this for D3DX9 because it's a little harder - there's no clear way to determine which D3DX9_x.DLL library to open. At least D3DX9_x.DLL does not seem to import D3D9.DLL and D3DX is separately redistributable so there is still some advantage to be had.
Review URL: http://codereview.appspot.com/1951044

git-svn-id: http://angleproject.googlecode.com/svn/trunk@384 736b8ea6-26fd-11df-bfd4-992fa37f6226
4 files changed