forked from enlightenment/efl
evas/evas3d: rewrite evas-3d-cube2 example with eo based.
This commit is contained in:
parent
862488083b
commit
4c35b22c2a
|
@ -1,35 +1,38 @@
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <Eo.h>
|
||||||
|
#include <Evas.h>
|
||||||
#include <Ecore.h>
|
#include <Ecore.h>
|
||||||
#include <Ecore_Evas.h>
|
#include <Ecore_Evas.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <math.h>
|
|
||||||
#include <Evas.h>
|
|
||||||
|
|
||||||
#define WIDTH 1024
|
#define WIDTH 400
|
||||||
#define HEIGHT 1024
|
#define HEIGHT 400
|
||||||
|
|
||||||
typedef struct _Scene_Data
|
typedef struct _Scene_Data
|
||||||
{
|
{
|
||||||
Evas_3D_Scene *scene;
|
Eo *scene;
|
||||||
Evas_3D_Node *root_node;
|
Eo *root_node;
|
||||||
Evas_3D_Node *camera_node;
|
Eo *camera_node;
|
||||||
Evas_3D_Node *light_node;
|
Eo *light_node;
|
||||||
Evas_3D_Node *mesh_node;
|
Eo *mesh_node;
|
||||||
|
|
||||||
Evas_3D_Camera *camera;
|
Eo *camera;
|
||||||
Evas_3D_Light *light;
|
Eo *light;
|
||||||
Evas_3D_Mesh *mesh;
|
Eo *mesh;
|
||||||
Evas_3D_Material *material0;
|
Eo *material0;
|
||||||
Evas_3D_Material *material1;
|
Eo *material1;
|
||||||
|
|
||||||
Evas_3D_Texture *texture0;
|
Eo *texture0;
|
||||||
Evas_3D_Texture *texture1;
|
Eo *texture1;
|
||||||
Evas_3D_Texture *texture_normal;
|
Eo *texture_normal;
|
||||||
} Scene_Data;
|
} Scene_Data;
|
||||||
|
|
||||||
Ecore_Evas *ecore_evas = NULL;
|
static Ecore_Evas *ecore_evas = NULL;
|
||||||
Evas *evas = NULL;
|
static Evas *evas = NULL;
|
||||||
Evas_Object *background = NULL;
|
static Eo *background = NULL;
|
||||||
Evas_Object *image = NULL;
|
static Eo *image = NULL;
|
||||||
|
|
||||||
static const float cube_vertices[] =
|
static const float cube_vertices[] =
|
||||||
{
|
{
|
||||||
|
@ -119,10 +122,8 @@ _on_canvas_resize(Ecore_Evas *ee)
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|
||||||
ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
|
ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
|
||||||
|
eo_do(background, evas_obj_size_set(w, h));
|
||||||
evas_object_resize(background, w, h);
|
eo_do(image, evas_obj_size_set(w, h));
|
||||||
evas_object_resize(image, w, h);
|
|
||||||
evas_object_move(image, 0, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
|
@ -135,20 +136,18 @@ _animate_scene(void *data)
|
||||||
|
|
||||||
angle += 0.2;
|
angle += 0.2;
|
||||||
|
|
||||||
evas_3d_node_orientation_angle_axis_set(scene->mesh_node, angle, 1.0, 1.0, 1.0);
|
eo_do(scene->mesh_node,
|
||||||
|
evas_3d_node_orientation_angle_axis_set(angle, 1.0, 1.0, 1.0));
|
||||||
|
|
||||||
/* Rotate */
|
/* Rotate */
|
||||||
if (angle > 360.0)
|
if (angle > 360.0) angle -= 360.0f;
|
||||||
angle -= 360.0f;
|
|
||||||
|
|
||||||
frame += inc;
|
frame += inc;
|
||||||
|
|
||||||
if (frame >= 20)
|
if (frame >= 20) inc = -1;
|
||||||
inc = -1;
|
else if (frame <= 0) inc = 1;
|
||||||
else if (frame <= 0)
|
|
||||||
inc = 1;
|
|
||||||
|
|
||||||
evas_3d_node_mesh_frame_set(scene->mesh_node, scene->mesh, frame);
|
eo_do(scene->mesh_node, evas_3d_node_mesh_frame_set(scene->mesh, frame));
|
||||||
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -156,119 +155,147 @@ _animate_scene(void *data)
|
||||||
static void
|
static void
|
||||||
_camera_setup(Scene_Data *data)
|
_camera_setup(Scene_Data *data)
|
||||||
{
|
{
|
||||||
data->camera = evas_3d_camera_add(evas);
|
data->camera = eo_add(EVAS_3D_CAMERA_CLASS, evas);
|
||||||
evas_3d_camera_projection_perspective_set(data->camera, 60.0, 1.0, 2.0, 50.0);
|
eo_do(data->camera,
|
||||||
|
evas_3d_camera_projection_perspective_set(60.0, 1.0, 2.0, 50.0));
|
||||||
|
|
||||||
|
// data->camera_node =
|
||||||
|
// eo_add(EVAS_3D_NODE_CLASS, evas, EVAS_3D_NODE_TYPE_CAMERA);
|
||||||
data->camera_node = evas_3d_node_add(evas, EVAS_3D_NODE_TYPE_CAMERA);
|
data->camera_node = evas_3d_node_add(evas, EVAS_3D_NODE_TYPE_CAMERA);
|
||||||
evas_3d_node_camera_set(data->camera_node, data->camera);
|
eo_do(data->camera_node,
|
||||||
evas_3d_node_member_add(data->root_node, data->camera_node);
|
evas_3d_node_camera_set(data->camera));
|
||||||
evas_3d_node_position_set(data->camera_node, 0.0, 0.0, 10.0);
|
eo_do(data->root_node,
|
||||||
evas_3d_node_look_at_set(data->camera_node, EVAS_3D_SPACE_PARENT, 0.0, 0.0, 0.0,
|
evas_3d_node_member_add(data->camera_node));
|
||||||
EVAS_3D_SPACE_PARENT, 0.0, 1.0, 0.0);
|
eo_do(data->camera_node,
|
||||||
|
evas_3d_node_position_set(0.0, 0.0, 10.0),
|
||||||
|
evas_3d_node_look_at_set(EVAS_3D_SPACE_PARENT, 0.0, 0.0, 0.0,
|
||||||
|
EVAS_3D_SPACE_PARENT, 0.0, 1.0, 0.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_light_setup(Scene_Data *data)
|
_light_setup(Scene_Data *data)
|
||||||
{
|
{
|
||||||
data->light = evas_3d_light_add(evas);
|
data->light = eo_add(EVAS_3D_LIGHT_CLASS, evas);
|
||||||
evas_3d_light_ambient_set(data->light, 0.2, 0.2, 0.2, 1.0);
|
eo_do(data->light,
|
||||||
evas_3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0);
|
evas_3d_light_ambient_set(0.2, 0.2, 0.2, 1.0),
|
||||||
evas_3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0);
|
evas_3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0),
|
||||||
|
evas_3d_light_specular_set(1.0, 1.0, 1.0, 1.0));
|
||||||
|
|
||||||
|
// data->light_node = eo_add(EVAS_3D_NODE_CLASS, evas, EVAS_3D_NODE_TYPE_LIGHT);
|
||||||
data->light_node = evas_3d_node_add(evas, EVAS_3D_NODE_TYPE_LIGHT);
|
data->light_node = evas_3d_node_add(evas, EVAS_3D_NODE_TYPE_LIGHT);
|
||||||
evas_3d_node_light_set(data->light_node, data->light);
|
eo_do(data->light_node,
|
||||||
evas_3d_node_member_add(data->root_node, data->light_node);
|
evas_3d_node_light_set(data->light));
|
||||||
evas_3d_node_position_set(data->light_node, 0.0, 0.0, 10.0);
|
eo_do(data->root_node,
|
||||||
evas_3d_node_look_at_set(data->light_node, EVAS_3D_SPACE_PARENT, 0.0, 0.0, 0.0,
|
evas_3d_node_member_add(data->light_node));
|
||||||
EVAS_3D_SPACE_PARENT, 0.0, 1.0, 0.0);
|
eo_do(data->light_node,
|
||||||
|
evas_3d_node_position_set(0.0, 0.0, 10.0),
|
||||||
|
evas_3d_node_look_at_set(EVAS_3D_SPACE_PARENT, 0.0, 0.0, 0.0,
|
||||||
|
EVAS_3D_SPACE_PARENT, 0.0, 1.0, 0.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_mesh_setup(Scene_Data *data)
|
_mesh_setup(Scene_Data *data)
|
||||||
{
|
{
|
||||||
/* Setup material. */
|
/* Setup material. */
|
||||||
data->material0 = evas_3d_material_add(evas);
|
data->material0 = eo_add(EVAS_3D_MATERIAL_CLASS, evas);
|
||||||
data->material1 = evas_3d_material_add(evas);
|
eo_do(data->material0,
|
||||||
|
evas_3d_material_enable_set(EVAS_3D_MATERIAL_AMBIENT, EINA_TRUE),
|
||||||
|
evas_3d_material_enable_set(EVAS_3D_MATERIAL_DIFFUSE, EINA_TRUE),
|
||||||
|
evas_3d_material_enable_set(EVAS_3D_MATERIAL_SPECULAR, EINA_TRUE);
|
||||||
|
evas_3d_material_color_set(EVAS_3D_MATERIAL_AMBIENT,
|
||||||
|
0.2, 0.2, 0.2, 1.0),
|
||||||
|
evas_3d_material_color_set(EVAS_3D_MATERIAL_DIFFUSE,
|
||||||
|
0.8, 0.8, 0.8, 1.0),
|
||||||
|
evas_3d_material_color_set(EVAS_3D_MATERIAL_SPECULAR,
|
||||||
|
1.0, 1.0, 1.0, 1.0),
|
||||||
|
evas_3d_material_shininess_set(100.0));
|
||||||
|
|
||||||
evas_3d_material_enable_set(data->material0, EVAS_3D_MATERIAL_AMBIENT, EINA_TRUE);
|
data->material1 = eo_add(EVAS_3D_MATERIAL_CLASS, evas);
|
||||||
evas_3d_material_enable_set(data->material0, EVAS_3D_MATERIAL_DIFFUSE, EINA_TRUE);
|
eo_do(data->material1,
|
||||||
evas_3d_material_enable_set(data->material0, EVAS_3D_MATERIAL_SPECULAR, EINA_TRUE);
|
evas_3d_material_enable_set(EVAS_3D_MATERIAL_AMBIENT, EINA_TRUE),
|
||||||
evas_3d_material_enable_set(data->material0, EVAS_3D_MATERIAL_NORMAL, EINA_TRUE);
|
evas_3d_material_enable_set(EVAS_3D_MATERIAL_DIFFUSE, EINA_TRUE),
|
||||||
|
evas_3d_material_enable_set(EVAS_3D_MATERIAL_SPECULAR, EINA_TRUE),
|
||||||
|
evas_3d_material_enable_set(EVAS_3D_MATERIAL_NORMAL, EINA_TRUE);
|
||||||
|
evas_3d_material_color_set(EVAS_3D_MATERIAL_AMBIENT,
|
||||||
|
0.2, 0.2, 0.2, 1.0),
|
||||||
|
evas_3d_material_color_set(EVAS_3D_MATERIAL_DIFFUSE,
|
||||||
|
0.8, 0.8, 0.8, 1.0),
|
||||||
|
evas_3d_material_color_set(EVAS_3D_MATERIAL_SPECULAR,
|
||||||
|
1.0, 1.0, 1.0, 1.0),
|
||||||
|
evas_3d_material_shininess_set(100.0));
|
||||||
|
|
||||||
evas_3d_material_color_set(data->material0, EVAS_3D_MATERIAL_AMBIENT, 0.2, 0.2, 0.2, 1.0);
|
/* Texture 1 */
|
||||||
evas_3d_material_color_set(data->material0, EVAS_3D_MATERIAL_DIFFUSE, 0.8, 0.8, 0.8, 1.0);
|
data->texture0 = eo_add(EVAS_3D_TEXTURE_CLASS, evas);
|
||||||
evas_3d_material_color_set(data->material0, EVAS_3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 1.0);
|
eo_do(data->texture0, evas_3d_texture_data_set(EVAS_3D_COLOR_FORMAT_RGBA,
|
||||||
evas_3d_material_shininess_set(data->material0, 100.0);
|
EVAS_3D_PIXEL_FORMAT_8888, 4,
|
||||||
|
4, &pixels0[0]));
|
||||||
|
eo_do(data->material0, evas_3d_material_texture_set(EVAS_3D_MATERIAL_DIFFUSE,
|
||||||
|
data->texture0));
|
||||||
|
/* Texture 2 */
|
||||||
|
data->texture1 = eo_add(EVAS_3D_TEXTURE_CLASS, evas);
|
||||||
|
eo_do(data->texture1, evas_3d_texture_data_set(EVAS_3D_COLOR_FORMAT_RGBA,
|
||||||
|
EVAS_3D_PIXEL_FORMAT_8888, 4,
|
||||||
|
4, &pixels1[0]));
|
||||||
|
eo_do(data->material1, evas_3d_material_texture_set(EVAS_3D_MATERIAL_DIFFUSE,
|
||||||
|
data->texture1));
|
||||||
|
/* Normal texture */
|
||||||
|
data->texture_normal = eo_add(EVAS_3D_TEXTURE_CLASS, evas);
|
||||||
|
|
||||||
evas_3d_material_enable_set(data->material1, EVAS_3D_MATERIAL_AMBIENT, EINA_TRUE);
|
eo_do(data->texture_normal, evas_3d_texture_file_set("normal_lego.png",
|
||||||
evas_3d_material_enable_set(data->material1, EVAS_3D_MATERIAL_DIFFUSE, EINA_TRUE);
|
NULL));
|
||||||
evas_3d_material_enable_set(data->material1, EVAS_3D_MATERIAL_SPECULAR, EINA_TRUE);
|
|
||||||
evas_3d_material_enable_set(data->material1, EVAS_3D_MATERIAL_NORMAL, EINA_TRUE);
|
|
||||||
|
|
||||||
evas_3d_material_color_set(data->material1, EVAS_3D_MATERIAL_AMBIENT, 0.2, 0.2, 0.2, 1.0);
|
|
||||||
evas_3d_material_color_set(data->material1, EVAS_3D_MATERIAL_DIFFUSE, 0.8, 0.8, 0.8, 1.0);
|
|
||||||
evas_3d_material_color_set(data->material1, EVAS_3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 1.0);
|
|
||||||
evas_3d_material_shininess_set(data->material1, 100.0);
|
|
||||||
|
|
||||||
data->texture0 = evas_3d_texture_add(evas);
|
|
||||||
data->texture1 = evas_3d_texture_add(evas);
|
|
||||||
data->texture_normal = evas_3d_texture_add(evas);
|
|
||||||
|
|
||||||
evas_3d_texture_data_set(data->texture0, EVAS_3D_COLOR_FORMAT_RGBA,
|
|
||||||
EVAS_3D_PIXEL_FORMAT_8888, 4, 4, &pixels0[0]);
|
|
||||||
evas_3d_texture_data_set(data->texture1, EVAS_3D_COLOR_FORMAT_RGBA,
|
|
||||||
EVAS_3D_PIXEL_FORMAT_8888, 4, 4, &pixels1[0]);
|
|
||||||
evas_3d_texture_file_set(data->texture_normal, "normal_lego.png", NULL);
|
|
||||||
|
|
||||||
evas_3d_material_texture_set(data->material0, EVAS_3D_MATERIAL_DIFFUSE, data->texture0);
|
|
||||||
evas_3d_material_texture_set(data->material1, EVAS_3D_MATERIAL_DIFFUSE, data->texture1);
|
|
||||||
evas_3d_material_texture_set(data->material1, EVAS_3D_MATERIAL_NORMAL, data->texture_normal);
|
|
||||||
|
|
||||||
|
eo_do(data->material1, evas_3d_material_texture_set(EVAS_3D_MATERIAL_NORMAL,
|
||||||
|
data->texture_normal));
|
||||||
/* Setup mesh. */
|
/* Setup mesh. */
|
||||||
data->mesh = evas_3d_mesh_add(evas);
|
data->mesh = eo_add(EVAS_3D_MESH_CLASS, evas);
|
||||||
evas_3d_mesh_vertex_count_set(data->mesh, 24);
|
eo_do(data->mesh,
|
||||||
evas_3d_mesh_frame_add(data->mesh, 0);
|
evas_3d_mesh_vertex_count_set(24),
|
||||||
|
evas_3d_mesh_frame_add(0),
|
||||||
evas_3d_mesh_frame_vertex_data_set(data->mesh, 0, EVAS_3D_VERTEX_POSITION,
|
evas_3d_mesh_frame_vertex_data_set(0, EVAS_3D_VERTEX_POSITION,
|
||||||
12 * sizeof(float), &cube_vertices[ 0]);
|
12 * sizeof(float),
|
||||||
evas_3d_mesh_frame_vertex_data_set(data->mesh, 0, EVAS_3D_VERTEX_NORMAL,
|
&cube_vertices[0]),
|
||||||
12 * sizeof(float), &cube_vertices[ 3]);
|
evas_3d_mesh_frame_vertex_data_set(0, EVAS_3D_VERTEX_NORMAL,
|
||||||
evas_3d_mesh_frame_vertex_data_set(data->mesh, 0, EVAS_3D_VERTEX_COLOR,
|
12 * sizeof(float),
|
||||||
12 * sizeof(float), &cube_vertices[ 6]);
|
&cube_vertices[3]),
|
||||||
evas_3d_mesh_frame_vertex_data_set(data->mesh, 0, EVAS_3D_VERTEX_TEXCOORD,
|
evas_3d_mesh_frame_vertex_data_set(0, EVAS_3D_VERTEX_COLOR,
|
||||||
12 * sizeof(float), &cube_vertices[10]);
|
12 * sizeof(float),
|
||||||
|
&cube_vertices[6]),
|
||||||
evas_3d_mesh_index_data_set(data->mesh, EVAS_3D_INDEX_FORMAT_UNSIGNED_SHORT,
|
evas_3d_mesh_frame_vertex_data_set(0, EVAS_3D_VERTEX_TEXCOORD,
|
||||||
36, &cube_indices[0]);
|
12 * sizeof(float),
|
||||||
evas_3d_mesh_vertex_assembly_set(data->mesh, EVAS_3D_VERTEX_ASSEMBLY_TRIANGLES);
|
&cube_vertices[10]),
|
||||||
|
evas_3d_mesh_index_data_set(EVAS_3D_INDEX_FORMAT_UNSIGNED_SHORT,
|
||||||
evas_3d_mesh_shade_mode_set(data->mesh, EVAS_3D_SHADE_MODE_NORMAL_MAP);
|
36, &cube_indices[0]),
|
||||||
|
evas_3d_mesh_vertex_assembly_set(EVAS_3D_VERTEX_ASSEMBLY_TRIANGLES),
|
||||||
evas_3d_mesh_frame_material_set(data->mesh, 0, data->material0);
|
evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_NORMAL_MAP),
|
||||||
|
evas_3d_mesh_frame_material_set(0, data->material0),
|
||||||
evas_3d_mesh_frame_add(data->mesh, 20);
|
evas_3d_mesh_frame_add(20),
|
||||||
evas_3d_mesh_frame_material_set(data->mesh, 20, data->material1);
|
evas_3d_mesh_frame_material_set(20, data->material1));
|
||||||
|
|
||||||
|
// data->mesh_node = eo_add(EVAS_3D_NODE_CLASS, evas, EVAS_3D_NODE_TYPE_MESH);
|
||||||
data->mesh_node = evas_3d_node_add(evas, EVAS_3D_NODE_TYPE_MESH);
|
data->mesh_node = evas_3d_node_add(evas, EVAS_3D_NODE_TYPE_MESH);
|
||||||
evas_3d_node_member_add(data->root_node, data->mesh_node);
|
eo_do(data->root_node,
|
||||||
evas_3d_node_mesh_add(data->mesh_node, data->mesh);
|
evas_3d_node_member_add(data->mesh_node));
|
||||||
|
eo_do(data->mesh_node,
|
||||||
|
evas_3d_node_mesh_add(data->mesh));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_scene_setup(Scene_Data *data)
|
_scene_setup(Scene_Data *data)
|
||||||
{
|
{
|
||||||
data->scene = evas_3d_scene_add(evas);
|
data->scene = eo_add(EVAS_3D_SCENE_CLASS, evas);
|
||||||
evas_3d_scene_size_set(data->scene, WIDTH, HEIGHT);
|
eo_do(data->scene, evas_3d_scene_size_set(WIDTH, HEIGHT),
|
||||||
evas_3d_scene_background_color_set(data->scene, 0.0, 0.0, 0.0, 0.0);
|
evas_3d_scene_background_color_set(0.0, 0.0, 0.0, 0.0));
|
||||||
|
|
||||||
|
// data->root_node = eo_add(EVAS_3D_NODE_CLASS, evas, EVAS_3D_NODE_TYPE_NODE);
|
||||||
data->root_node = evas_3d_node_add(evas, EVAS_3D_NODE_TYPE_NODE);
|
data->root_node = evas_3d_node_add(evas, EVAS_3D_NODE_TYPE_NODE);
|
||||||
|
|
||||||
_camera_setup(data);
|
_camera_setup(data);
|
||||||
_light_setup(data);
|
_light_setup(data);
|
||||||
_mesh_setup(data);
|
_mesh_setup(data);
|
||||||
|
|
||||||
evas_3d_scene_root_node_set(data->scene, data->root_node);
|
eo_do(data->scene,
|
||||||
evas_3d_scene_camera_node_set(data->scene, data->camera_node);
|
evas_3d_scene_root_node_set(data->root_node),
|
||||||
|
evas_3d_scene_camera_node_set(data->camera_node));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -276,13 +303,11 @@ main(void)
|
||||||
{
|
{
|
||||||
Scene_Data data;
|
Scene_Data data;
|
||||||
|
|
||||||
if (!ecore_evas_init())
|
if (!ecore_evas_init()) return 0;
|
||||||
return 0;
|
|
||||||
|
|
||||||
ecore_evas = ecore_evas_new(NULL, 10, 10, WIDTH, HEIGHT, NULL);
|
ecore_evas = ecore_evas_new(NULL, 10, 10, WIDTH, HEIGHT, NULL);
|
||||||
|
|
||||||
if (!ecore_evas)
|
if (!ecore_evas) return 0;
|
||||||
return 0;
|
|
||||||
|
|
||||||
ecore_evas_callback_delete_request_set(ecore_evas, _on_delete);
|
ecore_evas_callback_delete_request_set(ecore_evas, _on_delete);
|
||||||
ecore_evas_callback_resize_set(ecore_evas, _on_canvas_resize);
|
ecore_evas_callback_resize_set(ecore_evas, _on_canvas_resize);
|
||||||
|
@ -293,20 +318,20 @@ main(void)
|
||||||
_scene_setup(&data);
|
_scene_setup(&data);
|
||||||
|
|
||||||
/* Add a background rectangle objects. */
|
/* Add a background rectangle objects. */
|
||||||
background = evas_object_rectangle_add(evas);
|
background = eo_add(EVAS_OBJ_RECTANGLE_CLASS, evas);
|
||||||
evas_object_color_set(background, 0, 0, 0, 255);
|
eo_do(background,
|
||||||
evas_object_move(background, 0, 0);
|
evas_obj_color_set(0, 0, 0, 255),
|
||||||
evas_object_resize(background, WIDTH, HEIGHT);
|
evas_obj_size_set(WIDTH, HEIGHT),
|
||||||
evas_object_show(background);
|
evas_obj_visibility_set(EINA_TRUE));
|
||||||
|
|
||||||
/* Add an image object for 3D scene rendering. */
|
/* Add an image object for 3D scene rendering. */
|
||||||
image = evas_object_image_filled_add(evas);
|
image = evas_object_image_filled_add(evas);
|
||||||
evas_object_move(image, 0, 0);
|
eo_do(image,
|
||||||
evas_object_resize(image, WIDTH, HEIGHT);
|
evas_obj_size_set(WIDTH, HEIGHT),
|
||||||
evas_object_show(image);
|
evas_obj_visibility_set(EINA_TRUE));
|
||||||
|
|
||||||
/* Set the image object as render target for 3D scene. */
|
/* Set the image object as render target for 3D scene. */
|
||||||
evas_object_image_scene_set(image, data.scene);
|
eo_do(image, evas_obj_image_scene_set(data.scene));
|
||||||
|
|
||||||
/* Add animation timer callback. */
|
/* Add animation timer callback. */
|
||||||
ecore_timer_add(0.01, _animate_scene, &data);
|
ecore_timer_add(0.01, _animate_scene, &data);
|
||||||
|
|
Loading…
Reference in New Issue