summaryrefslogtreecommitdiff
path: root/src/examples
diff options
context:
space:
mode:
authorBogdan Devichev <b.devichev@samsung.com>2015-03-18 12:31:46 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-03-18 15:22:20 +0100
commita2065e3b10a0125f5c42e0889245f30c5aa80157 (patch)
tree8aa51049adf038c412c4b6fbc9d137c8e09b86e0 /src/examples
parentf4400a890cdf62ca606ba61d3e862f779a660bee (diff)
evas: refactor colorpick examples.
Reviewers: cedric, Hermet, raster Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2152 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/evas/evas-3d-colorpick.c188
1 files changed, 51 insertions, 137 deletions
diff --git a/src/examples/evas/evas-3d-colorpick.c b/src/examples/evas/evas-3d-colorpick.c
index dec68f4..7900af4 100644
--- a/src/examples/evas/evas-3d-colorpick.c
+++ b/src/examples/evas/evas-3d-colorpick.c
@@ -6,7 +6,7 @@
6 * Use key UP/DOWN for changing z coordinate of camera 6 * Use key UP/DOWN for changing z coordinate of camera
7 * Use key LEFT/RIGHT for scale each node 7 * Use key LEFT/RIGHT for scale each node
8 * Use shortcut parameters of commanline: r - rows of objects, c - columns of objects, 8 * Use shortcut parameters of commanline: r - rows of objects, c - columns of objects,
9 * p - precision of the spheres, f - path for first texture, s - path for second texture. 9 * p - precision of the spheres, t - path for a texture.
10 * 10 *
11 * @verbatim 11 * @verbatim
12 * gcc -o evas-3d-colorpick evas-3d-colorpick.c evas-3d-primitives.c `pkg-config --libs --cflags evas ecore ecore-evas eo eina efl` -lm 12 * gcc -o evas-3d-colorpick evas-3d-colorpick.c evas-3d-primitives.c `pkg-config --libs --cflags evas ecore ecore-evas eo eina efl` -lm
@@ -33,7 +33,6 @@
33#define WIDTH 800 33#define WIDTH 800
34#define HEIGHT 600 34#define HEIGHT 600
35 35
36#define ANIMATION_COUNT 3
37#define MAX_PATH 128 36#define MAX_PATH 128
38#define INIT_SCALE 7.5 37#define INIT_SCALE 7.5
39#define BIG_SCALE 10.0 38#define BIG_SCALE 10.0
@@ -42,15 +41,12 @@
42#define VEC_3(value) value, value, value 41#define VEC_3(value) value, value, value
43 42
44static const vec2 tex_scale = {1, 1}; 43static const vec2 tex_scale = {1, 1};
45static const char *image1_path = PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "/wood.jpg"; 44static const char *image_path = PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "/wood.jpg";
46static const char *image2_path = PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "/rocks.jpg";
47 45
48Ecore_Evas *ecore_evas = NULL; 46Ecore_Evas *ecore_evas = NULL;
49Evas *evas = NULL; 47Evas *evas = NULL;
50Evas_Object *image = NULL, *bg = NULL; 48Evas_Object *image = NULL, *bg = NULL;
51 49
52Eina_Bool (*animate_func[ANIMATION_COUNT])(void*);
53
54static const 50static const
55Ecore_Getopt optdesc = { 51Ecore_Getopt optdesc = {
56 "", 52 "",
@@ -64,8 +60,7 @@ Ecore_Getopt optdesc = {
64 ECORE_GETOPT_STORE_INT('r', "row", "Rows of spheres"), 60 ECORE_GETOPT_STORE_INT('r', "row", "Rows of spheres"),
65 ECORE_GETOPT_STORE_INT('c', "column", "Columns of spheres"), 61 ECORE_GETOPT_STORE_INT('c', "column", "Columns of spheres"),
66 ECORE_GETOPT_STORE_INT('p', "precision", "Precision of spheres"), 62 ECORE_GETOPT_STORE_INT('p', "precision", "Precision of spheres"),
67 ECORE_GETOPT_STORE_STR('f', "texture1", "Name1 of texture"), 63 ECORE_GETOPT_STORE_STR('t', "texture", "Name of texture"),
68 ECORE_GETOPT_STORE_STR('s', "texture2", "Name2 of texture"),
69 ECORE_GETOPT_HELP('h', "help"), 64 ECORE_GETOPT_HELP('h', "help"),
70 ECORE_GETOPT_SENTINEL 65 ECORE_GETOPT_SENTINEL
71 } 66 }
@@ -74,16 +69,13 @@ Ecore_Getopt optdesc = {
74 typedef struct _Object 69 typedef struct _Object
75 { 70 {
76 Eo *node; 71 Eo *node;
77 Eo *mesh1; 72 Eo *mesh;
78 Eo *mesh2; 73 Eo *material;
79 Eo *material1; 74 Eo *texture;
80 Eo *material2;
81 Eo *texture1;
82 Eo *texture2;
83 75
84 Evas_Real speed; 76 Evas_Real speed;
85 Ecore_Timer *animate; 77 Ecore_Timer *animate;
86 Eina_Bool (*sphere_init)(void *sphere, const char *texture1, const char *texture2); 78 Eina_Bool (*sphere_init)(void *sphere, const char *texture);
87 Eina_Bool (*sphere_animate)(void *data); 79 Eina_Bool (*sphere_animate)(void *data);
88 80
89 } Test_object; 81 } Test_object;
@@ -103,7 +95,7 @@ typedef struct _Scene
103 95
104 Eina_List *spheres; 96 Eina_List *spheres;
105 97
106 Eina_Bool (*scene_init)(const char *texture1, const char *texture2); 98 Eina_Bool (*scene_init)(const char *texture);
107 99
108} Scene_Data; 100} Scene_Data;
109 101
@@ -134,31 +126,12 @@ _on_canvas_resize(Ecore_Evas *ee)
134} 126}
135 127
136static Eina_Bool 128static Eina_Bool
137_animate_sphere1(void *data) 129_animate_sphere(void *data)
138{
139 static int angle = 0.0;
140 Eo *n = (Eo*)(((Test_object *)data)->node);
141 eo_do(n, evas_3d_node_orientation_angle_axis_set(angle, 1.0, 0.0, 1.0));
142 angle++;
143 if (angle > 360) angle = 0.0;
144 return EINA_TRUE;
145}
146static Eina_Bool
147_animate_sphere2(void *data)
148{
149 static int angle = 0.0;
150 Eo *n = (Eo*)(((Test_object *)data)->node);
151 eo_do(n, evas_3d_node_orientation_angle_axis_set(angle, 0.0, 1.0, 1.0));
152 angle++;
153 if (angle > 360) angle = 0.0;
154 return EINA_TRUE;
155}
156static Eina_Bool
157_animate_sphere3(void *data)
158{ 130{
159 static int angle = 0.0; 131 static int angle = 0.0;
160 Eo *n = (Eo*)(((Test_object *)data)->node); 132 Eo *n = (Eo*)(((Test_object *)data)->node);
161 eo_do(n, evas_3d_node_orientation_angle_axis_set(angle, 1.0, 1.0, 0.0)); 133 Evas_Real s = ((Test_object *)data)->speed;
134 eo_do(n, evas_3d_node_orientation_angle_axis_set(angle, s, s - 1, s + 1));
162 angle++; 135 angle++;
163 if (angle > 360) angle = 0.0; 136 if (angle > 360) angle = 0.0;
164 return EINA_TRUE; 137 return EINA_TRUE;
@@ -167,19 +140,19 @@ _animate_sphere3(void *data)
167void _recalculate_position() 140void _recalculate_position()
168{ 141{
169 int i = 0, j = 0, count = 0; 142 int i = 0, j = 0, count = 0;
170 Evas_Real x0, y0, z0, x1, y1, z1, shiftx = 0, shifty = 0; 143 Evas_Real x1, y1, shiftx = 0, shifty = 0;
171 Test_object *m; 144 Test_object *m;
172 145
173 eo_do(((Test_object *)eina_list_nth(globalscene.spheres, 0))->node, evas_3d_object_update());
174 eo_do(((Test_object *)eina_list_nth(globalscene.spheres, 0))->node, 146 eo_do(((Test_object *)eina_list_nth(globalscene.spheres, 0))->node,
175 evas_3d_node_bounding_box_get(&x0, &y0, &z0, &x1, &y1, &z1)); 147 evas_3d_object_update(),
148 evas_3d_node_bounding_box_get(NULL, NULL, NULL, &x1, &y1, NULL));
176 149
177 for (i = 0; i < globalscene.row; ++i) 150 for (i = 0; i < globalscene.row; ++i)
178 { 151 {
179 shiftx = i * 2 * x1; 152 shiftx = (i * 2 - globalscene.row) * x1;
180 for(j = 0; j < globalscene.col; ++j) 153 for(j = 0; j < globalscene.col; ++j)
181 { 154 {
182 shifty = j * 2 * y1; 155 shifty = (j * 2 - globalscene.col) * y1;
183 m = (Test_object *)eina_list_nth(globalscene.spheres, count); 156 m = (Test_object *)eina_list_nth(globalscene.spheres, count);
184 eo_do(m->node, evas_3d_node_position_set(shifty, 0.0, shiftx)); 157 eo_do(m->node, evas_3d_node_position_set(shifty, 0.0, shiftx));
185 count++; 158 count++;
@@ -196,13 +169,13 @@ _on_key_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
196 Test_object * item; 169 Test_object * item;
197 if (!strcmp(ev->key, "Down")) 170 if (!strcmp(ev->key, "Down"))
198 { 171 {
199 eo_do(globalscene.camera_node, evas_3d_node_position_get(EVAS_3D_SPACE_PARENT, &x, &y, &z)); 172 eo_do(globalscene.camera_node, evas_3d_node_position_get(EVAS_3D_SPACE_PARENT, &x, &y, &z),
200 eo_do(globalscene.camera_node, evas_3d_node_position_set(x, y, (z - 5))); 173 evas_3d_node_position_set(x, y, (z - 5)));
201 } 174 }
202 else if (!strcmp(ev->key, "Up")) 175 else if (!strcmp(ev->key, "Up"))
203 { 176 {
204 eo_do(globalscene.camera_node, evas_3d_node_position_get(EVAS_3D_SPACE_PARENT, &x, &y, &z)); 177 eo_do(globalscene.camera_node, evas_3d_node_position_get(EVAS_3D_SPACE_PARENT, &x, &y, &z),
205 eo_do(globalscene.camera_node, evas_3d_node_position_set(x, y, (z + 5))); 178 evas_3d_node_position_set(x, y, (z + 5)));
206 } 179 }
207 else if (!strcmp(ev->key, "Left")) 180 else if (!strcmp(ev->key, "Left"))
208 { 181 {
@@ -267,57 +240,27 @@ _on_mouse_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *eo EINA
267} 240}
268 241
269Eina_Bool 242Eina_Bool
270_init_sphere(void *this, const char *texture1, const char *texture2) 243_init_sphere(void *this, const char *texture)
271{ 244{
272 Test_object *sphere = (Test_object *)this; 245 Test_object *sphere = (Test_object *)this;
273 sphere->mesh1 = eo_add(EVAS_3D_MESH_CLASS, evas); 246 sphere->mesh = eo_add(EVAS_3D_MESH_CLASS, evas);
274 sphere->mesh2 = eo_add(EVAS_3D_MESH_CLASS, evas); 247 sphere->material = eo_add(EVAS_3D_MATERIAL_CLASS, evas);
275 sphere->material1 = eo_add(EVAS_3D_MATERIAL_CLASS, evas); 248 evas_3d_add_sphere_frame(sphere->mesh, 0, globalscene.precision, tex_scale);
276 sphere->material2 = eo_add(EVAS_3D_MATERIAL_CLASS, evas); 249 eo_do(sphere->mesh,
277 250 evas_3d_mesh_frame_material_set(0, sphere->material),
278 evas_3d_add_sphere_frame(sphere->mesh1, 0, globalscene.precision, tex_scale);
279 eo_do(sphere->mesh1,
280 evas_3d_mesh_frame_material_set(0, sphere->material1),
281 evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PHONG));
282
283 evas_3d_add_sphere_frame(sphere->mesh2, 0, globalscene.precision, tex_scale);
284 eo_do(sphere->mesh2,
285 evas_3d_mesh_frame_material_set(0, sphere->material2),
286 evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PHONG)); 251 evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PHONG));
287 252
253 eo_do(sphere->mesh, evas_3d_mesh_color_pick_enable_set(EINA_TRUE));
288 254
289 eo_do(sphere->mesh1, evas_3d_mesh_color_pick_enable_set(EINA_TRUE)); 255 sphere->texture = eo_add(EVAS_3D_TEXTURE_CLASS, evas);
290 eo_do(sphere->mesh2, evas_3d_mesh_color_pick_enable_set(EINA_TRUE)); 256 eo_do(sphere->texture,
291 257 evas_3d_texture_file_set(texture, NULL),
292 sphere->texture1 = eo_add(EVAS_3D_TEXTURE_CLASS, evas);
293 eo_do(sphere->texture1,
294 evas_3d_texture_file_set(texture1, NULL),
295 evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST,
296 EVAS_3D_TEXTURE_FILTER_NEAREST),
297 evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT,
298 EVAS_3D_WRAP_MODE_REPEAT));
299 sphere->texture2 = eo_add(EVAS_3D_TEXTURE_CLASS, evas);
300 eo_do(sphere->texture2,
301 evas_3d_texture_file_set(texture2, NULL),
302 evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST, 258 evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST,
303 EVAS_3D_TEXTURE_FILTER_NEAREST), 259 EVAS_3D_TEXTURE_FILTER_NEAREST),
304 evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT, 260 evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT,
305 EVAS_3D_WRAP_MODE_REPEAT)); 261 EVAS_3D_WRAP_MODE_REPEAT));
306 eo_do(sphere->material1, 262 eo_do(sphere->material,
307 evas_3d_material_texture_set(EVAS_3D_MATERIAL_DIFFUSE, sphere->texture1), 263 evas_3d_material_texture_set(EVAS_3D_MATERIAL_DIFFUSE, sphere->texture),
308 evas_3d_material_enable_set(EVAS_3D_MATERIAL_AMBIENT, EINA_TRUE),
309 evas_3d_material_enable_set(EVAS_3D_MATERIAL_DIFFUSE, EINA_TRUE),
310 evas_3d_material_enable_set(EVAS_3D_MATERIAL_SPECULAR, EINA_TRUE),
311 evas_3d_material_enable_set(EVAS_3D_MATERIAL_NORMAL, EINA_TRUE),
312 evas_3d_material_color_set(EVAS_3D_MATERIAL_AMBIENT,
313 0.01, 0.01, 0.01, 1.0),
314 evas_3d_material_color_set(EVAS_3D_MATERIAL_DIFFUSE,
315 1.0, 1.0, 1.0, 1.0),
316 evas_3d_material_color_set(EVAS_3D_MATERIAL_SPECULAR,
317 1.0, 1.0, 1.0, 1.0),
318 evas_3d_material_shininess_set(50.0));
319 eo_do(sphere->material2,
320 evas_3d_material_texture_set(EVAS_3D_MATERIAL_DIFFUSE, sphere->texture2),
321 evas_3d_material_enable_set(EVAS_3D_MATERIAL_AMBIENT, EINA_TRUE), 264 evas_3d_material_enable_set(EVAS_3D_MATERIAL_AMBIENT, EINA_TRUE),
322 evas_3d_material_enable_set(EVAS_3D_MATERIAL_DIFFUSE, EINA_TRUE), 265 evas_3d_material_enable_set(EVAS_3D_MATERIAL_DIFFUSE, EINA_TRUE),
323 evas_3d_material_enable_set(EVAS_3D_MATERIAL_SPECULAR, EINA_TRUE), 266 evas_3d_material_enable_set(EVAS_3D_MATERIAL_SPECULAR, EINA_TRUE),
@@ -334,16 +277,12 @@ _init_sphere(void *this, const char *texture1, const char *texture2)
334 277
335 278
336Eina_Bool 279Eina_Bool
337_init_scene(const char *texture1, const char *texture2) 280_init_scene(const char *texture)
338{ 281{
339 int i = 0, j = 0, count = 0; 282 int i = 0, count = 0;
340 Evas_Real x0, y0, z0, x1, y1, z1, tmp, shiftx = 0, shifty = 0; 283 Evas_Real tmp;
341 Test_object *m; 284 Test_object *m;
342 285
343 animate_func[0] = _animate_sphere1;
344 animate_func[1] = _animate_sphere2;
345 animate_func[2] = _animate_sphere3;
346
347 globalscene.scene = eo_add(EVAS_3D_SCENE_CLASS, evas); 286 globalscene.scene = eo_add(EVAS_3D_SCENE_CLASS, evas);
348 287
349 globalscene.root_node = eo_add(EVAS_3D_NODE_CLASS, evas, 288 globalscene.root_node = eo_add(EVAS_3D_NODE_CLASS, evas,
@@ -351,7 +290,7 @@ _init_scene(const char *texture1, const char *texture2)
351 290
352 globalscene.camera = eo_add(EVAS_3D_CAMERA_CLASS, evas); 291 globalscene.camera = eo_add(EVAS_3D_CAMERA_CLASS, evas);
353 eo_do(globalscene.camera, 292 eo_do(globalscene.camera,
354 evas_3d_camera_projection_perspective_set(60.0, 1.0, 1.0, 1000.0)); 293 evas_3d_camera_projection_perspective_set(30.0, 1.0, 1.0, 1000.0));
355 294
356 globalscene.camera_node = 295 globalscene.camera_node =
357 eo_add(EVAS_3D_NODE_CLASS, evas, 296 eo_add(EVAS_3D_NODE_CLASS, evas,
@@ -361,7 +300,7 @@ _init_scene(const char *texture1, const char *texture2)
361 eo_do(globalscene.root_node, 300 eo_do(globalscene.root_node,
362 evas_3d_node_member_add(globalscene.camera_node)); 301 evas_3d_node_member_add(globalscene.camera_node));
363 eo_do(globalscene.camera_node, 302 eo_do(globalscene.camera_node,
364 evas_3d_node_position_set(70.0, 0.0, 300.0), 303 evas_3d_node_position_set(0.0, 30.0, 800.0),
365 evas_3d_node_look_at_set(EVAS_3D_SPACE_PARENT, 0.0, 0.0, -1000.0, 304 evas_3d_node_look_at_set(EVAS_3D_SPACE_PARENT, 0.0, 0.0, -1000.0,
366 EVAS_3D_SPACE_PARENT, 0.0, 1.0, 0.0)); 305 EVAS_3D_SPACE_PARENT, 0.0, 1.0, 0.0));
367 globalscene.light = eo_add(EVAS_3D_LIGHT_CLASS, evas); 306 globalscene.light = eo_add(EVAS_3D_LIGHT_CLASS, evas);
@@ -383,56 +322,33 @@ _init_scene(const char *texture1, const char *texture2)
383 evas_3d_node_member_add(globalscene.light_node)); 322 evas_3d_node_member_add(globalscene.light_node));
384 323
385 tmp = 0.01; 324 tmp = 0.01;
386 for (i = 0; i < globalscene.col * globalscene.row; i++, j++) 325 for (i = 0; i < globalscene.col * globalscene.row; i++)
387 { 326 {
388 Test_object *spheretmp; 327 Test_object *spheretmp;
389 m = malloc(sizeof(Test_object)); 328 m = malloc(sizeof(Test_object));
390 m->sphere_init = _init_sphere; 329 m->sphere_init = _init_sphere;
391 if (!i) 330 if (!i)
392 m->sphere_init(m, texture1, texture2); 331 m->sphere_init(m, texture);
393 else 332 else
394 { 333 {
395 spheretmp = (Test_object *)eina_list_nth(globalscene.spheres, 0); 334 spheretmp = (Test_object *)eina_list_nth(globalscene.spheres, 0);
396 m->mesh1 = spheretmp->mesh1; 335 m->mesh = spheretmp->mesh;
397 m->mesh2 = spheretmp->mesh2; 336 m->material = spheretmp->material;
398 m->material1 = spheretmp->material1; 337 m->texture = spheretmp->texture;
399 m->material2 = spheretmp->material2;
400 m->texture1 = spheretmp->texture1;
401 m->texture2 = spheretmp->texture2;
402 } 338 }
403 m->node = eo_add(EVAS_3D_NODE_CLASS, evas, 339 m->node = eo_add(EVAS_3D_NODE_CLASS, evas,
404 evas_3d_node_constructor(EVAS_3D_NODE_TYPE_MESH)); 340 evas_3d_node_constructor(EVAS_3D_NODE_TYPE_MESH));
405 m->speed = tmp; 341 m->speed = tmp;
406 if (j >= ANIMATION_COUNT) j = 0; 342 m->sphere_animate = _animate_sphere;
407 m->sphere_animate = animate_func[j];
408 m->animate = ecore_timer_add(m->speed, m->sphere_animate, m); 343 m->animate = ecore_timer_add(m->speed, m->sphere_animate, m);
409 eo_do(globalscene.root_node, evas_3d_node_member_add(m->node)); 344 eo_do(globalscene.root_node, evas_3d_node_member_add(m->node));
410 eo_do(m->node, evas_3d_node_mesh_add(m->mesh1), 345 eo_do(m->node, evas_3d_node_mesh_add(m->mesh),
411 evas_3d_node_scale_set(VEC_3(INIT_SCALE))); 346 evas_3d_node_scale_set(VEC_3(INIT_SCALE)));
412 globalscene.spheres = eina_list_append(globalscene.spheres, m); 347 globalscene.spheres = eina_list_append(globalscene.spheres, m);
413 tmp += 0.01; 348 tmp += 0.01;
414 } 349 }
415 350
416 eo_do(((Test_object *)eina_list_nth(globalscene.spheres, 0))->node, evas_3d_object_update()); 351 _recalculate_position();
417 eo_do(((Test_object *)eina_list_nth(globalscene.spheres, 0))->node,
418 evas_3d_node_bounding_box_get(&x0, &y0, &z0, &x1, &y1, &z1));
419
420 for (i = 0; i < globalscene.row; ++i)
421 {
422 shiftx = i * 2 * x1;
423 for(j = 0; j < globalscene.col; ++j)
424 {
425 shifty = j * 2 * y1;
426 m = (Test_object *)eina_list_nth(globalscene.spheres, count);
427 eo_do(m->node, evas_3d_node_position_set(shifty, 0.0, shiftx));
428 if (!(i % 2))
429 {
430 eo_do(m->node, evas_3d_node_mesh_del(m->mesh1));
431 eo_do(m->node, evas_3d_node_mesh_add(m->mesh2));
432 }
433 count++;
434 }
435 }
436 352
437 eo_do(globalscene.scene, 353 eo_do(globalscene.scene,
438 evas_3d_scene_root_node_set(globalscene.root_node), 354 evas_3d_scene_root_node_set(globalscene.root_node),
@@ -444,15 +360,14 @@ _init_scene(const char *texture1, const char *texture2)
444int main(int argc, char **argv) 360int main(int argc, char **argv)
445{ 361{
446 int row = 0, col = 0, precision = 0; 362 int row = 0, col = 0, precision = 0;
447 char *texture1 = NULL, *texture2 = NULL; 363 char *texture = NULL;
448 Eina_Bool r; 364 Eina_Bool r;
449 365
450 Ecore_Getopt_Value values[] = { 366 Ecore_Getopt_Value values[] = {
451 ECORE_GETOPT_VALUE_INT(row), 367 ECORE_GETOPT_VALUE_INT(row),
452 ECORE_GETOPT_VALUE_INT(col), 368 ECORE_GETOPT_VALUE_INT(col),
453 ECORE_GETOPT_VALUE_INT(precision), 369 ECORE_GETOPT_VALUE_INT(precision),
454 ECORE_GETOPT_VALUE_STR(texture1), 370 ECORE_GETOPT_VALUE_STR(texture),
455 ECORE_GETOPT_VALUE_STR(texture2),
456 ECORE_GETOPT_VALUE_NONE 371 ECORE_GETOPT_VALUE_NONE
457 }; 372 };
458 373
@@ -464,11 +379,10 @@ int main(int argc, char **argv)
464 if (!row) row = 2; 379 if (!row) row = 2;
465 if (!col) col = 5; 380 if (!col) col = 5;
466 if (!precision) precision = 30; 381 if (!precision) precision = 30;
467 if (!texture1) texture1 = (char *)image1_path; 382 if (!texture) texture = (char *)image_path;
468 if (!texture2) texture2 = (char *)image2_path;
469 383
470 fprintf(stdout, "row - %d, col - %d, precision of spheres - %d, texture1 - %s, texture2 - %s\n", 384 fprintf(stdout, "row - %d, col - %d, precision of spheres - %d, texture - %s\n",
471 row, col, precision, texture1, texture2); 385 row, col, precision, texture);
472 386
473 ecore_evas = ecore_evas_new("opengl_x11", 10, 10, WIDTH, HEIGHT, NULL); 387 ecore_evas = ecore_evas_new("opengl_x11", 10, 10, WIDTH, HEIGHT, NULL);
474 388
@@ -490,7 +404,7 @@ int main(int argc, char **argv)
490 globalscene.row = row; 404 globalscene.row = row;
491 globalscene.col = col; 405 globalscene.col = col;
492 globalscene.precision = precision; 406 globalscene.precision = precision;
493 globalscene.scene_init(texture1, texture2); 407 globalscene.scene_init(texture);
494 408
495 image = evas_object_image_filled_add(evas); 409 image = evas_object_image_filled_add(evas);
496 410