Raylib bindings for Mojo.
Note
This project is not complete there are somethings that are not implemented yet (like raudio). Also majority of the functions are not tested, the majority should probably work but there are no guarantees and also some structs could be incorrectly implemented.
Warning: This project seems to have errors in MacOs and it is also a little bit more complex because FFI still isn't complete in mojo (see Issue 3144 for the FFI macos issue and FFI general issue).
- C, C Compiler
- CMake
- RayLib
-
RayLib installation guide:
- You can install raylib using brew Install raylib package managers or manually Install RayLib, Working on GNU Linux
- Note: if you are using WSL and its built-in windowing server. When installing raylib set this flag in the cmake command
-DUSE_WAYLAND=ON
.
-
Clone the repo
git clone https://github.com/andresnowak/raylib-mojo
-
Build the raylib bindings:
cd raylib-mojo/raylib/raylib_bindings mkdir build mkdir lib touch config.cmake cd build cmake .. make
- In
config.cmake
you have to set the path to the raylib installation. For example:
set(RAYLIB_ROOT_DIR "/home/linuxbrew/.linuxbrew/Cellar/raylib/5.0")
- In
-
Set the path to RayLib:
In
raylib
dir create a file calledenv_variables.mojo
and in there set the complete path to the raylib installation and for the bindings we create. For example:alias RAYLIB_PATH = "/home/linuxbrew/.linuxbrew/Cellar/raylib/5.0" alias alias RAYLIB_BINDINGS_PATH = "/home/usr/raylib-mojo/raylib/raylib_bindings/lib/libraylib_bindings.so"
-
Run demo:
After that you can run
demo.mojo
.
As there are still things missing and some things are incorrectly implemented and maybe some things could be better implemented, any fix and improvement is appreciated.
- Fork the Project
- Create your Feature Branch
- Commit your Changes
- Push to the Branch
- Open a Pull Request
raylib-mojo is licensed under an unmodified zlib/libpng license. View LICENSE for more information.
- Built with Mojo created by Modular
- Extra: This project was implemented because of this one fire-physics-engine