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