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 545:fdcdcd8b9fd1
prev543:361ec0a70cf2
next561:533f6b478071
author nkeynes
date Thu Nov 29 09:28:28 2007 +0000 (15 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/gtkui/main_win.c Thu Nov 22 11:10:15 2007 +0000
1.2 +++ b/src/gtkui/main_win.c Thu Nov 29 09:28:28 2007 +0000
1.3 @@ -26,9 +26,12 @@
1.4 #include <stdlib.h>
1.5
1.6 #include <gtk/gtk.h>
1.7 +#include <gdk/gdkx.h>
1.8 +#include <X11/Xutil.h>
1.9
1.10 #include "dream.h"
1.11 #include "gtkui/gtkui.h"
1.12 +#include "drivers/video_glx.h"
1.13
1.14
1.15 struct main_window_info {
1.16 @@ -87,8 +90,17 @@
1.17 gtk_window_add_accel_group (GTK_WINDOW (win->window), accel_group);
1.18
1.19 gtk_toolbar_set_style( GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS );
1.20 +
1.21 + Display *display = gdk_x11_display_get_xdisplay( gtk_widget_get_display(win->window));
1.22 + Screen *screen = gdk_x11_screen_get_xscreen( gtk_widget_get_screen(win->window));
1.23 + int screen_no = XScreenNumberOfScreen(screen);
1.24 + video_glx_init(display, screen_no);
1.25
1.26 + XVisualInfo *visual = video_glx_get_visual();
1.27 + GdkVisual *gdkvis = gdk_x11_screen_lookup_visual( gtk_widget_get_screen(win->window), visual->visualid );
1.28 + GdkColormap *colormap = gdk_colormap_new( gdkvis, FALSE );
1.29 win->video = gtk_drawing_area_new();
1.30 + gtk_widget_set_colormap( win->video, colormap );
1.31 GTK_WIDGET_SET_FLAGS(win->video, GTK_CAN_FOCUS|GTK_CAN_DEFAULT);
1.32 gtk_widget_set_size_request( win->video, 640, 480 );
1.33 frame = gtk_frame_new(NULL);
.