Mercurial > hg > Game > Cerium
comparison TaskManager/Test/simple_render/viewer.cpp @ 74:5da437ae84db
*** empty log message ***
author | gongo |
---|---|
date | Mon, 18 Feb 2008 04:05:56 +0900 |
parents | 811ffebd8deb |
children | 5a1a5f4c28fd |
comparison
equal
deleted
inserted
replaced
73:811ffebd8deb | 74:5da437ae84db |
---|---|
30 if (SDL_Init( SDL_INIT_VIDEO ) < 0) { | 30 if (SDL_Init( SDL_INIT_VIDEO ) < 0) { |
31 fprintf(stderr,"Couldn't initialize SDL: %s\n",SDL_GetError()); | 31 fprintf(stderr,"Couldn't initialize SDL: %s\n",SDL_GetError()); |
32 exit( 1 ); | 32 exit( 1 ); |
33 } | 33 } |
34 | 34 |
35 #ifdef _DEBUG | 35 #ifndef _DEBUG |
36 screen = SDL_SetVideoMode( width, height, bpp, SDL_HWSURFACE); | 36 screen = SDL_SetVideoMode( width, height, bpp, SDL_HWSURFACE); |
37 if (screen == NULL) { | 37 if (screen == NULL) { |
38 fprintf(stderr, "Couldn't set GL mode: %s\n", SDL_GetError()); | 38 fprintf(stderr, "Couldn't set GL mode: %s\n", SDL_GetError()); |
39 SDL_Quit(); | 39 SDL_Quit(); |
40 exit(1); | 40 exit(1); |
297 | 297 |
298 zRow_init(); | 298 zRow_init(); |
299 graph_line(); | 299 graph_line(); |
300 | 300 |
301 fd_update_sgp = manager->open("UpdateSGP"); | 301 fd_update_sgp = manager->open("UpdateSGP"); |
302 fd_update_sgp = 1; | |
303 fd_create_pp = manager->open("CreatePP"); | 302 fd_create_pp = manager->open("CreatePP"); |
304 fd = manager->open("ViewerRunDraw"); | 303 fd = manager->open("ViewerRunDraw"); |
305 task_update_sgp = manager->create_task(fd_update_sgp, | 304 task_update_sgp = manager->create_task(fd_update_sgp, |
306 sizeof(SceneGraphPack), | 305 sizeof(SceneGraphPack), |
307 sgp_buff, sgp_buff, NULL); | 306 sgp_buff, sgp_buff, NULL); |
311 task = manager->create_task(fd, 0, 0, 0, NULL); | 310 task = manager->create_task(fd, 0, 0, 0, NULL); |
312 | 311 |
313 task->set_depend(task_update_sgp); | 312 task->set_depend(task_update_sgp); |
314 task->set_depend(task_create_pp); | 313 task->set_depend(task_create_pp); |
315 | 314 |
316 task_update_sgp->set_cpu(CPU_SPE); | 315 //task_update_sgp->set_cpu(CPU_SPE); |
317 task_create_pp->set_cpu(CPU_SPE); | 316 task_create_pp->set_cpu(CPU_SPE); |
318 | 317 |
319 task_update_sgp->spawn(); | 318 task_update_sgp->spawn(); |
320 task_create_pp->spawn(); | 319 task_create_pp->spawn(); |
321 task->spawn(); | 320 task->spawn(); |
331 | 330 |
332 PolygonPack *pp; | 331 PolygonPack *pp; |
333 | 332 |
334 pp_buff->get_buffer(&pp); | 333 pp_buff->get_buffer(&pp); |
335 | 334 |
336 //polygon->draw(pp); // test draw of PolygonPack | 335 polygon->draw(pp); // test draw of PolygonPack |
337 SDL_BlitSurface(bitmap, NULL, screen, NULL); | 336 SDL_BlitSurface(bitmap, NULL, screen, NULL); |
338 SDL_UpdateRect(screen, 0, 0, 0, 0); | 337 SDL_UpdateRect(screen, 0, 0, 0, 0); |
339 | 338 |
340 frames++; | 339 frames++; |
341 | 340 |