Event loop in DLL steal events
-
Good day. I implement some OpenGL plugin for 3rd party software using proxy dll. So there is 2 functions:
Init() called only once and init OpenGL and QApplication if it not peresent
@
...
isInQtApp = ( qApp != nullptr ); // global bool
if ( !isInQtApp ){
int argc = 0;
new QApplication( argc, 0 );
qApp->processEvents();
}// OpenGL init
...
@and apply() function called on every buffers swapping (on each frame rendered)
@
if ( !isInQtApp ){
qApp->sendPostedEvents();
}// OpenGL rendering
...
@I need QApplication event loop for signal/slots and networking.
This implementation works well for Quake 4 for example and some other application, but in FurMark network is not working.
I try to add--
@
qApp->processEvents();
@after
@
qApp->sendPostedEvents();
@and it get OK for FurMark, but steal any events from other applications, I cant move camera by mouse or move by keyboard. What I am doing wrong?
I am using Qt 4.8.4