summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksandr Shcherbina <o.shcherbina@samsung.com>2015-07-29 15:18:22 +0300
committerBogdan Devichev <b.devichev@samsung.com>2015-07-29 15:18:22 +0300
commitce7671db7704bf166e3940e4cb16c896138db7a8 (patch)
tree19f424a3f88bfa8e8af7cc5503dde48812c96c54
parent6e6fe25d1bf4861ef9e9cdf4cabcee7a6c64ea43 (diff)
[evas_canvas3d_test] Change to interface EVAS_CANVAS3Darcpatch-D2883
Summary: Change namespace Reviewers: b.devichev Reviewed By: b.devichev Differential Revision: https://phab.enlightenment.org/D2883
-rw-r--r--src/evas-3d-visual-test.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/src/evas-3d-visual-test.c b/src/evas-3d-visual-test.c
index 47d5b9c..759a27d 100644
--- a/src/evas-3d-visual-test.c
+++ b/src/evas-3d-visual-test.c
@@ -78,10 +78,10 @@ int precision = 40;
78int cur_diff = 0; 78int cur_diff = 0;
79int cur_norm = 0; 79int cur_norm = 0;
80char mode = 'f'; 80char mode = 'f';
81int cur_bm_f1 = EVAS_3D_BLEND_SRC_ALPHA; 81int cur_bm_f1 = EVAS_CANVAS3D_BLEND_SRC_ALPHA;
82int cur_bm_f2 = EVAS_3D_BLEND_ONE_MINUS_SRC_ALPHA; 82int cur_bm_f2 = EVAS_CANVAS3D_BLEND_ONE_MINUS_SRC_ALPHA;
83static vec2 tex_scale = {9.0, 9.0}; 83static vec2 tex_scale = {9.0, 9.0};
84int current_shade_mode = 7; //EVAS_3D_SHADE_MODE_PHONG 84int current_shade_mode = 7; //EVAS_CANVAS3D_SHADE_MODE_PHONG
85float ratio = 0.9; 85float ratio = 0.9;
86 86
87void (*mesh_func[PRIMITIVES_COUNT])(Eo*, int, float, vec2); 87void (*mesh_func[PRIMITIVES_COUNT])(Eo*, int, float, vec2);
@@ -194,10 +194,10 @@ static Eo*
194_texture_init(const char *path) 194_texture_init(const char *path)
195{ 195{
196 if (!path) return NULL; 196 if (!path) return NULL;
197 Eo *texture = eo_add(EVAS_3D_TEXTURE_CLASS, evas); 197 Eo *texture = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas);
198 eo_do(texture, evas_3d_texture_file_set(path, NULL), 198 eo_do(texture, evas_3d_texture_file_set(path, NULL),
199 evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT, 199 evas_3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT,
200 EVAS_3D_WRAP_MODE_REPEAT)); 200 EVAS_CANVAS3D_WRAP_MODE_REPEAT));
201 return texture; 201 return texture;
202} 202}
203 203
@@ -236,27 +236,27 @@ _material_init(Scene_Data *data,
236 float r, float g, float b, float a, 236 float r, float g, float b, float a,
237 int diff_tex_num, int norm_tex_num) 237 int diff_tex_num, int norm_tex_num)
238{ 238{
239 Eo *material = eo_add(EVAS_3D_MATERIAL_CLASS, evas); 239 Eo *material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
240 240
241 eo_do(material, 241 eo_do(material,
242 evas_3d_material_enable_set(EVAS_3D_MATERIAL_AMBIENT, EINA_TRUE), 242 evas_3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE),
243 evas_3d_material_enable_set(EVAS_3D_MATERIAL_NORMAL, EINA_TRUE), 243 evas_3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_NORMAL, EINA_TRUE),
244 evas_3d_material_enable_set(EVAS_3D_MATERIAL_DIFFUSE, EINA_TRUE), 244 evas_3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE),
245 evas_3d_material_enable_set(EVAS_3D_MATERIAL_SPECULAR, EINA_TRUE), 245 evas_3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE),
246 246
247 evas_3d_material_color_set(EVAS_3D_MATERIAL_AMBIENT, r, g, b, a), 247 evas_3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, r, g, b, a),
248 evas_3d_material_color_set(EVAS_3D_MATERIAL_DIFFUSE, r, g, b, a), 248 evas_3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, r, g, b, a),
249 evas_3d_material_color_set(EVAS_3D_MATERIAL_SPECULAR, 249 evas_3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR,
250 1.0, 1.0, 1.0, a), 250 1.0, 1.0, 1.0, a),
251 evas_3d_material_shininess_set(100.0), 251 evas_3d_material_shininess_set(100.0),
252 252
253 evas_3d_material_texture_set(EVAS_3D_MATERIAL_NORMAL, 253 evas_3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_NORMAL,
254 data->norm_tex[norm_tex_num]), 254 data->norm_tex[norm_tex_num]),
255 evas_3d_material_texture_set(EVAS_3D_MATERIAL_DIFFUSE, 255 evas_3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE,
256 data->diff_tex[diff_tex_num]), 256 data->diff_tex[diff_tex_num]),
257 evas_3d_material_texture_set(EVAS_3D_MATERIAL_AMBIENT, 257 evas_3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_AMBIENT,
258 data->diff_tex[diff_tex_num]), 258 data->diff_tex[diff_tex_num]),
259 evas_3d_material_texture_set(EVAS_3D_MATERIAL_SPECULAR, 259 evas_3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_SPECULAR,
260 data->diff_tex[diff_tex_num])); 260 data->diff_tex[diff_tex_num]));
261 return material; 261 return material;
262} 262}
@@ -274,7 +274,7 @@ _primitive_init_wrapper(int incr_func,
274 vec2 ts = {tex_scale.x * pow(1.1, incr_tex_scale_x), 274 vec2 ts = {tex_scale.x * pow(1.1, incr_tex_scale_x),
275 tex_scale.y * pow(1.1, incr_tex_scale_y)}; 275 tex_scale.y * pow(1.1, incr_tex_scale_y)};
276 276
277 Eo *mesh = eo_add(EVAS_3D_MESH_CLASS, evas); 277 Eo *mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
278 mesh_func[_change_from_to(current_func, 0, PRIMITIVES_COUNT, incr_func)] 278 mesh_func[_change_from_to(current_func, 0, PRIMITIVES_COUNT, incr_func)]
279 (mesh, 279 (mesh,
280 _change_from_to(precision, 2, 50, incr_prec), 280 _change_from_to(precision, 2, 50, incr_prec),
@@ -329,8 +329,8 @@ PRIMITIVE_INIT_WRAPPER(terrain, terrain, 0, l_precision, ts)
329static Eo* 329static Eo*
330_parent_node_setup(Eo *mesh, double x, double y, double z, double size) 330_parent_node_setup(Eo *mesh, double x, double y, double z, double size)
331{ 331{
332 Eo *node = eo_add(EVAS_3D_NODE_CLASS, evas, 332 Eo *node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas,
333 evas_3d_node_constructor(EVAS_3D_NODE_TYPE_MESH)); 333 evas_3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
334 eo_do(node, evas_3d_node_mesh_add(mesh), 334 eo_do(node, evas_3d_node_mesh_add(mesh),
335 evas_3d_node_position_set(x, y, z), 335 evas_3d_node_position_set(x, y, z),
336 evas_3d_node_scale_set(size, size, size), 336 evas_3d_node_scale_set(size, size, size),
@@ -342,8 +342,8 @@ _parent_node_setup(Eo *mesh, double x, double y, double z, double size)
342static Eo* 342static Eo*
343_child_node_setup(Eo *mesh, double x, double y, double z, double alpha) 343_child_node_setup(Eo *mesh, double x, double y, double z, double alpha)
344{ 344{
345 Eo *node = eo_add(EVAS_3D_NODE_CLASS, evas, 345 Eo *node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas,
346 evas_3d_node_constructor(EVAS_3D_NODE_TYPE_MESH)); 346 evas_3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
347 eo_do(node, evas_3d_node_mesh_add(mesh), 347 eo_do(node, evas_3d_node_mesh_add(mesh),
348 evas_3d_node_position_set(0.0, 0.0, -0.5), 348 evas_3d_node_position_set(0.0, 0.0, -0.5),
349 evas_3d_node_orientation_angle_axis_set(alpha, x, y, z)); 349 evas_3d_node_orientation_angle_axis_set(alpha, x, y, z));
@@ -354,21 +354,21 @@ _child_node_setup(Eo *mesh, double x, double y, double z, double alpha)
354static void 354static void
355_camera_setup(Scene_Data *data) 355_camera_setup(Scene_Data *data)
356{ 356{
357 data->camera = eo_add(EVAS_3D_CAMERA_CLASS, evas); 357 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
358 358
359 eo_do(data->camera, 359 eo_do(data->camera,
360 evas_3d_camera_projection_ortho_set(-CAM_COORD, CAM_COORD, -CAM_COORD, 360 evas_3d_camera_projection_ortho_set(-CAM_COORD, CAM_COORD, -CAM_COORD,
361 CAM_COORD, -10.0, 30.0)); 361 CAM_COORD, -10.0, 30.0));
362 362
363 data->camera_node = 363 data->camera_node =
364 eo_add(EVAS_3D_NODE_CLASS, evas, 364 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas,
365 evas_3d_node_constructor(EVAS_3D_NODE_TYPE_CAMERA)); 365 evas_3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA));
366 366
367 eo_do(data->camera_node, 367 eo_do(data->camera_node,
368 evas_3d_node_camera_set(data->camera), 368 evas_3d_node_camera_set(data->camera),
369 evas_3d_node_position_set(0.0, 0.0, 11.0), 369 evas_3d_node_position_set(0.0, 0.0, 11.0),
370 evas_3d_node_look_at_set(EVAS_3D_SPACE_PARENT, 0.0, 0.0, 3.0, 370 evas_3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 3.0,
371 EVAS_3D_SPACE_PARENT, 0.0, 1.0, 0.0)); 371 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
372 372
373 eo_do(data->root_node, evas_3d_node_member_add(data->camera_node)); 373 eo_do(data->root_node, evas_3d_node_member_add(data->camera_node));
374} 374}
@@ -376,20 +376,20 @@ _camera_setup(Scene_Data *data)
376static void 376static void
377_light_setup(Scene_Data *data) 377_light_setup(Scene_Data *data)
378{ 378{
379 data->light = eo_add(EVAS_3D_LIGHT_CLASS, evas); 379 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas);
380 eo_do(data->light, 380 eo_do(data->light,
381 evas_3d_light_ambient_set(AMBIENT_LIGHT, 1.0), 381 evas_3d_light_ambient_set(AMBIENT_LIGHT, 1.0),
382 evas_3d_light_diffuse_set(DIFFUSE_LIGHT, 1.0), 382 evas_3d_light_diffuse_set(DIFFUSE_LIGHT, 1.0),
383 evas_3d_light_specular_set(SPECULAR_LIGHT, 1.0), 383 evas_3d_light_specular_set(SPECULAR_LIGHT, 1.0),
384 evas_3d_light_projection_perspective_set(20.0, 1.0, 8.0, 20.0)); 384 evas_3d_light_projection_perspective_set(20.0, 1.0, 8.0, 20.0));
385 385
386 data->light_node = eo_add(EVAS_3D_NODE_CLASS, evas, 386 data->light_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas,
387 evas_3d_node_constructor(EVAS_3D_NODE_TYPE_LIGHT)); 387 evas_3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT));
388 eo_do(data->light_node, 388 eo_do(data->light_node,
389 evas_3d_node_light_set(data->light), 389 evas_3d_node_light_set(data->light),
390 evas_3d_node_position_set(0.0, 0.0, 9.0), 390 evas_3d_node_position_set(0.0, 0.0, 9.0),
391 evas_3d_node_look_at_set(EVAS_3D_SPACE_PARENT, 0.0, 0.0, 0.0, 391 evas_3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
392 EVAS_3D_SPACE_PARENT, 0.0, 1.0, 0.0)); 392 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
393 eo_do(data->root_node, evas_3d_node_member_add(data->light_node)); 393 eo_do(data->root_node, evas_3d_node_member_add(data->light_node));
394} 394}
395 395
@@ -579,14 +579,14 @@ _scene_setup(Scene_Data *data)
579 _set_functions_of_primitives(); 579 _set_functions_of_primitives();
580 _textures_init(data); 580 _textures_init(data);
581 581
582 data->scene = eo_add(EVAS_3D_SCENE_CLASS, evas); 582 data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
583 583
584 eo_do(data->scene, 584 eo_do(data->scene,
585 evas_3d_scene_size_set(WIDTH, HEIGHT); 585 evas_3d_scene_size_set(WIDTH, HEIGHT);
586 evas_3d_scene_background_color_set(BG_COLOR, 1)); 586 evas_3d_scene_background_color_set(BG_COLOR, 1));
587 587
588 data->root_node = eo_add(EVAS_3D_NODE_CLASS, evas, 588 data->root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas,
589 evas_3d_node_constructor(EVAS_3D_NODE_TYPE_NODE)); 589 evas_3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
590 590
591 _camera_setup(data); 591 _camera_setup(data);
592 _light_setup(data); 592 _light_setup(data);