summaryrefslogtreecommitdiff
path: root/src/examples
diff options
context:
space:
mode:
authorBogdan Devichev <b.devichev@samsung.com>2015-03-18 11:46:55 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-03-18 11:49:31 +0100
commit35773988e5a0583dc9c854d32766a2c3dd02a2f6 (patch)
treeee54c135aa0f33dbf0fdbf9f00bb0a8436ca5e95 /src/examples
parent5c4fdf7e4cb0512694f53c8d30f8b57605e3b793 (diff)
evas: add evas-common.h to dist and move resources of parallax-occlusion to comon directory.
Reviewers: Hermet, raster, cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2044 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/evas/Makefile.am7
-rw-r--r--src/examples/evas/evas-3d-parallax-occlusion.c19
-rw-r--r--src/examples/evas/resources/images/four_NM_height.tga (renamed from src/examples/evas/four_NM_height.tga)bin262188 -> 262188 bytes
-rw-r--r--src/examples/evas/resources/images/rocks.jpg (renamed from src/examples/evas/rocks.jpg)bin26972 -> 26972 bytes
-rw-r--r--src/examples/evas/resources/images/rocks_NM_height.tga (renamed from src/examples/evas/rocks_NM_height.tga)bin262188 -> 262188 bytes
-rw-r--r--src/examples/evas/resources/images/wood.jpg (renamed from src/examples/evas/wood.jpg)bin24192 -> 24192 bytes
6 files changed, 21 insertions, 5 deletions
diff --git a/src/examples/evas/Makefile.am b/src/examples/evas/Makefile.am
index d02dd34..80604ec 100644
--- a/src/examples/evas/Makefile.am
+++ b/src/examples/evas/Makefile.am
@@ -334,6 +334,10 @@ resources/images/cube1.png \
334resources/images/normal_lego.png \ 334resources/images/normal_lego.png \
335resources/images/sonic.png \ 335resources/images/sonic.png \
336resources/images/sweet_home_reversed.png \ 336resources/images/sweet_home_reversed.png \
337resources/images/wood.jpg \
338resources/images/rocks.jpg \
339resources/images/four_NM_height.tga \
340resources/images/rocks_NM_height.tga \
337resources/models/mesh_for_mmap.eet \ 341resources/models/mesh_for_mmap.eet \
338resources/models/mesh_for_mmap.md2 \ 342resources/models/mesh_for_mmap.md2 \
339resources/models/mesh_for_mmap.obj \ 343resources/models/mesh_for_mmap.obj \
@@ -351,7 +355,8 @@ resources/models/sweet_home.obj \
351resources/models/sweet_home_only_vertex_coords.obj \ 355resources/models/sweet_home_only_vertex_coords.obj \
352resources/models/sweet_home_without_normals.obj \ 356resources/models/sweet_home_without_normals.obj \
353resources/models/sweet_home_without_tex_coords.obj \ 357resources/models/sweet_home_without_tex_coords.obj \
354Makefile.examples 358Makefile.examples \
359evas-common.h
355 360
356examples: $(EXTRA_PROGRAMS) $(EDJS) 361examples: $(EXTRA_PROGRAMS) $(EDJS)
357 362
diff --git a/src/examples/evas/evas-3d-parallax-occlusion.c b/src/examples/evas/evas-3d-parallax-occlusion.c
index ca25b1f..b92f5a7 100644
--- a/src/examples/evas/evas-3d-parallax-occlusion.c
+++ b/src/examples/evas/evas-3d-parallax-occlusion.c
@@ -8,18 +8,29 @@
8 * @endverbatim 8 * @endverbatim
9 */ 9 */
10 10
11#ifdef HAVE_CONFIG_H
12#include "config.h"
13#else
14#define PACKAGE_EXAMPLES_DIR "."
11#define EFL_EO_API_SUPPORT 15#define EFL_EO_API_SUPPORT
12#define EFL_BETA_API_SUPPORT 16#define EFL_BETA_API_SUPPORT
17#endif
13 18
14#include <Eo.h> 19#include <Eo.h>
15#include <Evas.h> 20#include <Evas.h>
16#include <Ecore.h> 21#include <Ecore.h>
17#include <Ecore_Evas.h> 22#include <Ecore_Evas.h>
18#include "evas-3d-primitives.h" 23#include "evas-3d-primitives.h"
24#include "evas-common.h"
19 25
20#define WIDTH 400 26#define WIDTH 400
21#define HEIGHT 400 27#define HEIGHT 400
22 28
29static const char *rock_diffuse = PACKAGE_EXAMPLES_DIR EVAS_MODEL_FOLDER "rocks.jpg";
30static const char *rock_n_and_height_map = PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "rocks_NM_height.tga";
31static const char *wood_diffuse = PACKAGE_EXAMPLES_DIR EVAS_MODEL_FOLDER "wood.jpg";
32static const char *wood_n_and_height_map = PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "four_NM_height.tga";
33
23typedef struct _Scene_Data 34typedef struct _Scene_Data
24{ 35{
25 Eo *scene; 36 Eo *scene;
@@ -136,10 +147,10 @@ _mesh_setup(Scene_Data *data)
136 147
137 data->texture_rocks = eo_add(EVAS_3D_TEXTURE_CLASS, evas); 148 data->texture_rocks = eo_add(EVAS_3D_TEXTURE_CLASS, evas);
138 data->texture_rocks_n = eo_add(EVAS_3D_TEXTURE_CLASS, evas); 149 data->texture_rocks_n = eo_add(EVAS_3D_TEXTURE_CLASS, evas);
139 eo_do(data->texture_rocks, evas_3d_texture_file_set("rocks.jpg", NULL), 150 eo_do(data->texture_rocks, evas_3d_texture_file_set(rock_diffuse, NULL),
140 evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT, 151 evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT,
141 EVAS_3D_WRAP_MODE_REPEAT)); 152 EVAS_3D_WRAP_MODE_REPEAT));
142 eo_do(data->texture_rocks_n, evas_3d_texture_file_set("rocks_NM_height.tga", NULL), 153 eo_do(data->texture_rocks_n, evas_3d_texture_file_set(rock_n_and_height_map, NULL),
143 evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT, 154 evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT,
144 EVAS_3D_WRAP_MODE_REPEAT)); 155 EVAS_3D_WRAP_MODE_REPEAT));
145 156
@@ -162,10 +173,10 @@ _mesh_setup(Scene_Data *data)
162 173
163 data->texture_wood = eo_add(EVAS_3D_TEXTURE_CLASS, evas); 174 data->texture_wood = eo_add(EVAS_3D_TEXTURE_CLASS, evas);
164 data->texture_four_n = eo_add(EVAS_3D_TEXTURE_CLASS, evas); 175 data->texture_four_n = eo_add(EVAS_3D_TEXTURE_CLASS, evas);
165 eo_do(data->texture_wood, evas_3d_texture_file_set("wood.jpg", NULL), 176 eo_do(data->texture_wood, evas_3d_texture_file_set(wood_diffuse, NULL),
166 evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT, 177 evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT,
167 EVAS_3D_WRAP_MODE_REPEAT)); 178 EVAS_3D_WRAP_MODE_REPEAT));
168 eo_do(data->texture_four_n, evas_3d_texture_file_set("four_NM_height.tga", NULL), 179 eo_do(data->texture_four_n, evas_3d_texture_file_set(wood_n_and_height_map, NULL),
169 evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT, 180 evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT,
170 EVAS_3D_WRAP_MODE_REPEAT)); 181 EVAS_3D_WRAP_MODE_REPEAT));
171 182
diff --git a/src/examples/evas/four_NM_height.tga b/src/examples/evas/resources/images/four_NM_height.tga
index 08bb3a2..08bb3a2 100644
--- a/src/examples/evas/four_NM_height.tga
+++ b/src/examples/evas/resources/images/four_NM_height.tga
Binary files differ
diff --git a/src/examples/evas/rocks.jpg b/src/examples/evas/resources/images/rocks.jpg
index 4c140af..4c140af 100644
--- a/src/examples/evas/rocks.jpg
+++ b/src/examples/evas/resources/images/rocks.jpg
Binary files differ
diff --git a/src/examples/evas/rocks_NM_height.tga b/src/examples/evas/resources/images/rocks_NM_height.tga
index 7c8ee3b..7c8ee3b 100644
--- a/src/examples/evas/rocks_NM_height.tga
+++ b/src/examples/evas/resources/images/rocks_NM_height.tga
Binary files differ
diff --git a/src/examples/evas/wood.jpg b/src/examples/evas/resources/images/wood.jpg
index 102787e..102787e 100644
--- a/src/examples/evas/wood.jpg
+++ b/src/examples/evas/resources/images/wood.jpg
Binary files differ