Created
April 22, 2025 20:46
-
-
Save Majkl-J/465db24696afd289ba81da1b0d74605d to your computer and use it in GitHub Desktop.
Example of including the rust-heart dll in C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RustHeart | |
{ | |
// Initialize our external library we use for the signal | |
[STAThread] | |
[DllImport("rustheart")] | |
public static extern IntPtr test_lib(); | |
/// Freeing | |
[DllImport("rustheart")] | |
public static extern void free_rust_string(IntPtr pointer_to_clear); | |
[DllImport("rustheart")] | |
public static extern void free_runnable(IntPtr pointer_to_clear); | |
// Simple heart handling | |
[DllImport("rustheart")] | |
public static extern IntPtr build_simple_heart(Int64 bpm, Double amplitude); | |
[DllImport("rustheart")] | |
public static extern void simple_heart_start(IntPtr handler_pointer, UInt64 baud); | |
[DllImport("rustheart")] | |
public static extern double simple_heart_read(IntPtr handler_pointer); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment