examples/opengl/pbuffers/glwidget.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
   173 
   173 
   174 void GLWidget::perspectiveProjection()
   174 void GLWidget::perspectiveProjection()
   175 {
   175 {
   176     glMatrixMode(GL_PROJECTION);
   176     glMatrixMode(GL_PROJECTION);
   177     glLoadIdentity();
   177     glLoadIdentity();
       
   178 #ifdef QT_OPENGL_ES
       
   179     glFrustumf(-aspect, +aspect, -1.0, +1.0, 4.0, 15.0);
       
   180 #else
   178     glFrustum(-aspect, +aspect, -1.0, +1.0, 4.0, 15.0);
   181     glFrustum(-aspect, +aspect, -1.0, +1.0, 4.0, 15.0);
       
   182 #endif
   179     glMatrixMode(GL_MODELVIEW);
   183     glMatrixMode(GL_MODELVIEW);
   180 }
   184 }
   181 
   185 
   182 void GLWidget::orthographicProjection()
   186 void GLWidget::orthographicProjection()
   183 {
   187 {
   184     glMatrixMode(GL_PROJECTION);
   188     glMatrixMode(GL_PROJECTION);
   185     glLoadIdentity();
   189     glLoadIdentity();
       
   190 #ifdef QT_OPENGL_ES
       
   191     glOrthof(-1.0, +1.0, -1.0, +1.0, -90.0, +90.0);
       
   192 #else
   186     glOrtho(-1.0, +1.0, -1.0, +1.0, -90.0, +90.0);
   193     glOrtho(-1.0, +1.0, -1.0, +1.0, -90.0, +90.0);
       
   194 #endif
   187     glMatrixMode(GL_MODELVIEW);
   195     glMatrixMode(GL_MODELVIEW);
   188 }
   196 }
   189 
   197 
   190 void GLWidget::resizeGL(int width, int height)
   198 void GLWidget::resizeGL(int width, int height)
   191 {
   199 {