Jump to content

Suggestion on how to integrate the Interface plugin to a App?


photo

Recommended Posts

hi:

   I'm trying to integrate the plugin "Interface" into the exe, but i found some issue hope you could help.

 

in order to use the inteface, we need to expose the script functions like:

Interpreter::addExternFunction("engine.interface.getWidth",MakeExternObjectFunction(Interface::get(),&Interface::getWidth),id);

If i put the interpreter declare functions after 

Unigine::EnginePtr engine(UNIGINE_VERSION, widget, argc, argv);

in my main function, it seems the editor scripts will not able to find those functions since editor script runs first.

if i put the code before engine initialize, i can't get the interface initialized since the engine not started.

anyway to  workaround this case?

thanks

Link to comment

i figured out a way to make it work.

still not perfect solution when app has a dependency on engine to start first. 

basically problems are:

1:you can't create your class instance first before engine initialize if your class need something like engine.app .. (of course), so if you start your instance after engine initialize. you can't add your interpreter.

2: there is no way to addSystemLogic init() from your app. You can only do update or shutdown, render() in your system logic. but you can do the init in a plugin. the reason is similar as problem 1

Link to comment
×
×
  • Create New...