int main(int argc, char **argv) { if(argc < 2) { printf("Usage: %s <speed>\n", argv[0]); printf("\nHotkeys available:"); printf("\n Solar system controls\n"); printf(" r start/stop rotation\n"); printf(" c toggle circles/squares\n"); printf(" o show/hide orbit-polygons\n"); printf(" +/- increase/decrease orbital speed\n"); printf("\n Camera Movements\n"); printf(" w/s move camera forward/backwards\n"); printf(" a/d strafe camera left/right\n"); printf(" l_mouse use mouse for camera orientation\n"); printf(" q/e tilt camera left/right\n"); printf("\n Lightning\n"); printf(" 1 light switch for the sun\n"); printf(" 2 light switch for neighboring star\n"); printf("\n Other\n"); printf(" esq quit\n"); return 1; } /*parse rotation speed*/ speed = atof(argv[1]); /*initialize graphics library*/ glutInit(&argc, argv); glutInitWindowSize(600, 600); glutCreateWindow("A7.3 - Planeten"); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE); glutDisplayFunc(display); glutIdleFunc(idle); glutReshapeFunc(reshape); //handles window resizing /*control settings*/ glutKeyboardFunc(keyboard); glutMotionFunc(mousemove); glutMouseFunc(mouseclick); init_openGL(); glutMainLoop(); }
static int set_openGL_sync(int val, void *param) { if (no_sync) return 0; openGL_sync = val; if (openGL_sync && openGL_initialized) init_openGL(); log_message(openGL_log, "%s openGL_sync", openGL_sync? "enabling" : "disabling"); ui_update_menus(); return 0; }
void openGL_sync_init(void) { Display *dpy; if (openGL_log == LOG_ERR) openGL_log = log_open("openGL"); else return; /* we've been initializied already */ dpy = x11ui_get_display_ptr(); if (check_openGL(dpy)) no_sync = 1; else init_openGL(); }