Re: [GtkGLExt] capturing video clips
- From: "Mihai Drăghicioiu" <mihai draghicioiu gmail com>
- To: cbeau <cbeauc gmail com>
- Cc: gtkglext-list gnome org
- Subject: Re: [GtkGLExt] capturing video clips
- Date: Tue, 26 Feb 2008 07:01:13 +0200
The real issue with this which is also an issue for taking screenshots, is that the obscured parts of an onscreen widget like a gtk_drawing_area will have "junk" in them (not get rendered) and so there will be junk in your captured image/movie. For example, I'd go for a coffee, my screensaver would kick in and my encoder would record nothing but junk.
To prevent this, it is good to switch to using an offscreen widget. For example, use a GtkImage to display an offscreen "GdkPixmap" and render your OpenGL scenes to the GdkPixmap. This way, the GdkPixmap is always fully rendered because it is offscreen and "captures" of the GdkPixmap (NOT THE GtkImage) are always right regardless of whether GtkImage is fully rendered or not. However, I have had tones of troubles getting GdkPixmap rendering to work and it still doesn't work on many graphics card (offscreen rendering not working well at all!). If you are using a GdkPixmap, then the corresponding call above would be replaced by:
---------------------------------------
screenshot = gdk_pixbuf_get_from_drawable( screenshot, GDK_DRAWABLE(pixmap), gdk_colormap_get_system(), 0, 0, 0, 0, scapture.enc_width, scapture.enc_height );
Where:
GdkPixmap *pixmap;
pixmap = gdk_pixmap_new( NULL, width, height, gdk_gl_config_get_depth(glconfig) );
glpixmap = gdk_pixmap_set_gl_capability( pixmap, glconfig, NULL );
gtk_image_set_from_pixmap( GTK_IMAGE(image), pixmap, NULL );
-----------------------------------------
or
you could just try reading the back buffer from OpenGL directly, with
glReadPixels. No extra pixmap no nothing. the call is simple:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]