unlimitedbacon / stl-thumb

Thumbnail generator for STL files
MIT License
1.02k stars 89 forks source link

Updated glium #44

Closed mtorromeo closed 2 years ago

mtorromeo commented 2 years ago

By updating the glium dependency, I managed to solve the segmentation faults with release builds.

This should fix at least #41 and #38, possibly more.

I could have updated more dependencies, but wanted to keep the PR with only relevant changes.

I also had to resist the urge to run cargo fmt on the codebase :P

mtorromeo commented 2 years ago

I just noticed that creating an EventLoop in create_headless_display makes it panic when used as a library, but I am not sure how else I am supposed to build a headless display.

unlimitedbacon commented 2 years ago

Oh hell yes thank you!

And crap, of course something else breaks. The joys of OpenGL -_-. I'll try to figure out what we can do about the EventLoop as soon as I get the chance.

Also feel free to run cargo fmt (I know it needs it) or upgrade more crates. Just submit them as separate PRs.

unlimitedbacon commented 2 years ago

Finally got around to looking at this. This is the error I'm getting when running cargo test. Is this the same thing you were seeing?

thread 'tests::cube' panicked at 'Initializing the event loop outside of the main thread is a significant cross-platform compatibility hazard. If you really, absolutely need to create an EventLoop on a different thread, please use the `EventLoopExtUnix::new_any_thread` function.', /home/neo/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.25.0/src/platform_impl/linux/mod.rs:751:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I tried the suggested workaround and it works on Linux, but it does indeed stop stl-thumb from building on Windows.

mtorromeo commented 2 years ago

Yes I had a similar error, not sure if it was identical or not.

There seem to be a similar function for windows EventLoopExtWindows::new_any_thread https://github.com/rust-windowing/winit/blob/1b3b82a3c1369c5248a2e6a251230ba6c615e918/src/platform/windows.rs#L27

unlimitedbacon commented 2 years ago

Good find. I'll see if I can make that work.