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

ndk-example: Demonstrate Looper usage without winit #161

Merged
merged 2 commits into from
Aug 23, 2021

Conversation

MarijnS95
Copy link
Member

Fixes #111

Originally proposed here, this adds a simple looper example demonstrating how to use Android's Looper through the NDK bindings in similar fashion to winit. It uses ndk_glue's event pipe, Android's InputQueue and a custom Unix pipe to transfer events to the Looper (thread).

Comment on lines +134 to +157
// Stop the activity
ndk_glue::native_activity().finish()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still pending #160; but we can get this PR in already and it will just have to be cleaned up there (and it should probably fail to compile no matter how we implement it).

Copy link
Contributor

@msiglreith msiglreith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a nice reference!

Originally proposed [here], this adds a simple looper example
demonstrating how to use Android's `Looper` through the NDK bindings in
similar fashion to `winit`.  It uses `ndk_glue`'s event pipe, Android's
`InputQueue` and a custom Unix pipe to transfer events to the Looper
(thread).

[here]: rust-mobile#111 (comment)
@MarijnS95
Copy link
Member Author

@msiglreith Thanks for reviewing! Wanted to hold off merging until finalizing all the changes to add_fd_with_callback so that it can be demonstrated/tested as well, that's all here now too.

@msiglreith msiglreith merged commit a8c1385 into rust-mobile:master Aug 23, 2021
@MarijnS95 MarijnS95 deleted the looper-example branch August 23, 2021 17:30
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.

ndk-glue: impossible to poll events in a non-blocking fashion
2 participants