I have a function called:
bool game_init(void* window);
takes a pointer to window handle,basically it just initialize opengl, and do rendering from c++(I export this function to python using boost::python),now I created a simple hello word window,to try it.
app = QtWidgets.QApplication(["",""])
window = QtWidgets.QMainWindow()
winid = window.winId()
ctypes.pythonapi.PyCapsule_GetPointer.restype = ctypes.c_void_p
ctypes.pythonapi.PyCapsule_GetPointer.argtypes = [ctypes.py_object, ctypes.c_char_p]
handle = ctypes.pythonapi.PyCapsule_GetPointer(winid.ascapsule() , None)
Interesting that All I did the handle is just an integer something like 85983252
which I guess it is the handle of the hello world window,but how do I pass this integer as void * so that my c++ code can create an opengl window using that?
Currently the error gives me: python parameter bool game_init(int); does not match the cpp code.
environment:
Linux,pyqt5 boost::python gcc,python 3.4