changeset 101:c31499d11926

*** empty log message ***
author gongo
date Mon, 03 Mar 2008 14:06:33 +0900
parents 9f8b53beef7e
children 62679f4cae18
files TaskManager/Test/simple_render/Makefile TaskManager/Test/simple_render/polygon.cpp TaskManager/Test/simple_render/viewer.cpp
diffstat 3 files changed, 29 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/Test/simple_render/Makefile	Fri Feb 29 05:43:43 2008 +0900
+++ b/TaskManager/Test/simple_render/Makefile	Mon Mar 03 14:06:33 2008 +0900
@@ -8,15 +8,15 @@
 TASK_OBJS = $(TASK_SRCS:.cpp=.o)
 
 CC      = g++
-CFLAGS  = -g -O9 -Wall -DDEBUG
+CFLAGS  = -g -Wall# -DDEBUG
 INCLUDE = -I../../../include/TaskManager -I.
 
 EXTRA_CFLAGS = `sdl-config --cflags` `xml2-config --cflags` -I/usr/local/include/SDL
 
-EXTRA_LIBS = -lCellManager -lspe2 -lpthread
-#EXTRA_LIBS = -lFifoManager
+#EXTRA_LIBS = -lCellManager -lspe2 -lpthread
+EXTRA_LIBS = -lFifoManager
 
-LIBS = `sdl-config --libs` /usr/local/lib/libSDL_image.a -lGL \
+LIBS = `sdl-config --libs` -lSDL_image -lGL \
        `xml2-config --libs` -L../.. $(EXTRA_LIBS)
 #LIBS = `sdl-config --libs` -lSDL_image -Wl,-framework,OpenGL \
 #      `xml2-config --libs` -L../.. $(EXTRA_LIBS)
--- a/TaskManager/Test/simple_render/polygon.cpp	Fri Feb 29 05:43:43 2008 +0900
+++ b/TaskManager/Test/simple_render/polygon.cpp	Mon Mar 03 14:06:33 2008 +0900
@@ -356,8 +356,6 @@
 {
     SPAN_PTR span;
 
-    printf("%d\n", sp->info.size);
-    printf("%d\n", sp->span[0].y);
     for (int n = 0; n < sp->info.size; n++) {
 	span = &sp->span[n];
 
--- a/TaskManager/Test/simple_render/viewer.cpp	Fri Feb 29 05:43:43 2008 +0900
+++ b/TaskManager/Test/simple_render/viewer.cpp	Mon Mar 03 14:06:33 2008 +0900
@@ -30,7 +30,7 @@
 	exit( 1 );
     }
     
-#ifdef _DEBUG
+#ifndef _DEBUG
     screen = SDL_SetVideoMode( width, height, bpp, SDL_HWSURFACE);
     if (screen == NULL) {
 	fprintf(stderr, "Couldn't set GL mode: %s\n", SDL_GetError());
@@ -291,13 +291,13 @@
     task = manager->create_task(fd, 0, 0, 0, NULL);      
     task->spawn();
     
-    posix_memalign((void**)&__texture, 16, 128*128*3);
-    memcpy(__texture, polygon->texture_image->pixels, 128*128*3);
-    HTaskPtr task_init_tex = manager->create_task(0, 0, (uint32)__texture, 0, NULL);
-    task_init_tex->set_cpu(CPU_SPE);
-    task_init_tex->spawn();
+    //posix_memalign((void**)&__texture, 16, 128*128*3);
+    //memcpy(__texture, polygon->texture_image->pixels, 128*128*3);
+    //HTaskPtr task_init_tex = manager->create_task(0, 0, (uint32)__texture, 0, NULL);
+    //task_init_tex->set_cpu(CPU_SPE);
+    //task_init_tex->spawn();
 
-    fbdev_addr = get_fbdev_addr();
+    //fbdev_addr = get_fbdev_addr();
 }
 
 void
@@ -329,11 +329,11 @@
     // clean_pixels や zRow_init は、
     // spe で fb に draw する時は必要ない。
     // ppe 側で draw する時にだけ呼ぶべき。
-    //clean_pixels();
-    //zRow_init();
+    clean_pixels();
+    zRow_init();
 
     // これ自身、一つのタスクとして回す方がよいか
-    //graph_line();
+    graph_line();
 
     fd_update_sgp = manager->open("UpdateSGP");
     fd_create_pp  = manager->open("CreatePP");
@@ -395,8 +395,8 @@
  * 本当はタスクとして TestDraw を選ぶ
  */
 
-#define DRAW_POLYGON
-//#define DRAW_SPANPACK
+//#define DRAW_POLYGON
+#define DRAW_SPANPACK
 //#define DRAW_SPUSPAN
 void
 Viewer::run_draw(void)
@@ -408,7 +408,7 @@
     fd = manager->open("ViewerRunLoop");
     task = manager->create_task(fd, 0, 0, 0, NULL);
 
-#if 1
+#if 0
     for (int j = 0; j < 6; j++) {
 	 for (int i = 0; i < 10; i++) {
 	      if (ssl->ss[j].spp[i].info.size < 1) continue;
@@ -423,13 +423,8 @@
     }
 #endif
     task->spawn();
-
-    SDL_BlitSurface(bitmap, NULL, screen, NULL);
-    SDL_UpdateRect(screen, 0, 0, 0, 0);    
-
-    frames++;
     
-    return;
+    //return;
     
 #if 0 // USE DOUBLE BUFFER
     PolygonPack *pp;
@@ -440,17 +435,14 @@
 #endif
 
 #ifdef DRAW_POLYGON
-    polygon->draw(pp);    // test draw of PolygonPack
-
+    //polygon->draw(pp);    // test draw of PolygonPack
+    polygon->draw(sgp);    // test draw of PolygonPack
 #else
 #  ifdef DRAW_SPANPACK // test draw of SpanPack
-    for (int i = 0; i < 1; i++) {
-	polygon->draw(&ssl->ss[0].spp[i]);
-	polygon->draw(&ssl->ss[1].spp[i]);
-	polygon->draw(&ssl->ss[2].spp[i]);
-	polygon->draw(&ssl->ss[3].spp[i]);
-	polygon->draw(&ssl->ss[4].spp[i]);
-	polygon->draw(&ssl->ss[5].spp[i]);
+    for (int j = 0; j < 6; j++) {
+	 for (int i = 0; i < 10; i++) {
+	      polygon->draw(&ssl->ss[j].spp[i]);
+	 }
     }
 #  else
     polygon->draw(&ssl->ss[0]);
@@ -462,6 +454,11 @@
 #  endif
 #endif
 
+    SDL_BlitSurface(bitmap, NULL, screen, NULL);
+    SDL_UpdateRect(screen, 0, 0, 0, 0);    
+
+    frames++;
+
     return;
 }