mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 05:40:03 -04:00
Get hello world simple to compile
This commit is contained in:
@@ -31,7 +31,7 @@ default = ["fragile-send-sync-non-atomic-wasm", "macos-window-resize-jitter-fix"
|
||||
capture = ["dep:egui"]
|
||||
|
||||
## Enable [`winit`](https://docs.rs/winit) integration. On Linux, requires either `wayland` or `x11`
|
||||
winit = ["dep:winit", "winit/rwh_06", "dep:egui", "capture"]
|
||||
winit = ["dep:winit", "dep:egui", "capture"]
|
||||
|
||||
## Enables Wayland support for winit.
|
||||
wayland = ["winit?/wayland"]
|
||||
|
||||
@@ -143,12 +143,12 @@ impl Painter {
|
||||
pub async fn set_window(
|
||||
&mut self,
|
||||
viewport_id: ViewportId,
|
||||
window: Option<Arc<winit::window::Window>>,
|
||||
window: Option<Arc<dyn winit::window::Window>>,
|
||||
) -> Result<(), crate::WgpuError> {
|
||||
profiling::scope!("Painter::set_window"); // profile_function gives bad names for async functions
|
||||
|
||||
if let Some(window) = window {
|
||||
let size = window.inner_size();
|
||||
let size = window.surface_size();
|
||||
if !self.surfaces.contains_key(&viewport_id) {
|
||||
let surface = self.instance.create_surface(window)?;
|
||||
self.add_surface(surface, viewport_id, size).await?;
|
||||
@@ -169,12 +169,12 @@ impl Painter {
|
||||
pub async unsafe fn set_window_unsafe(
|
||||
&mut self,
|
||||
viewport_id: ViewportId,
|
||||
window: Option<&winit::window::Window>,
|
||||
window: Option<&dyn winit::window::Window>,
|
||||
) -> Result<(), crate::WgpuError> {
|
||||
profiling::scope!("Painter::set_window_unsafe"); // profile_function gives bad names for async functions
|
||||
|
||||
if let Some(window) = window {
|
||||
let size = window.inner_size();
|
||||
let size = window.surface_size();
|
||||
if !self.surfaces.contains_key(&viewport_id) {
|
||||
let surface = unsafe {
|
||||
self.instance
|
||||
|
||||
Reference in New Issue
Block a user