https://github.com/ufrshubham/raylib-dart
Dart bindings for Raylib!
https://github.com/ufrshubham/raylib-dart
dart dart-ffi ffi game-library raylib raylib-binding raylib-dart
Last synced: about 1 month ago
JSON representation
Dart bindings for Raylib!
- Host: GitHub
- URL: https://github.com/ufrshubham/raylib-dart
- Owner: ufrshubham
- License: zlib
- Created: 2021-08-29T12:00:34.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-11-21T17:07:01.000Z (over 3 years ago)
- Last Synced: 2024-10-18T23:31:50.024Z (7 months ago)
- Topics: dart, dart-ffi, ffi, game-library, raylib, raylib-binding, raylib-dart
- Language: Dart
- Homepage:
- Size: 779 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Raylib-Dart
Dart bindings for raylib 4.0.0, a simple and easy-to-use library to learn videogames programming [www.raylib.com](https://www.raylib.com/)
## Note
- This project is still work in progress and a lot of APIs from raylib are not yet exposed correctly
- Right now it only supports Windows and Linux (in theory Mac should also work perfectly fine).
- This package uses a custom fork of [raylib](https://github.com/ufrshubham/raylib) added as submodule under vendors. So stock raylib binaries might not work.
- Some APIs from raylib are not exposed because I feel that dart already has native libraries to handle such things. For example:
- Logging
- File management (expect dropped file APIs)
- MemAlloc and MemFree- For a full list exposed APIs, check the [Cheatsheet](Cheatsheet.md)
## Usage
A simple usage example:
```dart
import 'package:raylib_dart/raylib_dart.dart';int main() {
// Might be a different path depending on your platform.
final raylibPath = path.join(
Directory.current.path, 'vendors/raylib/build/raylib/Release/raylib.dll');final raylib = Raylib(raylibPath);
final core = raylib.core;core.initWindow(1280, 720, 'Hello Raylib!');
core.targetFPS = 60;while (!core.shouldWindowClose) {
core.beginDrawing();
core.clearBackground(core.colors.black);
core.endDrawing();
}core.closeWindow();
}
```## Todo
- [ ] Add idiomatic wrappers for all the auto-generated dart bindings.
- [ ] (In progress) Add APIs to create native raylib structs (like Vector2, Color, Vector3) from dart. See [structs example](https://github.com/dart-lang/samples/tree/master/ffi/structs) from dart ffi.
- [ ] Figure out best way to distribute platform specific raylib binaries with this package. See [sqflite](https://github.com/tekartik/sqflite/tree/master/sqflite_common_ffi) for reference.
- [ ] Get all the examples from raylib working with this package.
- [ ] Add build instructions for the forked version of raylib.
- [ ] Add instructions for development and contribution to this project.
## For discussions
- Use the [Discussions](https://github.com/ufrshubham/raylib-dart/discussions) tab
- Or join my [Discord](https://discord.gg/6xZ4ycWSYB)