Exporting CPP classes to Angel Script
Hi, My CPP application provides a set of APIs which either accepts STL or returns STL.Even if I export these APIs to Angel Script I wont be able to use it because STL classes wont be available in Angel. As far as I understand , to export an existing class(May be I wont be able to change the implementation of the class) to Angel script which uses reference counting I have to put a wrapper for that class and implement certain behaviours and export all those. Is there any utility available to export the required existing classes to Angel script by providing the wrapper ? Regards, Vivek
I don't think there is a tool that can do exactly what you want. However, perhaps you can take a look at the AngelScript C++ interface generator and see if you can adjust it to generate the wrappers you need.
The CScriptString that is in the add_on directory is a light wrapper for the std::string class. If you take a look at it you'll see that for the most part the std::string class isn't wrapped at all. Of course, it is not always possible to use the original class, but in many situations it is.
I also suggest you think hard about what you really need to expose to the scripts. Is it necessary to expose the STL classes themselves, or can you just expose some methods that retrieve the value of interest directly?
The CScriptString that is in the add_on directory is a light wrapper for the std::string class. If you take a look at it you'll see that for the most part the std::string class isn't wrapped at all. Of course, it is not always possible to use the original class, but in many situations it is.
I also suggest you think hard about what you really need to expose to the scripts. Is it necessary to expose the STL classes themselves, or can you just expose some methods that retrieve the value of interest directly?
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
Popular Topics
Advertisement
Recommended Tutorials
Advertisement