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.
1 Answer
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)
1 Comment
JJMcGee
I already have the cpp, is it just a one line call :os.system(path) or do I need to add something else so Python knows what to do with it? Sorry for such a 'hand-holding' question but I'm not at all familiar with it and need to have it ready in a couple of hours(if I can even manage). Thank you for your help.