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

egui_winit/wgpu: enable Android support #1634

Merged
merged 2 commits into from
May 22, 2022

Commits on May 22, 2022

  1. egui-winit: don't assume window available at init

    On Android in particular we can only initialize render state once we
    have a native window, after a 'Resumed' lifecycle event. It's still
    practical to be able to initialize an egui_winit::State early on
    so this adds setters for the max_texture_side and pixels_per_point
    that can be called once we have a valid Window and have initialized
    a graphics context.
    
    On Wayland, where we need to access the Display for clipboard handling
    we now get the Display from the event loop instead of a window.
    rib committed May 22, 2022
    Configuration menu
    Copy the full SHA
    e355bef View commit details
    Browse the repository at this point in the history
  2. egui-wgpu: lazily initialize render + surface state

    Enable the renderer and surface state initialization to be deferred
    until we know that any winit window we created has a valid native window
    and enable the surface state to be updated in case the native window
    changes.
    
    In particular these changes help with running on Android where winit
    windows will only have a valid native window associated with them
    between Resumed and Paused lifecycle events, and so surface creation
    (and render state initialization) needs to wait until the first
    Resumed event, and the surface needs to be dropped/recreated based on
    Paused/Resumed events.
    rib committed May 22, 2022
    Configuration menu
    Copy the full SHA
    e75ac2b View commit details
    Browse the repository at this point in the history