-
Notifications
You must be signed in to change notification settings - Fork 920
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
winit inside Android GLSurfaceView #3998
Comments
CC @MarijnS95 Also, how does Glutin support Android? |
with EGL, you just use it + raw-window-handle and that's about it. They are talking about android specific view here they get from somewhere else IIRC, which is not glutin related at all. |
Unfortunately wrapping an arbitrary In addition, If you were to perform (EGL) context management yourself in Rust (i.e. via the already mentioned What we are planning on the Separate from that, subsurfaces are going to be a great fit for individual And finally, Android added a new With refactors ongoing in Footnotes
|
Thanks for digging in here! This all makes sense. Turns out the number of things you need here is pretty minimal and I got this working last night: https://github.com/MerchGuardian/egui-android-test/blob/master/egui-view/native_gl_surface/src/lib.rs#L163-L238. I wish I knew about your https://github.com/MarijnS95/AndroidNativeSurface repo sooner 😅 Given how simple this turned out, I think that rewriting the backend to make this usecase fit doesnt make sense. 👍 for |
Glad to hear that you got it working by relying on the already-currented (with surface!) context from
|
Description
Hi,
I have a requirement to embed an OpenGL app into Android's GLSurfaceView, which lives inside an existing jetpack compose app (Unable to use
NativeActivity
orGameActivity
). I would like to somehow have winit wrap thisGLSurfaceView
into awinit::window::Window
so that I can re-use platform-agnostic Rust rendering code (egui).It looks like this use case isnt supported so I was curious if this is something you would be interested in a PR for, of if this is best left outside of the library.
Similar to the web,
GLSurfaceView
"owns" the lifecycle (handles OpenGL context creation, redraw interval, redraw thread, etc.).a. New feature flag
b. New API for connecting a
winit
window to an existingGLSurfaceView
c. Subscribe to android events form the GLSurfaceView, feed these to
winit
d. ...
winit
?Relevant platforms
Android
The text was updated successfully, but these errors were encountered: