C/C++ Function call (native_code)
Declaration
You can declare C/C++ functions that you can directly use in smala code.The declatation as to be made before
_main_
of _define_
_native_code_
%{
...
%}
Example
use core
use display
use gui
_native_code_
%{
#include
void func_1 (string text){
cout << text << endl << endl;
}
void func_2 (){
cout << "i'm func_2" << endl << endl;
}
/* you can declare function defined in other .h/.cpp */
// extern void func_3 ();
%}
_main_
Component root
{
Frame f ("native code exemple", 0, 0, 512, 512)
func_1 ("Helloworld")
func_2 ()
//func_3 ()
}