Add headless feature - #784
Conversation
|
This is a good start! I would look into the idea of merging headless::App and normal App, so that sketches can run headless without having to change the App type in function signatures. This would also help with deduplicating the Builder and Fn types. My suggestion is to change |
|
I've started implementing your suggestion @dzil123 but run into a bit of a roadblock. What should the id be a key to? I've tried using it as a key to Any ideas on this? I think we should try to find as many options as possible. Also what should non-headless windows be called in the enum? |
Allows nannou to run apps without having to use
winitto create a window. It Builds off of @dzil123 's proof of concept branch (https://github.com/dzil123/nannou/tree/headless) and provides a similar API to non-headless.Theres still a few methods missing from the struct counterparts as I've only made whats been necessary to get things working. This is because I believe theres a more rusty way to do this. We could do this two ways:
"headless".It would be a non-default feature that when set, the structs change to not include
winittypes. Methods that can't work withoutwinitcould be left in but only run theunimplemented!()macro. Also this feature could remove other modules that won't be necessarily used (like audio)