Orbit Not compiling for windows
aliessmael opened this issue · 10 comments
Sorry it looks like I haven't ever tried to build this for Windows and also that I completely missed the banner on this documentation page: https://docs.microsoft.com/en-us/dotnet/maui/user-interface/graphics/images that states
Warning
The PlatformImage type isn't supported on Windows.
I haven't seen a clear way to load an image for this just yet. Are you able to build and run on a different target for now?
The issue is because the shared package does not actually support windows - and there is a separate nuget for windows: https://www.nuget.org/packages/Microsoft.Maui.Graphics.Win2D.WinUI.Desktop
However, this uses all different type names W2DImage and stuff :(
Hopefully I can get a combined package for net7 or sooner.
The reason this is like this is because technically there are 3 windows backends... So none are in the main package. There was XAML, SharpDX and Win2D. We picked Win2D for maui and are going to make that the default/in-box.
But for now, windows TFMs use that package instead.
@mattleibow thank you so much for the insight here!
I will have a play with that linked package for now to see if there is a way to make the image loading part work on Windows.
Thanks again
Sorry it looks like I haven't ever tried to build this for Windows and also that I completely missed the banner on this documentation page: https://docs.microsoft.com/en-us/dotnet/maui/user-interface/graphics/images that states
Warning
The PlatformImage type isn't supported on Windows.I haven't seen a clear way to load an image for this just yet. Are you able to build and run on a different target for now?
Yes it is building fine for android but still struggling with emulator deployment, also I had to remove windows support to skip the compile errors
@aliessmael thanks for that screenshot. I am in the process of trying to separate out state from display and this may well help to solve this issue.
It seems I have also been testing this in a landscape mode on my Mac so all of this stuff is really helpful to show issues with the rendering.
I should also have pointed out that this is very much a work in progress, I am hoping to get to an MVP release in the coming weeks/months. So feedback like this is really helpful
This might not be completely fixed?
When invoking "new W2DImageLoadingService().FromStream(stream)" I see this exception:
System.Exception: 'No resource creator has been registered globally or for this thread.'
I found the following open issue:
IImageLoadingServcie cannot load image on Windows
The suggested workaround to connect a GlobalCreator after the GraphicsView is loaded partially solves this issue.
Exception will be thrown until the GraphicView "Loaded" handler workaround is invoked, so you would need to defer resource loading until after Loaded is triggered.
I used a Lazy to load the resources on the first Render call to the GameObject.
Well it still compiles 😉. All jokes aside that bug doesn't look good but I really appreciate you sharing the underlying bug detail and potential workaround. I'm not on my computer right now but I'll open a new issue when I am including your details so it will be easier to track.