Skip to content
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

Why does the documentation in C ++ not have the information of each class and method as in godot C #? #604

Open
kone9 opened this issue Aug 27, 2021 · 3 comments · May be fixed by #1311
Open
Labels
discussion enhancement This is an enhancement on the current functionality

Comments

@kone9
Copy link

kone9 commented Aug 27, 2021

Download the source code, but there is no explanation of everything that the class owns.

example rigidbody class

C++ godot-cpp master.

Screenshot_5

C# in Godot Engine Mono Versión 3.3.3 stable

Screenshot_6

Example copying some comments found in the C # file inside the Rigidbody.hpp

Screenshot_7

As we see the C # code, each functionality is correctly commented.
Open any way to make this automatic?

thanks!.

@Calinou
Copy link
Member

Calinou commented Aug 27, 2021

This is because the Godot API is documented in the class reference rather than C++ files. We can't afford copy-pasting all the method descriptions in the C++ source as they would quickly become outdated. For Godot core, the only way to avoid duplication would be to create an application that can read the C++ source code and generate the class reference with pre-filled descriptions based on that, but this is a lot of work for little gain.

Nonetheless, for godot-cpp's use cases, I wonder if it's possible to use the DocData available when generating the JSON API file which is then used to generate the bindings. Do note however that GDNative is being replaced with GDExtension in Godot 4.0, so this work would have to be redone from scratch there.

@ariesssss
Copy link

I asked a related question here: https://godotforums.org/d/36688-applying-the-class-reference-documentation-to-c

It is not always easy to figure out how to do something in godot-cpp after reading the godot class reference documentation. I give the example of the Transform3D * vector3 operation, which exists in the class reference but not in godot-cpp.

How do I, in the general case, find out how to implement, in C++, the features described in the class reference?

@dsnopek
Copy link
Collaborator

dsnopek commented Oct 17, 2023

Now that PR godotengine/godot#82331 has been merged, we could have the code generator in godot-cpp add doc comments in a format that IDEs can understand (perhaps Doxygen?). Personally, I think this would be a great (optional) feature!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion enhancement This is an enhancement on the current functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants