Changed Direct3D renderer to call GetAncestor() in device_create() to

get the root window

This is to make -attach_window work with non-root windows
This commit is contained in:
npwoods 2019-12-22 18:04:03 -05:00
parent 6a457210e8
commit dd8f98b56d

View File

@ -801,8 +801,12 @@ void renderer_d3d9::update_gamma_ramp()
// device_create
//============================================================
int renderer_d3d9::device_create(HWND device_hwnd)
int renderer_d3d9::device_create(HWND hwnd)
{
// identify the actual window; this is needed so that -attach_window
// can work on a non-root HWND
HWND device_hwnd = GetAncestor(hwnd, GA_ROOT);
// if a device exists, free it
if (m_device != nullptr)
{