Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orbit Not compiling for windows #4

Closed
aliessmael opened this issue Jul 11, 2022 · 10 comments
Closed

Orbit Not compiling for windows #4

aliessmael opened this issue Jul 11, 2022 · 10 comments
Labels
bug Something isn't working

Comments

@aliessmael
Copy link

Compiling Orbit for windows machine gives theses errors.

image

@bijington
Copy link
Owner

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?

@bijington bijington added the bug Something isn't working label Jul 11, 2022
@mattleibow
Copy link

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.

@bijington
Copy link
Owner

@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

@aliessmael
Copy link
Author

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

image

@aliessmael
Copy link
Author

Got it running on android emulator, but look like there is display issue.
Any way thanks for the demo it is helpful.

image

@bijington
Copy link
Owner

@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.

@bijington
Copy link
Owner

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

@bijington
Copy link
Owner

This should now be resolved since c7c154a

@aluitink
Copy link

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.

@bijington
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants