summaryrefslogtreecommitdiff
path: root/src/examples/evas/evas-3d-fog.c
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-11-01 21:57:43 -0200
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-11-01 21:57:43 -0200
commitfa88a2337f4c1ed74dbe5f8e9b8ab9e80aa94215 (patch)
tree289d1f0e30abe7aeb9100ab9ed3e3a755d1c18b7 /src/examples/evas/evas-3d-fog.c
parentb9a6a8e7384fc79fced2132407208abfedf77fe1 (diff)
Eo: Partial implementation to remove eo_dodevs/felipealmeida/eo_optimisations
Diffstat (limited to 'src/examples/evas/evas-3d-fog.c')
-rw-r--r--src/examples/evas/evas-3d-fog.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/examples/evas/evas-3d-fog.c b/src/examples/evas/evas-3d-fog.c
index 5d191e8..8d9a0c6 100644
--- a/src/examples/evas/evas-3d-fog.c
+++ b/src/examples/evas/evas-3d-fog.c
@@ -82,13 +82,13 @@ _animate_scene(void *data)
82static void 82static void
83_camera_setup(Scene_Data *data) 83_camera_setup(Scene_Data *data)
84{ 84{
85 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); 85 eo_add(data->camera, EVAS_CANVAS3D_CAMERA_CLASS, evas);
86 86
87 eo_do(data->camera, 87 eo_do(data->camera,
88 evas_canvas3d_camera_projection_perspective_set(60.0, 1.0, 2.0, 50.0)); 88 evas_canvas3d_camera_projection_perspective_set(60.0, 1.0, 2.0, 50.0));
89 89
90 data->camera_node = 90
91 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 91 eo_add(data->camera_node, EVAS_CANVAS3D_NODE_CLASS, evas,
92 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA)); 92 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA));
93 93
94 eo_do(data->camera_node, 94 eo_do(data->camera_node,
@@ -103,14 +103,14 @@ _camera_setup(Scene_Data *data)
103static void 103static void
104_light_setup(Scene_Data *data) 104_light_setup(Scene_Data *data)
105{ 105{
106 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); 106 eo_add(data->light, EVAS_CANVAS3D_LIGHT_CLASS, evas);
107 eo_do(data->light, 107 eo_do(data->light,
108 evas_canvas3d_light_ambient_set(0.2, 0.2, 0.2, 1.0), 108 evas_canvas3d_light_ambient_set(0.2, 0.2, 0.2, 1.0),
109 evas_canvas3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0), 109 evas_canvas3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0),
110 evas_canvas3d_light_specular_set(1.0, 1.0, 1.0, 1.0)); 110 evas_canvas3d_light_specular_set(1.0, 1.0, 1.0, 1.0));
111 111
112 data->light_node = 112
113 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 113 eo_add(data->light_node, EVAS_CANVAS3D_NODE_CLASS, evas,
114 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT)); 114 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT));
115 eo_do(data->light_node, 115 eo_do(data->light_node,
116 evas_canvas3d_node_light_set(data->light), 116 evas_canvas3d_node_light_set(data->light),
@@ -133,7 +133,7 @@ _set_ball(Eo *mesh, Eo *sphere, Evas_Canvas3D_Material *material)
133static void 133static void
134_mesh_setup(Scene_Data *data) 134_mesh_setup(Scene_Data *data)
135{ 135{
136 data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 136 eo_add(data->material, EVAS_CANVAS3D_MATERIAL_CLASS, evas);
137 137
138 eo_do(data->material, 138 eo_do(data->material,
139 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 139 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE),
@@ -145,23 +145,23 @@ _mesh_setup(Scene_Data *data)
145 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0), 145 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0),
146 evas_canvas3d_material_shininess_set(100.0)); 146 evas_canvas3d_material_shininess_set(100.0));
147 147
148 data->sphere = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); 148 eo_add(data->sphere, EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
149 eo_do(data->sphere, 149 eo_do(data->sphere,
150 evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE), 150 evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE),
151 evas_canvas3d_primitive_precision_set(50)); 151 evas_canvas3d_primitive_precision_set(50));
152 152
153 data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 153 eo_add(data->mesh, EVAS_CANVAS3D_MESH_CLASS, evas);
154 data->mesh1 = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 154 eo_add(data->mesh1, EVAS_CANVAS3D_MESH_CLASS, evas);
155 155
156 _set_ball(data->mesh, data->sphere, data->material); 156 _set_ball(data->mesh, data->sphere, data->material);
157 _set_ball(data->mesh1, data->sphere, data->material); 157 _set_ball(data->mesh1, data->sphere, data->material);
158 158
159 data->animation_node = 159
160 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 160 eo_add(data->animation_node, EVAS_CANVAS3D_NODE_CLASS, evas,
161 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE)); 161 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
162 162
163 data->mesh_node = 163
164 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 164 eo_add(data->mesh_node, EVAS_CANVAS3D_NODE_CLASS, evas,
165 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH)); 165 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
166 166
167 eo_do(data->animation_node, evas_canvas3d_node_member_add(data->mesh_node)); 167 eo_do(data->animation_node, evas_canvas3d_node_member_add(data->mesh_node));
@@ -169,8 +169,8 @@ _mesh_setup(Scene_Data *data)
169 eo_do(data->mesh_node, evas_canvas3d_node_mesh_add(data->mesh), 169 eo_do(data->mesh_node, evas_canvas3d_node_mesh_add(data->mesh),
170 evas_canvas3d_node_position_set(0.0, 0.0, 3.0)); 170 evas_canvas3d_node_position_set(0.0, 0.0, 3.0));
171 171
172 data->mesh_node1 = 172
173 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 173 eo_add(data->mesh_node1, EVAS_CANVAS3D_NODE_CLASS, evas,
174 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH)); 174 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
175 175
176 eo_do(data->root_node, evas_canvas3d_node_member_add(data->mesh_node1)); 176 eo_do(data->root_node, evas_canvas3d_node_member_add(data->mesh_node1));
@@ -184,14 +184,14 @@ _mesh_setup(Scene_Data *data)
184static void 184static void
185_scene_setup(Scene_Data *data) 185_scene_setup(Scene_Data *data)
186{ 186{
187 data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); 187 eo_add(data->scene, EVAS_CANVAS3D_SCENE_CLASS, evas);
188 188
189 eo_do(data->scene, 189 eo_do(data->scene,
190 evas_canvas3d_scene_size_set(WIDTH, HEIGHT); 190 evas_canvas3d_scene_size_set(WIDTH, HEIGHT);
191 evas_canvas3d_scene_background_color_set(FOG_COLOR, 1)); 191 evas_canvas3d_scene_background_color_set(FOG_COLOR, 1));
192 192
193 data->root_node = 193
194 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 194 eo_add(data->root_node, EVAS_CANVAS3D_NODE_CLASS, evas,
195 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE)); 195 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
196 196
197 _camera_setup(data); 197 _camera_setup(data);
@@ -226,7 +226,7 @@ main(void)
226 _scene_setup(&data); 226 _scene_setup(&data);
227 227
228 /* Add a background rectangle objects. */ 228 /* Add a background rectangle objects. */
229 background = eo_add(EVAS_RECTANGLE_CLASS, evas); 229 eo_add(background, EVAS_RECTANGLE_CLASS, evas);
230 eo_do(background, 230 eo_do(background,
231 efl_gfx_color_set(0, 0, 0, 255), 231 efl_gfx_color_set(0, 0, 0, 255),
232 efl_gfx_size_set(WIDTH, HEIGHT), 232 efl_gfx_size_set(WIDTH, HEIGHT),