[kaffe] buffered image - to avoid flicker

Gianluca Moro giangiammy at yahoo.com
Thu Nov 3 03:43:05 PST 2005


Hi all,

to avoid flickering during the screen update in kaffe,
I'm trying to use a double buffering tecnique,
drawing on an image, and at the end update the screen. 

I modified the update method, as in the code that follows:
the program in the PC with java (j2sdk1.4.2_06) works
correctly, while with kaffe 1.1.6 on a MIPS machine
with Tiny-X it presents the same flicker as before.
The same program, on kaffe on PC gives the following
error:
(:5012): Gdk-CRITICAL **: file gdkdraw.c: line 771 (gdk_draw_pixbuf):
assertion `GDK_IS_PIXBUF (pixbuf)' failed
(:5012): GLib-GObject-CRITICAL **: file gobject.c: line 1579
(g_object_unref): assertion `G_IS_OBJECT (object)' failed
                                                        
Is there some particular things to keep in mind while 
using double buffering for drawing? Any experience?
The problems can depend on Tiny-X?

thankyou
giammy

/** Update - Method, implements double buffering */
public void update (Graphics g)
{
    // initialize buffer
    if (bufferedImage == null) {
	bufferedImage = createImage(interfaceDef.width, 
				    interfaceDef.height);
	bufferedG = bufferedImage.getGraphics ();
    }
    // clear screen in background
    //dbg.setColor (getBackground ());
    //dbg.fillRect (0, 0, this.getSize().width, this.getSize().height);

    // draw elements in background
    // dbg.setColor (getForeground());
    paint (bufferedG);
		    
    // draw image on the screen
    g.drawImage (bufferedImage, 0, 0, this);
}


--
Gianluca Moro          http://groups.yahoo.com/group/embeddeditalia/
ISCRIVITI alla         Mailing List Italiana su LINUX EMBEDDED
giangiammy at yahoo.com   Visit http://ilpinguino.altervista.org/


	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it




More information about the kaffe mailing list