diff --git a/.gitignore b/.gitignore index 23a39f2..19683c7 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ android/ .vscode/ addons/ -Cargo.lock \ No newline at end of file +Cargo.lock +steam_appid.txt \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index c0c7af6..96ac615 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,6 +20,7 @@ path-clean = "1.0.1" pollster = "0.3" puffin = "0.19.1" puffin_egui = "0.29" +steamworks = {git = "https://github.com/trevyn/steamworks-rs", branch = "master"} wgpu = {version = "22.1.0", default-features = false, features = ["metal", "naga-ir"]} winit = "0.30" # rapier2d = {version = "0.22.0", features = ["default", "debug-render"]} diff --git a/src/main.rs b/src/main.rs index d86cdf9..4fa5d01 100644 --- a/src/main.rs +++ b/src/main.rs @@ -44,5 +44,35 @@ fn config() -> GlassConfig { fn main() -> Result<(), GlassError> { eprintln!("Hello world!"); + match steamworks::Client::init() { + Ok(client) => { + let _cb = client.register_callback(|p: steamworks::PersonaStateChange| { + println!("Got callback: {:?}", p); + }); + + let utils = client.utils(); + println!("Utils:"); + println!("AppId: {:?}", utils.app_id()); + println!("UI Language: {}", utils.ui_language()); + + let apps = client.apps(); + println!("Apps"); + println!( + "IsInstalled(480): {}", + apps.is_app_installed(steamworks::AppId(480)) + ); + println!( + "InstallDir(480): {}", + apps.app_install_dir(steamworks::AppId(480)) + ); + println!("BuildId: {}", apps.app_build_id()); + println!("AppOwner: {:?}", apps.app_owner()); + println!("Langs: {:?}", apps.available_game_languages()); + println!("Lang: {}", apps.current_game_language()); + } + + Err(e) => println!("Steam client error: {}", e), + } + Glass::run(config(), |context| Box::new(FluidSimApp::new(context))) }