mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 06:10:06 -04:00
Add glow::Context to epi::Frame (#1425)
This can be used, for instance, to: * Render things to offscreen buffers. * Read the pixel buffer from the previous frame (glow::Context::read_pixels). * Render things behind the egui windows.
This commit is contained in:
@@ -627,11 +627,16 @@ impl Painter {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn clear(gl: &glow::Context, dimension: [u32; 2], clear_color: egui::Rgba) {
|
||||
pub fn clear(gl: &glow::Context, screen_size_in_pixels: [u32; 2], clear_color: egui::Rgba) {
|
||||
unsafe {
|
||||
gl.disable(glow::SCISSOR_TEST);
|
||||
|
||||
gl.viewport(0, 0, dimension[0] as i32, dimension[1] as i32);
|
||||
gl.viewport(
|
||||
0,
|
||||
0,
|
||||
screen_size_in_pixels[0] as i32,
|
||||
screen_size_in_pixels[1] as i32,
|
||||
);
|
||||
|
||||
let clear_color: Color32 = clear_color.into();
|
||||
gl.clear_color(
|
||||
|
||||
Reference in New Issue
Block a user