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 545:fdcdcd8b9fd1
prev537:d924be49e192
next552:02ddb55a507b
author nkeynes
date Thu Nov 29 09:28:28 2007 +0000 (13 years ago)
permissions -rw-r--r--
last change Refactor GLX support and implement pbuffer rendering support
file annotate diff log raw
1.1 --- a/src/drivers/video_gtk.c Tue Nov 20 10:27:58 2007 +0000
1.2 +++ b/src/drivers/video_gtk.c Thu Nov 29 09:28:28 2007 +0000
1.3 @@ -22,7 +22,7 @@
1.4 #include <stdint.h>
1.5 #include "dream.h"
1.6 #include "display.h"
1.7 -#include "drivers/video_x11.h"
1.8 +#include "drivers/video_glx.h"
1.9 #include "drivers/gl_common.h"
1.10 #include "gtkui/gtkui.h"
1.11
1.12 @@ -80,8 +80,12 @@
1.13
1.14 gboolean video_gtk_expose_callback(GtkWidget *widget, GdkEventExpose *event, gpointer data )
1.15 {
1.16 - gl_fbo_detach();
1.17 - gl_redisplay_last();
1.18 + render_buffer_t buffer = pvr2_get_front_buffer();
1.19 + if( buffer == NULL ) {
1.20 + display_gtk_driver.display_blank(pvr2_get_border_colour());
1.21 + } else {
1.22 + display_gtk_driver.display_render_buffer(buffer);
1.23 + }
1.24 return TRUE;
1.25 }
1.26
1.27 @@ -89,13 +93,13 @@
1.28 {
1.29 video_width = event->width;
1.30 video_height = event->height;
1.31 - gl_fbo_detach();
1.32 - gl_redisplay_last();
1.33 + video_gtk_expose_callback(widget, NULL, data);
1.34 return TRUE;
1.35 }
1.36
1.37 gboolean video_gtk_init()
1.38 {
1.39 +
1.40 video_win = gtk_gui_get_renderarea();
1.41 if( video_win == NULL ) {
1.42 return FALSE;
1.43 @@ -115,17 +119,16 @@
1.44 gtk_widget_set_double_buffered( video_win, FALSE );
1.45 video_width = video_win->allocation.width;
1.46 video_height = video_win->allocation.height;
1.47 - return video_glx_init( gdk_x11_display_get_xdisplay( gtk_widget_get_display(GTK_WIDGET(video_win))),
1.48 - gdk_x11_screen_get_xscreen( gtk_widget_get_screen(GTK_WIDGET(video_win))),
1.49 - GDK_WINDOW_XWINDOW( GTK_WIDGET(video_win)->window ),
1.50 - video_width, video_height, &display_gtk_driver );
1.51 + Display *display = gdk_x11_display_get_xdisplay( gtk_widget_get_display(GTK_WIDGET(video_win)));
1.52 + Window window = GDK_WINDOW_XWINDOW( GTK_WIDGET(video_win)->window );
1.53 + video_glx_init_context( display, window );
1.54 + video_glx_init_driver( &display_gtk_driver );
1.55 }
1.56
1.57 void video_gtk_shutdown()
1.58 {
1.59 if( video_win != NULL ) {
1.60 video_glx_shutdown();
1.61 - gtk_widget_destroy( GTK_WIDGET(video_win) );
1.62 }
1.63
1.64 }
.