aboutsummaryrefslogtreecommitdiffstats
path: root/src/examples/evas/evas-3d-frustum.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/examples/evas/evas-3d-frustum.c')
-rw-r--r--src/examples/evas/evas-3d-frustum.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/examples/evas/evas-3d-frustum.c b/src/examples/evas/evas-3d-frustum.c
index 465160bae7..a89c407ddf 100644
--- a/src/examples/evas/evas-3d-frustum.c
+++ b/src/examples/evas/evas-3d-frustum.c
@@ -296,8 +296,8 @@ _on_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *eo EINA_UNUSED, void
static void
_camera_setup(Scene_Data *data)
{
- data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
- data->camera_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas,
+ eo_add(data->camera, EVAS_CANVAS3D_CAMERA_CLASS, evas);
+ eo_add(data->camera_node, EVAS_CANVAS3D_NODE_CLASS, evas,
evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA));
eo_do(data->camera_node,
evas_canvas3d_node_camera_set(data->camera),
@@ -312,13 +312,13 @@ _camera_setup(Scene_Data *data)
static void
_light_setup(Scene_Data *data)
{
- data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas);
+ eo_add(data->light, EVAS_CANVAS3D_LIGHT_CLASS, evas);
eo_do(data->light,
evas_canvas3d_light_ambient_set( 0.2, 0.2, 0.2, 1.0);
evas_canvas3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0);
evas_canvas3d_light_specular_set(1.0, 1.0, 1.0, 1.0));
- data->light_node = eo_add(EVAS_CANVAS3D_NODE_CLASS,evas,
+ eo_add(data->light_node, EVAS_CANVAS3D_NODE_CLASS,evas,
evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT));
eo_do(data->light_node,
evas_canvas3d_node_light_set(data->light),
@@ -331,7 +331,7 @@ _light_setup(Scene_Data *data)
static void
_mesh_setup(Scene_Data *data)
{
- data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
+ eo_add(data->material, EVAS_CANVAS3D_MATERIAL_CLASS, evas);
eo_do(data->material,
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE),
@@ -343,31 +343,30 @@ _mesh_setup(Scene_Data *data)
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0),
evas_canvas3d_material_shininess_set(100.0));
- data->cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
+ eo_add(data->cube, EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
eo_do(data->cube,
evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE));
- data->sphere = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
+ eo_add(data->sphere, EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
eo_do(data->sphere,
evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE),
evas_canvas3d_primitive_precision_set(20));
- data->mesh_aabb = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
+ eo_add(data->mesh_aabb, EVAS_CANVAS3D_MESH_CLASS, evas);
eo_do(data->mesh_aabb,
evas_canvas3d_mesh_from_primitive_set(0, data->cube),
evas_canvas3d_mesh_vertex_assembly_set(EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINES),
evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_DIFFUSE),
evas_canvas3d_mesh_frame_material_set(0, data->material));
- data->mesh_sphere = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
+ eo_add(data->mesh_sphere, EVAS_CANVAS3D_MESH_CLASS, evas);
eo_do(data->mesh_sphere,
evas_canvas3d_mesh_from_primitive_set(0, data->sphere),
evas_canvas3d_mesh_vertex_assembly_set(EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINES),
evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_DIFFUSE),
evas_canvas3d_mesh_frame_material_set(0, data->material));
- data->mesh_node =
- eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
+ eo_add(data->mesh_node, EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
eo_do(data->root_node, evas_canvas3d_node_member_add(data->mesh_node));
eo_do(data->mesh_node, evas_canvas3d_node_mesh_add(data->mesh_aabb));
}
@@ -375,9 +374,9 @@ _mesh_setup(Scene_Data *data)
static void
_mesh_setup_model(Scene_Data *data)
{
- data->mesh_model = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
- data->material_model = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
- data->texture_model = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas);
+ eo_add(data->mesh_model, EVAS_CANVAS3D_MESH_CLASS, evas);
+ eo_add(data->material_model, EVAS_CANVAS3D_MATERIAL_CLASS, evas);
+ eo_add(data->texture_model, EVAS_CANVAS3D_TEXTURE_CLASS, evas);
eo_do(data->texture_model,
evas_canvas3d_texture_file_set(texture_path, NULL),
@@ -405,16 +404,16 @@ _mesh_setup_model(Scene_Data *data)
static void
_scene_setup(Scene_Data *data)
{
- data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
+ eo_add(data->scene, EVAS_CANVAS3D_SCENE_CLASS, evas);
- data->root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas,
+ eo_add(data->root_node, EVAS_CANVAS3D_NODE_CLASS, evas,
evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
_light_setup(data);
_mesh_setup_model(data);
_camera_setup(data);
- data->mesh_node_model = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas,
+ eo_add(data->mesh_node_model, EVAS_CANVAS3D_NODE_CLASS, evas,
evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
eo_do(data->mesh_node_model,
evas_canvas3d_node_position_set(obj_x, obj_y, obj_z),