From 059c7c4dca4b0b46e610b105cd85e7d97fc13f2f Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Fri, 11 Sep 2015 10:26:48 +1000 Subject: Failed experiment, but let's keep it for now. --- src/extantz/extantz.c | 4 +++- src/extantz/extantz.h | 1 + src/extantz/scenri.c | 21 ++++++++++++++++++++- 3 files changed, 24 insertions(+), 2 deletions(-) (limited to 'src/extantz') diff --git a/src/extantz/extantz.c b/src/extantz/extantz.c index 6ef9e14..310f9b9 100644 --- a/src/extantz/extantz.c +++ b/src/extantz/extantz.c @@ -398,7 +398,10 @@ static Eina_Bool doFrame(void *data) else if ((ourGlobals->scene) && (ourGlobals->scene->image)) { // evas_object_image_pixels_dirty_set(elm_image_object_get(ourGlobals->scene->image), EINA_TRUE); +#if USE_ELM_IMG _draw_gl(elm_image_object_get(ourGlobals->scene->image)); +#else +#endif } return EINA_TRUE; // Keep calling us. @@ -609,7 +612,6 @@ EAPI_MAIN int elm_main(int argc, char **argv) ourGlobals.running = 1; - // Don't do this, we need to clean up other stuff to, so set a clean up function below. //elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); elm_policy_set(ELM_POLICY_EXIT, ELM_POLICY_EXIT_NONE); diff --git a/src/extantz/extantz.h b/src/extantz/extantz.h index e4e562e..8e06948 100644 --- a/src/extantz/extantz.h +++ b/src/extantz/extantz.h @@ -5,6 +5,7 @@ #define USE_IRR 0 #define USE_DEMO 1 #define DO_GEARS 0 +#define USE_ELM_IMG 1 #include "LumbrJack.h" diff --git a/src/extantz/scenri.c b/src/extantz/scenri.c index 02be81c..76f4513 100644 --- a/src/extantz/scenri.c +++ b/src/extantz/scenri.c @@ -351,7 +351,10 @@ static Eina_Bool _stuffsLoader(void *data) Scene_Data *scenriAdd(Evas_Object *win) { Scene_Data *scene; - Evas_Object *evas, *temp; + Evas_Object *evas; +#if USE_ELM_IMG + Evas_Object *temp; +#endif int w, h; evas = evas_object_evas_get(win); @@ -373,12 +376,19 @@ Scene_Data *scenriAdd(Evas_Object *win) // Any colour or texture applied to this window gets applied to the scene, including transparency. // Interestingly enough, the position and size of the render seems to NOT depend on the position and size of this image? // Note that we can't reuse the windows background image, Evas_3D needs both images. +#if USE_ELM_IMG scene->image = eo_add(ELM_IMAGE_CLASS, win, evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), elm_obj_image_fill_outside_set(EINA_TRUE), efl_gfx_visible_set(EINA_TRUE), temp = elm_obj_image_object_get() ); +#else + scene->image = evas_object_image_filled_add(evas); + evas_object_size_hint_weight_set(scene->image, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), + evas_object_resize(scene->image, WIDTH, HEIGHT); + evas_object_show(scene->image); +#endif elm_object_tooltip_text_set(scene->image, ""); elm_object_tooltip_hide(scene->image); scene->camera_node = cameraAdd(evas, scene, scene->image); @@ -396,11 +406,20 @@ Scene_Data *scenriAdd(Evas_Object *win) ); eo_do(scene->root_node, evas_canvas3d_node_member_add(scene->light_node)); +#if USE_ELM_IMG eo_do(temp, evas_obj_image_scene_set(scene->scene)); // Elm can't seem to be able to tell us WHERE an image was clicked, so use raw Evas callbacks instead. evas_object_event_callback_add(temp, EVAS_CALLBACK_MOUSE_MOVE, _on_mouse_move, scene); evas_object_event_callback_add(temp, EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down, scene); +#else + eo_do(scene->image, evas_obj_image_scene_set(scene->scene)); + + // Elm can't seem to be able to tell us WHERE an image was clicked, so use raw Evas callbacks instead. + evas_object_event_callback_add(scene->image, EVAS_CALLBACK_MOUSE_MOVE, _on_mouse_move, scene); + evas_object_event_callback_add(scene->image, EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down, scene); +#endif + elm_win_resize_object_add(win, scene->image); -- cgit v1.1