godot-cpp icon indicating copy to clipboard operation
godot-cpp copied to clipboard

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

Open kone9 opened this issue 3 years ago • 3 comments

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!.

kone9 avatar Aug 27 '21 02:08 kone9

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.

Calinou avatar Aug 27 '21 12:08 Calinou

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?

ariesssss avatar Oct 17 '23 09:10 ariesssss

Now that PR https://github.com/godotengine/godot/pull/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!

dsnopek avatar Oct 17 '23 12:10 dsnopek