From: Fay J. F C. AAC/W. <joh...@eg...> - 2005-04-22 15:52:23
|
Gentlemen, The gist of the e-mail chain below is, I think, that our OpenGLUT brethren are looking into not processing window resize events that follow one right after the other, and possibly not processing them until just before a redraw. I will keep us posted on how it turns out. Before recommending it for "freeglut," I would want to look at how GLUT handles it. John F. Fay joh...@eg... 850-729-6330 -----Original Message----- From: ope...@li... [mailto:ope...@li...] On Behalf Of Nigel Stewart Sent: Thursday, April 21, 2005 8:42 PM To: ope...@li... Subject: Re: [OpenGLUT-devel] Re: Flooding the event queue with mouse motion > In the words of Martin Luther, what does this mean? Good question! I've been fiddling with the OpenGLUT event loop, with a particular view to opaque resize on KDE. In this mode a steady stream of resize and expose events are sent to the window as the user adjusts the window size. It's always looked a bit crappy in GLUT and FreeGLUT. Qt applications in particular, don't tend to flicker or tear the way OpenGLUT applications tend to. I came across this mouse motion handling, which seemed very much in line with collapsing mouse motion events. Overall, I think it is worth doing some additional queue manipulation in OpenGLUT due to the fact that when you actually trace all the events, it's no wonder that the queue can get flooded. For example, there is no point calling the resize callback if the very next event is another resize. It doesn't serve the purpose of efficently draining the queue to call the same callback 1000 times or so. In fact, I don't think a resize callback is needed until immediately before a draw. Nigel > ... > > if ( event->type == MotionNotify ) { // mouse move > if (event->xmotion.root != RootWindow(appDpy, x11Screen()) && > ! qt_xdnd_dragging ) > return FALSE; > > XMotionEvent lastMotion = event->xmotion; > while( XPending( appDpy ) ) { // compres mouse moves > XNextEvent( appDpy, &nextEvent ); > if ( nextEvent.type == ConfigureNotify > || nextEvent.type == PropertyNotify > || nextEvent.type == Expose > || nextEvent.type == NoExpose ) { > qApp->x11ProcessEvent( &nextEvent ); > continue; > } else if ( nextEvent.type != MotionNotify || > nextEvent.xmotion.window != > event->xmotion.window || > nextEvent.xmotion.state != event->xmotion.state ) { > XPutBackEvent( appDpy, &nextEvent ); > break; > } > if ( !qt_x11EventFilter(&nextEvent) > && !x11Event( &nextEvent ) ) // send event through filter > lastMotion = nextEvent.xmotion; > else > break; > } > type = QEvent::MouseMove; > pos.rx() = lastMotion.x; > pos.ry() = lastMotion.y; > globalPos.rx() = lastMotion.x_root; > globalPos.ry() = lastMotion.y_root; > > ... ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Openglut-devel mailing list Ope...@li... https://lists.sourceforge.net/lists/listinfo/openglut-devel |