On Tue Mar 7 07:47:49 2023 +0000, Rémi Bernon wrote:
There's the IDL side and the C implementation side. The `requires` keyword is only checked and enforced on the IDL side, although I'm not sure it's even very strict, and it means that if a class declares the `ISpatialSurfaceObserverStatics2` interface, it needs to declare the `ISpatialSurfaceObserverStatics` interface too. On the C side, nothing is enforced, and although you are supposed to implement the interfaces that were declared in the IDL, it will only be a problem to not have them when something queries it. Some interfaces like `IAgileObject` are completely trivial to add, so we usually add them right away (although I think incorrectly putting them with the default interface), but otherwise you don't have to implement interfaces that are never used. Then, even on the IDL side, declaring an interface doesn't necessarily mean you need to have its definition either, and a forward declaration is sometimes enough. You only need the definition for the default runtimeclass interfaces, as the interface UUID is then required for some things (I'm not sure anymore about the details).
I see, that makes sense, thanks for the thorough explanation.
Then, even on the IDL side, declaring an interface doesn't necessarily mean you need to have its definition either, and a forward declaration is sometimes enough. You only need the definition for the default runtimeclass interfaces, as the interface UUID is then required for some things (I'm not sure anymore about the details).
I thought it would be incorrect to add just forward declarations, I wish I knew this earlier.
I'm also working on adding the `IHolographicSpace` interface and I'm already done with the headers. I only added the default runtimeclass interfaces, but there were so many dependencies even with just that. I've already added the definitions for them, but now I'm wondering if it was even necessary. It took a significant amount of time too.
I'll submit it when I'm done with the implementations.
Speaking of which, I'm not sure which functions to implement. It's not clear which one is supposed to be called first by the apps. There are 3, IsConfigured, IsSupported, and IsAvailable. According to Microsoft Learn, IsSupported is always true on 64-bit Windows, but false on 32-bit.
On Desktop PCs running 64-bit Windows, this is always true. If IsAvailable is false because the > user has not yet set up their Mixed Reality headset, calling CreateForCoreWindow anyway will guide them through the setup flow.
On HoloLens, this is always true.
On any other system, including Desktop PCs running 32-bit Windows, this is false, as Mixed Reality headsets are not supported on those systems.
IsConfigured is also similar:
On Desktop PCs running 64-bit Windows, this is initially false. Once the user has set up Mixed Reality through the Mixed Reality Portal, this becomes true. If this is false, but IsSupported is true, calling CreateForCoreWindow anyway will guide the user through the setup flow.
I'm thinking it would be a good idea to implement all 3. What do you think?