mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-23 06:11:46 +00:00
30 lines
686 B
C++
30 lines
686 B
C++
|
#include "CIndirectMonitorContext.h"
|
||
|
#include "Direct3DDevice.h"
|
||
|
|
||
|
CIndirectMonitorContext::CIndirectMonitorContext(_In_ IDDCX_MONITOR monitor) :
|
||
|
m_monitor(monitor)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
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(swapChain, device, newFrameEvent));
|
||
|
}
|
||
|
|
||
|
void CIndirectMonitorContext::UnassignSwapChain()
|
||
|
{
|
||
|
m_thread.reset();
|
||
|
}
|