简体   繁体   中英

HoloLens DirectX C# app: Is it possible to show some text on the slate?

I've created my HoloLens application from the "Holographic DirectX 11 App (Universal Windows)" template. When I start the app, it shows a slate (a 2D window) in the HoloLens and I need to place it in the space. Then my app will work as a hologram (in an immersive view).

Before going to the immersive view, I want to check some conditions and show a message to the user, if the application cannot start.

Currently, my app does not have any XAML code.

It uses SharpDX library.

Can I write some text on the slate window?

I understand that this is an old question, but I will answer just in case somebody else needs to do something similar.

There are two possible ways to do that:

1) Perhaps the easiest way is to start your app as a XAML app and then, if everything is alright, to switch to DirectX mode, otherwise write your message on the main XAML window of the app. You could also provide a "Go Holographic" button for the user. There is a very good blog post here by Jonathan Antoine, which explains how to perform the switch between XAML and Holographic mode in detail- it also provides the source code

2) Another solution is to write your text to a DirectX texture and then paint that texture onto a rectangle in the 3D immersive mode. But that one is probably not exactly what you want since you'll need to switch to Holographic mode first and it is a fair amount of work

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM