Skip to content

Commit

Permalink
Bump to 0.19
Browse files Browse the repository at this point in the history
  • Loading branch information
vladbat00 committed Jan 15, 2023
1 parent bc12171 commit f8b3915
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 25 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.19.0] - 15-Jan-2023

- Update the `arboard` dependency ([#142](https://github.com/mvlabat/bevy_egui/pull/142) by @jakobhellermann)
- Fix panics due to missing swapchain textures ([#141](https://github.com/mvlabat/bevy_egui/pull/141) by @connerebbinghaus)

## [0.18.0] - 11-Dec-2022

### Added
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy_egui"
version = "0.18.0"
version = "0.19.0"
authors = ["mvlabat <[email protected]>"]
description = "A plugin for Egui integration into Bevy"
license = "MIT"
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Here's a minimal usage example:
# Cargo.toml
[dependencies]
bevy = "0.9"
bevy_egui = "0.18"
bevy_egui = "0.19"
```

```rust
Expand All @@ -53,11 +53,11 @@ fn main() {
.add_plugin(EguiPlugin)
// Systems that create Egui widgets should be run during the `CoreStage::Update` stage,
// or after the `EguiSystem::BeginFrame` system (which belongs to the `CoreStage::PreUpdate` stage).
.add_system(ui_example)
.add_system(ui_example_system)
.run();
}

fn ui_example(mut egui_context: ResMut<EguiContext>) {
fn ui_example_system(mut egui_context: ResMut<EguiContext>) {
egui::Window::new("Hello").show(egui_context.ctx_mut(), |ui| {
ui.label("world");
});
Expand All @@ -80,7 +80,7 @@ cargo run --example ui

| bevy | bevy_egui |
|------|-----------|
| 0.9 | 0.17-0.18 |
| 0.9 | 0.17-0.19 |
| 0.8 | 0.15-0.16 |
| 0.7 | 0.13-0.14 |
| 0.6 | 0.10-0.12 |
Expand Down
4 changes: 2 additions & 2 deletions examples/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ fn main() {
.add_plugin(EguiPlugin)
// Systems that create Egui widgets should be run during the `CoreStage::Update` stage,
// or after the `EguiSystem::BeginFrame` system (which belongs to the `CoreStage::PreUpdate` stage).
.add_system(ui_example)
.add_system(ui_example_system)
.run();
}

fn ui_example(mut egui_context: ResMut<EguiContext>) {
fn ui_example_system(mut egui_context: ResMut<EguiContext>) {
egui::Window::new("Hello").show(egui_context.ctx_mut(), |ui| {
ui.label("world");
});
Expand Down
19 changes: 11 additions & 8 deletions examples/two_windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ fn main() {
app.add_plugins(DefaultPlugins)
.add_plugin(EguiPlugin)
.init_resource::<SharedUiState>()
.add_startup_system(load_assets)
.add_startup_system(create_new_window)
.add_system(ui_first_window)
.add_system(ui_second_window);
.add_startup_system(load_assets_system)
.add_startup_system(create_new_window_system)
.add_system(ui_first_window_system)
.add_system(ui_second_window_system);

let render_app = app.sub_app_mut(RenderApp);
let mut graph = render_app.world.get_resource_mut::<RenderGraph>().unwrap();
Expand All @@ -39,7 +39,10 @@ fn main() {

const SECONDARY_EGUI_PASS: &str = "secondary_egui_pass";

fn create_new_window(mut create_window_events: EventWriter<CreateWindow>, mut commands: Commands) {
fn create_new_window_system(
mut create_window_events: EventWriter<CreateWindow>,
mut commands: Commands,
) {
// sends out a "CreateWindow" event, which will be received by the windowing backend
create_window_events.send(CreateWindow {
id: *SECOND_WINDOW_ID,
Expand All @@ -62,7 +65,7 @@ fn create_new_window(mut create_window_events: EventWriter<CreateWindow>, mut co
});
}

fn load_assets(mut commands: Commands, assets: Res<AssetServer>) {
fn load_assets_system(mut commands: Commands, assets: Res<AssetServer>) {
commands.insert_resource(Images {
bevy_icon: assets.load("icon.png"),
});
Expand All @@ -78,7 +81,7 @@ struct SharedUiState {
shared_input: String,
}

fn ui_first_window(
fn ui_first_window_system(
mut egui_context: ResMut<EguiContext>,
mut ui_state: Local<UiState>,
mut shared_ui_state: ResMut<SharedUiState>,
Expand All @@ -101,7 +104,7 @@ fn ui_first_window(
});
}

fn ui_second_window(
fn ui_second_window_system(
mut egui_context: ResMut<EguiContext>,
mut ui_state: Local<UiState>,
mut shared_ui_state: ResMut<SharedUiState>,
Expand Down
16 changes: 8 additions & 8 deletions examples/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ fn main() {
.init_resource::<UiState>()
.add_plugins(DefaultPlugins)
.add_plugin(EguiPlugin)
.add_startup_system(configure_visuals)
.add_startup_system(configure_ui_state)
.add_system(update_ui_scale_factor)
.add_system(ui_example)
.add_startup_system(configure_visuals_system)
.add_startup_system(configure_ui_state_system)
.add_system(update_ui_scale_factor_system)
.add_system(ui_example_system)
.run();
}
#[derive(Default, Resource)]
Expand All @@ -43,18 +43,18 @@ struct UiState {
is_window_open: bool,
}

fn configure_visuals(mut egui_ctx: ResMut<EguiContext>) {
fn configure_visuals_system(mut egui_ctx: ResMut<EguiContext>) {
egui_ctx.ctx_mut().set_visuals(egui::Visuals {
window_rounding: 0.0.into(),
..Default::default()
});
}

fn configure_ui_state(mut ui_state: ResMut<UiState>) {
fn configure_ui_state_system(mut ui_state: ResMut<UiState>) {
ui_state.is_window_open = true;
}

fn update_ui_scale_factor(
fn update_ui_scale_factor_system(
keyboard_input: Res<Input<KeyCode>>,
mut toggle_scale_factor: Local<Option<bool>>,
mut egui_settings: ResMut<EguiSettings>,
Expand All @@ -74,7 +74,7 @@ fn update_ui_scale_factor(
}
}

fn ui_example(
fn ui_example_system(
mut egui_ctx: ResMut<EguiContext>,
mut ui_state: ResMut<UiState>,
// You are not required to store Egui texture ids in systems. We store this one here just to
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
//! .add_plugin(EguiPlugin)
//! // Systems that create Egui widgets should be run during the `CoreStage::Update` stage,
//! // or after the `EguiSystem::BeginFrame` system (which belongs to the `CoreStage::PreUpdate` stage).
//! .add_system(ui_example)
//! .add_system(ui_example_system)
//! .run();
//! }
//!
//! fn ui_example(mut egui_context: ResMut<EguiContext>) {
//! fn ui_example_system(mut egui_context: ResMut<EguiContext>) {
//! egui::Window::new("Hello").show(egui_context.ctx_mut(), |ui| {
//! ui.label("world");
//! });
Expand Down

0 comments on commit f8b3915

Please sign in to comment.