FooBar Play #1

This commit is contained in:
Mark Watkins 2011-08-26 16:56:51 +10:00
parent 1846185d38
commit edcda37c5e

View File

@ -83,12 +83,45 @@ void gFooBar::paint(gGraph & w,int left, int top, int width, int height)
double px=((1/rmx)*(w.min_x-w.rmin_x))*width;
double py=((1/rmx)*(w.max_x-w.rmin_x))*width;
glLineWidth(3);
int extra=0;
if (abs(px-py)<2) extra=2;
int hh=40;
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
glBegin(GL_QUADS);
glColor4ub(255,255,255,128);
glVertex2f(start_px+px-extra,top-hh);
glVertex2f(start_px+py+extra,top-hh);
//glColor4ub(255,255,255,128);
w.qglColor(m_handle_color);
glVertex2f(start_px+py+extra,top-hh/2.0);
glVertex2f(start_px+px-extra,top-hh/2.0);
// glColor4ub(255,255,255,128);
w.qglColor(m_handle_color);
glVertex2f(start_px+px-extra,top-hh/2.0);
glVertex2f(start_px+py+extra,top-hh/2.0);
glColor4ub(192,192,192,128);
glVertex2f(start_px+py+extra,h);
glVertex2f(start_px+px-extra,h);
glEnd();
glDisable(GL_BLEND);
w.qglColor(m_handle_color);
glBegin(GL_LINE_LOOP);
glVertex2f(start_px+px-extra,top-hh);
glVertex2f(start_px+py+extra,top-hh);
glVertex2f(start_px+py+extra,h);
glVertex2f(start_px+px-extra,h);
glEnd();
/*glLineWidth(3);
glBegin(GL_LINES);
w.qglColor(m_handle_color);
glVertex2f(start_px+px-4,h);
glVertex2f(start_px+py+4,h);
glEnd();
glVertex2f(start_px+px-extra,h);
glVertex2f(start_px+py+extra,h);
glEnd(); */
glLineWidth(1);