Help! I want the perspective field of view angle to be configurable by the user. I thought I could just copy & paste the CView:OnSize() GL_PROJECTION matrix code to the FoV combobox selection change code:
void CView::OnSelchangeFoV() {
glMatrixMode(GL_PROJECTION);
OutputGlError(“MatrixMode”) ;
glLoadIdentity();
GLdouble gldAspect = (GLdouble) m_clientArea.cx/ (GLdouble) m_clientArea.cy;
// nFov value gotten from combobox
GLdouble gldFov = (GLdouble) nFoV; gluPerspective(gldFov, gldAspect, 1.0, 100);
glViewport(0, 0, m_clientArea.cx, m_clientArea.cy);
Invalidate(FALSE);
Howver, I get the following error:
MatrixMode had error: #(1282) invalid operation
Removing the glMatrixMode(GL_PROJECTION) line does not change the screen rendering.