Advertisement

Able to use across multi dlls?

Started by April 28, 2009 06:35 AM
2 comments, last by WitchLord 15 years, 7 months ago
Can I use AngelScript across multi dlls?In my project I have a main exe and some plugin dlls,Can I bind functions both in exe and dll to Angle Script? If it works,I can use AngelScript to handle the main loop and add dlls to add addtion functions.
Yes, you can safely register functions both from the main application and from the DLLs with AngelScript. That is completely transparent to AngelScript.


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

Advertisement
Thanks,WitchLord,I will give it a try.

I have used Squirrel for 2 month,there are some static variables in template functions in sqplus so when I use it across dlls,the static variables are different in every dlls.It really drives me crazy to debug it.
So AngelScript doesn't have this kind of problem?

PS:should I compile AS as dll when I use it across dlls?I noticed "class asIScriptEngine" is not exported from the angelscript.dll.

[Edited by - huangyous on April 28, 2009 7:10:07 PM]
There are no static variables declared by the angelscript.h header, so you shouldn't have any problems with variables being instanciated both in the main application and the DLLs.

It is not necessary to compile AngelScript into a DLL, in fact I recommend using it as a static library, since you're likely not going to share it with any other application.

But, if you still want to use AngelScript as a DLL, then the asIScriptEngine interface is defined in the angelscript.h header so it is not something that is exported by the DLL. The only thing the DLL needs to export is the global functions, specifically the asCreateScriptEngine function that instanciates the engine for you.

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