comparison TaskManager/Test/simple_render/viewer.cpp @ 29:e949a536a68d

*** empty log message ***
author gongo
date Mon, 11 Feb 2008 17:33:38 +0900
parents 243ee0a1fe6f
children 6a77b5e755ab
comparison
equal deleted inserted replaced
28:243ee0a1fe6f 29:e949a536a68d
323 void Viewer::run() 323 void Viewer::run()
324 { 324 {
325 int frames = 0; 325 int frames = 0;
326 int start_time, this_time; 326 int start_time, this_time;
327 327
328 HTaskPtr task_create_sgp = NULL;
328 HTaskPtr task_update_sgp = NULL; 329 HTaskPtr task_update_sgp = NULL;
329 HTaskPtr task_create_pp = NULL; 330 HTaskPtr task_create_pp = NULL;
331 int fd_create_sgp;
330 int fd_update_sgp; 332 int fd_update_sgp;
331 int fd_create_pp; 333 int fd_create_pp;
332 334
333 start_time = get_ticks(); 335 start_time = get_ticks();
334 336
358 p->next->next->next->next->next->next->next->next->viewer = this; 360 p->next->next->next->next->next->next->next->next->viewer = this;
359 p->next->next->next->next->next->next->next->next->next->viewer = this; 361 p->next->next->next->next->next->next->next->next->next->viewer = this;
360 */ 362 */
361 363
362 SceneGraphPack *sgp = new SceneGraphPack; 364 SceneGraphPack *sgp = new SceneGraphPack;
363 create_sgp(sgp,p); 365 //create_sgp(sgp,p);
364 366
365 PolygonPack *pp = new PolygonPack; 367 PolygonPack *pp = new PolygonPack;
366 368
367 graph_line(); 369 graph_line();
368 370
408 //p->child->brother->angle[1] = r*3; 410 //p->child->brother->angle[1] = r*3;
409 //p->child->brother->child->angle[1] = r*4; 411 //p->child->brother->child->angle[1] = r*4;
410 x += 0.5; 412 x += 0.5;
411 y += 0.5; 413 y += 0.5;
412 z += 0.5; 414 z += 0.5;
413 //p->xyz[0] = x; 415 p->xyz[0] = x;
414 //p->xyz[1] = y; 416 p->xyz[1] = y;
415 //p->xyz[2] = z; 417 p->xyz[2] = z;
416 //p->tree_draw(); 418 p->tree_draw();
417 419
418 420 #if 1
419 #if 0 421 create_sgp(sgp, p);
420 update_sgp(sgp, sgp); 422 update_sgp(sgp, sgp);
421 create_pp(pp, sgp); 423 create_pp(pp, sgp);
422 #else 424 #else
425 fd_create_sgp = manager->open("CreateSGP");
423 fd_update_sgp = manager->open("UpdateSGP"); 426 fd_update_sgp = manager->open("UpdateSGP");
424 fd_create_pp = manager->open("CreatePP"); 427 fd_create_pp = manager->open("CreatePP");
425 428
426 task_update_sgp = manager->create_task(fd_update_sgp, 429 task_create_sgp =
427 sizeof(SceneGraphPack), 430 manager->create_task(fd_create_sgp,
428 (unsigned int)sgp, 431 sizeof(Polygon),
429 (unsigned int)sgp, 432 (unsigned int)p,
430 NULL); 433 (unsigned int)sgp,
431 434 NULL);
432 task_create_pp = manager->create_task(fd_create_pp, 435 task_update_sgp =
433 sizeof(SceneGraphPack), 436 manager->create_task(fd_update_sgp,
434 (unsigned int)sgp, 437 sizeof(SceneGraphPack),
435 (unsigned int)pp, 438 (unsigned int)sgp,
436 NULL); 439 (unsigned int)sgp,
437 //manager->set_task_depend(task_update_sgp, task_create_pp); 440 NULL);
441 task_create_pp =
442 manager->create_task(fd_create_pp,
443 sizeof(SceneGraphPack),
444 (unsigned int)sgp,
445 (unsigned int)pp,
446 NULL);
447
448 manager->set_task_depend(task_create_sgp, task_update_sgp);
449 manager->set_task_depend(task_create_sgp, task_create_pp);
450 manager->spawn_task(task_create_sgp);
438 manager->spawn_task(task_update_sgp); 451 manager->spawn_task(task_update_sgp);
439 manager->spawn_task(task_create_pp); 452 manager->spawn_task(task_create_pp);
440 453
441 manager->run(); 454 manager->run();
442 #endif 455 #endif