Skip to content

Commit

Permalink
Mock spawn camera
Browse files Browse the repository at this point in the history
This doesn't do anything useful. Commit just kept around in case I need
to revisit this.

`_setup_camera` commented out for the moment because we observed the
error mentioned in the comment
(bevyengine/bevy#11734).
With `do_nothing`, we get this:

```
2024-03-28T11:58:43.553731Z ERROR log: X11 error: XError {
    description: "BadWindow (invalid Window parameter)",
    error_code: 3,
    request_code: 148,
    minor_code: 1,
}
2024-03-28T11:58:43.567517Z ERROR bevy_winit: winit event loop returned an error: os error at /home/alex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.15/src/platform_impl/linux/x11/mod.rs:427: Xlib error: X error: BadWindow (invalid Window parameter) (code: 3, request code: 148, minor code: 1)
```
  • Loading branch information
Ablesius committed Mar 28, 2024
1 parent a792013 commit 9ca9e38
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@ use bevy::prelude::*;

fn main() {
App::new()
// this crashes when closing the window with https://github.com/bevyengine/bevy/issues/11734
// .add_systems(Startup, setup_camera)
// this does NOT crash, instead has this: https://gist.github.com/Ablesius/f8ed4b0a7252e49d1a4380189cae19eb
// try: replaced call to do_nothing with ()
.add_systems(Startup, do_nothing)
.add_plugins(DefaultPlugins)
.run();
}

fn _setup_camera(mut commands: Commands) {
// need to deviate from the blog entry
// based on https://github.com/marcusbuffett/bevy_snake/commit/d7f263735dd8cc7ef5d94b961f1f7554ece780a3#r113302872
commands.spawn(Camera2dBundle::default());
}

// TODO: drop-in
// remove as soon as _setup_camera works
fn do_nothing() {}

0 comments on commit 9ca9e38

Please sign in to comment.