https://github.com/dagit/druid-test
Testing druid + winit over ipc-channels
https://github.com/dagit/druid-test
Last synced: 10 months ago
JSON representation
Testing druid + winit over ipc-channels
- Host: GitHub
- URL: https://github.com/dagit/druid-test
- Owner: dagit
- Created: 2022-11-16T00:31:36.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-11-16T01:24:45.000Z (over 3 years ago)
- Last Synced: 2025-05-31T10:47:54.484Z (about 1 year ago)
- Language: Rust
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This is a simple demo to test using winit (for accelerated rendering) along side druid for normal UI elements. These two libraries cannot coexist noramlly in one program as they both need to execute a message handling loop on the process's original thread. Mostly this in an issue for macOS and probably works fine on windows. I tested linux and it wasn't an issue there.
To work around this limitation:
1. `main()` immediately performs a double `fork()` (double forks make it so you don't accidentally get zombie proceses)
2. The parent process runs winit
3. The child process runs druid
4. The parent and child exchange ipc channels for sending and receiving messages
The demo is based on copying the multiwindow example from the druid sources and the basic triangle example from the glium sources.
TODO: Other things to add to the demo
* [ ] Right-click context menu on the winit side to hide/show the druid window
* [ ] Move the message sending/receiving into the event loops in a non-blocking way
* [ ] When the winit window is closed send a `Quit` message to the druid side and exit
* [ ] Figure out why the macOS version is having an issue with cleanly exiting. On closing the windows there is a panic that's probably something I'm doing wrong.
* [X] Test on linux
* [X] Test on macOS
* [ ] Test on windows