Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

m_deviceResources->GetD2DDeviceContext() always returns null

I need to render plain text in a Holographic App, My code is based on Holographic Facetracking Sample (https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/HolographicFaceTracking/cpp) and the DirectX spiningcube UWP Template (SampleFpsTextRenderer class to be precise), the problem is when I try to access to
m_deviceResources->GetD2DDeviceContext();

It always returns null so a npe appears.

In my DevicesResources.h file I have:

    // D2D accessors.
    ID2D1Factory2*          GetD2DFactory()                 const { return m_d2dFactory.Get();      }
    IDWriteFactory2*        GetDWriteFactory()              const { return m_dwriteFactory.Get();   }
    IWICImagingFactory2*    GetWicImagingFactory()          const { return m_wicFactory.Get();      }

    ID2D1DeviceContext1*    GetD2DDeviceContext()           const { return m_d2dContext.Get(); }
    D2D1::Matrix3x2F    GetOrientationTransform2D()     const { return m_orientationTransform2D; }

 // Direct2D factories.
    Microsoft::WRL::ComPtr<ID2D1Factory2>                   m_d2dFactory;
    Microsoft::WRL::ComPtr<IDWriteFactory2>                 m_dwriteFactory;
    Microsoft::WRL::ComPtr<IWICImagingFactory2>             m_wicFactory;

    Microsoft::WRL::ComPtr<ID2D1DeviceContext1>             m_d2dContext;

Any idea of what the problem can be?.

PS. Device m_deviceResources is not null, I used breakpoint to check this.

Sign In or Register to comment.