mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 06:10:06 -04:00
polish glutin upgrade with glutin-winit crate (#2526)
* use glutin-winit for glow context creation * added some tracing for easier debugging of glutin problems * fmt * add more debug logs * more tracing * fallback egl instead of prefer egl * update pure glow example to use glutin_winit * add more logging. ignore vsync option if not supported * cranky lint * add some logging for easier debugging * drop window after glutin surface * small changes based on pr review * build fix --------- Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
This commit is contained in:
@@ -64,15 +64,13 @@ pub fn read_window_info(
|
||||
monitor_size,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn build_window<E>(
|
||||
pub fn window_builder<E>(
|
||||
event_loop: &EventLoopWindowTarget<E>,
|
||||
title: &str,
|
||||
native_options: &epi::NativeOptions,
|
||||
window_settings: Option<WindowSettings>,
|
||||
) -> Result<winit::window::Window, winit::error::OsError> {
|
||||
) -> winit::window::WindowBuilder {
|
||||
let epi::NativeOptions {
|
||||
always_on_top,
|
||||
maximized,
|
||||
decorated,
|
||||
fullscreen,
|
||||
@@ -159,11 +157,19 @@ pub fn build_window<E>(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
window_builder
|
||||
}
|
||||
pub fn build_window<E>(
|
||||
event_loop: &EventLoopWindowTarget<E>,
|
||||
title: &str,
|
||||
native_options: &epi::NativeOptions,
|
||||
window_settings: Option<WindowSettings>,
|
||||
) -> Result<winit::window::Window, winit::error::OsError> {
|
||||
let window_builder = window_builder(event_loop, title, native_options, window_settings);
|
||||
let window = window_builder.build(event_loop)?;
|
||||
|
||||
use winit::window::WindowLevel;
|
||||
window.set_window_level(if *always_on_top {
|
||||
window.set_window_level(if native_options.always_on_top {
|
||||
WindowLevel::AlwaysOnTop
|
||||
} else {
|
||||
WindowLevel::Normal
|
||||
|
||||
Reference in New Issue
Block a user