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

Huge miss

Started by
0 comments, last by WitchLord 16 years, 11 months ago
First of all - thanx for a excelent job. Im tring to use you lib in my CRM project. But i foun a very big miss, i just wonder of why i cant call script funcs within active context, or is there a way to call them? If there are no ways, then how make events go work??? for example i have a function inside app, wich show a dialog, when user press Ok i need to call a script func "OnOk()" within an active context (the same stack), but there is no way to do so.
Advertisement
You mean, you need some way of registering event handlers, but don't know how to do it?

Although I know you're look for function pointers, which are not yet supported in AngelScript, there are still a couple of ways to do it.

Alternative 1:

You can go the java way, and use interfaces, i.e. declare an interface with a method OnEvent(), and then have your event handlers implement that interface.

Alternative 2:

You can register the event handlers through named lookups, i.e. expose an API from the application where the script can register event handlers by giving the name of the functions. The API can then look up the function id for this function and call it when needed.


I'll implement support for function pointers when I can. This is already on the to-do list.

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