FACT++  1.0
void BasicGlCamera::resizeGL ( int  width,
int  height 
)
protectedvirtual

Reimplemented in Q3DCameraWidget.

Definition at line 656 of file BasicGlCamera.cc.

References fTextSize, pixelSize, shownSizex, shownSizey, and viewSize.

Referenced by PixelAtPosition().

657  {
658  glViewport(0, 0, cWidth, cHeight);
659  glMatrixMode(GL_PROJECTION);
660  glLoadIdentity();
661  GLfloat windowRatio = (float)cWidth/(float)cHeight;
662  if (windowRatio < 1)
663  {
664  windowRatio = 1.0f/windowRatio;
665  gluOrtho2D(-viewSize, viewSize, -viewSize*windowRatio, viewSize*windowRatio);
666  pixelSize = 2*viewSize/(float)cWidth;
667  shownSizex = 2*viewSize;
668  shownSizey = 2*viewSize*windowRatio;
669  }
670  else
671  {
672  gluOrtho2D(-viewSize*windowRatio, viewSize*windowRatio, -viewSize, viewSize);
673  pixelSize = 2*viewSize/(float)cHeight;
674  shownSizex = 2*viewSize*windowRatio;
675  shownSizey = 2*viewSize;
676  }
677  glMatrixMode(GL_MODELVIEW);
678 
679  fTextSize = (int)(cWidth*12/600); //want a sized 12 font for a window of 600 pixels width
680  setFont(QFont("Monospace", fTextSize));
681  }

+ Here is the caller graph for this function: