Skip to content

Commit

Permalink
Merge pull request #39 from osimarr/main
Browse files Browse the repository at this point in the history
Bump egui version to 0.27.0
  • Loading branch information
ArjunNair authored Mar 29, 2024
2 parents 9b84594 + 57b3d6c commit 94c43f9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
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

0 comments on commit 94c43f9

Please sign in to comment.