You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found that "pub fn to_rgba8(&self, ctx: &mut Context) -> GameResult<Vec>" is not implemented in gwg. Do we have any other method to do the same ? If not, what steps do we need to implement it in gwg ?
Hmm, good question.
We'd probably need to look into miniquads Texture type and how it can be serialized.
From what I can see our only option would be to use gl_internal_id to get the raw OpenGL-handle which we could then probably use to copy the texture GPU-buffer into a CPU-one that we specify, similar to how it works in ggez.
That would require to use some raw OpenGL-calls, accessible through the gl-context that is provided through the miniquad-context which is part of the gwg-context. But, I am not that used to working with OpenGL directly, so I don't spontaneously know what the necessary steps / functions would be exactly and I'm currently sadly a bit busy, so it's not very likely that I'll look into it soon, but I'll try to do so once things get better (which will probably take a couple of weeks sadly). That and working out the asset-cache-thing so that we can finally upgrade to newer miniquad versions...
No issues, I managed to do the same with the image crate. Something like:
image = include_bytes!("../resources/image.png");
rgba = image::load_from_memory(image).unwrap().to_rgba().into_raw();
Thanks !
I found that "pub fn to_rgba8(&self, ctx: &mut Context) -> GameResult<Vec>" is not implemented in gwg. Do we have any other method to do the same ? If not, what steps do we need to implement it in gwg ?
I'm looking to the source code at:
https://github.com/ggez/ggez/blob/master/src/graphics/image.rs
And I'm thinking that maybe this is too much for me :)
Thanks.
The text was updated successfully, but these errors were encountered: