# Draw the needle
localmatrix {
    rotate z => -.25+$self->gauge_angle_fn->($mph);
    ($self->{_needle_displaylist} ||= do {
        my $img= $res->img('speed-needle');
        $img->gl_tex->bind; # make sure it's loaded before creating display list
        displaylist {
            $img->gl_tex->bind;
            my $hub_rad= $img->height / $img->width * $self->gauge_tick_rad / 2;
            triangle_strip {
                glColor4d(1,1,0,0.2);
                glTexCoord2d(0,0);
                glVertex2d(-$hub_rad, -$hub_rad);
                glTexCoord2d(0,1);
                glVertex2d($hub_rad, -$hub_rad);
                glColor4d(1,1,0,0.3);
                glTexCoord2d(.5,0);
                glVertex2d(-$hub_rad, -$hub_rad+($hub_rad + $self->gauge_tick_rad)*.5);
                glTexCoord2d(.5,1);
                glVertex2d($hub_rad, -$hub_rad+($hub_rad + $self->gauge_tick_rad)*.5);
                glColor4d(1,1,0,1);
                glTexCoord2d(1,0);
                glVertex2d(-$hub_rad, $self->gauge_tick_rad);
                glTexCoord2d(1,1);
                glVertex2d($hub_rad, $self->gauge_tick_rad);
            };
        };
    })->exec;
};
