Problems with Bevy version 0.10.0 WindowDescriptor struct
I saw this tutorial:Bevy Game Engine Tutorial - Window and First Sprite (Ep1 and I tried to do the same thing, but my Bevy is in version 0.10.0, and this structure WindowDescriptor
is not working, I've tried to do it in other ways seen here on Stack OverFlow but without success with that so far!
My code is like this:
use bevy::prelude::*;
pub const CLEAR: Color = Color::rgb(0.1, 0.1, 0.1);
fn main() {
App::new()
.insert_resource(ClearColor(CLEAR))
.insert_resource(WindowDescriptor {
title: "Bevy Demo".to_string(),
width: 1600.0,
height: 900.0,
vsync: true,
resizable: true,
..Default::default()
})
.add_plugins(DefaultPlugins)
.run();
}
My Cargo.toml looks like this:
[package]
name = "test-bevy-game"
version = "0.1.0"
edition = "2021"
[profile.dev]
opt-level = 1
[profile.dev.package."*"]
opt-level = 3
[dependencies]
bevy = { version = "0.10.1", features = ["dynamic_linking"] }
And the debug error is this:
error[E0422]: cannot find struct, variant or union type `WindowDescriptor` in this scope
--> src\main.rs:8:22
|
8 | .insert_resource(WindowDescriptor {
| ^^^^^^^^^^^^^^^^ not found in this scope
For more information about this error, try `rustc --explain E0422`.
error: could not compile `test-bevy-game` due to previous error
I just don't want the compiler to give me any errors about this, I hope I can at least add the ecs vsync, width, height, title statically in my code, I want to know if bevy in version 0.10.0 need to change the version to an older one?