1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-03 15:20:05 -04:00

Merge branch 'master' into master

This commit is contained in:
Fredrik Fornwall
2023-11-25 09:28:45 +01:00
committed by GitHub
70 changed files with 1504 additions and 975 deletions

View File

@@ -5,6 +5,12 @@ This file is updated upon each release.
Changes since the last release can be found by running the `scripts/generate_changelog.py` script.
## 0.24.0 - 2023-11-23
* Change `Arc<glow::Context>` to `Rc<glow::Context>` [#3598](https://github.com/emilk/egui/pull/3598)
* Update MSRV to Rust 1.72 [#3595](https://github.com/emilk/egui/pull/3595)
* Clamp viewport values [#3604](https://github.com/emilk/egui/pull/3604) (thanks [@Wumpf](https://github.com/Wumpf)!)
## 0.23.0 - 2023-09-27
* Update `egui`

View File

@@ -1,12 +1,12 @@
[package]
name = "egui_glow"
version = "0.23.0"
version.workspace = true
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
description = "Bindings for using egui natively using the glow library"
edition = "2021"
rust-version = "1.72"
edition.workspace = true
rust-version.workspace = true
homepage = "https://github.com/emilk/egui/tree/master/crates/egui_glow"
license = "MIT OR Apache-2.0"
license.workspace = true
readme = "README.md"
repository = "https://github.com/emilk/egui/tree/master/crates/egui_glow"
categories = ["gui", "game-development"]
@@ -44,7 +44,7 @@ winit = ["egui-winit"]
[dependencies]
egui = { version = "0.23.0", path = "../egui", default-features = false, features = [
egui = { version = "0.24.0", path = "../egui", default-features = false, features = [
"bytemuck",
] }
@@ -59,7 +59,7 @@ document-features = { version = "0.2", optional = true }
# Native:
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
egui-winit = { version = "0.23.0", path = "../egui-winit", optional = true, default-features = false }
egui-winit = { version = "0.24.0", path = "../egui-winit", optional = true, default-features = false }
puffin = { workspace = true, optional = true }
# Web:

View File

@@ -404,10 +404,10 @@ impl Painter {
let viewport_px = info.viewport_in_pixels();
unsafe {
self.gl.viewport(
viewport_px.left_px.round() as _,
viewport_px.from_bottom_px.round() as _,
viewport_px.width_px.round() as _,
viewport_px.height_px.round() as _,
viewport_px.left_px,
viewport_px.from_bottom_px,
viewport_px.width_px,
viewport_px.height_px,
);
}

View File

@@ -1,7 +1,7 @@
pub use egui_winit;
pub use egui_winit::EventResponse;
use egui::{ViewportId, ViewportIdPair, ViewportOutput};
use egui::{ViewportId, ViewportOutput};
use egui_winit::winit;
use crate::shader_version::ShaderVersion;
@@ -35,6 +35,7 @@ impl EguiGlow {
.unwrap();
let egui_winit = egui_winit::State::new(
ViewportId::ROOT,
event_loop,
native_pixels_per_point,
Some(painter.max_texture_side()),
@@ -58,9 +59,7 @@ impl EguiGlow {
/// Call [`Self::paint`] later to paint.
pub fn run(&mut self, window: &winit::window::Window, run_ui: impl FnMut(&egui::Context)) {
let raw_input = self
.egui_winit
.take_egui_input(window, ViewportIdPair::ROOT);
let raw_input = self.egui_winit.take_egui_input(window);
let egui::FullOutput {
platform_output,
@@ -76,6 +75,7 @@ impl EguiGlow {
for (_, ViewportOutput { commands, .. }) in viewport_output {
let mut screenshot_requested = false;
egui_winit::process_viewport_commands(
&self.egui_ctx,
&mut self.viewport_info,
commands,
window,
@@ -87,12 +87,8 @@ impl EguiGlow {
}
}
self.egui_winit.handle_platform_output(
window,
ViewportId::ROOT,
&self.egui_ctx,
platform_output,
);
self.egui_winit
.handle_platform_output(window, &self.egui_ctx, platform_output);
self.shapes = shapes;
self.pixels_per_point = pixels_per_point;