Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to integrate iced_native UI for use with Kiss3d #235

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

alvinhochun
Copy link
Collaborator

@alvinhochun alvinhochun commented Jul 19, 2020

This implements a hacky and incomplete iced_native UI support built on top the generic version of PR #233.

A short write-up on this PR:

  • A lot of code was adapted from the iced_glow implementation, some unmodified
  • The glow::Context is obtained in a hackish way from Kiss3d (this would be a non-issue if Kiss3d switches to glow in the future as in the web-sys branch)
  • Kiss3d assumes a single VAO but the iced_glow rect.rs implementation uses its own VAO, so extra code had to be added to have Kiss3d rebind its VAO
  • The code flow and demo example mostly follows iced's integration example
  • iced_native does not handle input events in a way that can support integration well (How to integrate input events with existing engine, and use iced as ui library? iced-rs/iced#408), which means there is currently no way to tell whether an iced widget are capturing the mouse or keyboard and there is no way to determine whether the input events are unhandled by iced.

To try the demo, edit gui/iced/Cargo.toml to point to a local copy of iced (use my fork event-capture branch at https://github.com/alvinhochun/iced/tree/event-capture) and run cargo run -p kiss3d_iced --example demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant