Awesome
Naylib
<img src="assets/naylib.png" alt="Naylib logo" width="15%" />Welcome to this repository! Here you'll find a Nim wrapper for raylib, a library for creating 2D and 3D games. The Nim API is designed to be user-friendly and easy to use.
Features
- Easy-to-use API: Simplified Nim interface for raylib functions
- Cross-platform support: Develop for multiple platforms including Windows, Linux, macOS, Web and Android
- Comprehensive documentation: Detailed guides and API references
- Active community: Get support and share your creations
Documentation
To learn more about how to use this wrapper, you can check out the documentation:
- raylib - Core library for videogame programming
- raymath - Mathematical functions for game development
- rlgl - Abstraction layer for OpenGL with immediate-mode API
- reasings - Smooth animation transitions
- rmem - Memory pool and objects pool allocators
If you're familiar with the C version of raylib, you may find the cheatsheet useful.
Installation
Install naylib easily with nimble install naylib
.
For Linux users only: Ensure you have the required dependencies installed using your distribution's native package manager.
Examples
We've also provided some example code to help you get started. You can find it in the
accompanying example repository.
To compile and run an example: nim c -r -d:release example.nim
Changes from Raylib to Naylib
Naylib introduces several improvements and changes compared to the original Raylib. For a comprehensive overview of these changes, including memory management, naming conventions, and API improvements, please refer to our Changes Overview document.
Advanced Usage
For detailed instructions on advanced topics, please refer to our Advanced Usage Guide.
Here are quick links to some important sections:
- Important Usage Tips - Learn how to properly call
closeWindow
and other crucial tips - Building for the Web (WebAssembly) - Instructions for compiling your project for web browsers
- Building for Android - Step-by-step guide for Android development
- Raylib Functions to Nim Alternatives - Find Nim equivalents for raylib functions
Check out the wrapper's Configuration Guide for detailed information on how to use and contribute to naylib-wrapper.
Platform Support
Target | Windows | Linux | macOS |
---|---|---|---|
Native | Supported, Tested | Supported, Tested | Supported, Tested |
WebAssembly | Supported, Tested | Supported, Tested | Supported, Tested |
DRM | Untested | Supported | Untested |
Android | Supported, Tested | Supported, Tested | Possibly Works |
Windows (Cross) | N/A | Known Issues | Untested |
Development Status
- Our CI pipeline ensures quality across Windows, Linux, and macOS for both native and WebAssembly builds.
- We also maintain a separate CI for Android cross-compilation from Windows and Linux hosts.
CI Status
Alternative Game Development Libraries
While we believe that Naylib provides a great option for game development with Nim, we understand that it may not be the perfect fit for everyone. Here are some noteworthy alternatives:
- NimForUE: Plugin for Unreal Engine 5
- nsdl3: High level SDL 3 wrapper
- sokol-nim: Auto-generated bindings for sokol headers
- gdextcore: Godot 4.x bindings
- godot-nim: Godot 3 bindings
- nico: Pico-8 inspired game framework
- p5nim: Processing library
For a comprehensive list of game development resources in Nim, visit awesome-nim.
Contributing
We welcome contributions! Whether it's bug reports, feature requests, or code contributions, please feel free to engage with our project.
License
Naylib is open-source software licensed under the MIT License.
Please note that the raylib source code included in this distribution is licensed under the zlib license.
Contact
For support and discussions, join us on Discord:
- Nim server (#gamedev): discord.gg/nim
- Raylib server (#raylib-nim): discord.gg/raylib