looking-glass/idd/LGIdd/CIndirectMonitorContext.cpp
Geoffrey McRae 0c3dce3ca6 [idd] implemented frame feed from the guest (very hacky)
This is NOT READY for general consumption, if you decide to make
use of this driver, DO NOT ASK FOR SUPPORT.
2023-04-11 16:55:58 +10:00

31 lines
No EOL
757 B
C++

#include "CIndirectMonitorContext.h"
#include "Direct3DDevice.h"
CIndirectMonitorContext::CIndirectMonitorContext(_In_ IDDCX_MONITOR monitor, CIndirectDeviceContext * device) :
m_monitor(monitor),
m_devContext(device)
{
}
CIndirectMonitorContext::~CIndirectMonitorContext()
{
m_thread.reset();
}
void CIndirectMonitorContext::AssignSwapChain(IDDCX_SWAPCHAIN swapChain, LUID renderAdapter, HANDLE newFrameEvent)
{
m_thread.reset();
auto device = std::make_shared<Direct3DDevice>(renderAdapter);
if (FAILED(device->Init()))
{
WdfObjectDelete(swapChain);
return;
}
m_thread.reset(new CSwapChainProcessor(m_devContext, swapChain, device, newFrameEvent));
}
void CIndirectMonitorContext::UnassignSwapChain()
{
m_thread.reset();
}