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

application pointer in registered functions

Started by
1 comment, last by WitchLord 18 years, 5 months ago
Hi, What is the proper method (if any) for accessing pointers from the main application instance inside of registered functions of the script engine? Is there some sort of a registry for storing pointers and data inside the engine that is not accessible to the scripts themselves? Thanks Scott
Advertisement
If you mean what I think you do; The registered function is just a normal C++ function.
I've been thinking about adding methods to both the engine and context interfaces that would allow the application to store a pointer to user data. That would allow the application registered functions to easily find that user data simply by calling asGetActiveContext() and then GetUserData().

But I don't know when I'll do this, so until then the easiest way would be to use a std::map that allow the registered function to find the corresponding user data for a context.

Regards,
Andreas

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