-
-
Notifications
You must be signed in to change notification settings - Fork 253
ExtensionLibrary::on_main_loop_*: merge into new on_stage_init/deinit API
#1380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+294
−132
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-1380 |
bd6e127 to
eb85854
Compare
ExtensionLibrary: merge 3 on_main_loop_*() methods -> on_main_loop_event()ExtensionLibrary::on_main_loop_*: merge into new on_stage_init/deinit API
TitanNano
reviewed
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer Solution 2. It feels most consistent with what we already have and does not introduce two extra functions.
d841973 to
2c7085e
Compare
f2848f5 to
dced4e3
Compare
…frame Add InitStage as a superset of InitLevel, with added MainLoop variant. Integrates into the layered approach of on_level_[de]init, but with a new pair of methods due to backwards compatibility.
dced4e3 to
d484ea9
Compare
We previously used a type alias because `use` statements don't allow RustDoc in this case. However, this caused many broken links and shows up in a "Type Aliases" section, rather than in "Enums" next to `InitStage`. The new setup requires HTML links because the godot-ffi crate doesn't know the symbols, but it ultimately works, and we can also avoid duplicating docs.
d484ea9 to
025b1fb
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
c: ffi
Low-level components and interaction with GDExtension API
quality-of-life
No new functionality, but improves ergonomics/internals
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Iterates on the API design for main-loop callbacks, introduced in #1313.
Quick comparison:
(0): Status quo (master)
Separate methods for each callback. Direct C mapping.
(1): Group main-loop together
See first commit 74f9a01.
Smaller API in
ExtensionLibraryand fully independent of existingInitLevel, at the cost of enum + case differentiation even forFrame.(2): Group init level/stage together
See second commit a1d9adc.
Consistently treats all initialization stages (main loop has strict ordering > init levels). However, both
InitLevel+InitStagewill need to coexist, as the latter cannot be used for e.g. a class' init level.