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
Load resources on a seperate thread #815
Comments
This has (kind of) been discussed in #251. The problem is, as you correctly stated, that everything wants a A (not great) workaround I did was to load resources one after another, a single resource each frame in order to not freeze the UI completely, but still show a progress bar on a loading screen. |
What if this problem were solved by adding something new to the ggez API? One idea I had is that this functionality could be implemented on a type
If we want to get fancy, we could add async asset loading right to
|
The async loader concept is one I've considered, note that the |
The library |
Oooh, the |
I'm closing this basically because I'm not going to do this without a major redesign, which is not on my to-do list any time soon. Both OpenGL and |
I am trying to load images to draw on a separate thread which I show a loading progress bar on the main thread. It is currently hard to do this with ggez because all of the functions for load data, both in the
filesystem
module and thegraphics::Image
type require access to theContext
, which I cannot pass to a different thread nor duplicate. None of the examples or docs seem to explain how this could be accomplished.Some alternatives I have considered
ggez
features, and I still need to get spirtes into a type thatggez::graphics
can draw.Image::from_rgba8
function to load them. I think this requires an entirely new dependency to handle converting a png to the rgba8 format. I would need to use the same process for audio.Since loading on a different thread is very common, I think an example of how to do this would be helpful for ggez users. If anyone has suggestions for a good way to load assets on another thread I would be happy to write up a guide and example to help future users of the library.
The text was updated successfully, but these errors were encountered: