PDA

View Full Version : GTK Cairo advanced usage (VSync) help



ZDemon
March 29th, 2007, 10:17 AM
Does anyone know how to make a cairo widget wait for vsync?

My program looks like it is visually choppy, although it seems to be fast.

Do i have to use OpenGL?

Thanks for any input.

lnostdal
March 29th, 2007, 04:33 PM
hi,
http://developer.gnome.org/doc/API/2.0/gdk/gdk-Windows.html#gdk-window-begin-paint-rect
http://developer.gnome.org/doc/API/2.0/gdk/gdk-Windows.html#gdk-window-begin-paint-region

ZDemon
March 30th, 2007, 04:33 AM
Yeah it works now.


GdkRegion *draw=gdk_drawable_get_clip_region (drawable_widget->window);
gdk_window_begin_paint_region (drawable_widget->window,draw);
cairo_t* cr = gdk_cairo_create(drawable_widget->window);
..
..
..
..
gdk_window_end_paint (drawable_widget->window);

Thanks Inostdal.