11.07.2015 Views

Download document (10.35 MB) - Escuela Superior de Informática ...

Download document (10.35 MB) - Escuela Superior de Informática ...

Download document (10.35 MB) - Escuela Superior de Informática ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

154 Capítulo D. Código fuente353354 ventanaAncho = widget->allocation.width;355 ventanaAlto = widget->allocation.height;356357 calculaProyeccion();358 ren<strong>de</strong>rFrame();359360 gdk_gl_drawable_gl_end (gldrawable);361362 return TRUE;363 }364365 /********************************************************************366 * Funcion: dibujar_gl367 * Descripcion: Manejador <strong>de</strong>l evento <strong>de</strong> dibujado <strong>de</strong>l Widget368 * Entradas: widget --> Puntero al widget GtkGlExt369 * event --> Puntero con caracteristicas <strong>de</strong>l evento370 * data --> Puntero con datos <strong>de</strong> los parametros371 * Salidas: Devuelve TRUE si no se produjo error.372 ******************************************************************/373 gboolean dibujar_gl (GtkWidget *widget, GdkEventExpose *event,374 gpointer data) {375376 GdkGLContext *glcontext = gtk_widget_get_gl_context (widget);377 GdkGLDrawable *gldrawable = gtk_widget_get_gl_drawable (widget);378379 GtkWidget *hscale_frame;380 GtkWidget *boton_play;381 GtkWidget *spin_ver_velocidad;382383 int nuevoframe, frameactual;384 int velocidad, i;385386387 if (!gdk_gl_drawable_gl_begin (gldrawable, glcontext)){388 g_print ("*** ERROR: Problem in dibujar\n");389 return FALSE;390 }391392 /* Comenzamos la parte <strong>de</strong> OpenGL */393 ventanaAncho = widget->allocation.width;394 ventanaAlto = widget->allocation.height;395396397 hscale_frame = gla<strong>de</strong>_xml_get_widget (gxml, "hscale_frame");398 frameactual = (int) gtk_range_get_value (GTK_RANGE (hscale_frame));399400 calculaProyeccion();401 ren<strong>de</strong>rFrame();402403 if (frameactual == 1 && frameInitialized == 0)404 {405 initializeFaceCapture();406 showImages();407 }408409410 /* Enviamos la informacion y terminamos */411 if (gdk_gl_drawable_is_double_buffered (gldrawable)) {412 gdk_gl_drawable_swap_buffers (gldrawable);

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!