Search
lxdream.org :: lxdream :: r661:99d9494955a9
lxdream 0.9.1
released Jun 29
Download Now
changeset661:99d9494955a9
parent660:d1b2695347c6
child662:7c8b88493ee1
authornkeynes
dateThu Apr 17 00:01:40 2008 +0000 (11 years ago)
Patch up the osmesa driver
src/drivers/video_gdk.c
src/drivers/video_gtk.c
1.1 --- a/src/drivers/video_gdk.c Wed Apr 16 23:47:32 2008 +0000
1.2 +++ b/src/drivers/video_gdk.c Thu Apr 17 00:01:40 2008 +0000
1.3 @@ -21,13 +21,14 @@
1.4 #include <gdk/gdk.h>
1.5 #include <gdk-pixbuf/gdk-pixbuf.h>
1.6 #include <gtk/gtkwidget.h>
1.7 +#include <GL/glu.h>
1.8 #include <GL/osmesa.h>
1.9 #include "lxdream.h"
1.10 #include "display.h"
1.11
1.12 #define MAX_PIXBUF 16
1.13
1.14 -extern GtkWidget *gtk_video_win;
1.15 +extern GtkWidget *gtk_video_drawable;
1.16 extern int video_width, video_height;
1.17
1.18 static render_buffer_t gdk_pixbuf_create_render_buffer( uint32_t width, uint32_t height );
1.19 @@ -111,7 +112,7 @@
1.20 glFinish();
1.21
1.22 void *pb = pixbuf_array[buffer->buf_id];
1.23 - GdkGC *gc = gtk_video_win->style->fg_gc[GTK_STATE_NORMAL];
1.24 + GdkGC *gc = gtk_video_drawable->style->fg_gc[GTK_STATE_NORMAL];
1.25 GdkColor black = {0,0,0,0};
1.26
1.27 assert(gc);
1.28 @@ -127,36 +128,36 @@
1.29 x2 -= x1;
1.30 gdk_gc_set_foreground( gc, &black );
1.31 gdk_gc_set_background( gc, &black );
1.32 - gdk_draw_rectangle( gtk_video_win->window, gc, TRUE, 0, 0, x1, video_height );
1.33 - gdk_draw_rectangle( gtk_video_win->window, gc, TRUE, x2, 0, video_width, video_height );
1.34 + gdk_draw_rectangle( gtk_video_drawable->window, gc, TRUE, 0, 0, x1, video_height );
1.35 + gdk_draw_rectangle( gtk_video_drawable->window, gc, TRUE, x2, 0, video_width, video_height );
1.36 } else if( ah < video_height ) {
1.37 y1 = (video_height - ah)/2;
1.38 y2 -= y1;
1.39 gdk_gc_set_foreground( gc, &black );
1.40 gdk_gc_set_background( gc, &black );
1.41 - gdk_draw_rectangle( gtk_video_win->window, gc, TRUE, 0, 0, video_width, y1 );
1.42 - gdk_draw_rectangle( gtk_video_win->window, gc, TRUE, 0, y2, video_width, video_height );
1.43 + gdk_draw_rectangle( gtk_video_drawable->window, gc, TRUE, 0, 0, video_width, y1 );
1.44 + gdk_draw_rectangle( gtk_video_drawable->window, gc, TRUE, 0, y2, video_width, video_height );
1.45 }
1.46 int w = x2-x1;
1.47 int h = y2-y1;
1.48
1.49 if( w != buffer->width || h != buffer->height ) {
1.50 - gdk_draw_rgb_32_image( gtk_video_win->window, gc, x1, y1, buffer->width, buffer->height, GDK_RGB_DITHER_NONE,
1.51 + gdk_draw_rgb_32_image( gtk_video_drawable->window, gc, x1, y1, buffer->width, buffer->height, GDK_RGB_DITHER_NONE,
1.52 pb, buffer->width*4 );
1.53 } else {
1.54 - gdk_draw_rgb_32_image( gtk_video_win->window, gc, x1, y1, buffer->width, buffer->height, GDK_RGB_DITHER_NONE,
1.55 + gdk_draw_rgb_32_image( gtk_video_drawable->window, gc, x1, y1, buffer->width, buffer->height, GDK_RGB_DITHER_NONE,
1.56 pb, buffer->width*4 );
1.57 }
1.58 }
1.59
1.60 static gboolean gdk_pixbuf_display_blank( uint32_t colour )
1.61 {
1.62 - GdkGC *gc = gtk_video_win->style->fg_gc[GTK_STATE_NORMAL];
1.63 + GdkGC *gc = gtk_video_drawable->style->fg_gc[GTK_STATE_NORMAL];
1.64 GdkColor col = { };
1.65
1.66 gdk_gc_set_foreground( gc, &col );
1.67 gdk_gc_set_background( gc, &col );
1.68 - gdk_draw_rectangle( gtk_video_win->window, gc, TRUE, 0, 0, video_width, video_height );
1.69 + gdk_draw_rectangle( gtk_video_drawable->window, gc, TRUE, 0, 0, video_width, video_height );
1.70 return TRUE;
1.71 }
1.72
2.1 --- a/src/drivers/video_gtk.c Wed Apr 16 23:47:32 2008 +0000
2.2 +++ b/src/drivers/video_gtk.c Thu Apr 17 00:01:40 2008 +0000
2.3 @@ -99,7 +99,7 @@
2.4
2.5 #endif
2.6
2.7 -static GtkWidget *gtk_video_drawable = NULL;
2.8 +GtkWidget *gtk_video_drawable = NULL;
2.9 int video_width = 640;
2.10 int video_height = 480;
2.11
.