是否可以在Windows合成api中获取给定合成器的渲染设备?

时间:2018-09-02 18:07:06

标签: uwp com uwp-xaml c++-winrt

我想知道是否有可能以某种方式为给定的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

0 个答案:

没有答案