aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2010-01-12 19:17:20 +0100
committerThomas White <taw@bitwiz.org.uk>2010-01-12 19:17:20 +0100
commitf9f9fb2b86dd7a72fdc2492f3e1b8631232fc036 (patch)
tree53119d1d373332b125878ca07f99359ec3d5f97c
parentb0f2b6c899aa3afd148fc3956c3c90a3b5847b94 (diff)
Fixes for problems revealed on ATI driverHEADmaster
-rw-r--r--src/displaywindow.c8
-rw-r--r--src/glbits.c7
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);