Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Added Rust as a supported language within SKM's Foreign Function Interface (FFI) system. This update enables SKM to handle Rust FFI calls alongside the existing supported languages, allowing Rust programs to properly interface with SplashKit's core functionality.
Changes Made
Type of change
How Has This Been Tested?
Testing Note
I’m building a test runner to make testing more accessible for other users. This will be provided in a future PR with the tests. In the meantime I’ll provide a tutorial on how you can run a rust program.
Why this manual setup is necessary:
The SplashKit installation scripts download from the GitHub source project regardless of running the installation script locally. This means the files must be manually copied to your SplashKit directory to use the Rust implementation. The following steps ensure proper setup of the Rust environment for SplashKit.
Setting Up a Rust Project with SplashKit SDK
Prerequisites
Step 1: Clone the Repository
git clone https://github.com/NoahJCross/skm cd skm
Step 2: Install dos2unix
Choose the appropriate command for your system:
Step 3: Create Directory Structure
mkdir -p ~/.splashkit/{rust/src,new/rust/files/src,fix/rust}
Step 4: Copy Files
Copy entire directories with
-r
:Step 5: Convert Line Endings
Step 6: Set File Permissions
Step 7: Create and Run a Test Project
mkdir rust_test cd rust_test skm new rust
At this point, you can either create your own program or use the provided sample code. Copy the sample code into
src/main.rs
.Step 8: Build and Run
cargo build && cargo run
This will compile and run your Rust SplashKit project. The sample code creates a simple coin collector game with player movement, coins to collect, and enemies to avoid.
Checklist