Re: gtk_preview_draw_row too slow




Sascha Ziemann <szi@aibon.ping.de> writes:

> Federico Mena Quintero <federico@nuclecu.unam.mx> writes:
> 
> | Create a GdkPixmap for every frame, and use gtk_preview_put() to
> | render each frame into a separate pixmap.  When you want to paint a
> | frame to the screen, simply use gdk_draw_pixmap().
> 
> For what do I need gdk_draw_pixmap? If I understand gtk_preview_put
> correct, it takes a pixmap and puts it in a GtkPreview.
> gdk_draw_pixmap sounds as if it is copying the data. Am I wrong? How
> many Pixmaps do I need to play n frames? n or n+1?

gtk_preview_put takes a GtkPreview and draws it into a Drawable.
(Pixmap or Window). Quartic is suggesting that you take your n frames
and use gtk_preview_put() to put them into n pixmaps. (Pixmaps are
images stored on the server, but not drawn). Then when you want to
display a frame you use gtk_draw_pixmap to copy the pixmap into the
window. 

(In this case, it may be a bit better to do:

void	      gdk_window_set_back_pixmap (GdkWindow	  *window,
					  GdkPixmap	  *pixmap,
					  gint		   parent_relative);

then,

void	      gdk_window_clear	     (GdkWindow	   *window);


Because if you do that, you won't have to worry about redrawing the
frame if you move something else on top of it when it is displayed.)

Regards,
                                        Owen



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]