Date: Sat, 09 Jul 2005 06:58:09 +0900 (JST) Message-Id: <20050709.065809.78734215.garrigue at math.nagoya-u.ac.jp> To: matthieu.dubuget at laposte.net Cc: lablgtk at math.nagoya-u.ac.jp Subject: Re: Double buffering ? From: Jacques Garrigue In-Reply-To: <42CE8604.4080508 at laposte.net> References: <42CE8604.4080508 at laposte.net> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Matthieu Dubuget > I'm playing with lissajous.ml ($Id: lissajous.ml,v 1.9 2000/06/06 > 03:51:04 garrigue Exp $), extracted from the example directory of lablgtk2. > > I modified it to test drawing area as a tool to display living curves. > > With my current implementation, the display is "fickering". This is > especially visible if the image displayed is not modified between two > exposures. > > I thought double buffering would allow to avoid this effect? And that > it was enabled by default with version 2 of gtk? Double-buffering is enabled when drawing all widgets. But lissajous.ml works at a lower level, by calling Gdk directly on an on-screen window. This clearly bypasses double-buffering. You can easily recover it by using a pixmap. examples/timer.ml does this for instance: it first creates a pixmap, draws on it, and then copies it to the screen. To avoid using too many resources, it caches the pixmap and only creates a new one when the size changes. Jacques