Reputation: 19
I've made a gui and am wondering how I would go about embedding a C++ program inside a section of the gui. So for example, from my MainWindow, if you click 'start game' a new window opens up with some graphical display, and the c++ game is embedded/executed within it. I've seen some articles about wrappers and using python in c++, but I don't have a good understanding of it, so I'm not sure that those apply to me in this case. If this is possible, should it be a .cpp or .exe? I'm more inclined to think it should be an executable file, but clearly I have no idea what I'm doing. I would greatly appreciate any help or guidance.
Upvotes: 0
Views: 2054
Reputation: 11075
The easiest solution here is to create a standalone application in cpp that is simply called by your python gui with a system call: os.system()
. if you instead create a library (DLL) and wrap it into a python library with something like swig you can call functions directly and potentially wrap something like a GL renderer into a qt frame widget (if you want a 3d render widget this has been done before so don't waste your time re-inventing the wheel)
Upvotes: 1