mirror of
https://github.com/lightsoutgames/bevy_full_throttle
synced 2024-12-03 16:35:58 +00:00
Initial commit.
This commit is contained in:
commit
ff74bf29ba
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
target
|
||||
Cargo.lock
|
12
Cargo.toml
Normal file
12
Cargo.toml
Normal file
|
@ -0,0 +1,12 @@
|
|||
[package]
|
||||
name = "bevy_full_throttle"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
bevy = { version = "0.6", default-features = false }
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
windows = { version = "0.30", features = ["Win32_System_Power", "Win32_System_Registry", "Win32_System_SystemServices"] }
|
18
src/lib.rs
Normal file
18
src/lib.rs
Normal file
|
@ -0,0 +1,18 @@
|
|||
use bevy::prelude::*;
|
||||
#[cfg(windows)]
|
||||
use windows::Win32::System::{Power, SystemServices::GUID_MIN_POWER_SAVINGS};
|
||||
|
||||
fn setup() {
|
||||
#[cfg(windows)]
|
||||
unsafe {
|
||||
Power::PowerSetActiveScheme(None, &GUID_MIN_POWER_SAVINGS);
|
||||
}
|
||||
}
|
||||
|
||||
pub struct FullThrottlePlugin;
|
||||
|
||||
impl Plugin for FullThrottlePlugin {
|
||||
fn build(&self, app: &mut App) {
|
||||
app.add_startup_system(setup);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user