Mercurial > hg > Members > kono > Cerium
annotate Renderer/Engine/spe/Property.cc @ 758:e615e552efa5
change Test/create_task
author | hiroki |
---|---|
date | Sat, 30 Jan 2010 19:33:16 +0900 |
parents | 5238f3e854fc |
children | 24a37fe8419a |
rev | line source |
---|---|
756
2575791a333a
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
1 #include <stdio.h> |
2575791a333a
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
2 #include <string.h> |
2575791a333a
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
3 #include <math.h> |
2575791a333a
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
4 #include "Property.h" |
2575791a333a
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
5 #include "Func.h" |
2575791a333a
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
6 #include "types.h" |
2575791a333a
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
7 |
2575791a333a
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
8 /* これは必須 */ |
2575791a333a
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
9 SchedDefineTask(PropertyTask); |
2575791a333a
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
10 |
2575791a333a
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
11 typedef struct { |
758 | 12 float xyz[3]; |
13 const char *name; | |
756
2575791a333a
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
14 } Property, *PropertyPtr; |
2575791a333a
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
15 |
2575791a333a
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
16 static int |
2575791a333a
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
17 run(SchedTask *s,void *rbuf, void *wbuf) |
2575791a333a
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
18 { |
2575791a333a
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
19 PropertyPtr property = (PropertyPtr)s->get_input(rbuf, 0); |
2575791a333a
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
20 PropertyPtr update_property = (PropertyPtr)s->get_output(wbuf, 0); |
2575791a333a
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
21 |
758 | 22 property->xyz[0] += 1.0f; |
23 property->xyz[1] += 1.0f; | |
24 property->xyz[2] += 1.0f; | |
756
2575791a333a
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
25 |
2575791a333a
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
26 memcpy((void*)update_property, (void*)property, sizeof(Property)); |
2575791a333a
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
27 return 0; |
2575791a333a
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
28 } |