https://github.com/vurv78/rglua
Toolkit for garrysmod development with the source sdk and lua c api
https://github.com/vurv78/rglua
dll garrys-mod garrysmod glua gmod lua module srcds
Last synced: 17 days ago
JSON representation
Toolkit for garrysmod development with the source sdk and lua c api
- Host: GitHub
- URL: https://github.com/vurv78/rglua
- Owner: Vurv78
- License: mit
- Created: 2020-12-31T05:36:11.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-12-29T03:59:57.000Z (4 months ago)
- Last Synced: 2025-03-29T17:12:27.715Z (25 days ago)
- Topics: dll, garrys-mod, garrysmod, glua, gmod, lua, module, srcds
- Language: Rust
- Homepage: https://docs.rs/rglua
- Size: 155 KB
- Stars: 47
- Watchers: 4
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# 🌑 ``rglua`` [](https://crates.io/crates/rglua)  [](https://opensource.org/licenses/Apache-2.0) [](https://discord.gg/epJFC6cNsw)
This is a crate that allows interop with the (g)luajit c api as well as the source sdk through libloading and vtable bindings.
You can then use these for binary modules or manually injected code, like with [Autorun-rs](https://github.com/Vurv78/Autorun-rs)More information on binary modules can be found on the garrysmod wiki: [Creating Binary Modules](https://wiki.facepunch.com/gmod/Creating_Binary_Modules) and examples [can be found here.](https://github.com/Vurv78/rglua/tree/master/examples)
## Usage
If you are targeting 32 bit make sure to install the toolchain and build to it:
```bash
rustup target add i686-pc-windows-msvc
cargo build --target=i686-pc-windows-msvc
```## Comparison
There are actually a decent amount of libraries out there for gmod development.
Here's a comparison and why you could use this one.[rglua]: https://crates.io/crates/rglua
[rust-glua-sys]: https://github.com/SpiralP/rust-glua-sys
[gmod-rs]: https://crates.io/crates/gmod
[gmrs]: https://github.com/diogo464/gmrs| Library | [rglua] | [rust-glua-sys] | [gmod-rs] | [gmrs] |
|-----------------------------------|---------|-----------------|-------------|--------|
| *Full* Lua C Api Bindings | ✔️ | ❌ | ❌ | ❌ |
| On Crates.io | ✔️ | ❌ | ✔️ | ❌ |
| Proc Macros | ✔️ | ❌ | ✔️ | ✔️ |
| Interfacing w/ Source SDK | ✔️ | ❌ | ❌ | ❌ |
| Returning Result<> from functions | ✔️ | ❌ | ❌ | ✔️ |
| Can be used on stable | ✔️ | ✔️ | ❌ | ✔️ |
| Real world examples | ✔️ | ❌ | 〰️ | ✔️ |
| Linux / OSX Support | ✔️ | ❌ | ✔️ | ✔️ |
| Github Stars | 😢 | 👍 | 👑 | 🤷♂️ |__*You can help with that last one 😉*__
## Acknowledgements
### [garrysmod_common](https://github.com/danielga/garrysmod_common)
This is heavily based off of garrysmod_common, in how we export the lua_shared functions and trying to replicate everything from the Lua C Api.