Skip to content

Commit

Permalink
glow: move where FRAMEBUFFER_SRGB is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Mar 20, 2022
1 parent d20be45 commit e369626
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
5 changes: 0 additions & 5 deletions egui_glow/examples/pure_glow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,5 @@ fn create_display(

let gl = unsafe { glow::Context::from_loader_function(|s| gl_window.get_proc_address(s)) };

unsafe {
use glow::HasContext as _;
gl.enable(glow::FRAMEBUFFER_SRGB);
}

(gl_window, gl)
}
5 changes: 0 additions & 5 deletions egui_glow/src/epi_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ fn create_display(

let gl = unsafe { glow::Context::from_loader_function(|s| gl_window.get_proc_address(s)) };

unsafe {
use glow::HasContext as _;
gl.enable(glow::FRAMEBUFFER_SRGB);
}

(gl_window, gl)
}

Expand Down
5 changes: 5 additions & 0 deletions egui_glow/src/painter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@ impl Painter {
glow::ONE,
);

if !cfg!(target_arch = "wasm32") {
self.gl.enable(glow::FRAMEBUFFER_SRGB);
check_for_gl_error(&self.gl, "FRAMEBUFFER_SRGB");
}

let width_in_points = width_in_pixels as f32 / pixels_per_point;
let height_in_points = height_in_pixels as f32 / pixels_per_point;

Expand Down

0 comments on commit e369626

Please sign in to comment.