summaryrefslogtreecommitdiff
path: root/src/examples/evas/evas-3d-aabb.c
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2014-05-27 22:41:40 +0900
committerChunEon Park <hermet@hermet.pe.kr>2014-05-27 22:41:40 +0900
commit1d0330f9b12106ffd87bb223f4bc7142074be046 (patch)
treebc63ee2adf7d5e9b80763b7ff52e6b9fc71ca0d1 /src/examples/evas/evas-3d-aabb.c
parent28871750b79f6bbb6b08ec8e7796d67aafa59f14 (diff)
evas/evas3d - fixed incorrect usage in evas-3d-aabb example.
Diffstat (limited to 'src/examples/evas/evas-3d-aabb.c')
-rw-r--r--src/examples/evas/evas-3d-aabb.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/examples/evas/evas-3d-aabb.c b/src/examples/evas/evas-3d-aabb.c
index c1ced0d..7765cae 100644
--- a/src/examples/evas/evas-3d-aabb.c
+++ b/src/examples/evas/evas-3d-aabb.c
@@ -38,7 +38,7 @@ Eo *light = NULL;
38 38
39 39
40static Eina_Bool 40static Eina_Bool
41_mesh_aabb(Evas_3D_Mesh **mesh_b, const Evas_3D_Node *node); 41_mesh_aabb(Evas_3D_Mesh **mesh_b);
42 42
43static Eina_Bool 43static Eina_Bool
44_animate_scene(void *data) 44_animate_scene(void *data)
@@ -47,7 +47,7 @@ _animate_scene(void *data)
47 47
48 eo_do((Evas_3D_Node *)data, evas_3d_node_mesh_frame_set(mesh, frame)); 48 eo_do((Evas_3D_Node *)data, evas_3d_node_mesh_frame_set(mesh, frame));
49 49
50 _mesh_aabb(&mesh_box, mesh_box_node); 50 _mesh_aabb(&mesh_box);
51 51
52 frame += 32; 52 frame += 32;
53 53
@@ -104,7 +104,7 @@ _on_canvas_resize(Ecore_Evas *ee)
104} 104}
105 105
106static Eina_Bool 106static Eina_Bool
107_mesh_aabb(Evas_3D_Mesh **mesh_b, const Evas_3D_Node *node) 107_mesh_aabb(Evas_3D_Mesh **mesh_b)
108{ 108{
109 Evas_Real x0, y0, z0, x1, y1, z1; 109 Evas_Real x0, y0, z0, x1, y1, z1;
110 110
@@ -159,14 +159,11 @@ _mesh_aabb(Evas_3D_Mesh **mesh_b, const Evas_3D_Node *node)
159 memcpy(cube_indices, indices, sizeof(indices)); 159 memcpy(cube_indices, indices, sizeof(indices));
160 160
161 eo_do(*mesh_b, 161 eo_do(*mesh_b,
162 evas_3d_mesh_vertex_count_set(24), 162 evas_3d_mesh_frame_vertex_data_copy_set(0, EVAS_3D_VERTEX_POSITION,
163 evas_3d_mesh_frame_add( 0), 163 3 * sizeof(float),
164 evas_3d_mesh_frame_vertex_data_copy_set(0, EVAS_3D_VERTEX_POSITION, 3 * sizeof(float), &cube_vertices[ 0]), 164 &cube_vertices[ 0]),
165 evas_3d_mesh_index_data_copy_set(EVAS_3D_INDEX_FORMAT_UNSIGNED_SHORT, 48, &cube_indices[0]), 165 evas_3d_mesh_index_data_copy_set(EVAS_3D_INDEX_FORMAT_UNSIGNED_SHORT,
166 evas_3d_mesh_vertex_assembly_set(EVAS_3D_VERTEX_ASSEMBLY_LINES), 166 48, &cube_indices[0]));
167 evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_DIFFUSE),
168 evas_3d_mesh_frame_material_set(0, material_box));
169
170 free(cube_vertices); 167 free(cube_vertices);
171 free(cube_indices); 168 free(cube_indices);
172 169
@@ -264,7 +261,13 @@ main(void)
264 eo_do(material_box, evas_3d_material_enable_set(EVAS_3D_MATERIAL_DIFFUSE, EINA_TRUE)); 261 eo_do(material_box, evas_3d_material_enable_set(EVAS_3D_MATERIAL_DIFFUSE, EINA_TRUE));
265 262
266 mesh_box = eo_add(EVAS_3D_MESH_CLASS, evas); 263 mesh_box = eo_add(EVAS_3D_MESH_CLASS, evas);
267 _mesh_aabb(&mesh_box, mesh_box_node); 264 eo_do(mesh_box,
265 evas_3d_mesh_vertex_count_set(24),
266 evas_3d_mesh_frame_add(0),
267 evas_3d_mesh_vertex_assembly_set(EVAS_3D_VERTEX_ASSEMBLY_LINES),
268 evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_DIFFUSE),
269 evas_3d_mesh_frame_material_set(0, material_box));
270 _mesh_aabb(&mesh_box);
268 271
269 eo_do(root_node, 272 eo_do(root_node,
270 evas_3d_node_member_add(mesh_box_node)); 273 evas_3d_node_member_add(mesh_box_node));