| 24 | #include "DX9Helper.h" |
| 25 | |
| 26 | UINT GetAdapter(HWND hWnd, IDirect3D9Ex* pD3D) |
| 27 | { |
| 28 | CheckPointer(hWnd, D3DADAPTER_DEFAULT); |
| 29 | CheckPointer(pD3D, D3DADAPTER_DEFAULT); |
| 30 | |
| 31 | const HMONITOR hMonitor = MonitorFromWindow(hWnd, MONITOR_DEFAULTTONEAREST); |
| 32 | CheckPointer(hMonitor, D3DADAPTER_DEFAULT); |
| 33 | |
| 34 | const UINT adapterCount = pD3D->GetAdapterCount(); |
| 35 | for (UINT adapter = 0; adapter < adapterCount; ++adapter) { |
| 36 | const HMONITOR hAdapterMonitor = pD3D->GetAdapterMonitor(adapter); |
| 37 | if (hAdapterMonitor == hMonitor) { |
| 38 | return adapter; |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | return D3DADAPTER_DEFAULT; |
| 43 | } |
| 44 | |
| 45 | HRESULT Dump4ByteSurface(IDirect3DSurface9* pSurface, const wchar_t* filename) |
| 46 | { |
no outgoing calls
no test coverage detected