Passing application side array to AS?
See how AS arrays are more then C++ arrays, there probably isn't a great way of doing this huh?
I use the std::vector registration helper included in the sdk with a modified version for use with handles of classes. I like it much.
An example of std::vector binding is in tests/test_feature/source/stdvector.h.
As of 2.17.0 (if all goes as planned) you'll be able to register a template type, e.g. array<class T> and AngelScript will be able to instanciate it for any type. For the array types that the application uses, you'll be able to register a template specialization, e.g. arrat<float> so you can directly pass arrays of this type to and from scripts.
This is a generalization of the current built-in array type and the array type overloading that stdvector.h does. Eventually I'll probably remove the built-in dynamic array type in favour of this template type (with a standard add-on, of course).
This is a generalization of the current built-in array type and the array type overloading that stdvector.h does. Eventually I'll probably remove the built-in dynamic array type in favour of this template type (with a standard add-on, of course).
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