is it just mouse and keyboard stuff that’s not getting called, or is everything else also on hold? when is ‘computation’ getting called? (it’s not a virtual function so i guess you’re invoking it yourself somewhere).
It looks to me like you’re starting it from the main message thread - which would mean that it would be trapped inside the loop until it somehow had the chance to also send mouse event. What you’re doing (looping computation which can be interrupted by some external flag) is the sort of thing that should go in the ‘run()’ body of a Thread subclass.
This is just off the top of my head here, but this could be one answer…
class A : public OpenGLComponent, public Thread
void mouseEnter ( const MouseEvent & e )
void run ()
while (!threadShouldExit ())
// heavy computation
the computation can be started with startThread(). This means that your loop can continue whilst the message thread is still able to do its thing. I’m not sure how tricky OpenGL gets with multi-threading, but it’s safe to say that you should always be careful when using threads.
Also, I’m not sure how many of these components you may have, it may not be a wise move to derive your OpenGLComponent from Thread too; you might want to make a shared Thread for driving more than one [if so, you could just have the ‘Computation’ function do a single cycle, and have the thread call it (for each registered object) each time round its loop.
Sorry if i’m telling you stuff you already know (quite likely), but heck, more information just in case shouldn’t do any harm!