AppWindow::AppWindow ( const char* label, int x, int y, int w, int h ) : GlutWindow ( label, x, y, w, h ) { addMenuEntry ( "Option 0", evOption0 ); addMenuEntry ( "Option 1", evOption1 ); _viewaxis = true; _fovy = GS_TORAD(60.0f); _rotx = gspi/8.0f; _roty = gspi/4.0f; _w = w; _h = h; rt = 0.25f; rb = 0.25f; numfaces = 16; textureChoice = false; blendFactor = 0.75f; _lasttime = gs_time(); _animateinc = 0.1f; _animate = true; _normals = false; _flatn = true; _phong = false; initPrograms (); initTextures (); }
void AppWindow::glutSpecial ( int key, int x, int y ) { bool rd=true; const float incr=GS_TORAD(2.5f); const float incf=0.05f; switch ( key ) { case GLUT_KEY_LEFT: _roty-=incr; break; case GLUT_KEY_RIGHT: _roty+=incr; break; case GLUT_KEY_UP: _rotx+=incr; break; case GLUT_KEY_DOWN: _rotx-=incr; break; case GLUT_KEY_PAGE_UP: _fovy-=incf; break; case GLUT_KEY_PAGE_DOWN: _fovy+=incf; break; default: return; // return without rendering } if (rd) redraw(); // ask the window to be rendered when possible }
AppWindow::AppWindow ( const char* label, int x, int y, int w, int h ) :GlutWindow ( label, x, y, w, h ) { initPrograms (); addMenuEntry ( "Option 0", evOption0 ); addMenuEntry ( "Option 1", evOption1 ); _viewaxis = true; _fovy = GS_TORAD(120.0f); _rotx = _roty = 0; _w = w; _h = h; rotate = 0; speed = 0; _turnlr = 0; xview = 0; yview = 0; animate = false; sunx = 0.5f; suny = 1.0f; sunz = 0.8f; camera = true; sunanim = true; }