ComponentSystem initialize() in IG plugin


photo

Recommended Posts

Quote

Do we still need to manually add Unigine::ComponentSystem::get()->initialize(); Can't this be done automatically when the IG plugin is included?

Yes, that's mandatory. If you call it multiple times you will have several independed component systems :)

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to post
9 minutes ago, silent said:

Yes, that's mandatory. If you call it multiple times you will have several independed component systems

Ok. But there is no "isInitialized()" function to check if the call has already been made, so in essence this forbids to call it from a plugin; it has to be called from the main app. Hence the question: shouldn't it be part of the default app when an IG/VR template is selected? And why not simply chose to *always* have it initialized? (I don't have the full picture here, so most probably I'm missing a crucial element to understand the rational)

Link to post

When you call ComponentSystem->initialize() in a plugin you will create a new ComponentSystem completely independent from that one that was initialized in main application. There will be no conflicts or whatsoever.

There is also internal checks inside initialize() method, so you will not accidentally init the same ComponentSystem twice.

Maybe we will find more elegant way how to improve this behavior in the future versions :)

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to post