Initial Commit

This commit is contained in:
Jordon Brooks 2023-06-02 22:58:55 +01:00
parent afddf6b3e8
commit 54edd950eb
4 changed files with 80 additions and 0 deletions

6
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,6 @@
{
"rust-analyzer.linkedProjects": [
".\\Cargo.toml",
".\\Cargo.toml"
]
}

16
Cargo.toml Normal file
View file

@ -0,0 +1,16 @@
[package]
name = "harmony_link_test"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[profile.release]
panic = "abort" # Strip expensive panic clean-up logic
codegen-units = 1 # Compile crates one after another so the compiler can optimize better
lto = true # Enables link to optimizations
opt-level = "z" # Optimize for binary size
strip = true # Remove debug symbols
[dependencies]
libloading = "0.8.0"

34
README.md Normal file
View file

@ -0,0 +1,34 @@
# HarmonyLink: The Handheld Game Link
HarmonyLink is a powerful plugin designed to bridge the gap between your favorite game engines and handheld gaming devices. Initially focusing on the Steam Deck, HarmonyLink aims to provide seamless integration with a variety of handheld devices, enabling games to access critical system metrics and offer a more personalized, immersive gaming experience.
## Key Features
- Device Identification: HarmonyLink allows games to recognize the specific handheld device they are running on.
- User-Set Power Limits: HarmonyLink provides access to user-defined power limits, allowing games to adapt and optimize performance based on these constraints.
- Real-Time Metrics: With HarmonyLink, games can access real-time information about the handheld device's power usage and docking status, enabling a level of interaction and responsiveness previously unattainable.
- Cross-Platform Compatibility: Although initial development focuses on Unreal Engine and the Steam Deck, HarmonyLink is designed with the future in mind. We plan to extend compatibility to other game engines like Unity and more handheld devices.
## Getting Started
To compile HarmonyLink for Unreal Engine, follow these steps:
> NOTE: This guide assumes that you have a basic understanding of using Unreal Engine and its plugin system.
1. Clone the repository to your local machine.
2. Navigate to the directory containing the .uproject file of your Unreal Engine project.
3. Create a "Plugins" folder if it doesn't already exist.
4. Copy the "HarmonyLink" folder into the "Plugins" folder.
5. Open your Unreal Engine project. You'll be prompted to build missing modules.
6. Click "Yes" to rebuild now.
## Get Involved
HarmonyLink is a community-driven project and we welcome contributions of all kinds:
- Bug Reports: Found a problem? Let us know so we can fix it!
- Feature Suggestions: Have an idea for improving HarmonyLink? We'd love to hear it.
- Code Contributions: Want to get your hands dirty? Feel free to make a pull request. For major changes, please open an issue first to discuss what you'd like to change.
Before contributing, please make sure to read our Contributing Guide and Code of Conduct.
Join us as we revolutionize the handheld gaming experience. Whether you're a game developer aiming to optimize your game for handheld devices or a gamer looking forward to more immersive and responsive handheld games, HarmonyLink is the plugin you've been waiting for.

24
src/main.rs Normal file
View file

@ -0,0 +1,24 @@
extern crate libloading;
fn main() {
let lib = unsafe { match libloading::Library::new("harmony_link_core.dll") {
Ok(lib) => lib,
Err(err) => {
eprintln!("Error loading DLL: {}", err);
return;
},
}
};
unsafe {
let func: libloading::Symbol<unsafe extern "C" fn()> = match lib.get(b"start") {
Ok(func) => func,
Err(err) => {
eprintln!("Error finding function in DLL: {}", err);
return;
}
};
func();
}
}