30 Ott 2002
Costruzione di Interfacce - Paolo Cignoni
14
La funzione di Draw (dirty!)
void glSlider::Draw()
{
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0,300,0,300,-1,1);  // ATTENZIONE HACK
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
  int curp=CurPos(); 
glDisable(GL_LIGHTING);
glBegin(GL_LINE_LOOP);
glVertex2i(px   , py   );
glVertex2i(px+sx, py   );
glVertex2i(px+sx, py+sy);
glVertex2i(px   , py+sy);
  glEnd();
glBegin(GL_QUADS);
glVertex2i(curp-sy/2,py);
glVertex2i(curp+sy/2,py);
glVertex2i(curp+sy/2,py+sy);
glVertex2i(curp-sy/2,py+sy);
  glEnd();
}