From 63525b28eab466aace07f464087e05c58a7de1d4 Mon Sep 17 00:00:00 2001 From: jcweaver997 Date: Sun, 4 May 2025 18:46:00 -0500 Subject: [PATCH] added steam init --- Cargo.toml | 1 + src/main.rs | 4 ++++ src/steam.rs | 16 ++++++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 src/steam.rs diff --git a/Cargo.toml b/Cargo.toml index a471037..0e93b9e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ image = "0.24.7" # Image processing walkdir = "2.4.0" # Directory traversal global-hotkey = "0.4.2" # Global hotkey registration lazy_static = "1.4.0" # Thread-safe static initialization +steamworks = "0.11.0" # Platform-specific dependencies [target.'cfg(windows)'.dependencies] diff --git a/src/main.rs b/src/main.rs index 58203bf..4def902 100644 --- a/src/main.rs +++ b/src/main.rs @@ -23,6 +23,9 @@ use global_hotkey::{ // Import our platform-specific module mod platform; +pub mod steam; +use steam::*; + // Define a struct to hold cursor information #[derive(Clone)] struct CursorInfo { @@ -257,6 +260,7 @@ fn boot() -> (CursorRush, Task) { } fn main() -> iced::Result { + let _steam = steam::Steam::new(); iced::application("Cursor Rush", update, view) .theme(|_| Theme::Dark) .subscription(subscription) diff --git a/src/steam.rs b/src/steam.rs new file mode 100644 index 0000000..847f0b5 --- /dev/null +++ b/src/steam.rs @@ -0,0 +1,16 @@ +use steamworks::{AppId, Client, SingleClient}; + + +pub struct Steam { + client: Client, + single: SingleClient +} + +impl Steam { + pub fn new() -> Self { + let (client, single) = Client::init_app(AppId(1430270)).unwrap(); + Self { + client, single + } + } +} \ No newline at end of file