#include <config.h>
#include <gtk/gtk.h>
-#include <gtk/gtkgl.h>
-#include <gdk/gdkkeysyms.h>
#include <GL/gl.h>
#include <math.h>
static gboolean expose(GtkWidget *da, GdkEventExpose *event, gpointer user_data)
{
- //g_message("radar:expose");
+ g_message("radar:expose");
Sweep *sweep = cur_sweep;
/* Draw the rays */
+
+ glPushMatrix();
glBindTexture(GL_TEXTURE_2D, sweep_tex);
glEnable(GL_TEXTURE_2D);
-
+ glColor3f(1,1,1);
glBegin(GL_QUAD_STRIP);
int _ri; // not really used, creates strange fragments..
for (_ri = 0; _ri < sweep->h.nrays; _ri++) {
/* (find middle of bin) / scale for opengl */
// near left
glTexCoord2f(0.0, (double)ri/sweep->h.nrays);
- glVertex3f(lx*near_dist, ly*near_dist, 0.0);
+ glVertex3f(lx*near_dist, ly*near_dist, 1.0);
// far left
glTexCoord2f(1.0, (double)ri/sweep->h.nrays);
- glVertex3f(lx*far_dist, ly*far_dist, 0.0);
+ glVertex3f(lx*far_dist, ly*far_dist, 1.0);
}
//g_print("ri=%d, nr=%d, bw=%f\n", _ri, sweep->h.nrays, sweep->h.beam_width);
glEnd();
+ glPopMatrix();
/* Texture debug */
//glBegin(GL_QUADS);
//glEnd();
/* Print the color table */
- glDisable(GL_TEXTURE_2D);
glPushMatrix();
- glLoadIdentity();
+ glDisable(GL_TEXTURE_2D);
+ glMatrixMode(GL_MODELVIEW ); glLoadIdentity();
+ glMatrixMode(GL_PROJECTION); glLoadIdentity();
glBegin(GL_QUADS);
int i;
for (i = 0; i < nred; i++) {
glColor4ub(red[i], green[i], blue[i], get_alpha(i));
- glVertex3f(-1., (float)((i ) - nred/2)/(nred/2), 0.); // bot left
- glVertex3f(-1., (float)((i+1) - nred/2)/(nred/2), 0.); // top left
- glVertex3f(-.9, (float)((i+1) - nred/2)/(nred/2), 0.); // top right
- glVertex3f(-.9, (float)((i ) - nred/2)/(nred/2), 0.); // bot right
+ glVertex3f(-1.0, (float)((i ) - nred/2)/(nred/2), 0.0); // bot left
+ glVertex3f(-1.0, (float)((i+1) - nred/2)/(nred/2), 0.0); // top left
+ glVertex3f(-0.9, (float)((i+1) - nred/2)/(nred/2), 0.0); // top right
+ glVertex3f(-0.9, (float)((i ) - nred/2)/(nred/2), 0.0); // bot right
}
glEnd();
glPopMatrix();