Initial commit.

This commit is contained in:
Nolan Darilek 2022-01-19 14:52:52 -06:00
commit ff74bf29ba
3 changed files with 32 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
target
Cargo.lock

12
Cargo.toml Normal file
View 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
View 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);
}
}