You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The godot-rust bindings developers welcome contribution from everyone. Here are the guidelines if you are thinking of helping us:
4
4
5
-
## Contributions
6
5
7
-
Contributions should be made in the form of GitHub pull requests (PRs). Each pull request will be reviewed by a core contributor (someone with permission to land patches) and either landed in the main tree or given feedback for changes that would be required.
6
+
## Submitting a PR
8
7
9
-
When opening a PR, our continuous integration (CI) pipeline will automatically perform a few basic checks (formatting, lints, unit tests). Please make sure those checks pass, adjusting your code if necessary.
8
+
Contributions should be made in the form of GitHub pull requests (PRs). Each pull request will be reviewed by the godot-rust team or other contributors.
10
9
11
-
Should you wish to work on an issue, please claim it first by commenting on the GitHub issue that you want to work on it. This is to prevent duplicated efforts from contributors on the same issue.
12
10
13
-
##Getting started
11
+
### Picking a task
14
12
15
-
Have a look at the [issues](https://github.com/godot-rust/godot-rust/issues) to find good tasks to start with.
13
+
Have a look at the [issue tracker] to find good tasks to start with. Should you wish to work on an issue, please claim it first by commenting in it. This is to prevent duplicated efforts from contributors on the same issue.
16
14
17
-
## Pull Request Checklist
15
+
We especially appreciate input on the issues labeled [`help wanted`]. The label [`good first issue`] encompasses issues which do not require a deep prior knowledge of the godot-rust intricacies and could be picked up by a newcomer.
18
16
19
-
- Branch from the master branch and, if needed, rebase to the current master branch before submitting your pull request. If it doesn't merge cleanly with master you may be asked to rebase your changes.
17
+
You can also open a pull request directly without an associated issue. Note however that discussing the issue with other developers beforehand increases the chances of a PR being accepted, and may save time on both your and the reviewer's end. Such discussions can also happen in our Discord server.
20
18
21
-
- Use one commit per logical change. Often, PRs only consist of a single commit. If you change unrelated parts of the code, split it into separate commits.
22
19
23
-
- If your patch is not getting reviewed or you need a specific person to review it, you can @-reply a reviewer asking for a review in the pull request or a comment.
20
+
### Git workflow
24
21
25
-
- Whenever applicable, add tests relevant to the fixed bug or new feature.
22
+
* Branch from the `master` branch and, if needed, rebase to the current `master` branch before submitting your pull request. If it doesn't merge cleanly, you may be asked to rebase your changes.
26
23
27
-
- Use `cargo fmt` to format your code.
24
+
* Use one commit per logical change. Often, PRs only consist of a single commit. If you change unrelated parts of the code, split it into separate commits.
28
25
29
-
## Testing
26
+
* If your patch is not getting reviewed or you need a specific person to review it, you can @-reply a reviewer asking for a review in the pull request or a comment.
30
27
31
-
Everywhere: run `cargo test --workspace` from the root of the repository.
Whenever applicable, add tests relevant to the fixed bug or new feature.
41
32
42
-
The `godot` command in the above snippet is your local installation of godot and may vary depending on how it was installed.
33
+
Some types and functions can only be used if the engine is running. In order to test them, use the `godot_test!` macro, and explicitly invoke the test functions in [test/src/lib.rs](test/src/lib.rs). Don't hesitate to see how existing code does this.
43
34
44
-
### Automating tests
35
+
36
+
### Local and CI checks
45
37
46
-
If you are on a bash-compatible system, you can use the `pre-commit.sh` to automatically run your tests every time you try to commit code. You can install it with:
38
+
The repository root contains a script `check.sh`. If you invoke it without arguments, it will run a list of basic checks locally. This tool also allows you to quickly build RustDoc documentation of changed APIs. Please run `./check.sh --help` for more information about its usage.
If you use Windows, you might consider using a Unix shell interpreter (e.g. one shipped with Git-for-Windows, or WSL2, or similar).
52
41
53
-
If you don't need to run tests on your commit, you can simply run `git commit --no-verify` to skip the pre-commit script. The pre-commit script handles a few edge cases as well, by stashing all of your changes before running tests, just in case your unstashed changes mask errors in the bare commit. This is especially useful if you've stopped working on something to make a quick patch.
42
+
Additionally, when opening a PR, our continuous integration (CI) pipeline will automatically perform a few checks (formatting, lints, unit tests). Please make sure all of them pass, adjusting your code where necessary.
54
43
55
-
## Writing tests
56
-
57
-
Some types can only be used if the engine is running, in order to test them, use the `godot_test!` macro (see examples in [variant.rs](gdnative/src/variant.rs)), and explicitly invoke the test functions in [test/src/lib.rs](test/src/lib.rs).
58
44
59
45
## Communication
60
46
61
-
Primary communication between developers of the project happens on the `godot-rust` Discord server. [Invite link here](https://discord.gg/FNudpBD).
47
+
Primary communication between developers of the project happens on the `godot-rust` Discord server. [Invite link here][godot-rust-discord].
62
48
63
-
For questions about using `godot-rust` the `#gdnative` channel on the [Godot Engine community Discord server](https://godotengine.org/community) can be used.
64
-
On IRC the `#godotengine-gdnative` channel on freenode can be used for questions as well.
49
+
For questions about Godot, check out the options on the [Godot community page][godot-community]. For example, their Discord server hosts a `#gdnative-dev` channel for questions regarding GDNative interface. The contributor chat is helpful in case of discussions about Godot's own design and implementation.
65
50
66
-
If you are only interested in occasional announcements and showcases, follow [@GodotRust on Twitter](https://twitter.com/GodotRust). For questions and design discussions, please use Discord.
51
+
If you are only interested in occasional announcements and showcases, follow [@GodotRust on Twitter][godot-rust-twitter]. For questions and design discussions, please use Discord.
67
52
68
53
## License
69
54
70
55
Any contribution submitted for inclusion in the work by you shall be licensed under the [MIT license](LICENSE.md), without any additional terms or conditions.
**godot-rust** is a Rust library that implements native bindings for the [Godot game engine](http://godotengine.org/). This allows you to develop games or other applications in Godot, while benefiting from Rust's strengths, such as its type system, scalability and performance.
12
12
@@ -25,23 +25,10 @@ For versions 3.2 and 3.3, some extra steps are needed, see _Custom builds_ below
25
25
26
26
The bindings do _**not**_ support in-development Godot 4 versions at the moment. Support is planned as the native extensions become more stable.
27
27
28
-
## Requirements
29
-
30
-
The generator makes use of `bindgen`, which depends on Clang. Instructions for installing `bindgen`'s dependencies for popular OSes can be found [in their documentation](https://rust-lang.github.io/rust-bindgen/requirements.html).
31
-
32
-
`bindgen` may complain about a missing `llvm-config` binary, but it is not actually required to build the `gdnative` crate. If you see a warning about `llvm-config` and a failed build, it's likely that you're having a different problem!
33
-
34
-
### 'Header not found' errors
35
-
36
-
When building the library, `bindgen` may produce errors that look like this:
37
-
38
-
```
39
-
godot-rust\gdnative-sys/godot_headers\gdnative/string.h:39:10: fatal error: 'wchar.h' file not found
40
-
```
41
28
42
-
This means that `bindgen` was unable to find the C system headers for your platform. If you can locate the headers manually, you may try setting the `C_INCLUDE_PATH` environment variable so `libclang` could find them. If on Windows, you may try building from the Visual Studio "developer console", which should setup the appropriate variables for you.
29
+
## Getting started
43
30
44
-
## Usage
31
+
Detailed setup is explained in [the _Getting Started_ section of the book](https://godot-rust.github.io/book/getting-started.html). In case of problems, consider also reading the [FAQ](https://godot-rust.github.io/book/faq/configuration.html).
45
32
46
33
### Latest `master` version + Godot 3.4
47
34
@@ -78,15 +65,11 @@ Async support is a work-in-progress, with a low-level API available in the `gdna
78
65
79
66
## Example
80
67
81
-
The most general use-case of the bindings will be to interact with Godot using the generated wrapper
82
-
classes, as well as providing custom functionality by exposing Rust types as *NativeScript*s.
68
+
A typical use case is to expose your own _Native Class_, a Rust API that can be invoked from the Godot engine. The resulting native script can be attached to the scene tree, just like GDScript (`.gd` files).
83
69
84
-
NativeScript is an extension for GDNative that allows a dynamic library to register "script classes"
85
-
to Godot.
70
+
This happens via dynamic libraries and the _GDNative interface_, which will be loaded from Godot. The necessary wiring is done behind the scenes by godot-rust. A simple "Hello world" application could look like this:
86
71
87
-
As is tradition, a simple "Hello World" should serve as an introduction. For a full tutorial, check out ["Getting Started" from the user guide](https://godot-rust.github.io/book/getting-started.html)!
> Before launching the examples in the godot editor, you must first run `cargo build` and wait for the build operations to finish successfully.
103
+
> Before launching the examples in the Godot editor, you must first run `cargo build` and wait for the build operations to finish successfully.
121
104
>
122
-
>At startup, the Godot editor tries to load all resources used by the project, including the native binary. If it isn't present, the editor skips properties or signals associated with the missing NativeScripts in the scene. This will cause the scene tree to be non-functional for any sample that relies on properties or signals configured in the editor.
105
+
>At startup, the Godot editor tries to load all resources used by the project, including the native library. If the latter isn't present, the editor will skip properties or signals associated with the missing native scripts in the scene. This will cause the scene tree to be non-functional for any sample that relies on properties or signals configured in the editor.
123
106
124
107
The [/examples](https://github.com/godot-rust/godot-rust/tree/master/examples) directory contains several ready to use examples, complete with Godot projects and setup for easy compilation from Cargo:
125
108
@@ -133,31 +116,17 @@ The [/examples](https://github.com/godot-rust/godot-rust/tree/master/examples) d
See also (work-in-progress): [Third-party projects](https://godot-rust.github.io/book/projects.html) in the book.
139
-
140
-
### Tools and integrations
141
119
142
-
-[godot-egui](https://github.com/setzer22/godot-egui) (setzer22, jacobsky) - combine the [egui](https://github.com/emilk/egui) library with Godot
143
-
-[ftw](https://github.com/macalimlim/ftw) (macalimlim) - manage your godot-rust projects from the command line
120
+
### Third-party projects
144
121
145
-
### Open-source games
146
-
147
-
-[Action RPG](https://github.com/MacKarp/Rust_Action_RPG_Tutorial) (MacKarp) - this [Godot tutorial](https://www.youtube.com/playlist?list=PL9FzW-m48fn2SlrW0KoLT4n5egNdX-W9a) ported to Rust.
148
-
-[Air Combat](https://github.com/paytonrules/AirCombat) (paytonrules) - this [Godot tutorial](https://devga.me/tutorials/godot2d/) ported to Rust.
- Step by step guide - [Up and running with Rust and Godot: A basic setup](https://hagsteel.com/posts/godot-rust/)
122
+
To see a list of games and integrations developed on top of godot-rust, have a look at our list of [third-party projects](https://godot-rust.github.io/book/projects.html) in the book.
155
123
156
124
157
125
## Contributing
158
126
159
127
See the [contribution guidelines](CONTRIBUTING.md).
160
128
129
+
161
130
## License
162
131
163
-
Any contribution intentionally submitted for inclusion in the work by you shall be licensed under the [MIT license](LICENSE.md), without any additional terms or conditions.
132
+
Any contribution submitted for inclusion in the work by you shall be licensed under the [MIT license](LICENSE.md), without any additional terms or conditions.
0 commit comments