MCPcopy Create free account
hub / github.com/Aleksoid1978/VideoRenderer / GetAdapter

Function GetAdapter

Source/DX9Helper.cpp:26–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24#include "DX9Helper.h"
25
26UINT 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
45HRESULT Dump4ByteSurface(IDirect3DSurface9* pSurface, const wchar_t* filename)
46{

Callers 2

InitMethod · 0.70
InitInternalMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected