Search
lxdream.org :: lxdream/src/drivers/video_gtk.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/drivers/video_gtk.c
changeset 443:1163eb5c0590
prev436:e8c461d2545e
next449:21440948c684
author nkeynes
date Sat Oct 13 04:01:02 2007 +0000 (13 years ago)
permissions -rw-r--r--
last change Add ability to track the last displayed buffer, and handle expose/resize
events appropriately
file annotate diff log raw
1.1 --- a/src/drivers/video_gtk.c Thu Oct 11 08:20:38 2007 +0000
1.2 +++ b/src/drivers/video_gtk.c Sat Oct 13 04:01:02 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: video_gtk.c,v 1.14 2007-10-11 08:20:38 nkeynes Exp $
1.6 + * $Id: video_gtk.c,v 1.15 2007-10-13 04:01:02 nkeynes Exp $
1.7 *
1.8 * The PC side of the video support (responsible for actually displaying /
1.9 * rendering frames)
1.10 @@ -64,24 +64,20 @@
1.11
1.12 gboolean video_gtk_expose_callback(GtkWidget *widget, GdkEventExpose *event, gpointer data )
1.13 {
1.14 - /* redisplay last frame */
1.15 + gl_redisplay_last();
1.16 + return TRUE;
1.17 }
1.18
1.19 gboolean video_gtk_resize_callback(GtkWidget *widget, GdkEventConfigure *event, gpointer data )
1.20 {
1.21 video_width = event->width;
1.22 video_height = event->height;
1.23 + gl_redisplay_last();
1.24 + return TRUE;
1.25 }
1.26
1.27 gboolean video_gtk_init()
1.28 {
1.29 - /*
1.30 - video_win = GTK_WINDOW(gtk_window_new( GTK_WINDOW_TOPLEVEL ));
1.31 - gtk_window_set_title( video_win, APP_NAME " - Emulation Window" );
1.32 - gtk_window_set_policy( video_win, FALSE, FALSE, FALSE );
1.33 - gtk_window_set_default_size( video_win, video_width, video_height );
1.34 - */
1.35 -
1.36 video_win = gtk_gui_get_renderarea();
1.37
1.38 g_signal_connect( video_win, "key_press_event",
1.39 @@ -95,6 +91,7 @@
1.40 gtk_widget_add_events( video_win,
1.41 GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK |
1.42 GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK );
1.43 + gtk_widget_set_double_buffered( video_win, FALSE );
1.44 video_width = video_win->allocation.width;
1.45 video_height = video_win->allocation.height;
1.46 return video_glx_init( gdk_x11_display_get_xdisplay( gtk_widget_get_display(GTK_WIDGET(video_win))),
.