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

Update android backend. #1249

Closed
wants to merge 1 commit into from
Closed

Conversation

dvc94ch
Copy link
Member

@dvc94ch dvc94ch commented Dec 21, 2019

This adds basic support for android to glutin. The android build failure is due a too old version of cargo-apk, the docker image needs to use rust-mobile/android-rs-glue#256

Copy link
Contributor

@goddessfreya goddessfreya left a comment

Choose a reason for hiding this comment

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

I'm going to hold out and wait until this changes land upstream in winit, else I'll inevitably forget to change the dependencies back :P

Other than the one nit, looks good to me, although, I have no familiarity with android, so I guess me saying it "looks good" is worth jack shit.

@@ -621,6 +623,11 @@ impl Context {
egl.GetError()
)
}
if !self.vsync {
if egl.SwapInterval(self.display, 0) == ffi::egl::FALSE {
panic!("finish_impl: eglSwapInterval failed: 0x{:x}", egl.GetError());
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: finish_impl -> on_surface_created.

@katyo
Copy link

katyo commented Dec 23, 2019

@dvc94ch I tested winit with glutin from android branch with my simple gl triangle test. This builds and works good. But I still have some troubles with glutin on some devices. Particularly, it fails on eglMakeCurrent with EGL_BAD_MATCH. I tried different pixel formats, but it still failing. This looks like a bug in glutin.

@dvc94ch
Copy link
Member Author

dvc94ch commented Dec 23, 2019

Cool! I think it's maybe due to the orientation handling code. Is it a glutin example? Or do you have the code somewhere?

@katyo
Copy link

katyo commented Dec 24, 2019

@dvc94ch This is my own experimental code.
I discovered that some androids have valid (not null) pointer to native window only after resume event. Now I call make_current() on context here and this works. But I have another problem: Now demo crashes with 'supplied instant is later than self'. Because rust stack trace still doesn't work on android so this is hard to track the core of problem.
Upd: see my comment in winit pr rust-windowing/winit#1328 (comment)

@dvc94ch
Copy link
Member Author

dvc94ch commented Feb 5, 2020

Closing in favor of #1274

@dvc94ch dvc94ch closed this Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants