🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Registered Interface

Started by
0 comments, last by WitchLord 10 years, 4 months ago

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?

Advertisement

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

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement