mirror of
https://github.com/emilk/egui.git
synced 2026-07-18 12:38:58 +00:00
Add flag to disable hardware acceleration (#1681)
This is a fix for the behaviour on macOS platforms where any egui app would use the dedicated GPU and consume more power than needed. Not all apps might have dedicated GPU requirements.
This commit is contained in:
committed by
GitHub
parent
1d9524cc59
commit
72e38370fe
@@ -47,11 +47,12 @@ pub fn window_builder(
|
||||
max_window_size,
|
||||
resizable,
|
||||
transparent,
|
||||
vsync: _, // used in `fn create_display`
|
||||
multisampling: _, // used in `fn create_display`
|
||||
depth_buffer: _, // used in `fn create_display`
|
||||
stencil_buffer: _, // used in `fn create_display`
|
||||
renderer: _, // used in `fn run_native`
|
||||
vsync: _, // used in `fn create_display`
|
||||
multisampling: _, // used in `fn create_display`
|
||||
depth_buffer: _, // used in `fn create_display`
|
||||
stencil_buffer: _, // used in `fn create_display`
|
||||
hardware_acceleration: _, // used in `fn create_display`
|
||||
renderer: _, // used in `fn run_native`
|
||||
} = native_options;
|
||||
|
||||
let window_icon = icon_data.clone().and_then(load_icon);
|
||||
|
||||
@@ -17,6 +17,7 @@ fn create_display(
|
||||
crate::profile_function!();
|
||||
let gl_window = unsafe {
|
||||
glutin::ContextBuilder::new()
|
||||
.with_hardware_acceleration(native_options.hardware_acceleration)
|
||||
.with_depth_buffer(native_options.depth_buffer)
|
||||
.with_multisampling(native_options.multisampling)
|
||||
.with_srgb(true)
|
||||
|
||||
Reference in New Issue
Block a user