Skip to content

ndk-example: Demonstrate Looper usage without winit#161

Merged
msiglreith merged 2 commits into
rust-mobile:masterfrom
MarijnS95:looper-example
Aug 23, 2021
Merged

ndk-example: Demonstrate Looper usage without winit#161
msiglreith merged 2 commits into
rust-mobile:masterfrom
MarijnS95:looper-example

Conversation

@MarijnS95
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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