summaryrefslogtreecommitdiff
path: root/src/examples/evas/evas-3d-aabb.c
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2016-03-11 12:24:08 +0000
committerTom Hacohen <tom@stosb.com>2016-03-11 12:29:03 +0000
commitf24210caac8d50940ddef858994571be59179c10 (patch)
treecfc8b264e77abbab9827517d1827f9a4fb4dcd50 /src/examples/evas/evas-3d-aabb.c
parent9fdac37187e35f45570c3808011d0283c658652d (diff)
Revert "Automatic migration to the new eo_add syntax."
This reverts commit 4f949a2757b6332306264d7f126b15ba7bfd37d4.
Diffstat (limited to 'src/examples/evas/evas-3d-aabb.c')
-rw-r--r--src/examples/evas/evas-3d-aabb.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/examples/evas/evas-3d-aabb.c b/src/examples/evas/evas-3d-aabb.c
index a676185..d02668b 100644
--- a/src/examples/evas/evas-3d-aabb.c
+++ b/src/examples/evas/evas-3d-aabb.c
@@ -142,38 +142,40 @@ main(void)
142 142
143 evas = ecore_evas_get(ecore_evas); 143 evas = ecore_evas_get(ecore_evas);
144 144
145 eo_add(&scene, EVAS_CANVAS3D_SCENE_CLASS, evas); 145 scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
146 146
147 eo_add(&root_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(root_node, EVAS_CANVAS3D_NODE_TYPE_NODE)); 147 root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE));
148 148
149 eo_add(&camera, EVAS_CANVAS3D_CAMERA_CLASS, evas); 149 camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
150 evas_canvas3d_camera_projection_perspective_set(camera, 60.0, 1.0, 1.0, 500.0); 150 evas_canvas3d_camera_projection_perspective_set(camera, 60.0, 1.0, 1.0, 500.0);
151 151
152 eo_add(&camera_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(camera_node, EVAS_CANVAS3D_NODE_TYPE_CAMERA)); 152 camera_node =
153 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
153 evas_canvas3d_node_camera_set(camera_node, camera); 154 evas_canvas3d_node_camera_set(camera_node, camera);
154 evas_canvas3d_node_member_add(root_node, camera_node); 155 evas_canvas3d_node_member_add(root_node, camera_node);
155 evas_canvas3d_node_position_set(camera_node, 100.0, 50.0, 20.0); 156 evas_canvas3d_node_position_set(camera_node, 100.0, 50.0, 20.0);
156 evas_canvas3d_node_look_at_set(camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 20.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 1.0); 157 evas_canvas3d_node_look_at_set(camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 20.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 1.0);
157 eo_add(&light, EVAS_CANVAS3D_LIGHT_CLASS, evas); 158 light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas);
158 evas_canvas3d_light_ambient_set(light, 1.0, 1.0, 1.0, 1.0); 159 evas_canvas3d_light_ambient_set(light, 1.0, 1.0, 1.0, 1.0);
159 evas_canvas3d_light_diffuse_set(light, 1.0, 1.0, 1.0, 1.0); 160 evas_canvas3d_light_diffuse_set(light, 1.0, 1.0, 1.0, 1.0);
160 evas_canvas3d_light_specular_set(light, 1.0, 1.0, 1.0, 1.0); 161 evas_canvas3d_light_specular_set(light, 1.0, 1.0, 1.0, 1.0);
161 evas_canvas3d_light_directional_set(light, EINA_TRUE); 162 evas_canvas3d_light_directional_set(light, EINA_TRUE);
162 163
163 eo_add(&light_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(light_node, EVAS_CANVAS3D_NODE_TYPE_LIGHT)); 164 light_node =
165 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
164 evas_canvas3d_node_light_set(light_node, light); 166 evas_canvas3d_node_light_set(light_node, light);
165 evas_canvas3d_node_position_set(light_node, 1000.0, 0.0, 1000.0); 167 evas_canvas3d_node_position_set(light_node, 1000.0, 0.0, 1000.0);
166 evas_canvas3d_node_look_at_set(light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0); 168 evas_canvas3d_node_look_at_set(light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
167 evas_canvas3d_node_member_add(root_node, light_node); 169 evas_canvas3d_node_member_add(root_node, light_node);
168 170
169 eo_add(&mesh, EVAS_CANVAS3D_MESH_CLASS, evas); 171 mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
170 eo_add(&material, EVAS_CANVAS3D_MATERIAL_CLASS, evas); 172 material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
171 173
172 efl_file_set(mesh, model_path, NULL); 174 efl_file_set(mesh, model_path, NULL);
173 evas_canvas3d_mesh_frame_material_set(mesh, 0, material); 175 evas_canvas3d_mesh_frame_material_set(mesh, 0, material);
174 evas_canvas3d_mesh_shade_mode_set(mesh, EVAS_CANVAS3D_SHADE_MODE_PHONG); 176 evas_canvas3d_mesh_shade_mode_set(mesh, EVAS_CANVAS3D_SHADE_MODE_PHONG);
175 177
176 eo_add(&texture, EVAS_CANVAS3D_TEXTURE_CLASS, evas); 178 texture = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas);
177 evas_canvas3d_texture_file_set(texture, image_path, NULL); 179 evas_canvas3d_texture_file_set(texture, image_path, NULL);
178 evas_canvas3d_texture_filter_set(texture, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST); 180 evas_canvas3d_texture_filter_set(texture, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST);
179 evas_canvas3d_texture_wrap_set(texture, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT); 181 evas_canvas3d_texture_wrap_set(texture, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT);
@@ -187,16 +189,16 @@ main(void)
187 evas_canvas3d_material_color_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0); 189 evas_canvas3d_material_color_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0);
188 evas_canvas3d_material_shininess_set(material, 50.0); 190 evas_canvas3d_material_shininess_set(material, 50.0);
189 191
190 eo_add(&mesh_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(mesh_node, EVAS_CANVAS3D_NODE_TYPE_MESH)); 192 mesh_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
191 eo_add(&mesh_box_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(mesh_box_node, EVAS_CANVAS3D_NODE_TYPE_MESH)); 193 mesh_box_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
192 194
193 eo_add(&material_box, EVAS_CANVAS3D_MATERIAL_CLASS, evas); 195 material_box = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
194 evas_canvas3d_material_enable_set(material_box, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE); 196 evas_canvas3d_material_enable_set(material_box, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
195 197
196 eo_add(&cube, EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); 198 cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
197 evas_canvas3d_primitive_form_set(cube, EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE); 199 evas_canvas3d_primitive_form_set(cube, EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE);
198 200
199 eo_add(&mesh_box, EVAS_CANVAS3D_MESH_CLASS, evas); 201 mesh_box = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
200 evas_canvas3d_mesh_from_primitive_set(mesh_box, 0, cube); 202 evas_canvas3d_mesh_from_primitive_set(mesh_box, 0, cube);
201 evas_canvas3d_mesh_vertex_assembly_set(mesh_box, EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINES); 203 evas_canvas3d_mesh_vertex_assembly_set(mesh_box, EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINES);
202 evas_canvas3d_mesh_shade_mode_set(mesh_box, EVAS_CANVAS3D_SHADE_MODE_VERTEX_COLOR); 204 evas_canvas3d_mesh_shade_mode_set(mesh_box, EVAS_CANVAS3D_SHADE_MODE_VERTEX_COLOR);
@@ -213,7 +215,7 @@ main(void)
213 evas_canvas3d_scene_camera_node_set(scene, camera_node); 215 evas_canvas3d_scene_camera_node_set(scene, camera_node);
214 evas_canvas3d_scene_size_set(scene, WIDTH, HEIGHT); 216 evas_canvas3d_scene_size_set(scene, WIDTH, HEIGHT);
215 217
216 eo_add(&background, EVAS_RECTANGLE_CLASS, evas); 218 background = eo_add(EVAS_RECTANGLE_CLASS, evas);
217 efl_gfx_color_set(background, 0, 0, 0, 255); 219 efl_gfx_color_set(background, 0, 0, 0, 255);
218 efl_gfx_size_set(background, WIDTH, HEIGHT); 220 efl_gfx_size_set(background, WIDTH, HEIGHT);
219 efl_gfx_visible_set(background, EINA_TRUE); 221 efl_gfx_visible_set(background, EINA_TRUE);