From f9f9fb2b86dd7a72fdc2492f3e1b8631232fc036 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 12 Jan 2010 19:17:20 +0100 Subject: Fixes for problems revealed on ATI driver --- src/displaywindow.c | 8 ++++++++ src/glbits.c | 7 +++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/displaywindow.c b/src/displaywindow.c index 37b0052..dc8f944 100644 --- a/src/displaywindow.c +++ b/src/displaywindow.c @@ -733,6 +733,14 @@ DisplayWindow *displaywindow_open(ControlContext *ctx) dw->cur_image = 0; dw->realised = 0; + dw->gl_ref_vertex_array = NULL; + dw->gl_ref_normal_array = NULL; + dw->gl_marker_vertex_array = NULL; + dw->gl_marker_normal_array = NULL; + dw->gl_gen_vertex_array = NULL; + dw->gl_gen_normal_array = NULL; + dw->gl_line_vertex_array = NULL; + dw->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(dw->window), title); free(title); diff --git a/src/glbits.c b/src/glbits.c index 480c042..039135f 100644 --- a/src/glbits.c +++ b/src/glbits.c @@ -682,6 +682,8 @@ gint glbits_expose(GtkWidget *widget, GdkEventExpose *event, DisplayWindow *dw) } glMatrixMode(GL_MODELVIEW); + glShadeModel(GL_SMOOTH); + glDisable(GL_LIGHTING); glLoadIdentity(); glTranslatef(0.0, 0.0, -20.0); /* Draw the background (this is done before setting up rotations) */ @@ -695,15 +697,16 @@ gint glbits_expose(GtkWidget *widget, GdkEventExpose *event, DisplayWindow *dw) glMaterialfv(GL_FRONT, GL_SPECULAR, black); glMaterialf(GL_FRONT, GL_SHININESS, 0.0); glBegin(GL_QUADS); - glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, bg_bot); + glColor3f(1.0, 1.0, 1.0); glVertex3f(-3.0*aspect, -3.0, 0.0); glVertex3f(+3.0*aspect, -3.0, 0.0); - glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, bg_top); + glColor3f(0.0, 0.0, 1.0); glVertex3f(+3.0*aspect, +3.0, 0.0); glVertex3f(-3.0*aspect, +3.0, 0.0); glEnd(); /* Restore the old projection matrix */ glPopMatrix(); + glEnable(GL_LIGHTING); glClear(GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); -- cgit v1.2.3