annotate Renderer/Engine/spe/Property.cc @ 756:2575791a333a

add Test/create_task {spe, task}/Property
author hiroki@henri.cr.ie.u-ryukyu.ac.jp
date Fri, 29 Jan 2010 11:34:43 +0900
parents
children 5238f3e854fc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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 {
2575791a333a add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
12 float x, y, z;
2575791a333a add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
13 } Property, *PropertyPtr;
2575791a333a add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
14
2575791a333a add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
15 static int
2575791a333a add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
16 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
17 {
2575791a333a add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
18 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
19 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
20
2575791a333a add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
21 property->x += 1.0f;
2575791a333a add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
22 property->y += 1.0f;
2575791a333a add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
23 property->z += 1.0f;
2575791a333a add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
24
2575791a333a add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
25 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
26 return 0;
2575791a333a add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
27 }