Closed MOj0 closed 2 years ago
sigh, that should be fixed asap indeed. Thanks for sharing.
I don't know what the problem is either, but I assume miniquad now being at 0.3.13 while I still use an old alpha might likely be the culprit. High time to update that.
Ok, I looked into it, but I fear I don't see an elegant solution to this.
With EventHandlerFree
disappearing I think I'd have to restructure everything to no longer store the miniquad context (because we can't), but to instead hand it through, coming from update
and draw
, everywhere where it was used before.
This makes everything a bit more clunky, but it's not the end of the world.
I'm pretty optimistic that this would fix the problem, as miniquad would be in sync again, but to be honest I'm not sure if I'll get up the motivation to do this soon, with ggez aiming for its own Android support somewhere in the not-too-soon future.
But I guess I'll try. It's not that much work.
EDIT: Another approach would be to write an instruction on how to get older version of cargo-quad-apk
running yourself, without depending on the latest docker image. This would have the benefit of enabling people to keep on building for Android even with older versions of gwg. And it would also be most correct in terms of this being a recurring problem otherwise...
But in the end it would probably be best to do both, meh... I don't think I'll write the latter thing though, as I just have to little experience with Docker to give any reliable advice on this.
OK.
I just released 0.6.0 . In it I changed everything to respect the loss of EventHandlerFree
, making us hand around quad_ctx
a lot.
I checked everything except the Android build. If your project is simple enough to adapt to the new changes I'd be very thankful if you could perhaps try it again with these changes. Or perhaps it's way simpler to just try one of the examples, but I'm just done for today (and busy tomorrow).
So... now that I did all this I wondered: "Well, this is annoying. How does macroquad
solve this?"
And what do you know, they just solve it by storing the miniquad context inside of a big juicy unsafe static variable: ^^
static mut CONTEXT: Option<Context> = None;
...
miniquad::start(
conf::Conf {
sample_count: 4,
..config
},
|ctx| {
unsafe {
MAIN_FUTURE = Some(Box::pin(future));
}
unsafe { CONTEXT = Some(Context::new(ctx)) };
Box::new(Stage {})
},
);
To be honest I feel a bit stupid now. Maybe that would have been the way to go and I'll do so in the next version as well...
OS: Ubuntu 22.04.1 LTS
I cloned the repository and when I run the following command in the root folder:
sudo docker run -e RUST_BACKTRACE='full' --rm -v $(pwd)":/root/src" -w /root/src notfl3/cargo-apk cargo quad-apk build --example meshbatch
I get this output:I'm not sure what could be the problem, however when I ran the same command in the miniquad repo the build completed and it worked successfully on my Android device.