Missing class members on the documents.

Hi, I’m new to cocos2d. Thanks a lot for this beautiful multiplatform game engine.:slight_smile:

I’m having hard time using cocos2d-x, because some class members are not documented on the API reference.
For example, CCNode, the very foundation class, is missing lots of class members on the documentation. Also, the description of m_tTransform at the bottom of the CCNode page is mixed up with lots of other undocumented members.

I think the reason is that the doxygen doesn’t recognize the lines that define those class members by preprocessor macros.

Why don’t you apply doxygen to the source code after preprocess those macros?

I would pretty much appreciate the API reference that has at least complete list of class members, and guess more people would use cocos2d-x.

1 Like

Oh, so bad! I haven’t noticed that!
It’s not hard to do it, I remember there’s a setting somewhere to expand the marcos when running doxygen building.
Wait a moment.

So said! I don’t manage how to config the doxygen to expand preprocessor marcos in 5 minutes.
Can you help me to modify the config of cocos2d-x/doxygen/cocos2d-x.doxygen ?

If you are asking me for help, I have no idea. I never used doxygen.
Though, I’ll try, please don’t count on me.

Thank you for taking a look at the problem, anyway.

I tried with the changes below, and it seemed working.

Changes to doxygen/doxygen.cocos2d-x:

INCLUDE_PAT = …/cocos2dx/platform
SKIP_FUNCTION_MACROS = NO

Please confirm the result. Thanks.

I also found that setting EXTRACT_ALL to YES made some more classes visible, such as those defined in CCGeometry.h.

SKIP_FUNCTION_MARCOS = NO &
EXTRACT_ALL = YES
These setting rocks! But we had better not to add cocos2dx/platform into INCLUDE_PATH. Classes in platform folder is for engine internal use, if we find any class is valuable for game developers, we would bring it into cocos2d-x/include folder.

Fixed in https://github.com/cocos2d/cocos2d-x/commit/1887cb3723843763ebc865544c4ef6a4d37734fb

I pulled the latest code. Thanks!

Sadly, the missing class member are still missing from document generated with new source code.

The reason why I added “cocos2dx/platform” to INCLUDE_PATH is that the macros used to define class members are defined in cocos2dx/platform/CCPlatformMacros.h. e.g. CC_PROPERTY and CC_PROPERTY_READONLY.

Without letting doxygen know the location of CCPlatformMacros.h or the definition of the macros, it would still generate documentation missing lots of class members and getters/setters for them.

I think it is ok to set that path to INCLUDE_PATH, because the setting is only for doxygen. Setting INCLUDE_PATH doesn’t change the source tree, access level or visibility of class members in the source code.

What do you think?

Well, so I had to move these macros to cocos2d-x/include, there’re platform independent.

You don’t have to move the macros to include dir. You don’t have to change any source code for this issue.

What I’m suggesting is to change the value of INCLUDE_PATH, which is a setting of doxygen.
It tells doxygen where it can find necessary definitions to generate documents, not to compile/build the source code.