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 1287:dac8f363f1fe
prev1251:b8ab59d39756
author nkeynes
date Sun Jul 01 13:20:34 2012 +1000 (8 years ago)
permissions -rw-r--r--
last change Add support for Nokia N900
- Generic support for EGL with GTK
- Workaround for nokia bug with egl config
Based on patch from guinux, thanks!
file annotate diff log raw
1.1 --- a/src/drivers/video_gtk.c Sat Mar 03 16:11:28 2012 +1000
1.2 +++ b/src/drivers/video_gtk.c Sun Jul 01 13:20:34 2012 +1000
1.3 @@ -114,6 +114,10 @@
1.4
1.5 #endif
1.6
1.7 +#ifdef HAVE_GLES2
1.8 +#include "drivers/video_egl.h"
1.9 +#endif
1.10 +
1.11
1.12
1.13 GtkWidget *gtk_video_drawable = NULL;
1.14 @@ -266,6 +270,13 @@
1.15 GdkColormap *colormap = gdk_colormap_new( gdkvis, FALSE );
1.16 gtk_widget_set_colormap( drawable, colormap );
1.17 }
1.18 +#else
1.19 +#ifdef HAVE_GLES2
1.20 + if( ! video_egl_init() ) {
1.21 + ERROR( "Unable to initialize EGL, aborting" );
1.22 + exit(3);
1.23 + }
1.24 +#endif
1.25 #endif
1.26 gtk_video_drawable = drawable;
1.27 return drawable;
1.28 @@ -295,6 +306,14 @@
1.29 if( ! video_nsgl_init_driver( view, &display_gtk_driver ) ) {
1.30 return FALSE;
1.31 }
1.32 +#else
1.33 +#ifdef HAVE_GLES2
1.34 + Window window = GDK_WINDOW_XWINDOW( GTK_WIDGET(gtk_video_drawable)->window );
1.35 + if( ! video_egl_init_context( window, COLFMT_RGB888 ) ||
1.36 + ! video_egl_init_driver( &display_gtk_driver ) ) {
1.37 + return FALSE;
1.38 + }
1.39 +#endif
1.40 #endif
1.41 #endif
1.42 #endif
1.43 @@ -331,6 +350,10 @@
1.44 #else
1.45 #ifdef HAVE_NSGL
1.46 video_nsgl_shutdown();
1.47 +#else
1.48 +#ifdef HAVE_GLES2
1.49 + video_egl_shutdown();
1.50 +#endif
1.51 #endif
1.52 #endif
1.53 #endif
.