We are developing a small C ++ program in which I would like to implement a system of modules. It doesn't matter if they are in Python, Lua, or C ++ (personally, I would prefer C ++ or Python).
It is planned that the system will consist of modules that could refer to the already existing functions of this application or define their own. In particular, modules must be able to, for example, invoke or create GUI elements. The application is written using ImGui, the module must be able to use this graphical interface.
It would be ideal if the module system could be installed and removed dynamically. I know that this can be done in Python or Java, but how to implement it in C ++? I wondered about the need for boost.python, but I could not find how to do it.
Once again: the module should be able to create interface elements (in particular ImGui) in an already open 3D window. In particular, I would like to be able to add applications (mini-games) that would use the functions of the application or create new ones and still draw into the window of this large program.
Question: How to implement dynamic modular application systems in C ++
Here is the amendment / addition:
I apologize, lately (16 years) I speak little Russian, I can make mistakes.
I use Linux (Ubuntu). I am thinking about implementing in the form of dynamically loadable libraries (.so). I want to use C ++ (already sure).
How I think it over, but I have no idea if this is possible:
I will click on the button ("mini-games"), the application will look at which modules (mini-games) are in the modules folder (for example, in / opt / app / minigames / .so *) and show all of them in a list. I will choose one of them. An application must (each module have one Interafce) load this module and launch it, for example:
if(selected){ interface::module modul = load(selected) ; modul.run(); } As I understand it, for this you probably need to write an SDK?
I intend, during module initialization, to transfer an object to it (application context through which a module can call internal application functions) eg:
context->gui->createAlertDialog(...); Is that so correct? (I do not know English. Therefore, I hoped that they would help me here, since what Russian wonderful hackers are saying everywhere :))