cinetec_tech Posted February 2, 2017 Share Posted February 2, 2017 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
silent Posted February 2, 2017 Share Posted February 2, 2017 Hi Cinetec, I'm not sure, but maybe SDK Browser -> Samples -> C++ API -> Widgets -> InterfaceWindow or UserInterface samples will be useful in your case? How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
cinetec_tech Posted February 2, 2017 Author Share Posted February 2, 2017 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
Recommended Posts