aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid Walter Seikel2015-09-11 10:26:48 +1000
committerDavid Walter Seikel2015-09-11 10:26:48 +1000
commit059c7c4dca4b0b46e610b105cd85e7d97fc13f2f (patch)
tree55c716a3ec80d7582901b1ce5277c5a73e71e2b7
parentTODO++ (diff)
downloadSledjHamr-059c7c4dca4b0b46e610b105cd85e7d97fc13f2f.zip
SledjHamr-059c7c4dca4b0b46e610b105cd85e7d97fc13f2f.tar.gz
SledjHamr-059c7c4dca4b0b46e610b105cd85e7d97fc13f2f.tar.bz2
SledjHamr-059c7c4dca4b0b46e610b105cd85e7d97fc13f2f.tar.xz
Failed experiment, but let's keep it for now.
-rw-r--r--src/extantz/extantz.c4
-rw-r--r--src/extantz/extantz.h1
-rw-r--r--src/extantz/scenri.c21
3 files changed, 24 insertions, 2 deletions
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)
398 else if ((ourGlobals->scene) && (ourGlobals->scene->image)) 398 else if ((ourGlobals->scene) && (ourGlobals->scene->image))
399 { 399 {
400// evas_object_image_pixels_dirty_set(elm_image_object_get(ourGlobals->scene->image), EINA_TRUE); 400// evas_object_image_pixels_dirty_set(elm_image_object_get(ourGlobals->scene->image), EINA_TRUE);
401#if USE_ELM_IMG
401 _draw_gl(elm_image_object_get(ourGlobals->scene->image)); 402 _draw_gl(elm_image_object_get(ourGlobals->scene->image));
403#else
404#endif
402 } 405 }
403 406
404 return EINA_TRUE; // Keep calling us. 407 return EINA_TRUE; // Keep calling us.
@@ -609,7 +612,6 @@ EAPI_MAIN int elm_main(int argc, char **argv)
609 612
610 ourGlobals.running = 1; 613 ourGlobals.running = 1;
611 614
612
613 // Don't do this, we need to clean up other stuff to, so set a clean up function below. 615 // Don't do this, we need to clean up other stuff to, so set a clean up function below.
614 //elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); 616 //elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
615 elm_policy_set(ELM_POLICY_EXIT, ELM_POLICY_EXIT_NONE); 617 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 @@
5#define USE_IRR 0 5#define USE_IRR 0
6#define USE_DEMO 1 6#define USE_DEMO 1
7#define DO_GEARS 0 7#define DO_GEARS 0
8#define USE_ELM_IMG 1
8 9
9 10
10#include "LumbrJack.h" 11#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)
351Scene_Data *scenriAdd(Evas_Object *win) 351Scene_Data *scenriAdd(Evas_Object *win)
352{ 352{
353 Scene_Data *scene; 353 Scene_Data *scene;
354 Evas_Object *evas, *temp; 354 Evas_Object *evas;
355#if USE_ELM_IMG
356 Evas_Object *temp;
357#endif
355 int w, h; 358 int w, h;
356 359
357 evas = evas_object_evas_get(win); 360 evas = evas_object_evas_get(win);
@@ -373,12 +376,19 @@ Scene_Data *scenriAdd(Evas_Object *win)
373 // Any colour or texture applied to this window gets applied to the scene, including transparency. 376 // Any colour or texture applied to this window gets applied to the scene, including transparency.
374 // Interestingly enough, the position and size of the render seems to NOT depend on the position and size of this image? 377 // Interestingly enough, the position and size of the render seems to NOT depend on the position and size of this image?
375 // Note that we can't reuse the windows background image, Evas_3D needs both images. 378 // Note that we can't reuse the windows background image, Evas_3D needs both images.
379#if USE_ELM_IMG
376 scene->image = eo_add(ELM_IMAGE_CLASS, win, 380 scene->image = eo_add(ELM_IMAGE_CLASS, win,
377 evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), 381 evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND),
378 elm_obj_image_fill_outside_set(EINA_TRUE), 382 elm_obj_image_fill_outside_set(EINA_TRUE),
379 efl_gfx_visible_set(EINA_TRUE), 383 efl_gfx_visible_set(EINA_TRUE),
380 temp = elm_obj_image_object_get() 384 temp = elm_obj_image_object_get()
381 ); 385 );
386#else
387 scene->image = evas_object_image_filled_add(evas);
388 evas_object_size_hint_weight_set(scene->image, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND),
389 evas_object_resize(scene->image, WIDTH, HEIGHT);
390 evas_object_show(scene->image);
391#endif
382 elm_object_tooltip_text_set(scene->image, ""); 392 elm_object_tooltip_text_set(scene->image, "");
383 elm_object_tooltip_hide(scene->image); 393 elm_object_tooltip_hide(scene->image);
384 scene->camera_node = cameraAdd(evas, scene, scene->image); 394 scene->camera_node = cameraAdd(evas, scene, scene->image);
@@ -396,11 +406,20 @@ Scene_Data *scenriAdd(Evas_Object *win)
396 ); 406 );
397 eo_do(scene->root_node, evas_canvas3d_node_member_add(scene->light_node)); 407 eo_do(scene->root_node, evas_canvas3d_node_member_add(scene->light_node));
398 408
409#if USE_ELM_IMG
399 eo_do(temp, evas_obj_image_scene_set(scene->scene)); 410 eo_do(temp, evas_obj_image_scene_set(scene->scene));
400 411
401 // Elm can't seem to be able to tell us WHERE an image was clicked, so use raw Evas callbacks instead. 412 // Elm can't seem to be able to tell us WHERE an image was clicked, so use raw Evas callbacks instead.
402 evas_object_event_callback_add(temp, EVAS_CALLBACK_MOUSE_MOVE, _on_mouse_move, scene); 413 evas_object_event_callback_add(temp, EVAS_CALLBACK_MOUSE_MOVE, _on_mouse_move, scene);
403 evas_object_event_callback_add(temp, EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down, scene); 414 evas_object_event_callback_add(temp, EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down, scene);
415#else
416 eo_do(scene->image, evas_obj_image_scene_set(scene->scene));
417
418 // Elm can't seem to be able to tell us WHERE an image was clicked, so use raw Evas callbacks instead.
419 evas_object_event_callback_add(scene->image, EVAS_CALLBACK_MOUSE_MOVE, _on_mouse_move, scene);
420 evas_object_event_callback_add(scene->image, EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down, scene);
421#endif
422
404 423
405 elm_win_resize_object_add(win, scene->image); 424 elm_win_resize_object_add(win, scene->image);
406 425