asny / three-d

2D/3D renderer - makes it simple to draw stuff across platforms (including web)
MIT License
1.24k stars 105 forks source link

priotirize osmesa over glutin conext builder #379

Closed adhami3310 closed 11 months ago

adhami3310 commented 11 months ago

From manual testing on a machine without a display backend, attempting to create EventLoop will cause a panic, thus preventing it from attempting to create an osmesa instance which could work without a display backend. Simply reordering the lines (and removing unnecessary passing of the event loop back to the caller) fixes the issue and it does attempt osmesa first.

adhami3310 commented 11 months ago

there's some unneeded space in headless but there seems to be other formatting issues?

asny commented 11 months ago

First of all, thanks for the suggestion, it sure makes sense. Did you test that it works when not using osmesa? I've had a lot of issues earlier, so I'm not too fond of changing this 😬

About the formatting issues, I think you just need to run cargo fmt 🙂

adhami3310 commented 11 months ago

Did you test that it works when not using osmesa?

So I cannot confirm it works when not having osmesa installed as my system and docker images have osmesa enabled. If you don't have osmesa installed you can test this by running the headless example with cargo run --example headless --features="headless"

What I can confirm, is that it works perfectly fine when having osmesa enabled. I can find someone with no osmesa to test this.

asny commented 11 months ago

Sorry for the spam, tried to copy some old code, but it wasn't working anymore. I added an action that tests that headless is working on linux. I'm not on linux so I can't test it locally. It seems to work in the action, so I guess it's ok.