diff options
Diffstat (limited to 'src/examples/evas/evas-3d-blending.c')
-rw-r--r-- | src/examples/evas/evas-3d-blending.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/src/examples/evas/evas-3d-blending.c b/src/examples/evas/evas-3d-blending.c index db7c7a1590..90ee461389 100644 --- a/src/examples/evas/evas-3d-blending.c +++ b/src/examples/evas/evas-3d-blending.c @@ -143,12 +143,11 @@ _animate_scene(void *data) static void _camera_setup(Scene_Data *data) { - data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); + eo_add(&data->camera, EVAS_CANVAS3D_CAMERA_CLASS, evas); evas_canvas3d_camera_projection_perspective_set(data->camera, 60.0, 1.0, 2.0, 50.0); - data->camera_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); + eo_add(&data->camera_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->camera_node, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); evas_canvas3d_node_camera_set(data->camera_node, data->camera); evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 10.0); @@ -160,13 +159,12 @@ _camera_setup(Scene_Data *data) static void _light_setup(Scene_Data *data) { - data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); + eo_add(&data->light, EVAS_CANVAS3D_LIGHT_CLASS, evas); evas_canvas3d_light_ambient_set(data->light, 0.2, 0.2, 0.2, 1.0); evas_canvas3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0); evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0); - data->light_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); + eo_add(&data->light_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->light_node, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); evas_canvas3d_node_light_set(data->light_node, data->light); evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 10.0); evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0); @@ -184,7 +182,7 @@ _set_ball(Eo *mesh, Eo *sphere, Evas_Canvas3D_Material *material) static void _mesh_setup(Scene_Data *data) { - data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&data->material, EVAS_CANVAS3D_MATERIAL_CLASS, evas); evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE); evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE); @@ -194,7 +192,7 @@ _mesh_setup(Scene_Data *data) evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 0.2); evas_canvas3d_material_shininess_set(data->material, 100.0); - data->material1 = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); + eo_add(&data->material1, EVAS_CANVAS3D_MATERIAL_CLASS, evas); evas_canvas3d_material_enable_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE); evas_canvas3d_material_enable_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE); @@ -204,24 +202,22 @@ _mesh_setup(Scene_Data *data) evas_canvas3d_material_color_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 0.2); evas_canvas3d_material_shininess_set(data->material1, 100.0); - data->sphere = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); + eo_add(&data->sphere, EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); evas_canvas3d_primitive_form_set(data->sphere, EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE); evas_canvas3d_primitive_precision_set(data->sphere, 50); - data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); - data->mesh1 = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&data->mesh, EVAS_CANVAS3D_MESH_CLASS, evas); + eo_add(&data->mesh1, EVAS_CANVAS3D_MESH_CLASS, evas); _set_ball(data->mesh, data->sphere, data->material); _set_ball(data->mesh1, data->sphere, data->material1); - data->mesh_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&data->mesh_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->mesh_node, EVAS_CANVAS3D_NODE_TYPE_MESH)); evas_canvas3d_node_member_add(data->root_node, data->mesh_node); evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh); - data->mesh_node1 = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); + eo_add(&data->mesh_node1, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->mesh_node1, EVAS_CANVAS3D_NODE_TYPE_MESH)); evas_canvas3d_node_member_add(data->root_node, data->mesh_node1); evas_canvas3d_node_mesh_add(data->mesh_node1, data->mesh1); @@ -237,13 +233,12 @@ _mesh_setup(Scene_Data *data) static void _scene_setup(Scene_Data *data) { - data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); + eo_add(&data->scene, EVAS_CANVAS3D_SCENE_CLASS, evas); evas_canvas3d_scene_size_set(data->scene, WIDTH, HEIGHT); evas_canvas3d_scene_background_color_set(data->scene, 0.5, 0.5, 0.5, 1); - data->root_node = - eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE)); + eo_add(&data->root_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(data->root_node, EVAS_CANVAS3D_NODE_TYPE_NODE)); _camera_setup(data); _light_setup(data); |