Prev | Current Page 1023 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"


static var funcPtr = neko.Lib.load( ???LibraryName???, ???FunctionName???, intNumParams );
Part III: Extending the Possibilities
558
The variable is set as static so that it receives the function pointer without its parent class requiring
instantiation. While this is not the only way to do this, it is the most common method and is used by all
of the Neko libraries included with the basic Neko installation. However, as all the static C function
pointer variables are set at the time when the Neko script initializes, setting more than a few hundred of
these variables in one go may cause the virtual machine to bend under the strain, if not crash completely.
At such times, it is often better to assign such references when they are needed, rather than all at once.
Neko Value Types in C/C++
So, you ??™ ve seen how simple it is to get a quick library up and running, and how to call a function within
this library, but what about passing and receiving variables? Before you go headfirst into this topic, it
would first help to understand the structure of Neko values.


Pages:
1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035