-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Addition of GDExtension docs #6212
Conversation
6b9a23a
to
7c7ee2f
Compare
06ed137
to
ab374af
Compare
8f72d0f
to
d60c230
Compare
4db73a7
to
c3853a5
Compare
c3853a5
to
6ae775e
Compare
@mhilbrunner Since your last commit, I noticed that the SConstruct file you put in the folder structure doesn't actually run. Also, it is quite complex to understand. Since the build system was revamped the SConstruct doesn't need to that complicated anymore. At least for my template I have it way simpler so my reworked version would be this: #!/usr/bin/env python
import os
import sys
env = SConscript("godot-cpp/SConstruct")
# For the reference:
# - CCFLAGS are compilation flags shared between C and C++
# - CFLAGS are for C-specific compilation flags
# - CXXFLAGS are for C++-specific compilation flags
# - CPPFLAGS are for pre-processor flags
# - CPPDEFINES are for pre-processor defines
# - LINKFLAGS are for linking flags
# tweak this if you want to use different folders, or more folders, to store your source code in.
env.Append(CPPPATH=["src/"])
sources = Glob("src/*.cpp")
if env["platform"] == "macos":
library = env.SharedLibrary(
"demo/bin/osx/libgdexample.{}.framework".format(
env["platform"],
),
source=sources,
)
elif env["platform"] == "windows":
library = env.SharedLibrary(
"demo/bin/win64/libgdexample.{}.{}{}".format(env["platform"], env["arch"], env["SHLIBSUFFIX"]),
source=sources,
)
else:
library = env.SharedLibrary(
"demo/bin/linux/libgdexample.{}.{}{}".format(env["platform"], env["arch"], env["SHLIBSUFFIX"]),
source=sources,
)
Default(library) And the
Imho this would be clearer for new users. What do you think? |
|
||
GDExtension add-ons compiled for a given Godot version are only guaranteed to work | ||
with the same minor release series. For example, a GDExtension add-on compiled for | ||
Godot 4.0 will only work with Godot 4.0, 4.0.1, 4.0.2… but not Godot 3.5 or 3.6. |
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.
Nitpick: I'd rephrase to make it clearer that 3.5 and 3.6 don't have GDExtension at all (unless I missed something, GDExtension was NOT backported to 3.x branch)
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.
Good point👍🏻 I made it clearer that GDExtension isn't compatible with GDNative
Hmm. If all that GDExtension does is call on a dll, could I have some logic NOT using any Godot specific stuff e.g. in Golang and call on it WITHOUT having any Golang bindings? |
Good question! Not sure how that applies to other languages but I think in Python used with GDNative it was possible to use some modules assuming they were imported properly. |
Something that just occurred to me, and which IIRC is also missing from GDNative docs in 3.5, what's the debugger/remote tree situation? I expect to have to use the debugger for the language I'm using, but what about remote tree variables if I use a gdns straight on a node, e.g. the player, as is the case with many of the demo projects out there? |
I am not sure what you mean with your question. Could you elaborate? |
7124afa
to
c3c78c6
Compare
Literally what I said. Suppose I use a gdns file for my player node. Can I see e.g. the player's position or speed in the Godot remote tree? |
This here is the GDExtension docs addition, not GDNative. |
Ah, I was confused (again) by the fact you started from renaming the GDNative docs :P of course I meant Extension |
namespace godot { | ||
|
||
class GDExample : public Sprite2D { | ||
GD_CLASS(GDExample, Sprite2D) |
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.
GD_CLASS(GDExample, Sprite2D) | |
GDCLASS(GDExample, Sprite2D) |
I think you meant GDCLASS
. I got stuck here for a little while 🤓
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.
@yudi-azvd Thanks for noticing! It's updated now.
Alright, here's a little update what is already done in this PR and works (tested locally by me):
|
e6294b3
to
9e94d48
Compare
Generally looks good to me, just a few things that I guess were translated from the GDNative version but now work slightly differently in GDExtensions. |
889d3fd
to
97517d9
Compare
I worked in the feedback, added a property hint example (with |
e87daca
to
5f1ae28
Compare
Looking pretty good so far to me. |
80507b4
to
bd90ed4
Compare
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.
Looks good to me, gave it another read and spotted nothing else!
Could you convert the .pngs to .webp? We decided to change format for the docs.
Besides that, I'm happy to merge this. :)
bd90ed4
to
98268b9
Compare
@mhilbrunner Awesome! I converted the |
9fb46a1
to
c633524
Compare
Alright, the |
c633524
to
1016093
Compare
Yep, redirects are now fine, good work! :) |
Renames from GDNative to GDExtension Add Pictures/Gifs and clarified compatability Remove GDNative language bindings from GDExtension docs Update SConstruct and AddingProperties section updated with suggestions Added property hint example + updated to API naming changes Fixed redirect.csv
1016093
to
1d60984
Compare
It is done :O 😅 there was an issue with the renaming of the .png to .webp inside the documents themselves. Is fixed now. ready to merge @mhilbrunner |
Merged, finally! 🎉 Amazing work. Thanks for keeping up with all the reviews and change requests for so long. Amazing docs contribution and nice we have that in now for 4.0 launch. :) |
Aims to implement #5618 in its basic form (more can be added later in additional PRs)
Part of #5121
What this PR explains: