summaryrefslogtreecommitdiff
path: root/src/examples/evas/evas-map-aa-eo.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-04-26 15:11:51 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-05-11 17:54:00 +0900
commit0a224da86fe1602a2045fac55cb6457c71d81b88 (patch)
tree46d5c3bab9a14f9849a3a323c5b349b288a8b930 /src/examples/evas/evas-map-aa-eo.c
parentd111c6e1dd54e05a099fd36fbd64f53a55a2e7d8 (diff)
evas map: Introduce new API for maps (Efl.Gfx.Map)
This implements an entirely new API model for Evas Map by relying on high-level transformations on the object rather than an external Evas_Map structure that needs to be constantly updated manually. The implementation relies on Evas_Map. To rotate an object all you need to do now is efl_gfx_map_rotate(obj, 45.0, NULL, 0.5, 0.5); Or with a C++ syntax: obj.rotate(45.0, NULL, 0.5, 0.5); Or even simply (with default arguments): obj.rotate(45.0); The map transformation functions are: - rotate - rotate_3d - rotate_quat - zoom - translate (new!) - perspective_3d - lightning_3d @feature
Diffstat (limited to 'src/examples/evas/evas-map-aa-eo.c')
-rw-r--r--src/examples/evas/evas-map-aa-eo.c33
1 files changed, 10 insertions, 23 deletions
diff --git a/src/examples/evas/evas-map-aa-eo.c b/src/examples/evas/evas-map-aa-eo.c
index 12bcdfe..5b4c66f 100644
--- a/src/examples/evas/evas-map-aa-eo.c
+++ b/src/examples/evas/evas-map-aa-eo.c
@@ -58,30 +58,17 @@ static struct exemple_data d =
58 EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE }; 58 EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE };
59 59
60static void 60static void
61update() 61update(void)
62{ 62{
63 efl_gfx_map_populate(d.target1, 0); 63 efl_gfx_map_raw_coord_set(d.target1, 0, d.px1, d.py1, 0);
64 64 efl_gfx_map_raw_coord_set(d.target1, 1, d.px2, d.py2, 0);
65 efl_gfx_map_point_coord_set(d.target1, 0, d.px1, d.py1, 0); 65 efl_gfx_map_raw_coord_set(d.target1, 2, d.px3, d.py3, 0);
66 efl_gfx_map_point_coord_set(d.target1, 1, d.px2, d.py2, 0); 66 efl_gfx_map_raw_coord_set(d.target1, 3, d.px4, d.py4, 0);
67 efl_gfx_map_point_coord_set(d.target1, 2, d.px3, d.py3, 0); 67
68 efl_gfx_map_point_coord_set(d.target1, 3, d.px4, d.py4, 0); 68 efl_gfx_map_raw_coord_set(d.target2, 0, d.px1 + 400, d.py1, 0);
69 69 efl_gfx_map_raw_coord_set(d.target2, 1, d.px2 + 400, d.py2, 0);
70 efl_gfx_map_point_image_uv_set(d.target1, 0, 0, 0); 70 efl_gfx_map_raw_coord_set(d.target2, 2, d.px3 + 400, d.py3, 0);
71 efl_gfx_map_point_image_uv_set(d.target1, 1, IMAGE_SIZE_W, 0); 71 efl_gfx_map_raw_coord_set(d.target2, 3, d.px4 + 400, d.py4, 0);
72 efl_gfx_map_point_image_uv_set(d.target1, 2, IMAGE_SIZE_W, IMAGE_SIZE_H);
73 efl_gfx_map_point_image_uv_set(d.target1, 3, 0, IMAGE_SIZE_H);
74
75 efl_gfx_map_enable_set(d.target1, EINA_TRUE);
76
77 efl_gfx_map_dup(d.target2, d.target1);
78
79 efl_gfx_map_point_coord_set(d.target2, 0, d.px1 + 400, d.py1, 0);
80 efl_gfx_map_point_coord_set(d.target2, 1, d.px2 + 400, d.py2, 0);
81 efl_gfx_map_point_coord_set(d.target2, 2, d.px3 + 400, d.py3, 0);
82 efl_gfx_map_point_coord_set(d.target2, 3, d.px4 + 400, d.py4, 0);
83
84 efl_gfx_map_enable_set(d.target2, EINA_TRUE);
85} 72}
86 73
87static void 74static void