microsoft / OpenXR-MixedReality

OpenXR samples and preview headers for HoloLens and Windows Mixed Reality developers familiar with Visual Studio
https://aka.ms/openxr
MIT License
336 stars 96 forks source link

Some XrHandles can't be readily used in additional dlls that don't consume the openxr loader #78

Closed chrisfromwork closed 2 years ago

chrisfromwork commented 3 years ago

class definitions for items like SpaceHandle use xr* functions that requiring linking against the loader lib. It would be great if these classes could be defined in a manner where xrGetInstanceProcAddr/function pointers can be used, so that these helper handles can be used in dlls that don't link against the loader lib/setup the openxr experience.

This isn't a blocking issue, folks can unblock themselves by using UniqueExtHandles + manually providing the destroy function obtained through xrGetInstanceProcAddr.

yl-msft commented 3 years ago

Great feedback! The workaround of using UnqiueExtHandles is the right way to do this. Would be nice if the library can do this automatically.