Пример #1
0
void reshape(int w, int h){
  GW = w;
  GH = h;
  resetUIPosition();
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluPerspective(45.0, 1.0 * w / h, 1.0, 100.0);
  glMatrixMode(GL_MODELVIEW);
  glViewport(0, 0, w, h);
  glutPostRedisplay();
}
Пример #2
0
// =============================
//        Test Function
// =============================
void ScreenTest::resetDesignSize()
{
    const char* strHeight = m_editHeight->getText();
    std::stringstream strHeightValue;
    strHeightValue << strHeight;
    
    unsigned int intHeight;
    strHeightValue >> intHeight;
    
    
    
    const char* strWidth = m_editWidth->getText();
    std::stringstream strWidthValue;
    strWidthValue << strWidth;
    
    unsigned int intWidth;
    strWidthValue >> intWidth;
    
    Director::getInstance()->getOpenGLView()->setDesignResolutionSize(intWidth, intHeight, ResolutionPolicy::NO_BORDER);
    resetUIPosition();
}