I have a C++ application that does some interactive rendering, and I'd like to link it up with a Mathematica notebook with two-way communication (there are some tasks like drawing plots that are easier in Mathematica, and some like the 3D renderer that are easier in C++, but the goal is for both of things to be linked). I've been reading up on WSTP and it seems like that would be ideal to set up communication between the two programs (launching the C++ application from the Wolfram Kernel via
Install is not an issue).
My problem is that
WSMain puts the C++ application in a loop which checks for packets from Mathematica. Since this is an interactive graphics application, it already has its own main loop. It would be simpler for me if I could just do the checking for new packets manually in my own loop, since I obviously can't run both main loops at once (I guess I could have the two loops run in different threads or C++ processes, and then have those communicate but that seems like more trouble than it's worth).
Does anyone have experience with how to set this up or is there any example code floating around for how to set up the communication between the C(++) application and a Mathematica notebook without using the loop implied by the use of
MLMain in the case of MathLink)?
(If it matters, I'm on Windows 10 and compile the C++ application with VS2013 and don't require portability to other platforms.)