int main() { char *line; char **cmd; uneditedLine = (char*)malloc(256 * sizeof(char)); while (1) { my_setup(); my_prompt(); line = my_read(); strcpy(uneditedLine, line); if (line == 0) return 0; if (line[0] == '\0') { free(line); continue; } cmd = my_parse(line); my_execute(cmd); my_clean(line, cmd); } free(uneditedLine); return 0; }
int main(int argc, char** argv) { setbuf(stdout, NULL); /* for writing to stdout asap */ glutInit(&argc, argv); my_setup(argc, argv); glut_setup(); gl_setup(); glutMainLoop(); return(0); }
/******************************************************* FUNCTION: main ARGS: argc, argv RETURN: 0 DOES: main function (duh!); starts GL, GLU, GLUT, then loops ********************************************************/ int main(int argc, char** argv) { glutInit(&argc, argv); glut_setup(); gl_setup(); my_setup(); glutMainLoop(); return(0); }
/*Typical OpenGL/GLUT Main function */ int main(int argc, char **argv) { /* program arguments */ /* initialize GLUT and OpenGL; Must be called first */ glutInit( &argc, argv ) ; /* our own initializations; we'll define these setup procedures */ glut_setup() ; gl_setup() ; my_setup(); /* turn control over to GLUT */ glutMainLoop() ; return(0) ; /* make the compiler happy */ }
int main(int argc, char **argv) { /* General initialization for GLUT and OpenGL Must be called first */ glutInit(&argc, argv); /* we define these setup procedures */ glut_setup(); gl_setup(); my_setup(argc, argv); /* go into the main event loop */ glutMainLoop(); return (0); }
int main() { char *line; char **cmd; while (1) { my_setup(); my_prompt(); my_read(line); cmd = my_parse(line); //my_execute(cmd); //my_clean(); } return 0; }
int main(int argc, char** argv) { printKey(); // Command "key" printed to standard out glutInit(&argc, argv); my_setup(canvas_Width, canvas_Height, canvas_Name); initial(); // Set initial values of global variables glutDisplayFunc(display_func); // Register display callback glutKeyboardFunc(keypress); // Register key press callback glutMainLoop(); // Execute until killed return 0; }
//Typical OpenGL/GLUT Main function int main(int argc, char **argv) { // program arguments //initialize shape info for (int x = 0; x < SIZE; x++) { //even shapes are rectangles, odd shapes are circles if (x % 2 == 0) list_of_shapes[x].is_circle = 0; else list_of_shapes[x].is_circle = 1; list_of_shapes[x].curr_x = 0; list_of_shapes[x].curr_y = 0; list_of_shapes[x].p_ptr = NULL; } // initialize GLUT and OpenGL; Must be called first glutInit( &argc, argv ) ; // our own initializations; we'll define these setup procedures glut_setup() ; gl_setup() ; my_setup(); // turn control over to GLUT glutMainLoop() ; //Free memory for (int x = 0; x < 25; x++) { if (list_of_shapes[x].p_ptr != NULL) { delete [] list_of_shapes[x].p_ptr; } } return(0) ; // make the compiler happy }
int main(int argc, char **argv) { // see if the structs all compiled and work together test.id = 3; printf("test.id is %d\nHeck yes!\n", test.id); glutInit(&argc, argv); glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH); glutInitWindowPosition(100, 100); glutInitWindowSize(WINDOW_WIDTH, WINDOW_HEIGHT); glutCreateWindow("Fireworks"); initGL(); my_setup(); glutDisplayFunc(my_display); glutKeyboardFunc(my_keyboard); glutMainLoop(); return 0; }
int main(int argc, char **argv) { glutInit(&argc,argv); my_setup(canvas_Width,canvas_Height,canvas_Name); vector <int >new_fan; if(argc!=2){ cout<<"<usuage>:mismatched arguments"<<endl; exit(0); } ifstream mesh_input(argv[1]); if(mesh_input.is_open()) read_input_mesh(mesh_input,v_count,f_count,d_vb,d_ib); else{ cout<<"Cannot open input mesh"<<endl; exit(0); } mesh_input.close();//Finised with reading mesh data vector < vector<int> >fan(v_count); vector < vector<edge> >e(v_count); create_lists(e,d_ib,f_count); //delete[]d_ib;//done with index buffer list triangle_fan_create(e,d_vb,fan); output=new vertex_buffer[v_count]; size=fan[0].size(); for(int i=0;i<fan.size();i++){ for(int j=0;j<size;j++){ new_fan.push_back(fan[i][j]); } } test=&new_fan[0]; clock_t start=clock(); for(int i=0;i<10;i++) zhou_shimada(d_vb,output,test,fan[0].size(),v_count); clock_t stop=clock(); cout<<"Elapsed time="<<(double)((stop-start))/CLOCKS_PER_SEC<<endl; // print_output(output,v_count); glutDisplayFunc(display_func); glutKeyboardFunc(keyboard); glutMainLoop(); return 0; }