Search
lxdream.org :: lxdream/src/gtkui/main_win.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/gtkui/main_win.c
changeset 658:f5926310bfbe
prev635:76c63aac3590
next659:6b1dff1575b3
author nkeynes
date Wed Apr 16 12:43:52 2008 +0000 (12 years ago)
permissions -rw-r--r--
last change Start removing X11isms from gtkui into drivers
Overhaul the configure rules for figuring out the video driver
file annotate diff log raw
1.1 --- a/src/gtkui/main_win.c Thu Feb 14 13:54:11 2008 +0000
1.2 +++ b/src/gtkui/main_win.c Wed Apr 16 12:43:52 2008 +0000
1.3 @@ -27,13 +27,16 @@
1.4
1.5 #include <gtk/gtk.h>
1.6 #include <gdk/gdk.h>
1.7 -#include <gdk/gdkx.h>
1.8 #include <gdk/gdkkeysyms.h>
1.9 #include <X11/Xutil.h>
1.10
1.11 -#include "dream.h"
1.12 +#include "lxdream.h"
1.13 #include "gtkui/gtkui.h"
1.14 +
1.15 +#ifdef HAVE_GLX
1.16 +#include <gdk/gdkx.h>
1.17 #include "drivers/video_glx.h"
1.18 +#endif
1.19
1.20
1.21 struct main_window_info {
1.22 @@ -246,18 +249,17 @@
1.23 gtk_window_add_accel_group (GTK_WINDOW (win->window), accel_group);
1.24
1.25 gtk_toolbar_set_style( GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS );
1.26 -
1.27 +
1.28 + win->video = gtk_drawing_area_new();
1.29 +
1.30 +#ifdef HAVE_GLX
1.31 Display *display = gdk_x11_display_get_xdisplay( gtk_widget_get_display(win->window));
1.32 Screen *screen = gdk_x11_screen_get_xscreen( gtk_widget_get_screen(win->window));
1.33 int screen_no = XScreenNumberOfScreen(screen);
1.34 -#ifndef HAVE_LIBOSMESA
1.35 if( !video_glx_init(display, screen_no) ) {
1.36 ERROR( "Unable to initialize GLX, aborting" );
1.37 exit(3);
1.38 }
1.39 -#endif
1.40 -
1.41 - win->video = gtk_drawing_area_new();
1.42
1.43 XVisualInfo *visual = video_gtk_get_visual();
1.44 if( visual != NULL ) {
1.45 @@ -265,6 +267,8 @@
1.46 GdkColormap *colormap = gdk_colormap_new( gdkvis, FALSE );
1.47 gtk_widget_set_colormap( win->video, colormap );
1.48 }
1.49 +#endif
1.50 +
1.51 GTK_WIDGET_SET_FLAGS(win->video, GTK_CAN_FOCUS|GTK_CAN_DEFAULT);
1.52 gtk_widget_set_size_request( win->video, 640, 480 );
1.53 gtk_widget_set_double_buffered( win->video, FALSE );
.