Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump egui version to 0.27.0 #39

Merged
merged 2 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "egui_sdl2_gl"
version = "0.26.2"
version = "0.27.0"
authors = ["Arjun Nair <[email protected]>"]
edition = "2018"
description = "Backend for Egui to use with sdl2-rs and open gl"
Expand All @@ -15,7 +15,7 @@ include = ["**/*.rs", "Cargo.toml", "/shaders"]
[dependencies]
ahash = "~0.8"
gl = "~0.14"
egui = "~0.26"
egui = "~0.27"
sdl2 = { version = "~0.36" }
memoffset = "0.9.0"

Expand All @@ -41,4 +41,4 @@ sdl2_static-link = ["sdl2/static-link"]
use_epi = ["epi"]

[dev-dependencies]
egui_demo_lib = "~0.26"
egui_demo_lib = "~0.27"
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,12 @@ pub fn with_sdl2(
DpiScaling::Custom(custom) => default_scale * custom,
};
let painter = painter::Painter::new(window, scale, shader_ver);
EguiStateHandler::new(painter)
let state_handler = EguiStateHandler::new(&painter);
(painter, state_handler)
}

impl EguiStateHandler {
pub fn new(painter: Painter) -> (Painter, EguiStateHandler) {
pub fn new(painter: &Painter) -> Self {
let mut input = egui::RawInput {
screen_rect: Some(painter.screen_rect),
..Default::default()
Expand All @@ -117,14 +118,13 @@ impl EguiStateHandler {
.or_default()
.native_pixels_per_point = Some(painter.pixels_per_point);
let native_pixels_per_point = painter.pixels_per_point;
let _self = EguiStateHandler {
Self {
fused_cursor: FusedCursor::default(),
pointer_pos: Pos2::new(0f32, 0f32),
input,
modifiers: Modifiers::default(),
native_pixels_per_point,
};
(painter, _self)
}
}

pub fn process_input(
Expand Down
Loading