Advertisement Jump to content
Sign in to follow this  
Jason Goepel

Registered Interface

This topic is 1781 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

How to I get a pointer to the actual object from a pointer to asIScriptObject?


Also, how would I register an class that implements an application-registered interface? 

Edited by Jason Goepel

Share this post

Link to post
Share on other sites

The pointer you have with asIScriptObject is the pointer to actual object. :) asIScriptObject is the public interface to the internal asCScriptObject implementation. An asIScriptObject can only be used for script classes. For registered classes you should use the actual C++ class to represent the object.


C++ interfaces should be registered to AngelScript just like an ordinary reference counted C++ class (RegisterInterface is for script interfaces, not C++ interfaces), and then you'll likely want to add implicit and explicit reference cast behaviours to allow casting handles between the various types that have any relation you wish to expose to the scripts.


You'll want to check out this article in the manual:


Class hierarchies

Share this post

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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!