Jump to content
  • Advertisement
Sign in to follow this  
Thoran

When to use global wrapper functions for class members?

This topic is 3034 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I had a look at the scriptmath3d add-on and I am struggling with understanding when to use a global wrapper function and when to use the native class member for registering in angelscript. What I understood so far is that when using the generic calling convention I always need a wrapper, due to unpacking variables from the script objects stack. But looking at the native calling convention implementation of the Vector3 I see also global wrapper functions for the three constructors, while the operator members (like +, - etc.) are registered directly as I would expect it. Can someone please explain me the reason for the global wrapper functions for the constructors? Thanks in advance. Thoran

Share this post


Link to post
Share on other sites
Advertisement
C++ doesn't allow you to take the address of a constructor or a destructor, so these kinds of members always need wrappers.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!