-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Exception thrown when loading an image on Windows #20
Comments
Hi @bijington, I have done a little workaround for the windows environment. Here is the updated GameSceneView class that will handle the missing GlobalCreator initialization:
Also you can make the image loading Lazy like this:
|
@paramsaggu thank you for this update. Does this change prevent the possible COM exceptions that is mentioned here? dotnet/Microsoft.Maui.Graphics#422 (comment) I am definitely keen to follow this issue. I do believe the actual I like the idea of Lazy loading! We are actually discussing how to improve the efficiency around loading images and sharing them over at #19 so this could really help that! |
@bijington I have committed the changes in the fork of this repository. And recently I found that if you load images after GameView is Loaded, the GlobalCreator will automatically get initialized. |
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.
Originally posted by @aluitink in #4 (comment)
The text was updated successfully, but these errors were encountered: