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

(rustbasic) In Progress : Testing... #4182

Closed
wants to merge 321 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
321 commits
Select commit Hold shift + click to select a range
49f45f4
Update context.rs
rustbasic Mar 23, 2024
90159d5
Update glow_integration.rs
rustbasic Mar 23, 2024
d9abe7e
Update wgpu_integration.rs
rustbasic Mar 23, 2024
1c9b09c
Update lib.rs
rustbasic Mar 23, 2024
5abcade
Update wgpu_integration.rs
rustbasic Mar 23, 2024
3187042
Update glow_integration.rs
rustbasic Mar 23, 2024
20d4abf
Update epi_integration.rs
rustbasic Mar 23, 2024
5edf7d7
Update wgpu_integration.rs
rustbasic Mar 23, 2024
9e8ad1c
Update epi_integration.rs
rustbasic Mar 23, 2024
29d6819
Update glow_integration.rs
rustbasic Mar 23, 2024
7a39d0f
Update wgpu_integration.rs
rustbasic Mar 23, 2024
f430c46
Update wgpu_integration.rs
rustbasic Mar 23, 2024
8d72844
Update wgpu_integration.rs
rustbasic Mar 24, 2024
96407f3
Update lib.rs
rustbasic Mar 24, 2024
39f00d3
Update lib.rs
rustbasic Mar 24, 2024
7370c33
Update wgpu_integration.rs
rustbasic Mar 24, 2024
05dbd56
Update input.rs
rustbasic Mar 24, 2024
f05353a
Update lib.rs
rustbasic Mar 24, 2024
4a06e3c
Update wgpu_integration.rs
rustbasic Mar 24, 2024
3ee88a3
Update glow_integration.rs
rustbasic Mar 24, 2024
84af08a
Update wgpu_integration.rs
rustbasic Mar 24, 2024
4cc2ca1
Update lib.rs
rustbasic Mar 24, 2024
c743c8a
Update wgpu_integration.rs
rustbasic Mar 24, 2024
0d7d47c
Update glow_integration.rs
rustbasic Mar 24, 2024
b74d54a
Update lib.rs
rustbasic Mar 24, 2024
c35ddd1
Update lib.rs
rustbasic Mar 24, 2024
141aa22
Update epi_integration.rs
rustbasic Mar 24, 2024
29d2699
Merge branch 'emilk:master' into patch22
rustbasic Mar 25, 2024
4230968
Merge branch 'emilk:master' into patch22
rustbasic Mar 25, 2024
c5a6bbb
Update input.rs
rustbasic Mar 25, 2024
3935248
Update lib.rs
rustbasic Mar 25, 2024
c9851a4
Update wgpu_integration.rs
rustbasic Mar 25, 2024
46860a5
Update glow_integration.rs
rustbasic Mar 25, 2024
64aeb3a
Update context.rs
rustbasic Mar 25, 2024
8ad2587
Update wgpu_integration.rs
rustbasic Mar 25, 2024
e0ed8cc
Update context.rs
rustbasic Mar 26, 2024
991b6d8
Update wgpu_integration.rs
rustbasic Mar 26, 2024
61021e0
Update glow_integration.rs
rustbasic Mar 26, 2024
7b2d8c1
Update glow_integration.rs
rustbasic Mar 26, 2024
84dc8be
Update builder.rs
rustbasic Mar 26, 2024
98f44cb
Update lib.rs
rustbasic Mar 26, 2024
6cc00c7
Update input.rs
rustbasic Mar 26, 2024
8f1b0c4
Update input.rs
rustbasic Mar 26, 2024
16acfde
Update context.rs
rustbasic Mar 26, 2024
de36c34
Update input_state.rs
rustbasic Mar 26, 2024
9c1467e
Update builder.rs
rustbasic Mar 27, 2024
4b1471c
Update style.rs
rustbasic Mar 27, 2024
892db9e
Update run.rs
rustbasic Mar 27, 2024
a87f985
Merge branch 'master' into patch22
rustbasic Mar 27, 2024
259f4c8
Update style.rs
rustbasic Mar 27, 2024
78ac4b7
Update glow_integration.rs
rustbasic Mar 27, 2024
77b72f3
Update input.rs
rustbasic Mar 27, 2024
5b5d30e
Update wgpu_integration.rs
rustbasic Mar 27, 2024
6216c86
Update lib.rs
rustbasic Mar 29, 2024
ebbc44c
Update wgpu_integration.rs
rustbasic Mar 29, 2024
1acb72c
Update glow_integration.rs
rustbasic Mar 29, 2024
2a71c43
Merge branch 'master' into patch22
rustbasic Mar 29, 2024
a91de70
Update visuals.rs
rustbasic Mar 29, 2024
d7b2a95
Update style.rs
rustbasic Mar 29, 2024
04d95a2
Update visuals.rs
rustbasic Mar 29, 2024
ebc3564
Update visuals.rs
rustbasic Mar 29, 2024
2a1c65a
Update style.rs
rustbasic Mar 29, 2024
53e63f0
Merge branch 'emilk:master' into patch22
rustbasic Mar 29, 2024
fe570ac
Update input.rs
rustbasic Mar 29, 2024
76c4fa9
Update lib.rs
rustbasic Mar 29, 2024
c9b443d
Update epi_integration.rs
rustbasic Mar 29, 2024
96c0d9f
Update glow_integration.rs
rustbasic Mar 29, 2024
bfa875b
Update wgpu_integration.rs
rustbasic Mar 29, 2024
51d8740
Update run.rs
rustbasic Mar 29, 2024
0766059
Update epi_integration.rs
rustbasic Mar 29, 2024
82cf39f
Update glow_integration.rs
rustbasic Mar 29, 2024
2584eb7
Update glow_integration.rs
rustbasic Mar 29, 2024
9965861
Update glow_integration.rs
rustbasic Mar 29, 2024
7b3255c
Update wgpu_integration.rs
rustbasic Mar 29, 2024
7cf707d
Update lib.rs
rustbasic Mar 30, 2024
f0a5ac2
Update epi_integration.rs
rustbasic Mar 30, 2024
839b99e
Update wgpu_integration.rs
rustbasic Mar 30, 2024
fdc33b7
Update glow_integration.rs
rustbasic Mar 30, 2024
464194b
Merge branch 'emilk:master' into patch22
rustbasic Mar 30, 2024
6a55087
Update wgpu_integration.rs
rustbasic Mar 30, 2024
42339cf
Update epi_integration.rs
rustbasic Mar 30, 2024
b3cfb9b
Merge branch 'emilk:master' into patch22
rustbasic Mar 30, 2024
27310a6
Update wgpu_integration.rs
rustbasic Mar 30, 2024
34688c4
Update epi_integration.rs
rustbasic Mar 30, 2024
eecb354
Merge branch 'emilk:master' into patch22
rustbasic Mar 30, 2024
cbb20f8
Update epi_integration.rs
rustbasic Mar 30, 2024
14f58c7
Update style.rs
rustbasic Mar 30, 2024
6d455b7
Update glow_integration.rs
rustbasic Mar 30, 2024
347ab08
Update wgpu_integration.rs
rustbasic Mar 30, 2024
b11bbf0
Merge branch 'master' into patch22
rustbasic Mar 31, 2024
b82dbed
Update style.rs
rustbasic Mar 31, 2024
d766d8d
Update builder.rs
rustbasic Mar 31, 2024
195d284
Update glow_integration.rs
rustbasic Mar 31, 2024
171efc4
Merge branch 'emilk:master' into patch22
rustbasic Apr 1, 2024
3b45436
Merge branch 'master' into patch22
rustbasic Apr 1, 2024
ac129e4
Update glow_integration.rs
rustbasic Apr 1, 2024
4dc77a3
Merge branch 'emilk:master' into patch22
rustbasic Apr 1, 2024
14eabb3
Update glow_integration.rs
rustbasic Apr 1, 2024
284c73e
Update wgpu_integration.rs
rustbasic Apr 1, 2024
4f5a927
Update glow_integration.rs
rustbasic Apr 1, 2024
b26697a
Update epi_integration.rs
rustbasic Apr 1, 2024
2ee181d
Update epi_integration.rs
rustbasic Apr 1, 2024
8e4976b
Update epi_integration.rs
rustbasic Apr 1, 2024
064dcab
Update glow_integration.rs
rustbasic Apr 2, 2024
7b8c1e5
Update wgpu_integration.rs
rustbasic Apr 2, 2024
0d2ca19
Merge branch 'emilk:master' into patch22
rustbasic Apr 2, 2024
a378731
Update input.rs
rustbasic Apr 2, 2024
c7426c3
Update input.rs
rustbasic Apr 2, 2024
fe3c460
Merge branch 'emilk:master' into patch22
rustbasic Apr 2, 2024
3e7bc12
Update input.rs
rustbasic Apr 2, 2024
4a520db
Merge branch 'emilk:master' into patch22
rustbasic Apr 3, 2024
349a9f6
Update input.rs
rustbasic Apr 3, 2024
5e5243d
Update input.rs
rustbasic Apr 3, 2024
0f59d6c
Update input.rs
rustbasic Apr 3, 2024
b516f31
Merge branch 'emilk:master' into patch22
rustbasic Apr 3, 2024
79a85d4
Update builder.rs
rustbasic Apr 4, 2024
56931d8
Merge branch 'emilk:master' into patch22
rustbasic Apr 5, 2024
f6c50cc
Update input_state.rs
rustbasic Apr 5, 2024
6f1cd88
Update glow_integration.rs
rustbasic Apr 5, 2024
3e3aa1f
Update scroll_area.rs
rustbasic Apr 7, 2024
2c17ed1
Update input.rs
rustbasic Apr 7, 2024
20f1106
Update scroll_area.rs
rustbasic Apr 7, 2024
0d4bd0f
Update run.rs
rustbasic Apr 7, 2024
bbf615f
Update glow_integration.rs
rustbasic Apr 7, 2024
3a1d3af
Update wgpu_integration.rs
rustbasic Apr 7, 2024
f97c38b
Update input.rs
rustbasic Apr 7, 2024
3f5b106
Update epi.rs
rustbasic Apr 8, 2024
8616641
Update run.rs
rustbasic Apr 9, 2024
401da52
Update glow_integration.rs
rustbasic Apr 9, 2024
3f713f9
Update wgpu_integration.rs
rustbasic Apr 9, 2024
8ead7de
Update glow_integration.rs
rustbasic Apr 9, 2024
2638068
Update epi_integration.rs
rustbasic Apr 10, 2024
686e408
Update wgpu_integration.rs
rustbasic Apr 10, 2024
b5d2221
Update glow_integration.rs
rustbasic Apr 10, 2024
87c0042
Update wgpu_integration.rs
rustbasic Apr 10, 2024
8b1e728
Update glow_integration.rs
rustbasic Apr 10, 2024
f966274
Update epi_integration.rs
rustbasic Apr 10, 2024
480ec94
Update scroll_area.rs
rustbasic Apr 10, 2024
c5885e9
Update scroll_area.rs
rustbasic Apr 10, 2024
19b7c16
Update input_state.rs
rustbasic Apr 11, 2024
e46947f
Update scroll_area.rs
rustbasic Apr 11, 2024
29d5ce3
Update text_cursor_state.rs
rustbasic Apr 14, 2024
a0ae047
Update lib.rs
rustbasic Apr 14, 2024
af3befd
Update input.rs
rustbasic Apr 14, 2024
ff4e0b7
Update builder.rs
rustbasic Apr 14, 2024
d8af252
Update lib.rs
rustbasic Apr 14, 2024
b01e3f1
Update lib.rs
rustbasic Apr 14, 2024
0d4ec6b
Update id.rs
rustbasic Apr 17, 2024
ae8205b
Update state.rs
rustbasic Apr 17, 2024
70787d6
Update builder.rs
rustbasic Apr 17, 2024
d9f143e
Update state.rs
rustbasic Apr 17, 2024
a1d21f1
Update lib.rs
rustbasic Apr 19, 2024
07edf27
Update lib.rs
rustbasic Apr 19, 2024
76871af
Merge branch 'emilk:master' into patch22
rustbasic Apr 19, 2024
34587d4
Update resize.rs
rustbasic Apr 20, 2024
a2e2df2
Update window.rs
rustbasic Apr 20, 2024
704c96a
Update resize.rs
rustbasic Apr 20, 2024
6926536
Update resize.rs
rustbasic Apr 20, 2024
f4b1ebb
Update window.rs
rustbasic Apr 21, 2024
4c09339
Merge branch 'emilk:master' into patch22
rustbasic Apr 21, 2024
6167026
Update text_cursor_state.rs
rustbasic Apr 21, 2024
1509a87
Update text_cursor_state.rs
rustbasic Apr 22, 2024
ca43638
Update input.rs
rustbasic Apr 22, 2024
1f60ecd
Merge branch 'emilk:master' into patch22
rustbasic Apr 22, 2024
f5805ed
Merge branch 'master' into patch22
rustbasic Apr 22, 2024
22d9fdc
Update state.rs
rustbasic Apr 23, 2024
669b29a
Merge branch 'emilk:master' into patch22
rustbasic Apr 23, 2024
9d64e91
Merge branch 'emilk:master' into patch22
rustbasic Apr 24, 2024
13e9a89
Update epi_integration.rs
rustbasic Apr 25, 2024
f1bd710
Update epi_integration.rs
rustbasic Apr 25, 2024
a2f10b8
Update builder.rs
rustbasic Apr 25, 2024
b477242
Update input_state.rs
rustbasic Apr 25, 2024
992ef9d
Update context.rs
rustbasic Apr 25, 2024
7bb07f1
Update scroll_area.rs
rustbasic Apr 25, 2024
5d51b74
Update scroll_area.rs
rustbasic Apr 25, 2024
cd3908f
Update input_state.rs
rustbasic Apr 25, 2024
ee8882d
Update input_state.rs
rustbasic Apr 25, 2024
e2edc1d
Update input_state.rs
rustbasic Apr 25, 2024
240be43
Merge branch 'emilk:master' into patch22
rustbasic Apr 26, 2024
4afd36f
Update input_state.rs
rustbasic Apr 26, 2024
47f1ce5
Update epi_integration.rs
rustbasic Apr 27, 2024
32d6ec2
Update context.rs
rustbasic Apr 27, 2024
2ab1850
Update context.rs
rustbasic Apr 27, 2024
898d7e5
Update input_state.rs
rustbasic Apr 27, 2024
8a47702
Update context.rs
rustbasic Apr 27, 2024
2f54d63
Update input_state.rs
rustbasic Apr 28, 2024
aa82244
Update lib.rs
rustbasic Apr 29, 2024
257dc42
Merge branch 'emilk:master' into patch22
rustbasic Apr 29, 2024
294294d
Update glow_integration.rs
rustbasic May 1, 2024
ed436ba
Update viewport.rs
rustbasic May 1, 2024
fd14249
Update viewport.rs
rustbasic May 1, 2024
3c0e53a
Update lib.rs
rustbasic May 1, 2024
35349bc
Merge branch 'emilk:master' into patch22
rustbasic May 1, 2024
7f4b794
Update resize.rs
rustbasic May 2, 2024
53ba6b7
Merge branch 'master' into patch22
rustbasic May 3, 2024
d789c77
Update panel.rs
rustbasic May 3, 2024
ad4abc0
Update panel.rs
rustbasic May 3, 2024
d0ef558
Update ui.rs
rustbasic May 3, 2024
ea15b1a
Update ui.rs
rustbasic May 4, 2024
43d5430
Update placer.rs
rustbasic May 4, 2024
830b16e
Update ui.rs
rustbasic May 4, 2024
394afaf
Update window.rs
rustbasic May 4, 2024
77ef8ed
Update window.rs
rustbasic May 4, 2024
0a53ebf
Update viewport.rs
rustbasic May 4, 2024
5100d91
Update lib.rs
rustbasic May 5, 2024
745f4b6
Update lib.rs
rustbasic May 6, 2024
8e5a890
Update viewport.rs
rustbasic May 6, 2024
285fe72
Update viewport.rs
rustbasic May 7, 2024
ce383b0
Update viewport.rs
rustbasic May 7, 2024
62ba8cf
Update viewport.rs
rustbasic May 8, 2024
d9408aa
Update epi_integration.rs
rustbasic May 9, 2024
08e006a
Update wgpu_integration.rs
rustbasic May 11, 2024
4a5259c
Update glow_integration.rs
rustbasic May 11, 2024
2e02044
Merge branch 'master' into patch22
rustbasic May 11, 2024
1dd653a
Merge branch 'emilk:master' into patch22
rustbasic May 12, 2024
e454b32
Update epi_integration.rs
rustbasic May 12, 2024
fbd3c1b
Update viewport.rs
rustbasic May 15, 2024
70e6e70
Update viewport.rs
rustbasic May 15, 2024
ccbc9bf
Merge branch 'emilk:master' into patch22
rustbasic May 15, 2024
88828b0
Update placer.rs
rustbasic May 15, 2024
15d901a
Update Cargo.toml
rustbasic May 15, 2024
0068718
Update Cargo.toml
rustbasic May 15, 2024
a44b0d5
Update glow_integration.rs
rustbasic May 18, 2024
de664f7
Update glow_integration.rs
rustbasic May 18, 2024
398aa27
Merge branch 'emilk:master' into patch22
rustbasic May 18, 2024
41f93b1
Update builder.rs
rustbasic May 19, 2024
7325f86
Update builder.rs
rustbasic May 19, 2024
3c96a61
Update resize.rs
rustbasic May 20, 2024
d658166
Update window.rs
rustbasic May 20, 2024
d7850fa
Update builder.rs
rustbasic May 21, 2024
45a3d2c
Update resize.rs
rustbasic May 21, 2024
629b739
Update window.rs
rustbasic May 21, 2024
0e626d5
Update wgpu_integration.rs
rustbasic May 21, 2024
8e0749b
Update glow_integration.rs
rustbasic May 21, 2024
cfed618
Update builder.rs
rustbasic May 22, 2024
431561f
Merge branch 'emilk:master' into patch22
rustbasic May 22, 2024
a5b8f8d
Update builder.rs
rustbasic May 22, 2024
a711262
Update resize.rs
rustbasic May 22, 2024
d7c754e
Update window.rs
rustbasic May 22, 2024
19bf8c8
Merge branch 'master' into patch22
rustbasic May 23, 2024
e7f8ef4
Update input_state.rs
rustbasic May 23, 2024
70a070f
Merge branch 'emilk:master' into patch22
rustbasic May 25, 2024
dbb2f43
Update scroll_area.rs
rustbasic May 26, 2024
92062b1
Update resize.rs
rustbasic May 26, 2024
ce27c85
Update window.rs
rustbasic May 26, 2024
4a200b2
Update resize.rs
rustbasic May 26, 2024
6c6293f
Update window.rs
rustbasic May 27, 2024
6306fce
Update run.rs
rustbasic May 27, 2024
e0daba6
Update run.rs
rustbasic May 27, 2024
102c8df
Update run.rs
rustbasic May 27, 2024
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
8 changes: 5 additions & 3 deletions crates/eframe/src/epi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,15 @@ pub trait App {
/// egui recommends that rendering backends use a normal "gamma-space" (non-sRGB-aware) blending,
/// which means the values you return here should also be in `sRGB` gamma-space in the 0-1 range.
/// You can use [`egui::Color32::to_normalized_gamma_f32`] for this.
fn clear_color(&self, _visuals: &egui::Visuals) -> [f32; 4] {
fn clear_color(&self, visuals: &egui::Visuals) -> [f32; 4] {
// NOTE: a bright gray makes the shadows of the windows look weird.
// We use a bit of transparency so that if the user switches on the
// `transparent()` option they get immediate results.
egui::Color32::from_rgba_unmultiplied(12, 12, 12, 180).to_normalized_gamma_f32()

// _visuals.window_fill() would also be a natural choice
// egui::Color32::from_rgba_unmultiplied(12, 12, 12, 180).to_normalized_gamma_f32()
// or
// visuals.window_fill.to_normalized_gamma_f32()
visuals.window_fill.to_normalized_gamma_f32()
}

/// Controls whether or not the egui memory (window positions etc) will be
Expand Down
49 changes: 20 additions & 29 deletions crates/eframe/src/native/epi_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use winit::event_loop::EventLoopWindowTarget;

use raw_window_handle::{HasDisplayHandle as _, HasWindowHandle as _};

use egui::{DeferredViewportUiCallback, NumExt as _, ViewportBuilder, ViewportId};
use egui::{DeferredViewportUiCallback, NumExt as _, ViewportBuilder};
use egui_winit::{EventResponse, WindowSettings};

use crate::{epi, Theme};
Expand Down Expand Up @@ -144,12 +144,10 @@ pub struct EpiIntegration {
is_first_frame: bool,
pub frame_start: Instant,
pub egui_ctx: egui::Context,
pending_full_output: egui::FullOutput,

/// When set, it is time to close the native window.
close: bool,

can_drag_window: bool,
follow_system_theme: bool,
#[cfg(feature = "persistence")]
persist_window: bool,
Expand Down Expand Up @@ -206,9 +204,7 @@ impl EpiIntegration {
frame,
last_auto_save: Instant::now(),
egui_ctx,
pending_full_output: Default::default(),
close: false,
can_drag_window: false,
follow_system_theme: native_options.follow_system_theme,
#[cfg(feature = "persistence")]
persist_window: native_options.persist_window,
Expand Down Expand Up @@ -240,10 +236,14 @@ impl EpiIntegration {
});
}

/*

/// If `true`, it is time to close the native window.
pub fn should_close(&self) -> bool {
self.close
// self.close
self.egui_ctx.input(|i| i.viewport().should_close())
}
*/

pub fn on_window_event(
&mut self,
Expand All @@ -253,18 +253,13 @@ impl EpiIntegration {
) -> EventResponse {
crate::profile_function!(egui_winit::short_window_event_description(event));

use winit::event::{ElementState, MouseButton, WindowEvent};
use winit::event::WindowEvent;

match event {
WindowEvent::Destroyed => {
log::debug!("Received WindowEvent::Destroyed");
self.close = true;
}
WindowEvent::MouseInput {
button: MouseButton::Left,
state: ElementState::Pressed,
..
} => self.can_drag_window = true,
WindowEvent::ThemeChanged(winit_theme) if self.follow_system_theme => {
let theme = theme_from_winit_theme(*winit_theme);
self.frame.info.system_theme = Some(theme);
Expand All @@ -291,36 +286,32 @@ impl EpiIntegration {
) -> egui::FullOutput {
raw_input.time = Some(self.beginning.elapsed().as_secs_f64());

let close_requested = raw_input.viewport().close_requested();

app.raw_input_hook(&self.egui_ctx, &mut raw_input);

let full_output = self.egui_ctx.run(raw_input, |egui_ctx| {
if let Some(viewport_ui_cb) = viewport_ui_cb {
// Child viewport
// Child Deferred Viewport
crate::profile_scope!("viewport_callback");
viewport_ui_cb(egui_ctx);
} else {
// ROOT Viewport ( with Immediate Viewport )
crate::profile_scope!("App::update");
app.update(egui_ctx, &mut self.frame);
}
});

let is_root_viewport = viewport_ui_cb.is_none();
if is_root_viewport && close_requested {
let canceled = full_output.viewport_output[&ViewportId::ROOT]
.commands
.contains(&egui::ViewportCommand::CancelClose);
if canceled {
log::debug!("Closing of root viewport canceled with ViewportCommand::CancelClose");
} else {
log::debug!("Closing root viewport (ViewportCommand::CancelClose was not sent)");
self.close = true;
let continuous_mode = egui_ctx.options(|options| options.continuous_mode);
if continuous_mode {
let viewport_id = egui_ctx.viewport_id();
// TODO(rustbasic) : Do not recall until the next repaint.
// 1000 millis / 60 fps = 16.67 millis
self.egui_ctx
.request_repaint_after_for(std::time::Duration::from_millis(8), viewport_id);
}
}
});

self.pending_full_output.append(full_output);
std::mem::take(&mut self.pending_full_output)
// self.pending_full_output.append(full_output);
// std::mem::take(&mut self.pending_full_output)
full_output
}

pub fn report_frame_time(&mut self, seconds: f32) {
Expand Down
Loading
Loading