Mercurial > hg > Game > Cerium
changeset 756:a871b0d9c9ae draft
Test/create_task , create SPE task from application.
author | hiroki |
---|---|
date | Fri, 29 Jan 2010 14:34:30 +0900 |
parents | 8aaa29d3e874 |
children | 2aa6e7150588 |
files | Renderer/Engine/spe/Property.cc Renderer/Test/create_task.cc Renderer/Test/create_task.h |
diffstat | 3 files changed, 15 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Engine/spe/Property.cc Fri Jan 29 11:34:43 2010 +0900 +++ b/Renderer/Engine/spe/Property.cc Fri Jan 29 14:34:30 2010 +0900 @@ -10,6 +10,7 @@ typedef struct { float x, y, z; + int pad; } Property, *PropertyPtr; static int
--- a/Renderer/Test/create_task.cc Fri Jan 29 11:34:43 2010 +0900 +++ b/Renderer/Test/create_task.cc Fri Jan 29 14:34:30 2010 +0900 @@ -3,9 +3,12 @@ #include "SceneGraphRoot.h" #include "MainLoop.h" #include "create_task.h" -#include "sys.h" +#include "types.h" #include "Func.h" + +Property *property, *update_property; + // prototype static void move(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h); static void collision(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h, SceneGraphPtr tree); @@ -17,14 +20,16 @@ TaskManager *manager = sgroot->tmanager; HTaskPtr property_task = manager->create_task(PropertyTask); - Property *property = (Property *)manager->allocate(sizeof(Property)); - Property *property_update = (Property *)manager->allocate(sizeof(Property)); + printf("%f, %f, %f\n", update_property->x, update_property->y, update_property->z); + property->x = update_property->x; + property->y = update_property->y; + property->z = update_property->z; property_task->add_inData(property, sizeof(Property)); - property_task->add_outData(property_update, sizeof(Property)); + property_task->add_outData(update_property, sizeof(Property)); property_task->set_cpu(SPE_ANY); + property_task->spawn(); - property_task->spawn(); } static void @@ -49,6 +54,9 @@ sgroot->setSceneData(ball); + property = (Property *)sgroot->manager->allocate(sizeof(Property)); + update_property = (Property *)sgroot->manager->allocate(sizeof(Property)); + return sgroot; }