特定の xaml コントロールのコンポジターに対してこの API 関数を呼び出すことができるかどうか疑問に思っています: https://msdn.microsoft.com/en-ca/library/windows/apps/mt620066?f=255&MSPPError=-2147217396
私が考えているのは、次のようなものです。
// Get the graphics device for the compositor
auto compositor = Window::Current().Compositor();
com_ptr<ICompositorInterop> comp_interop{ compositor.as<ICompositorInterop> };
com_ptr<ICompositionGraphicsDevice> m_compgd{nullptr};
comp_interop->GetGraphicsDevice(m_compgd.put()); // This doesn't actually exist.
// Get the rendering device
com_ptr<ICompositionGraphicsDeviceInterop> compgd_interop{m_compgd.as<ICompositionGraphicsDeviceInterop>()};
com_ptr<IUnknown> m_device{ nullptr };
check_hresult(
compgd_interop->GetRenderingDevice(m_device.put())
);
GetGraphicsDevice
ただし、利用可能な機能がないため、明らかにこれは機能しませんCreateGraphicsDevice
。