summaryrefslogtreecommitdiff
path: root/src/examples/evas/evas-3d-cube2.c
diff options
context:
space:
mode:
authorBogdan Devichev <b.devichev@samsung.com>2015-05-29 18:14:08 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-05-29 18:22:09 +0200
commit0972211144adcf09170d41ceacb62788fb954651 (patch)
tree40145801fa2b10b0b59daddb28b12871f891fbf7 /src/examples/evas/evas-3d-cube2.c
parent9dcb827d12c58ea24d1ad2ce0f6aacb1f57b1146 (diff)
evas: Evas_3D examples use new API for creating primitives.
Summary: Examples changed due to D2516 Reviewers: Oleksander, Hermet, raster, cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2517 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/examples/evas/evas-3d-cube2.c')
-rw-r--r--src/examples/evas/evas-3d-cube2.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/examples/evas/evas-3d-cube2.c b/src/examples/evas/evas-3d-cube2.c
index e438973..4f43c7c 100644
--- a/src/examples/evas/evas-3d-cube2.c
+++ b/src/examples/evas/evas-3d-cube2.c
@@ -3,7 +3,7 @@
3 * by interpolation between frames. 3 * by interpolation between frames.
4 * 4 *
5 * @verbatim 5 * @verbatim
6 * gcc -o evas-3d-cube2 evas-3d-cube2.c evas-3d-primitives.c `pkg-config --libs --cflags efl evas ecore ecore-evas eo` -lm 6 * gcc -o evas-3d-cube2 evas-3d-cube2.c `pkg-config --libs --cflags efl evas ecore ecore-evas eo` -lm
7 * @endverbatim 7 * @endverbatim
8 */ 8 */
9 9
@@ -19,7 +19,6 @@
19#include <Evas.h> 19#include <Evas.h>
20#include <Ecore.h> 20#include <Ecore.h>
21#include <Ecore_Evas.h> 21#include <Ecore_Evas.h>
22#include "evas-3d-primitives.h"
23#include "evas-common.h" 22#include "evas-common.h"
24 23
25#define WIDTH 400 24#define WIDTH 400
@@ -37,6 +36,7 @@ typedef struct _Scene_Data
37 36
38 Eo *camera; 37 Eo *camera;
39 Eo *light; 38 Eo *light;
39 Eo *cube;
40 Eo *mesh; 40 Eo *mesh;
41 Eo *material0; 41 Eo *material0;
42 Eo *material1; 42 Eo *material1;
@@ -195,10 +195,15 @@ _mesh_setup(Scene_Data *data)
195 eo_do(data->material1, 195 eo_do(data->material1,
196 evas_3d_material_texture_set(EVAS_3D_MATERIAL_NORMAL, data->texture_normal)); 196 evas_3d_material_texture_set(EVAS_3D_MATERIAL_NORMAL, data->texture_normal));
197 197
198 /* Set data of primitive */
199 data->cube = eo_add(EVAS_3D_PRIMITIVE_CLASS, evas);
200 eo_do(data->cube,
201 evas_3d_primitive_form_set(EVAS_3D_MESH_PRIMITIVE_CUBE));
202
198 /* Setup mesh. */ 203 /* Setup mesh. */
199 data->mesh = eo_add(EVAS_3D_MESH_CLASS, evas); 204 data->mesh = eo_add(EVAS_3D_MESH_CLASS, evas);
200 evas_3d_add_cube_frame(data->mesh, 0);
201 eo_do(data->mesh, 205 eo_do(data->mesh,
206 evas_3d_mesh_from_primitive_set(0, data->cube),
202 evas_3d_mesh_frame_material_set(0, data->material0), 207 evas_3d_mesh_frame_material_set(0, data->material0),
203 evas_3d_mesh_frame_add(20), 208 evas_3d_mesh_frame_add(20),
204 evas_3d_mesh_frame_material_set(20, data->material1), 209 evas_3d_mesh_frame_material_set(20, data->material1),