From 3b7d35641635af8d8b2f9d4a15b474fa8aff9db1 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 23 May 2001 03:31:54 +0000 Subject: [PATCH] helps if I upload the texture in the correct format :) --- qw/source/gl_graph.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/qw/source/gl_graph.c b/qw/source/gl_graph.c index e76e06b76..43d29d4bc 100644 --- a/qw/source/gl_graph.c +++ b/qw/source/gl_graph.c @@ -84,7 +84,7 @@ R_LineGraph (int x, int y, int *h_vals, int count) s = r_graphheight->int_val; - size = 2 * count; + size = s * count; if (size > graph_size[graph_index]) { graph_size[graph_index] = size; graph_texels[graph_index] = realloc (graph_texels[graph_index], size); @@ -121,12 +121,13 @@ R_LineGraph (int x, int y, int *h_vals, int count) glBindTexture (GL_TEXTURE_2D, graph_texture[graph_index]); - glTexImage2D (GL_TEXTURE_2D, 0, gl_alpha_format, - graph_width[graph_index], s, 0, GL_RGBA, - GL_UNSIGNED_BYTE, graph_texels[graph_index]); + //glTexImage2D (GL_TEXTURE_2D, 0, gl_alpha_format, + // graph_width[graph_index], s, 0, GL_RGBA, + // GL_UNSIGNED_BYTE, graph_texels[graph_index]); - glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + //glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + //glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + GL_Upload8 (graph_texels[graph_index], graph_width[graph_index], s, 0, 1); glBegin (GL_QUADS); glTexCoord2f (0, 0);