summaryrefslogtreecommitdiff
path: root/src/examples
diff options
context:
space:
mode:
authorBogdan Devichev <b.devichev@samsung.com>2015-02-20 12:02:08 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-02-20 12:19:30 +0100
commit175c8cbd63244ba3c50c9f41301e7fedb0427a21 (patch)
tree71672dba56313e9e9d97fb9e33435f577f082d90 /src/examples
parent2ae90fd1ffce5ee5c3cb6ed78766792166290371 (diff)
evas: Evas_3D - add creation of folder for saving and usage of PACKAGE_DATA_DIR to every example of Evas_3D.
Reviewers: cedric, Hermet, raster Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2003 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/evas/Makefile.am3
-rw-r--r--src/examples/evas/evas-3d-aabb.c13
-rw-r--r--src/examples/evas/evas-3d-colorpick.c16
-rw-r--r--src/examples/evas/evas-3d-common.h6
-rw-r--r--src/examples/evas/evas-3d-cube2.c10
-rw-r--r--src/examples/evas/evas-3d-eet.c21
-rw-r--r--src/examples/evas/evas-3d-frustum.c13
-rw-r--r--src/examples/evas/evas-3d-md2.c13
-rw-r--r--src/examples/evas/evas-3d-mmap-set.c13
-rw-r--r--src/examples/evas/evas-3d-moon-space.c16
-rw-r--r--src/examples/evas/evas-3d-obj.c62
-rw-r--r--src/examples/evas/evas-3d-pick.c10
-rw-r--r--src/examples/evas/evas-3d-ply.c39
-rw-r--r--src/examples/evas/evas-3d-shadows.c13
14 files changed, 187 insertions, 61 deletions
diff --git a/src/examples/evas/Makefile.am b/src/examples/evas/Makefile.am
index b6700a1..9cb4284 100644
--- a/src/examples/evas/Makefile.am
+++ b/src/examples/evas/Makefile.am
@@ -32,6 +32,7 @@ ECORE_EVAS_COMMON_CPPFLAGS = \
32-I$(top_srcdir)/src/lib/eo \ 32-I$(top_srcdir)/src/lib/eo \
33-I$(top_srcdir)/src/lib/evas \ 33-I$(top_srcdir)/src/lib/evas \
34-I$(top_srcdir)/src/lib/ecore \ 34-I$(top_srcdir)/src/lib/ecore \
35-I$(top_srcdir)/src/lib/ecore_file \
35-I$(top_srcdir)/src/lib/ecore_input \ 36-I$(top_srcdir)/src/lib/ecore_input \
36-I$(top_srcdir)/src/lib/ecore_evas \ 37-I$(top_srcdir)/src/lib/ecore_evas \
37-I$(top_builddir)/src/lib/efl \ 38-I$(top_builddir)/src/lib/efl \
@@ -39,6 +40,7 @@ ECORE_EVAS_COMMON_CPPFLAGS = \
39-I$(top_builddir)/src/lib/eo \ 40-I$(top_builddir)/src/lib/eo \
40-I$(top_builddir)/src/lib/evas \ 41-I$(top_builddir)/src/lib/evas \
41-I$(top_builddir)/src/lib/ecore \ 42-I$(top_builddir)/src/lib/ecore \
43-I$(top_builddir)/src/lib/ecore_file \
42-I$(top_srcdir)/src/lib/ecore_input \ 44-I$(top_srcdir)/src/lib/ecore_input \
43-I$(top_builddir)/src/lib/ecore_evas \ 45-I$(top_builddir)/src/lib/ecore_evas \
44-DPACKAGE_EXAMPLES_DIR=\".\" \ 46-DPACKAGE_EXAMPLES_DIR=\".\" \
@@ -49,6 +51,7 @@ $(top_builddir)/src/lib/efl/libefl.la \
49$(top_builddir)/src/lib/eina/libeina.la \ 51$(top_builddir)/src/lib/eina/libeina.la \
50$(top_builddir)/src/lib/eo/libeo.la \ 52$(top_builddir)/src/lib/eo/libeo.la \
51$(top_builddir)/src/lib/ecore/libecore.la \ 53$(top_builddir)/src/lib/ecore/libecore.la \
54$(top_builddir)/src/lib/ecore_file/libecore_file.la \
52$(top_builddir)/src/lib/ecore_input/libecore_input.la \ 55$(top_builddir)/src/lib/ecore_input/libecore_input.la \
53$(top_builddir)/src/lib/ecore_evas/libecore_evas.la \ 56$(top_builddir)/src/lib/ecore_evas/libecore_evas.la \
54$(top_builddir)/src/lib/evas/libevas.la \ 57$(top_builddir)/src/lib/evas/libevas.la \
diff --git a/src/examples/evas/evas-3d-aabb.c b/src/examples/evas/evas-3d-aabb.c
index 722796c..ef3e079 100644
--- a/src/examples/evas/evas-3d-aabb.c
+++ b/src/examples/evas/evas-3d-aabb.c
@@ -6,6 +6,12 @@
6 * Compile with "gcc -o evas-3d-aabb evas-3d-aabb.c `pkg-config --libs --cflags efl evas ecore ecore-evas eo`" 6 * Compile with "gcc -o evas-3d-aabb evas-3d-aabb.c `pkg-config --libs --cflags efl evas ecore ecore-evas eo`"
7 */ 7 */
8 8
9#ifdef HAVE_CONFIG_H
10#include "config.h"
11#else
12#define PACKAGE_EXAMPLES_DIR "."
13#endif
14
9#define EFL_EO_API_SUPPORT 15#define EFL_EO_API_SUPPORT
10#define EFL_BETA_API_SUPPORT 16#define EFL_BETA_API_SUPPORT
11 17
@@ -18,6 +24,9 @@
18#define WIDTH 400 24#define WIDTH 400
19#define HEIGHT 400 25#define HEIGHT 400
20 26
27static const char *model_path = PACKAGE_EXAMPLES_DIR EVAS_3D_MODEL_FOLDER "/sonic.md2";
28static const char *image_path = PACKAGE_EXAMPLES_DIR EVAS_3D_IMAGE_FOLDER "/sonic.png";
29
21Ecore_Evas *ecore_evas = NULL; 30Ecore_Evas *ecore_evas = NULL;
22Evas *evas = NULL; 31Evas *evas = NULL;
23Eo *background = NULL; 32Eo *background = NULL;
@@ -228,13 +237,13 @@ main(void)
228 material = eo_add(EVAS_3D_MATERIAL_CLASS, evas); 237 material = eo_add(EVAS_3D_MATERIAL_CLASS, evas);
229 238
230 eo_do(mesh, 239 eo_do(mesh,
231 efl_file_set(EVAS_3D_MODEL_FOLDER"sonic.md2", NULL), 240 efl_file_set(model_path, NULL),
232 evas_3d_mesh_frame_material_set(0, material), 241 evas_3d_mesh_frame_material_set(0, material),
233 evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PHONG)); 242 evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PHONG));
234 243
235 texture = eo_add(EVAS_3D_TEXTURE_CLASS, evas); 244 texture = eo_add(EVAS_3D_TEXTURE_CLASS, evas);
236 eo_do(texture, 245 eo_do(texture,
237 evas_3d_texture_file_set(EVAS_3D_IMAGE_FOLDER"sonic.png", NULL), 246 evas_3d_texture_file_set(image_path, NULL),
238 evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST, 247 evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST,
239 EVAS_3D_TEXTURE_FILTER_NEAREST), 248 EVAS_3D_TEXTURE_FILTER_NEAREST),
240 evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT, 249 evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT,
diff --git a/src/examples/evas/evas-3d-colorpick.c b/src/examples/evas/evas-3d-colorpick.c
index 2dce999..6ca3376 100644
--- a/src/examples/evas/evas-3d-colorpick.c
+++ b/src/examples/evas/evas-3d-colorpick.c
@@ -11,6 +11,12 @@
11 */ 11 */
12//TODO new resources 12//TODO new resources
13 13
14#ifdef HAVE_CONFIG_H
15#include "config.h"
16#else
17#define PACKAGE_EXAMPLES_DIR "."
18#endif
19
14#define EFL_EO_API_SUPPORT 20#define EFL_EO_API_SUPPORT
15#define EFL_BETA_API_SUPPORT 21#define EFL_BETA_API_SUPPORT
16 22
@@ -27,6 +33,10 @@
27#define ANIMATION_COUNT 3 33#define ANIMATION_COUNT 3
28#define MAX_PATH 128 34#define MAX_PATH 128
29 35
36static const char *model_path = PACKAGE_EXAMPLES_DIR EVAS_3D_MODEL_FOLDER "/M15.obj";
37static const char *image1_path = PACKAGE_EXAMPLES_DIR EVAS_3D_IMAGE_FOLDER "/M15.png";
38static const char *image2_path = PACKAGE_EXAMPLES_DIR EVAS_3D_IMAGE_FOLDER "/M15_1.png";
39
30Ecore_Evas *ecore_evas = NULL; 40Ecore_Evas *ecore_evas = NULL;
31Evas *evas = NULL; 41Evas *evas = NULL;
32Evas_Object *image = NULL, *bg = NULL; 42Evas_Object *image = NULL, *bg = NULL;
@@ -444,9 +454,9 @@ int main(int argc, char **argv)
444 454
445 if (!row) row = 2; 455 if (!row) row = 2;
446 if (!col) col = 5; 456 if (!col) col = 5;
447 if (!model) model = EVAS_3D_MODEL_FOLDER"M15.obj"; 457 if (!model) model = (char *)model_path;
448 if (!texture1) texture1 = EVAS_3D_IMAGE_FOLDER"M15.png"; 458 if (!texture1) texture1 = (char *)image1_path;
449 if (!texture2) texture2 = EVAS_3D_IMAGE_FOLDER"M15_1.png"; 459 if (!texture2) texture2 = (char *)image2_path;
450 460
451 fprintf(stdout, "row - %d, col - %d, model - %s, texture1 - %s, texture2 - %s\n", 461 fprintf(stdout, "row - %d, col - %d, model - %s, texture1 - %s, texture2 - %s\n",
452 row, col, model, texture1, texture2); 462 row, col, model, texture1, texture2);
diff --git a/src/examples/evas/evas-3d-common.h b/src/examples/evas/evas-3d-common.h
index 065b544..4304b3d 100644
--- a/src/examples/evas/evas-3d-common.h
+++ b/src/examples/evas/evas-3d-common.h
@@ -1,3 +1,3 @@
1#define EVAS_3D_IMAGE_FOLDER "resources/images/" 1#define EVAS_3D_IMAGE_FOLDER "/resources/images"
2#define EVAS_3D_MODEL_FOLDER "resources/models/" 2#define EVAS_3D_MODEL_FOLDER "/resources/models"
3#define EVAS_3D_SAVED_FILES "saved_files/" 3#define EVAS_3D_SAVED_FILES "/saved_files"
diff --git a/src/examples/evas/evas-3d-cube2.c b/src/examples/evas/evas-3d-cube2.c
index 38a2d4e..3009520 100644
--- a/src/examples/evas/evas-3d-cube2.c
+++ b/src/examples/evas/evas-3d-cube2.c
@@ -1,3 +1,9 @@
1#ifdef HAVE_CONFIG_H
2#include "config.h"
3#else
4#define PACKAGE_EXAMPLES_DIR "."
5#endif
6
1#define EFL_EO_API_SUPPORT 7#define EFL_EO_API_SUPPORT
2#define EFL_BETA_API_SUPPORT 8#define EFL_BETA_API_SUPPORT
3 9
@@ -10,6 +16,8 @@
10#define WIDTH 400 16#define WIDTH 400
11#define HEIGHT 400 17#define HEIGHT 400
12 18
19static const char *normal_map_path = PACKAGE_EXAMPLES_DIR EVAS_3D_IMAGE_FOLDER "/normal_lego.png";
20
13typedef struct _Scene_Data 21typedef struct _Scene_Data
14{ 22{
15 Eo *scene; 23 Eo *scene;
@@ -231,7 +239,7 @@ _mesh_setup(Scene_Data *data)
231 evas_3d_texture_data_set(EVAS_3D_COLOR_FORMAT_RGBA, 239 evas_3d_texture_data_set(EVAS_3D_COLOR_FORMAT_RGBA,
232 EVAS_3D_PIXEL_FORMAT_8888, 4, 4, &pixels1[0])); 240 EVAS_3D_PIXEL_FORMAT_8888, 4, 4, &pixels1[0]));
233 eo_do(data->texture_normal, 241 eo_do(data->texture_normal,
234 evas_3d_texture_file_set(EVAS_3D_IMAGE_FOLDER"normal_lego.png", NULL)); 242 evas_3d_texture_file_set(normal_map_path, NULL));
235 243
236 eo_do(data->material0, 244 eo_do(data->material0,
237 evas_3d_material_texture_set(EVAS_3D_MATERIAL_DIFFUSE, data->texture0)); 245 evas_3d_material_texture_set(EVAS_3D_MATERIAL_DIFFUSE, data->texture0));
diff --git a/src/examples/evas/evas-3d-eet.c b/src/examples/evas/evas-3d-eet.c
index b6966bb..c7139a8 100644
--- a/src/examples/evas/evas-3d-eet.c
+++ b/src/examples/evas/evas-3d-eet.c
@@ -9,10 +9,16 @@
9* Show it in right side. 9* Show it in right side.
10* 10*
11* @verbatim 11* @verbatim
12* gcc -o evas-3d-eet evas-3d-eet.c `pkg-config --libs --cflags efl eina evas ecore ecore-evas eo` 12* gcc -o evas-3d-eet evas-3d-eet.c `pkg-config --libs --cflags efl eina evas ecore ecore-evas ecore-file eo`
13* @endverbatim 13* @endverbatim
14*/ 14*/
15 15
16#ifdef HAVE_CONFIG_H
17#include "config.h"
18#else
19#define PACKAGE_EXAMPLES_DIR "."
20#endif
21
16#define EFL_EO_API_SUPPORT 22#define EFL_EO_API_SUPPORT
17#define EFL_BETA_API_SUPPORT 23#define EFL_BETA_API_SUPPORT
18 24
@@ -25,6 +31,9 @@
25#define WIDTH 1024 31#define WIDTH 1024
26#define HEIGHT 1024 32#define HEIGHT 1024
27 33
34static const char *input_model_path = PACKAGE_EXAMPLES_DIR EVAS_3D_MODEL_FOLDER "/sonic.md2";
35static const char *output_model_path = PACKAGE_EXAMPLES_DIR EVAS_3D_SAVED_FILES "/saved_Sonic_EET.eet";
36
28Ecore_Evas *ecore_evas = NULL; 37Ecore_Evas *ecore_evas = NULL;
29Evas *evas = NULL; 38Evas *evas = NULL;
30Eo *background = NULL; 39Eo *background = NULL;
@@ -152,7 +161,7 @@ main(void)
152 material = eo_add(EVAS_3D_MATERIAL_CLASS, evas); 161 material = eo_add(EVAS_3D_MATERIAL_CLASS, evas);
153 162
154 eo_do(mesh, 163 eo_do(mesh,
155 efl_file_set(EVAS_3D_MODEL_FOLDER"sonic.md2", NULL), 164 efl_file_set(input_model_path, NULL),
156 evas_3d_mesh_frame_material_set(0, material), 165 evas_3d_mesh_frame_material_set(0, material),
157 evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PHONG)); 166 evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PHONG));
158 167
@@ -169,10 +178,14 @@ main(void)
169 0.50, 0.00, 0.50, 0.30), 178 0.50, 0.00, 0.50, 0.30),
170 evas_3d_material_shininess_set(50.0)); 179 evas_3d_material_shininess_set(50.0));
171 180
172 eo_do(mesh, efl_file_save(EVAS_3D_SAVED_FILES"saved_Sonic_EET.eet", NULL, NULL)); 181 if (!ecore_file_mkpath(PACKAGE_EXAMPLES_DIR EVAS_3D_SAVED_FILES))
182 fprintf(stderr, "Failed to create folder %s\n\n",
183 PACKAGE_EXAMPLES_DIR EVAS_3D_SAVED_FILES);
184
185 eo_do(mesh, efl_file_save(output_model_path, NULL, NULL));
173 186
174 eo_do(mesh2, 187 eo_do(mesh2,
175 efl_file_set(EVAS_3D_SAVED_FILES"saved_Sonic_EET.eet", NULL), 188 efl_file_set(output_model_path, NULL),
176 evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PHONG)); 189 evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PHONG));
177 190
178 mesh_node = eo_add(EVAS_3D_NODE_CLASS, evas, 191 mesh_node = eo_add(EVAS_3D_NODE_CLASS, evas,
diff --git a/src/examples/evas/evas-3d-frustum.c b/src/examples/evas/evas-3d-frustum.c
index 75c936a..90b8a6a 100644
--- a/src/examples/evas/evas-3d-frustum.c
+++ b/src/examples/evas/evas-3d-frustum.c
@@ -11,6 +11,12 @@
11 * Compile with "gcc -o evas-3d-frustum evas-3d-frustum.c `pkg-config --libs --cflags efl evas ecore ecore-evas eo` -lm" 11 * Compile with "gcc -o evas-3d-frustum evas-3d-frustum.c `pkg-config --libs --cflags efl evas ecore ecore-evas eo` -lm"
12 */ 12 */
13 13
14#ifdef HAVE_CONFIG_H
15#include "config.h"
16#else
17#define PACKAGE_EXAMPLES_DIR "."
18#endif
19
14#define EFL_EO_API_SUPPORT 20#define EFL_EO_API_SUPPORT
15#define EFL_BETA_API_SUPPORT 21#define EFL_BETA_API_SUPPORT
16 22
@@ -24,6 +30,9 @@
24#define WIDTH 800 30#define WIDTH 800
25#define HEIGHT 600 31#define HEIGHT 600
26 32
33static const char *image_eagle_path = PACKAGE_EXAMPLES_DIR EVAS_3D_IMAGE_FOLDER "/eagle.png";
34static const char *eagle_path = PACKAGE_EXAMPLES_DIR EVAS_3D_MODEL_FOLDER "/eagle.md2";
35
27typedef struct _Scene_Data 36typedef struct _Scene_Data
28{ 37{
29 Eo *root_node; 38 Eo *root_node;
@@ -453,7 +462,7 @@ _mesh_setup_model(Scene_Data *data)
453 data->texture_model = eo_add(EVAS_3D_TEXTURE_CLASS, evas); 462 data->texture_model = eo_add(EVAS_3D_TEXTURE_CLASS, evas);
454 463
455 eo_do(data->texture_model, 464 eo_do(data->texture_model,
456 evas_3d_texture_file_set(EVAS_3D_IMAGE_FOLDER"eagle.png", NULL), 465 evas_3d_texture_file_set(image_eagle_path, NULL),
457 evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST, EVAS_3D_TEXTURE_FILTER_NEAREST), 466 evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST, EVAS_3D_TEXTURE_FILTER_NEAREST),
458 evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT, EVAS_3D_WRAP_MODE_REPEAT)); 467 evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT, EVAS_3D_WRAP_MODE_REPEAT));
459 468
@@ -470,7 +479,7 @@ _mesh_setup_model(Scene_Data *data)
470 evas_3d_material_shininess_set(100.0)); 479 evas_3d_material_shininess_set(100.0));
471 480
472 eo_do(data->mesh_model, 481 eo_do(data->mesh_model,
473 efl_file_set(EVAS_3D_MODEL_FOLDER"eagle.md2", NULL), 482 efl_file_set(eagle_path, NULL),
474 evas_3d_mesh_frame_material_set(0, data->material_model), 483 evas_3d_mesh_frame_material_set(0, data->material_model),
475 evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_DIFFUSE)); 484 evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_DIFFUSE));
476} 485}
diff --git a/src/examples/evas/evas-3d-md2.c b/src/examples/evas/evas-3d-md2.c
index 76546cd..5a9309e 100644
--- a/src/examples/evas/evas-3d-md2.c
+++ b/src/examples/evas/evas-3d-md2.c
@@ -1,3 +1,9 @@
1#ifdef HAVE_CONFIG_H
2#include "config.h"
3#else
4#define PACKAGE_EXAMPLES_DIR "."
5#endif
6
1#define EFL_EO_API_SUPPORT 7#define EFL_EO_API_SUPPORT
2#define EFL_BETA_API_SUPPORT 8#define EFL_BETA_API_SUPPORT
3 9
@@ -10,6 +16,9 @@
10#define WIDTH 400 16#define WIDTH 400
11#define HEIGHT 400 17#define HEIGHT 400
12 18
19static const char *model_path = PACKAGE_EXAMPLES_DIR EVAS_3D_MODEL_FOLDER "/sonic.md2";
20static const char *image_path = PACKAGE_EXAMPLES_DIR EVAS_3D_IMAGE_FOLDER "/sonic.png";
21
13Ecore_Evas *ecore_evas = NULL; 22Ecore_Evas *ecore_evas = NULL;
14Evas *evas = NULL; 23Evas *evas = NULL;
15Eo *background = NULL; 24Eo *background = NULL;
@@ -121,13 +130,13 @@ main(void)
121 material = eo_add(EVAS_3D_MATERIAL_CLASS, evas); 130 material = eo_add(EVAS_3D_MATERIAL_CLASS, evas);
122 131
123 eo_do(mesh, 132 eo_do(mesh,
124 efl_file_set(EVAS_3D_MODEL_FOLDER"sonic.md2", NULL), 133 efl_file_set(model_path, NULL),
125 evas_3d_mesh_frame_material_set(0, material), 134 evas_3d_mesh_frame_material_set(0, material),
126 evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PHONG)); 135 evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PHONG));
127 136
128 texture = eo_add(EVAS_3D_TEXTURE_CLASS, evas); 137 texture = eo_add(EVAS_3D_TEXTURE_CLASS, evas);
129 eo_do(texture, 138 eo_do(texture,
130 evas_3d_texture_file_set(EVAS_3D_IMAGE_FOLDER"sonic.png", NULL), 139 evas_3d_texture_file_set(image_path, NULL),
131 evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST, 140 evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST,
132 EVAS_3D_TEXTURE_FILTER_NEAREST), 141 EVAS_3D_TEXTURE_FILTER_NEAREST),
133 evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT, 142 evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT,
diff --git a/src/examples/evas/evas-3d-mmap-set.c b/src/examples/evas/evas-3d-mmap-set.c
index 501046d..923654e 100644
--- a/src/examples/evas/evas-3d-mmap-set.c
+++ b/src/examples/evas/evas-3d-mmap-set.c
@@ -10,6 +10,12 @@
10* @endverbatim 10* @endverbatim
11*/ 11*/
12 12
13#ifdef HAVE_CONFIG_H
14#include "config.h"
15#else
16#define PACKAGE_EXAMPLES_DIR "."
17#endif
18
13#define EFL_EO_API_SUPPORT 19#define EFL_EO_API_SUPPORT
14#define EFL_BETA_API_SUPPORT 20#define EFL_BETA_API_SUPPORT
15 21
@@ -25,8 +31,8 @@
25#define HEIGHT 1000 31#define HEIGHT 1000
26 32
27#define LOAD_AND_ADD_MESH(extention, number) \ 33#define LOAD_AND_ADD_MESH(extention, number) \
28 extention##_file = \ 34 snprintf(buffer, PATH_MAX, "%s%s", template_path, #extention); \
29 eina_file_open(EVAS_3D_MODEL_FOLDER"mesh_for_mmap."#extention, 0); \ 35 extention##_file = eina_file_open(buffer , 0); \
30 mesh_##extention = eo_add(EVAS_3D_MESH_CLASS, evas); \ 36 mesh_##extention = eo_add(EVAS_3D_MESH_CLASS, evas); \
31 eo_do(mesh_##extention, \ 37 eo_do(mesh_##extention, \
32 evas_3d_mesh_mmap_set(extention##_file, NULL), \ 38 evas_3d_mesh_mmap_set(extention##_file, NULL), \
@@ -48,6 +54,8 @@
48 initial_node_data[number * 10 + 9]));\ 54 initial_node_data[number * 10 + 9]));\
49 ecore_timer_add(0.01, _animate_##extention, node_##extention); 55 ecore_timer_add(0.01, _animate_##extention, node_##extention);
50 56
57static const char *template_path = PACKAGE_EXAMPLES_DIR EVAS_3D_MODEL_FOLDER "/mesh_for_mmap.";
58
51Ecore_Evas *ecore_evas = NULL; 59Ecore_Evas *ecore_evas = NULL;
52Evas *evas = NULL; 60Evas *evas = NULL;
53Eo *background = NULL; 61Eo *background = NULL;
@@ -160,6 +168,7 @@ _on_canvas_resize(Ecore_Evas *ee)
160int 168int
161main(void) 169main(void)
162{ 170{
171 char buffer[PATH_MAX];
163 Eina_File *obj_file, *ply_file, *eet_file, *md2_file; 172 Eina_File *obj_file, *ply_file, *eet_file, *md2_file;
164 173
165 //Unless Evas 3D supports Software renderer, we set gl backened forcely. 174 //Unless Evas 3D supports Software renderer, we set gl backened forcely.
diff --git a/src/examples/evas/evas-3d-moon-space.c b/src/examples/evas/evas-3d-moon-space.c
index 87d8bb1..cbe4a92 100644
--- a/src/examples/evas/evas-3d-moon-space.c
+++ b/src/examples/evas/evas-3d-moon-space.c
@@ -16,6 +16,12 @@
16* gcc -o evas-3d-moon-space evas-3d-moon-space.c -g `pkg-config --libs --cflags evas ecore ecore-evas eo` -lm 16* gcc -o evas-3d-moon-space evas-3d-moon-space.c -g `pkg-config --libs --cflags evas ecore ecore-evas eo` -lm
17*/ 17*/
18 18
19#ifdef HAVE_CONFIG_H
20#include "config.h"
21#else
22#define PACKAGE_EXAMPLES_DIR "."
23#endif
24
19#define EFL_EO_API_SUPPORT 25#define EFL_EO_API_SUPPORT
20#define EFL_BETA_API_SUPPORT 26#define EFL_BETA_API_SUPPORT
21 27
@@ -30,6 +36,10 @@
30#define WIDTH 1024 36#define WIDTH 1024
31#define HEIGHT 1024 37#define HEIGHT 1024
32 38
39static const char *bg_image = PACKAGE_EXAMPLES_DIR EVAS_3D_IMAGE_FOLDER "/bg_space.jpg";
40static const char *moon_image = PACKAGE_EXAMPLES_DIR EVAS_3D_IMAGE_FOLDER "/moon.png";
41static const char *earth_image = PACKAGE_EXAMPLES_DIR EVAS_3D_IMAGE_FOLDER "/EarthDiffuse.png";
42
33typedef struct _Scene_Data 43typedef struct _Scene_Data
34{ 44{
35 Eo *texture_diffuse_moon; 45 Eo *texture_diffuse_moon;
@@ -448,7 +458,7 @@ _mesh_setup(Scene_Data *data)
448 458
449 /* Setup material and texture for planet. */ 459 /* Setup material and texture for planet. */
450 eo_do(data->texture_diffuse_planet, 460 eo_do(data->texture_diffuse_planet,
451 evas_3d_texture_file_set(EVAS_3D_IMAGE_FOLDER"EarthDiffuse.png", NULL), 461 evas_3d_texture_file_set(earth_image, NULL),
452 evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_LINEAR, EVAS_3D_TEXTURE_FILTER_LINEAR)); 462 evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_LINEAR, EVAS_3D_TEXTURE_FILTER_LINEAR));
453 463
454 eo_do(data->material_planet, 464 eo_do(data->material_planet,
@@ -463,7 +473,7 @@ _mesh_setup(Scene_Data *data)
463 473
464 /* Setup material and texture for moon. */ 474 /* Setup material and texture for moon. */
465 eo_do(data->texture_diffuse_moon, 475 eo_do(data->texture_diffuse_moon,
466 evas_3d_texture_file_set(EVAS_3D_IMAGE_FOLDER"moon.png", NULL), 476 evas_3d_texture_file_set(moon_image, NULL),
467 evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_LINEAR, EVAS_3D_TEXTURE_FILTER_LINEAR)); 477 evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_LINEAR, EVAS_3D_TEXTURE_FILTER_LINEAR));
468 478
469 eo_do(data->material_moon, 479 eo_do(data->material_moon,
@@ -733,7 +743,7 @@ main(void)
733 743
734 /* Add evas objects. */ 744 /* Add evas objects. */
735 background = evas_object_image_filled_add(evas); 745 background = evas_object_image_filled_add(evas);
736 evas_object_image_file_set(background, EVAS_3D_IMAGE_FOLDER"bg_space.jpg", NULL), 746 evas_object_image_file_set(background, bg_image, NULL),
737 evas_object_resize(background, WIDTH, HEIGHT), 747 evas_object_resize(background, WIDTH, HEIGHT),
738 evas_object_show(background); 748 evas_object_show(background);
739 749
diff --git a/src/examples/evas/evas-3d-obj.c b/src/examples/evas/evas-3d-obj.c
index b0203d3..bccbea2 100644
--- a/src/examples/evas/evas-3d-obj.c
+++ b/src/examples/evas/evas-3d-obj.c
@@ -9,10 +9,16 @@
9* If material was not set it will be not saved. 9* If material was not set it will be not saved.
10* 10*
11* @verbatim 11* @verbatim
12* gcc -o evas-3d-obj evas-3d-obj.c `pkg-config --libs --cflags efl evas ecore ecore-evas eo` 12* gcc -o evas-3d-obj evas-3d-obj.c `pkg-config --libs --cflags efl evas ecore ecore-evas ecore-file eo`
13* @endverbatim 13* @endverbatim
14*/ 14*/
15 15
16#ifdef HAVE_CONFIG_H
17#include "config.h"
18#else
19#define PACKAGE_EXAMPLES_DIR "."
20#endif
21
16#define EFL_EO_API_SUPPORT 22#define EFL_EO_API_SUPPORT
17#define EFL_BETA_API_SUPPORT 23#define EFL_BETA_API_SUPPORT
18 24
@@ -37,27 +43,28 @@
37#define GRID_SIZE 6 43#define GRID_SIZE 6
38#define NUMBER_OF_MESHES 8 44#define NUMBER_OF_MESHES 8
39 45
40#define ADD_OBJ_MESH(path, Y, Z, num, shade_mode, name_of_material) \ 46#define ADD_OBJ_MESH(path, Y, Z, num, shade_mode, name_of_material) \
41 mesh[num] = eo_add(EVAS_3D_MESH_CLASS, evas); \ 47 mesh[num] = eo_add(EVAS_3D_MESH_CLASS, evas); \
42 eo_do(mesh[num], \ 48 snprintf(full_file_path, PATH_MAX, "%s%s", path, ".obj"); \
43 efl_file_set(path".obj", NULL), \ 49 eo_do(mesh[num], \
44 evas_3d_mesh_frame_material_set(0, name_of_material), \ 50 efl_file_set(full_file_path, NULL), \
45 evas_3d_mesh_shade_mode_set(shade_mode)); \ 51 evas_3d_mesh_frame_material_set(0, name_of_material), \
46 mesh_node[num] = eo_add(EVAS_3D_NODE_CLASS, evas, \ 52 evas_3d_mesh_shade_mode_set(shade_mode)); \
47 evas_3d_node_constructor(EVAS_3D_NODE_TYPE_MESH)); \ 53 mesh_node[num] = eo_add(EVAS_3D_NODE_CLASS, evas, \
48 eo_do(root_node, \ 54 evas_3d_node_constructor(EVAS_3D_NODE_TYPE_MESH)); \
49 evas_3d_node_member_add(mesh_node[num])); \ 55 eo_do(root_node, \
50 eo_do(mesh_node[num], \ 56 evas_3d_node_member_add(mesh_node[num])); \
51 evas_3d_node_mesh_add(mesh[num]), \ 57 eo_do(mesh_node[num], \
52 evas_3d_node_position_set(0, Y, Z)); \ 58 evas_3d_node_mesh_add(mesh[num]), \
53 59 evas_3d_node_position_set(0, Y, Z)); \
54#define ADD_OBJ_MESH_AND_SAVED_COPY(path, Y, Z, num, shade_mode, name_of_material) \ 60
55 ADD_OBJ_MESH(EVAS_3D_MODEL_FOLDER"sweet_"#path, \ 61#define ADD_OBJ_MESH_AND_SAVED_COPY(path, Y, Z, num, shade_mode, name_of_material)\
56 Y, Z, num, shade_mode, name_of_material) \ 62 snprintf(buffer, PATH_MAX, "%s%s", input_template, #path); \
57 eo_do(mesh[num], efl_file_save(EVAS_3D_SAVED_FILES"saved_"#path".obj", \ 63 ADD_OBJ_MESH(buffer, Y, Z, num, shade_mode, name_of_material) \
58 NULL, NULL)); \ 64 snprintf(buffer, PATH_MAX, "%s%s%s", output_template, #path, ".obj"); \
59 ADD_OBJ_MESH(EVAS_3D_SAVED_FILES"saved_"#path, \ 65 eo_do(mesh[num], efl_file_save(buffer, NULL, NULL)); \
60 Y + COPY_OFFSET, Z, num + 4, shade_mode, name_of_material) 66 snprintf(buffer, PATH_MAX, "%s%s", output_template, #path); \
67 ADD_OBJ_MESH(buffer, Y + COPY_OFFSET, Z, num + 4, shade_mode, name_of_material)
61 68
62#define ADD_TEXTURE(name, path) \ 69#define ADD_TEXTURE(name, path) \
63 name = eo_add(EVAS_3D_TEXTURE_CLASS, evas); \ 70 name = eo_add(EVAS_3D_TEXTURE_CLASS, evas); \
@@ -83,6 +90,10 @@
83 COL_BLUE, 0.5), \ 90 COL_BLUE, 0.5), \
84 evas_3d_material_shininess_set(100.0)); 91 evas_3d_material_shininess_set(100.0));
85 92
93static const char *texture_path = PACKAGE_EXAMPLES_DIR EVAS_3D_IMAGE_FOLDER "/sweet_home_reversed.png";
94static const char *output_template = PACKAGE_EXAMPLES_DIR EVAS_3D_SAVED_FILES "/saved_";
95static const char *input_template = PACKAGE_EXAMPLES_DIR EVAS_3D_MODEL_FOLDER "/sweet_";
96
86Ecore_Evas *ecore_evas = NULL; 97Ecore_Evas *ecore_evas = NULL;
87Evas *evas = NULL; 98Evas *evas = NULL;
88Eo *background = NULL; 99Eo *background = NULL;
@@ -136,6 +147,7 @@ int
136main(void) 147main(void)
137{ 148{
138 int i; 149 int i;
150 char buffer[PATH_MAX], full_file_path[PATH_MAX];
139 //Unless Evas 3D supports Software renderer, we set gl backened forcely. 151 //Unless Evas 3D supports Software renderer, we set gl backened forcely.
140 setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); 152 setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1);
141 153
@@ -193,7 +205,7 @@ main(void)
193 eo_do(root_node, 205 eo_do(root_node,
194 evas_3d_node_member_add(light_node)); 206 evas_3d_node_member_add(light_node));
195 207
196 ADD_TEXTURE(texture, EVAS_3D_IMAGE_FOLDER"sweet_home_reversed.png") 208 ADD_TEXTURE(texture, texture_path)
197 209
198 ADD_MATERIAL(material) 210 ADD_MATERIAL(material)
199 211
@@ -201,6 +213,10 @@ main(void)
201 eo_do(material_with_tex, 213 eo_do(material_with_tex,
202 evas_3d_material_texture_set(EVAS_3D_MATERIAL_DIFFUSE, texture)); 214 evas_3d_material_texture_set(EVAS_3D_MATERIAL_DIFFUSE, texture));
203 215
216 if (!ecore_file_mkpath(PACKAGE_EXAMPLES_DIR EVAS_3D_SAVED_FILES))
217 fprintf(stderr, "Failed to create folder %s\n\n",
218 PACKAGE_EXAMPLES_DIR EVAS_3D_SAVED_FILES);
219
204 ADD_OBJ_MESH_AND_SAVED_COPY(home, -GRID_SIZE, -GRID_SIZE, 0, 220 ADD_OBJ_MESH_AND_SAVED_COPY(home, -GRID_SIZE, -GRID_SIZE, 0,
205 EVAS_3D_SHADE_MODE_PHONG, material_with_tex) 221 EVAS_3D_SHADE_MODE_PHONG, material_with_tex)
206 ADD_OBJ_MESH_AND_SAVED_COPY(home_without_normals, -GRID_SIZE, GRID_SIZE, 1, 222 ADD_OBJ_MESH_AND_SAVED_COPY(home_without_normals, -GRID_SIZE, GRID_SIZE, 1,
diff --git a/src/examples/evas/evas-3d-pick.c b/src/examples/evas/evas-3d-pick.c
index f983146..3d7c235 100644
--- a/src/examples/evas/evas-3d-pick.c
+++ b/src/examples/evas/evas-3d-pick.c
@@ -1,3 +1,9 @@
1#ifdef HAVE_CONFIG_H
2#include "config.h"
3#else
4#define PACKAGE_EXAMPLES_DIR "."
5#endif
6
1#define EFL_EO_API_SUPPORT 7#define EFL_EO_API_SUPPORT
2#define EFL_BETA_API_SUPPORT 8#define EFL_BETA_API_SUPPORT
3 9
@@ -11,6 +17,8 @@
11#define WIDTH 400 17#define WIDTH 400
12#define HEIGHT 400 18#define HEIGHT 400
13 19
20static const char *earth_image = PACKAGE_EXAMPLES_DIR EVAS_3D_IMAGE_FOLDER "/EarthDiffuse.png";
21
14typedef struct _vec4 22typedef struct _vec4
15{ 23{
16 float x; 24 float x;
@@ -344,7 +352,7 @@ main(void)
344 352
345 texture_diffuse = eo_add(EVAS_3D_TEXTURE_CLASS, evas); 353 texture_diffuse = eo_add(EVAS_3D_TEXTURE_CLASS, evas);
346 eo_do(texture_diffuse, 354 eo_do(texture_diffuse,
347 evas_3d_texture_file_set(EVAS_3D_IMAGE_FOLDER"EarthDiffuse.png", NULL), 355 evas_3d_texture_file_set(earth_image, NULL),
348 evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_LINEAR, 356 evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_LINEAR,
349 EVAS_3D_TEXTURE_FILTER_LINEAR)); 357 EVAS_3D_TEXTURE_FILTER_LINEAR));
350 eo_do(material, 358 eo_do(material,
diff --git a/src/examples/evas/evas-3d-ply.c b/src/examples/evas/evas-3d-ply.c
index d6102f9..8e010fc 100644
--- a/src/examples/evas/evas-3d-ply.c
+++ b/src/examples/evas/evas-3d-ply.c
@@ -7,11 +7,17 @@
7* and geometry to "saved_man_all_with_mods.ply", "saved_man_only_geometry.ply" and "saved_man_without_UVs.ply". 7* and geometry to "saved_man_all_with_mods.ply", "saved_man_only_geometry.ply" and "saved_man_without_UVs.ply".
8* 8*
9* @verbatim 9* @verbatim
10* gcc -o evas-3d-ply evas-3d-ply.c `pkg-config --libs --cflags efl evas ecore ecore-evas eo` 10* gcc -o evas-3d-ply evas-3d-ply.c `pkg-config --libs --cflags efl evas ecore ecore-evas ecore-file eo`
11* @endverbatim 11* @endverbatim
12*/ 12*/
13//TODO new resources 13//TODO new resources
14 14
15#ifdef HAVE_CONFIG_H
16#include "config.h"
17#else
18#define PACKAGE_EXAMPLES_DIR "."
19#endif
20
15#define EFL_EO_API_SUPPORT 21#define EFL_EO_API_SUPPORT
16#define EFL_BETA_API_SUPPORT 22#define EFL_BETA_API_SUPPORT
17 23
@@ -26,6 +32,18 @@
26 32
27#define NUMBER_OF_MESHES 32 33#define NUMBER_OF_MESHES 32
28 34
35static const char *image_path = PACKAGE_EXAMPLES_DIR EVAS_3D_IMAGE_FOLDER "/normal_lego.png";
36static const char *input_template = PACKAGE_EXAMPLES_DIR EVAS_3D_MODEL_FOLDER "/";
37static const char *output_template = PACKAGE_EXAMPLES_DIR EVAS_3D_SAVED_FILES "/";
38static const char *file_name[8] = {"Normal_UVs_Colors.ply",
39 "Normal_UVs_NoColors.ply",
40 "Normal_NoUVs_Colors.ply",
41 "Normal_NoUVs_NoColors.ply",
42 "NoNormal_UVs_Colors.ply",
43 "NoNormal_UVs_NoColors.ply",
44 "NoNormal_NoUVs_Colors.ply",
45 "NoNormal_NoUVs_NoColors.ply"};
46
29int draw_mode[2] = {EVAS_3D_SHADE_MODE_PHONG, EVAS_3D_SHADE_MODE_VERTEX_COLOR}; 47int draw_mode[2] = {EVAS_3D_SHADE_MODE_PHONG, EVAS_3D_SHADE_MODE_VERTEX_COLOR};
30 48
31Ecore_Evas *ecore_evas = NULL; 49Ecore_Evas *ecore_evas = NULL;
@@ -47,15 +65,6 @@ Eo *texture = NULL;
47Eo *light = NULL; 65Eo *light = NULL;
48Ecore_Animator *anim = NULL; 66Ecore_Animator *anim = NULL;
49 67
50char *file_name[8] = {"Normal_UVs_Colors.ply",
51 "Normal_UVs_NoColors.ply",
52 "Normal_NoUVs_Colors.ply",
53 "Normal_NoUVs_NoColors.ply",
54 "NoNormal_UVs_Colors.ply",
55 "NoNormal_UVs_NoColors.ply",
56 "NoNormal_NoUVs_Colors.ply",
57 "NoNormal_NoUVs_NoColors.ply"};
58
59static float angle = 0; 68static float angle = 0;
60 69
61static Eina_Bool 70static Eina_Bool
@@ -157,7 +166,7 @@ main(void)
157 material = eo_add(EVAS_3D_MATERIAL_CLASS, evas); 166 material = eo_add(EVAS_3D_MATERIAL_CLASS, evas);
158 texture = eo_add(EVAS_3D_TEXTURE_CLASS, evas); 167 texture = eo_add(EVAS_3D_TEXTURE_CLASS, evas);
159 eo_do(texture, 168 eo_do(texture,
160 evas_3d_texture_file_set(EVAS_3D_IMAGE_FOLDER"normal_lego.png", NULL), 169 evas_3d_texture_file_set(image_path, NULL),
161 evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST, 170 evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST,
162 EVAS_3D_TEXTURE_FILTER_NEAREST), 171 EVAS_3D_TEXTURE_FILTER_NEAREST),
163 evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT, 172 evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT,
@@ -176,18 +185,22 @@ main(void)
176 1.0, 1.0, 1.0, 1.0), 185 1.0, 1.0, 1.0, 1.0),
177 evas_3d_material_shininess_set(50.0)); 186 evas_3d_material_shininess_set(50.0));
178 187
188 if (!ecore_file_mkpath(PACKAGE_EXAMPLES_DIR EVAS_3D_SAVED_FILES))
189 fprintf(stderr, "Failed to create folder %s\n\n",
190 PACKAGE_EXAMPLES_DIR EVAS_3D_SAVED_FILES);
191
179 /* Add the meshes. */ 192 /* Add the meshes. */
180 for (i = 0; i < NUMBER_OF_MESHES; i++) 193 for (i = 0; i < NUMBER_OF_MESHES; i++)
181 { 194 {
182 mesh[i] = eo_add(EVAS_3D_MESH_CLASS, evas); 195 mesh[i] = eo_add(EVAS_3D_MESH_CLASS, evas);
183 196
184 snprintf(buffer, PATH_MAX, "%s%s", EVAS_3D_MODEL_FOLDER, file_name[i % 8]); 197 snprintf(buffer, PATH_MAX, "%s%s", input_template, file_name[i % 8]);
185 eo_do(mesh[i], 198 eo_do(mesh[i],
186 efl_file_set(buffer, NULL), 199 efl_file_set(buffer, NULL),
187 evas_3d_mesh_frame_material_set(0, material), 200 evas_3d_mesh_frame_material_set(0, material),
188 evas_3d_mesh_shade_mode_set(draw_mode[(i % 16) / 8])); 201 evas_3d_mesh_shade_mode_set(draw_mode[(i % 16) / 8]));
189 202
190 snprintf(buffer, PATH_MAX, "%s%s", EVAS_3D_SAVED_FILES, file_name[i % 8]); 203 snprintf(buffer, PATH_MAX, "%s%s", output_template, file_name[i % 8]);
191 eo_do(mesh[i], efl_file_save(buffer, NULL, NULL)); 204 eo_do(mesh[i], efl_file_save(buffer, NULL, NULL));
192 205
193 if (i > 15) 206 if (i > 15)
diff --git a/src/examples/evas/evas-3d-shadows.c b/src/examples/evas/evas-3d-shadows.c
index df5184b..86903f6 100644
--- a/src/examples/evas/evas-3d-shadows.c
+++ b/src/examples/evas/evas-3d-shadows.c
@@ -8,6 +8,12 @@
8 * Compile with gcc -o evas-3d-shadows evas-3d-shadows.c `pkg-config --libs --cflags efl evas ecore ecore-evas eo eina` -lm 8 * Compile with gcc -o evas-3d-shadows evas-3d-shadows.c `pkg-config --libs --cflags efl evas ecore ecore-evas eo eina` -lm
9 */ 9 */
10 10
11#ifdef HAVE_CONFIG_H
12#include "config.h"
13#else
14#define PACKAGE_EXAMPLES_DIR "."
15#endif
16
11#define EFL_EO_API_SUPPORT 17#define EFL_EO_API_SUPPORT
12#define EFL_BETA_API_SUPPORT 18#define EFL_BETA_API_SUPPORT
13 19
@@ -29,6 +35,9 @@
29#define DIFFUSE_LIGHT 1.0, 1.0, 1.0 35#define DIFFUSE_LIGHT 1.0, 1.0, 1.0
30#define SPECULAR_LIGHT 1.0, 1.0, 1.0 36#define SPECULAR_LIGHT 1.0, 1.0, 1.0
31 37
38static const char *model_path = PACKAGE_EXAMPLES_DIR EVAS_3D_MODEL_FOLDER "/sonic.md2";
39static const char *image_path = PACKAGE_EXAMPLES_DIR EVAS_3D_IMAGE_FOLDER "/sonic.png";
40
32Ecore_Evas *ecore_evas = NULL; 41Ecore_Evas *ecore_evas = NULL;
33Evas *evas = NULL; 42Evas *evas = NULL;
34Eo *background = NULL; 43Eo *background = NULL;
@@ -237,7 +246,7 @@ _model_setup(Body_3D *model)
237{ 246{
238 Eo *texture = eo_add(EVAS_3D_TEXTURE_CLASS, evas); 247 Eo *texture = eo_add(EVAS_3D_TEXTURE_CLASS, evas);
239 eo_do(texture, 248 eo_do(texture,
240 evas_3d_texture_file_set(EVAS_3D_IMAGE_FOLDER"sonic.png", NULL), 249 evas_3d_texture_file_set(image_path, NULL),
241 evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST, 250 evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST,
242 EVAS_3D_TEXTURE_FILTER_NEAREST), 251 EVAS_3D_TEXTURE_FILTER_NEAREST),
243 evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT, 252 evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT,
@@ -256,7 +265,7 @@ _model_setup(Body_3D *model)
256 model->mesh = eo_add(EVAS_3D_MESH_CLASS, evas); 265 model->mesh = eo_add(EVAS_3D_MESH_CLASS, evas);
257 266
258 eo_do(model->mesh, 267 eo_do(model->mesh,
259 efl_file_set(EVAS_3D_MODEL_FOLDER"sonic.md2", NULL), 268 efl_file_set(model_path, NULL),
260 evas_3d_mesh_frame_material_set(0, model->material), 269 evas_3d_mesh_frame_material_set(0, model->material),
261 evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PHONG)); 270 evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PHONG));
262 271