aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-05-01 23:27:42 +1000
committerDavid Walter Seikel2014-05-01 23:27:42 +1000
commit0e3b1373e1ec8cc26c81f28d8a6ff5cf000da239 (patch)
treeca9f6bc178cd3f8edf0b85e7a7213e00d2184e95 /src
parentUpdate Evas_3d example to match upstream, still doesn't work (diff)
downloadSledjHamr-0e3b1373e1ec8cc26c81f28d8a6ff5cf000da239.zip
SledjHamr-0e3b1373e1ec8cc26c81f28d8a6ff5cf000da239.tar.gz
SledjHamr-0e3b1373e1ec8cc26c81f28d8a6ff5cf000da239.tar.bz2
SledjHamr-0e3b1373e1ec8cc26c81f28d8a6ff5cf000da239.tar.xz
Now that Evas_3d examples actually work, I can add the magic that makes mine work to. B-)
Diffstat (limited to 'src')
-rw-r--r--src/GuiLua/GuiLua.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/GuiLua/GuiLua.c b/src/GuiLua/GuiLua.c
index f91cac5..00b7d83 100644
--- a/src/GuiLua/GuiLua.c
+++ b/src/GuiLua/GuiLua.c
@@ -584,6 +584,7 @@ static int window(lua_State *L)
584 char *name = "GuiLua"; 584 char *name = "GuiLua";
585 char *title = "GuiLua test harness"; 585 char *title = "GuiLua test harness";
586 struct _Widget *wid; 586 struct _Widget *wid;
587 int result = 0;
587 int w = WIDTH, h = HEIGHT; 588 int w = WIDTH, h = HEIGHT;
588 589
589 lua_getfield(L, LUA_REGISTRYINDEX, globName); 590 lua_getfield(L, LUA_REGISTRYINDEX, globName);
@@ -592,6 +593,8 @@ static int window(lua_State *L)
592 593
593 pull_lua(L, 1, "%w %h $title $name", &w, &h, &title, &name); 594 pull_lua(L, 1, "%w %h $title $name", &w, &h, &title, &name);
594 595
596 // Set the engine to opengl_x11, then open the window.
597 elm_config_preferred_engine_set("opengl_x11");
595 if ((ourGlobals->win = elm_win_util_standard_add(name, title))) 598 if ((ourGlobals->win = elm_win_util_standard_add(name, title)))
596 { 599 {
597 eina_clist_init(&ourGlobals->widgets); 600 eina_clist_init(&ourGlobals->widgets);
@@ -623,29 +626,28 @@ static int window(lua_State *L)
623 strcpy(wid->magic, "Widget"); 626 strcpy(wid->magic, "Widget");
624 eina_clist_add_head(&ourGlobals->widgets, &wid->node); 627 eina_clist_add_head(&ourGlobals->widgets, &wid->node);
625 628
626// TODO - Doesn't matter how you do it, calling evas_obj_image_scene_set() AND evas_obj_size_set() will segfault.
627// Not calling them both means the image is not big enough to see. FUCK!!
628 wid->obj = eo_add(EVAS_OBJ_IMAGE_CLASS, ourGlobals->win); 629 wid->obj = eo_add(EVAS_OBJ_IMAGE_CLASS, ourGlobals->win);
629 ourGlobals->image = (wid->obj); 630 ourGlobals->image = (wid->obj);
630 eo_do(wid->obj, 631 eo_do(wid->obj,
631 evas_obj_image_filled_set(EINA_TRUE), 632 evas_obj_image_filled_set(EINA_TRUE),
632// evas_obj_image_size_set(w, h), 633 evas_obj_image_size_set(w, h),
633 evas_obj_image_file_set("../../media/sky_01.jpg", NULL), 634 evas_obj_image_file_set("../../media/sky_01.jpg", NULL),
634 evas_obj_position_set(0, 0), 635 evas_obj_position_set(0, 0),
635 evas_obj_size_set(w, h), 636 evas_obj_size_set(w, h),
636 evas_obj_visibility_set(EINA_TRUE) 637 evas_obj_visibility_set(EINA_TRUE),
637// evas_obj_image_scene_set(ourScene.scene) 638 evas_obj_image_scene_set(ourScene.scene)
638 ); 639 );
639// evas_object_resize(wid->obj, w, h);
640// evas_object_move(wid->obj, 0, 0);
641 // Add animation timer callback. 640 // Add animation timer callback.
642 ecore_timer_add(0.016, _animate_scene, &ourScene); 641 ecore_timer_add(0.016, _animate_scene, &ourScene);
643 642
644 lua_pushlightuserdata(L, &ourGlobals->win); 643 lua_pushlightuserdata(L, &ourGlobals->win);
645 return 1; 644 result = 1;
646 } 645 }
647 646
648 return 0; 647 // Set preferred engine back to default from config
648 elm_config_preferred_engine_set(NULL);
649
650 return result;
649} 651}
650 652
651static int clear(lua_State *L) 653static int clear(lua_State *L)