diff options
author | David Walter Seikel | 2014-05-03 18:33:58 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-05-03 18:33:58 +1000 |
commit | 3c0fb329ecc4a719bd8d80257298d08f80b1bfd3 (patch) | |
tree | a0bb12ea6772588b90b0d26c855aeb802b6e56c3 /src/extantz/extantz.c | |
parent | Remove Evas_3d example stuff from GuiLua, now that it's in extantz. (diff) | |
download | SledjHamr-3c0fb329ecc4a719bd8d80257298d08f80b1bfd3.zip SledjHamr-3c0fb329ecc4a719bd8d80257298d08f80b1bfd3.tar.gz SledjHamr-3c0fb329ecc4a719bd8d80257298d08f80b1bfd3.tar.bz2 SledjHamr-3c0fb329ecc4a719bd8d80257298d08f80b1bfd3.tar.xz |
Move non GL_View stuff from gld -> ourGlobals. Plus some white space fixes.
Diffstat (limited to '')
-rw-r--r-- | src/extantz/extantz.c | 170 |
1 files changed, 82 insertions, 88 deletions
diff --git a/src/extantz/extantz.c b/src/extantz/extantz.c index 6ef2b75..d1fdf50 100644 --- a/src/extantz/extantz.c +++ b/src/extantz/extantz.c | |||
@@ -8,6 +8,7 @@ static void gldata_init(GLData *gld) | |||
8 | { | 8 | { |
9 | gld->useIrr = USE_IRR; | 9 | gld->useIrr = USE_IRR; |
10 | 10 | ||
11 | #if DO_GEARS | ||
11 | gld->view_rotx = -20.0; | 12 | gld->view_rotx = -20.0; |
12 | gld->view_roty = -30.0; | 13 | gld->view_roty = -30.0; |
13 | gld->view_rotz = 0.0; | 14 | gld->view_rotz = 0.0; |
@@ -16,10 +17,10 @@ static void gldata_init(GLData *gld) | |||
16 | gld->light[0] = 1.0; | 17 | gld->light[0] = 1.0; |
17 | gld->light[1] = 1.0; | 18 | gld->light[1] = 1.0; |
18 | gld->light[2] = -5.0; | 19 | gld->light[2] = -5.0; |
20 | #endif | ||
19 | } | 21 | } |
20 | 22 | ||
21 | 23 | ||
22 | |||
23 | static void _resize_winwin(GLData *gld) | 24 | static void _resize_winwin(GLData *gld) |
24 | { | 25 | { |
25 | Evas_Coord x, y, w, h; | 26 | Evas_Coord x, y, w, h; |
@@ -63,14 +64,15 @@ static void _resize(GLData *gld) | |||
63 | 64 | ||
64 | static void _resize_gl(Evas_Object *obj) | 65 | static void _resize_gl(Evas_Object *obj) |
65 | { | 66 | { |
66 | int w, h; | 67 | globals *ourGlobals = evas_object_data_get(obj, "glob"); |
67 | GLData *gld = evas_object_data_get(obj, "gld"); | 68 | GLData *gld = &ourGlobals->gld; |
68 | 69 | int w, h; | |
69 | elm_glview_size_get(obj, &w, &h); | 70 | if (!ourGlobals) return; |
70 | 71 | ||
71 | gld->img_w = w; | 72 | elm_glview_size_get(obj, &w, &h); |
72 | gld->img_h = h; | 73 | gld->img_w = w; |
73 | _resize(gld); | 74 | gld->img_h = h; |
75 | _resize(gld); | ||
74 | } | 76 | } |
75 | 77 | ||
76 | static void _on_resize(void *data, Evas *evas, Evas_Object *obj, void *event_info) | 78 | static void _on_resize(void *data, Evas *evas, Evas_Object *obj, void *event_info) |
@@ -78,54 +80,51 @@ static void _on_resize(void *data, Evas *evas, Evas_Object *obj, void *event_inf | |||
78 | globals *ourGlobals = data; | 80 | globals *ourGlobals = data; |
79 | GLData *gld = &ourGlobals->gld; | 81 | GLData *gld = &ourGlobals->gld; |
80 | 82 | ||
81 | eo_do(gld->win, evas_obj_size_get(&gld->win_w, &gld->win_h)); | 83 | eo_do(ourGlobals->win, evas_obj_size_get(&ourGlobals->win_w, &ourGlobals->win_h)); |
82 | eo_do(ourGlobals->tb, evas_obj_size_set(gld->win_w, 25)); | 84 | eo_do(ourGlobals->tb, evas_obj_size_set(ourGlobals->win_w, 25)); |
83 | _resize(gld); | 85 | _resize(gld); |
84 | } | 86 | } |
85 | 87 | ||
86 | // Callback from Evas, also used as the general callback for deleting the GL stuff. | 88 | // Callback from Evas, also used as the general callback for deleting the GL stuff. |
87 | static void _clean_gl(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) | 89 | static void _clean_gl(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) |
88 | { | 90 | { |
89 | GLData *gld = data; | 91 | globals *ourGlobals = data; |
92 | GLData *gld = &ourGlobals->gld; | ||
90 | 93 | ||
91 | ecore_animator_del(gld->animator); | 94 | ecore_animator_del(ourGlobals->animator); |
92 | 95 | ||
93 | // Do a make_current before deleting all the GL stuff. | 96 | // Do a make_current before deleting all the GL stuff. |
94 | // evas_gl_make_current(NULL, NULL, NULL); | 97 | // evas_gl_make_current(NULL, NULL, NULL); |
95 | 98 | ||
96 | // TODO - Since this is created on the render thread, better hope this is being deleted on the render thread. | 99 | // TODO - Since this is created on the render thread, better hope this is being deleted on the render thread. |
97 | finishIrr(gld); | 100 | finishIrr(gld); |
98 | 101 | ||
99 | #if DO_GEARS | 102 | #if DO_GEARS |
100 | Evas_GL_API *gl = gld->glApi; | 103 | Evas_GL_API *gl = gld->glApi; |
101 | 104 | ||
102 | gl->glDeleteShader(gld->vtx_shader); | 105 | gl->glDeleteShader(gld->vtx_shader); |
103 | gl->glDeleteShader(gld->fgmt_shader); | 106 | gl->glDeleteShader(gld->fgmt_shader); |
104 | gl->glDeleteProgram(gld->program); | 107 | gl->glDeleteProgram(gld->program); |
105 | 108 | ||
106 | gl->glDeleteBuffers(1, &gld->gear1->vbo); | 109 | gl->glDeleteBuffers(1, &gld->gear1->vbo); |
107 | gl->glDeleteBuffers(1, &gld->gear2->vbo); | 110 | gl->glDeleteBuffers(1, &gld->gear2->vbo); |
108 | gl->glDeleteBuffers(1, &gld->gear3->vbo); | 111 | gl->glDeleteBuffers(1, &gld->gear3->vbo); |
109 | 112 | ||
110 | free_gear(gld->gear1); | 113 | free_gear(gld->gear1); |
111 | free_gear(gld->gear2); | 114 | free_gear(gld->gear2); |
112 | free_gear(gld->gear3); | 115 | free_gear(gld->gear3); |
113 | #endif | 116 | #endif |
117 | |||
118 | evas_object_data_del((Evas_Object*)obj, "glob"); | ||
114 | } | 119 | } |
115 | 120 | ||
116 | // Callback from Elm, coz they do shit different. | 121 | // Callback from Elm, coz they do shit different. |
117 | static void _del_gl(Evas_Object *obj) | 122 | static void _del_gl(Evas_Object *obj) |
118 | { | 123 | { |
119 | GLData *gld = evas_object_data_get(obj, "gld"); | 124 | globals *ourGlobals = evas_object_data_get(obj, "glob"); |
120 | if (!gld) | 125 | if (!ourGlobals) return; |
121 | { | ||
122 | printf("Unable to get GLData. \n"); | ||
123 | return; | ||
124 | } | ||
125 | |||
126 | _clean_gl(gld, NULL, NULL, NULL); | ||
127 | 126 | ||
128 | evas_object_data_del((Evas_Object*)obj, "gld"); | 127 | _clean_gl(ourGlobals, NULL, NULL, NULL); |
129 | } | 128 | } |
130 | 129 | ||
131 | // Callback for when the app quits. | 130 | // Callback for when the app quits. |
@@ -200,42 +199,34 @@ static void init_evas_gl(globals *ourGlobals) | |||
200 | { | 199 | { |
201 | GLData *gld = &ourGlobals->gld; | 200 | GLData *gld = &ourGlobals->gld; |
202 | 201 | ||
203 | gld->sfc_w = gld->win_w; | 202 | gld->sfc_w = ourGlobals->win_w; |
204 | gld->sfc_h = gld->win_h; | 203 | gld->sfc_h = ourGlobals->win_h; |
205 | 204 | ||
206 | if (USE_IRR || DO_GEARS) | 205 | if (USE_IRR || DO_GEARS) |
207 | { | 206 | { |
208 | gld->sfc_h = gld->win_h; | 207 | gld->sfc_h = ourGlobals->win_h; |
209 | |||
210 | // Get the Evas / canvas from the elm window (that the Evas_Object "lives on"), which is itself an Evas_Object created by Elm, so not sure if it was created internally with Ecore_Evas. | ||
211 | gld->canvas = evas_object_evas_get(gld->win); | ||
212 | // An Ecore_Evas holds an Evas. | ||
213 | // Get the Ecore_Evas that wraps an Evas. | ||
214 | gld->ee = ecore_evas_ecore_evas_get(gld->canvas); // Only use this on Evas that was created with Ecore_Evas. | ||
215 | 208 | ||
216 | // Add a GLView | 209 | // Add a GLView |
217 | gld->elmGl = elm_glview_add(gld->win); | 210 | gld->elmGl = elm_glview_add(ourGlobals->win); |
218 | evas_object_size_hint_align_set(gld->elmGl, EVAS_HINT_FILL, EVAS_HINT_FILL); | 211 | evas_object_size_hint_align_set(gld->elmGl, EVAS_HINT_FILL, EVAS_HINT_FILL); |
219 | evas_object_size_hint_weight_set(gld->elmGl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); | 212 | evas_object_size_hint_weight_set(gld->elmGl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); |
220 | elm_glview_mode_set(gld->elmGl, 0 | ELM_GLVIEW_ALPHA | ELM_GLVIEW_DEPTH | ELM_GLVIEW_DIRECT); | 213 | elm_glview_mode_set(gld->elmGl, 0 | ELM_GLVIEW_ALPHA | ELM_GLVIEW_DEPTH | ELM_GLVIEW_DIRECT); |
221 | elm_glview_resize_policy_set(gld->elmGl, ELM_GLVIEW_RESIZE_POLICY_RECREATE); // Destroy the current surface on a resize and create a new one. | 214 | elm_glview_resize_policy_set(gld->elmGl, ELM_GLVIEW_RESIZE_POLICY_RECREATE); // Destroy the current surface on a resize and create a new one. |
222 | elm_glview_render_policy_set(gld->elmGl, ELM_GLVIEW_RENDER_POLICY_ON_DEMAND); | 215 | elm_glview_render_policy_set(gld->elmGl, ELM_GLVIEW_RENDER_POLICY_ON_DEMAND); |
223 | // elm_glview_render_policy_set(gld->elmGl, ELM_GLVIEW_RENDER_POLICY_ALWAYS); | 216 | // elm_glview_render_policy_set(gld->elmGl, ELM_GLVIEW_RENDER_POLICY_ALWAYS); |
217 | |||
218 | gld->glApi = elm_glview_gl_api_get(gld->elmGl); | ||
219 | evas_object_data_set(gld->elmGl, "glob", ourGlobals); | ||
224 | // These get called in the render thread I think. | 220 | // These get called in the render thread I think. |
225 | // None let me pass data, so this is why we are adding "gld" data to the object below. | 221 | // None let me pass data, so this is why we are adding "glob" data to the object above. |
226 | // Maybe we can use elm_object_signal_callback_add or elm_object_item_signal_callback_add (edje signals)? | 222 | // Maybe we can use elm_object_signal_callback_add or elm_object_item_signal_callback_add (edje signals)? |
227 | //elm_glview_init_func_set(gld->elmGl, _init_gl); // Not actually needed, it gets done in on_pixels. | 223 | //elm_glview_init_func_set(gld->elmGl, _init_gl); // Not actually needed, it gets done in on_pixels. |
228 | elm_glview_del_func_set(gld->elmGl, _del_gl); | 224 | elm_glview_del_func_set(gld->elmGl, _del_gl); |
229 | elm_glview_resize_func_set(gld->elmGl, _resize_gl); | 225 | elm_glview_resize_func_set(gld->elmGl, _resize_gl); |
230 | elm_glview_render_func_set(gld->elmGl, (Elm_GLView_Func_Cb) _draw_gl); | 226 | elm_glview_render_func_set(gld->elmGl, (Elm_GLView_Func_Cb) _draw_gl); |
231 | 227 | ||
232 | // Not needed, the resize callback above deals with that. | ||
233 | //elm_win_resize_object_add(gld->win, gld->elmGl); | ||
234 | gld->glApi = elm_glview_gl_api_get(gld->elmGl); | ||
235 | evas_object_data_set(gld->elmGl, "gld", gld); | ||
236 | evas_object_data_set(gld->elmGl, "glob", ourGlobals); | ||
237 | evas_object_show(gld->elmGl); | 228 | evas_object_show(gld->elmGl); |
238 | elm_box_pack_end(gld->bx, gld->elmGl); | 229 | elm_box_pack_end(ourGlobals->bx, gld->elmGl); |
239 | } | 230 | } |
240 | 231 | ||
241 | // TODO - apparently the proper way to deal with the new async rendering is to have this animator do the dirty thing, and call the Irrlicht rendering stuff in the _draw_gl call set above. | 232 | // TODO - apparently the proper way to deal with the new async rendering is to have this animator do the dirty thing, and call the Irrlicht rendering stuff in the _draw_gl call set above. |
@@ -243,7 +234,7 @@ static void init_evas_gl(globals *ourGlobals) | |||
243 | 234 | ||
244 | // Jiggling this seems to produce a trade off between flickering and frame rate. Nothing else changed the flickering. | 235 | // Jiggling this seems to produce a trade off between flickering and frame rate. Nothing else changed the flickering. |
245 | ecore_animator_frametime_set(0.04); // Default is 1/30, or 0.033333 | 236 | ecore_animator_frametime_set(0.04); // Default is 1/30, or 0.033333 |
246 | gld->animator = ecore_animator_add(doFrame, ourGlobals); // This animator will be called every frame tick, which defaults to 1/30 seconds. | 237 | ourGlobals->animator = ecore_animator_add(doFrame, ourGlobals); // This animator will be called every frame tick, which defaults to 1/30 seconds. |
247 | 238 | ||
248 | return; | 239 | return; |
249 | } | 240 | } |
@@ -274,29 +265,29 @@ static void makeMainMenu(globals *ourGlobals) | |||
274 | Elm_Object_Item *tb_it; | 265 | Elm_Object_Item *tb_it; |
275 | 266 | ||
276 | // A toolbar thingy. | 267 | // A toolbar thingy. |
277 | tb = eo_add(ELM_OBJ_TOOLBAR_CLASS, gld->win); | 268 | tb = eo_add(ELM_OBJ_TOOLBAR_CLASS, ourGlobals->win); |
278 | ourGlobals->tb = tb; | 269 | ourGlobals->tb = tb; |
279 | eo_do(tb, | 270 | eo_do(tb, |
280 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, 0.0), | 271 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, 0.0), |
281 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), | 272 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), |
282 | elm_obj_toolbar_shrink_mode_set(ELM_TOOLBAR_SHRINK_MENU), | 273 | elm_obj_toolbar_shrink_mode_set(ELM_TOOLBAR_SHRINK_MENU), |
283 | evas_obj_size_set(gld->win_w, 25), | 274 | evas_obj_size_set(ourGlobals->win_w, 25), |
284 | evas_obj_position_set(0, 0), | 275 | evas_obj_position_set(0, 0), |
285 | elm_obj_toolbar_align_set(0.0) | 276 | elm_obj_toolbar_align_set(0.0) |
286 | ); | 277 | ); |
287 | 278 | ||
288 | // Menus. | 279 | // Menus. |
289 | menu = _toolbar_menu_add(gld->win, tb, "file"); | 280 | menu = _toolbar_menu_add(ourGlobals->win, tb, "file"); |
290 | elm_menu_item_add(menu, NULL, NULL, "quit", _on_done, gld); | 281 | elm_menu_item_add(menu, NULL, NULL, "quit", _on_done, gld); |
291 | 282 | ||
292 | menu = _toolbar_menu_add(gld->win, tb, "edit"); | 283 | menu = _toolbar_menu_add(ourGlobals->win, tb, "edit"); |
293 | elm_menu_item_add(menu, NULL, NULL, "preferences", NULL, NULL); | 284 | elm_menu_item_add(menu, NULL, NULL, "preferences", NULL, NULL); |
294 | 285 | ||
295 | menu = _toolbar_menu_add(gld->win, tb, "view"); | 286 | menu = _toolbar_menu_add(ourGlobals->win, tb, "view"); |
296 | menu = _toolbar_menu_add(gld->win, tb, "world"); | 287 | menu = _toolbar_menu_add(ourGlobals->win, tb, "world"); |
297 | menu = _toolbar_menu_add(gld->win, tb, "tools"); | 288 | menu = _toolbar_menu_add(ourGlobals->win, tb, "tools"); |
298 | 289 | ||
299 | menu = _toolbar_menu_add(gld->win, tb, "help"); | 290 | menu = _toolbar_menu_add(ourGlobals->win, tb, "help"); |
300 | elm_menu_item_add(menu, NULL, NULL, "grid help", NULL, NULL); | 291 | elm_menu_item_add(menu, NULL, NULL, "grid help", NULL, NULL); |
301 | elm_menu_item_separator_add(menu, NULL); | 292 | elm_menu_item_separator_add(menu, NULL); |
302 | elm_menu_item_add(menu, NULL, NULL, "extantz blogs", NULL, NULL); | 293 | elm_menu_item_add(menu, NULL, NULL, "extantz blogs", NULL, NULL); |
@@ -304,10 +295,10 @@ static void makeMainMenu(globals *ourGlobals) | |||
304 | elm_menu_item_separator_add(menu, NULL); | 295 | elm_menu_item_separator_add(menu, NULL); |
305 | elm_menu_item_add(menu, NULL, NULL, "about extantz", NULL, NULL); | 296 | elm_menu_item_add(menu, NULL, NULL, "about extantz", NULL, NULL); |
306 | 297 | ||
307 | menu = _toolbar_menu_add(gld->win, tb, "advanced"); | 298 | menu = _toolbar_menu_add(ourGlobals->win, tb, "advanced"); |
308 | elm_menu_item_add(menu, NULL, NULL, "debug settings", NULL, NULL); | 299 | elm_menu_item_add(menu, NULL, NULL, "debug settings", NULL, NULL); |
309 | 300 | ||
310 | menu = _toolbar_menu_add(gld->win, tb, "god"); | 301 | menu = _toolbar_menu_add(ourGlobals->win, tb, "god"); |
311 | 302 | ||
312 | // Other stuff in the toolbar. | 303 | // Other stuff in the toolbar. |
313 | tb_it = elm_toolbar_item_append(tb, NULL, NULL, NULL, NULL); | 304 | tb_it = elm_toolbar_item_append(tb, NULL, NULL, NULL, NULL); |
@@ -354,30 +345,33 @@ EAPI_MAIN int elm_main(int argc, char **argv) | |||
354 | 345 | ||
355 | // Set the engine to opengl_x11, then open our window. | 346 | // Set the engine to opengl_x11, then open our window. |
356 | elm_config_preferred_engine_set("opengl_x11"); | 347 | elm_config_preferred_engine_set("opengl_x11"); |
357 | gld->win = elm_win_util_standard_add("extantz", "extantz virtual world viewer"); | 348 | ourGlobals.win = elm_win_util_standard_add("extantz", "extantz virtual world viewer"); |
358 | ourGlobals.win = gld->win; | ||
359 | // Get the Evas / canvas from the elm window (that the Evas_Object "lives on"), which is itself an Evas_Object created by Elm, so not sure if it was created internally with Ecore_Evas. | ||
360 | ourGlobals.evas = evas_object_evas_get(gld->win); | ||
361 | |||
362 | // Set preferred engine back to default from config | 349 | // Set preferred engine back to default from config |
363 | elm_config_preferred_engine_set(NULL); | 350 | elm_config_preferred_engine_set(NULL); |
364 | 351 | ||
352 | // TODO, or not TODO - I keep getting rid of these, but keep bringing them back. Leave ee commented for now. | ||
353 | // Get the Evas / canvas from the elm window (that the Evas_Object "lives on"), which is itself an Evas_Object created by Elm, so not sure if it was created internally with Ecore_Evas. | ||
354 | ourGlobals.evas = evas_object_evas_get(ourGlobals.win); | ||
355 | // An Ecore_Evas holds an Evas. | ||
356 | // Get the Ecore_Evas that wraps an Evas. | ||
357 | //ourGlobals.ee = ecore_evas_ecore_evas_get(ourGlobals.evas); // Only use this on Evas that was created with Ecore_Evas. | ||
358 | |||
365 | #if USE_PHYSICS | 359 | #if USE_PHYSICS |
366 | if (!ephysics_init()) | 360 | if (!ephysics_init()) |
367 | return 1; | 361 | return 1; |
368 | #endif | 362 | #endif |
369 | 363 | ||
370 | evas_object_smart_callback_add(gld->win, "delete,request", _on_done, gld); | 364 | evas_object_smart_callback_add(ourGlobals.win, "delete,request", _on_done, gld); |
371 | evas_object_event_callback_add(gld->win, EVAS_CALLBACK_RESIZE, _on_resize, &ourGlobals); | 365 | evas_object_event_callback_add(ourGlobals.win, EVAS_CALLBACK_RESIZE, _on_resize, &ourGlobals); |
372 | 366 | ||
373 | // Get the screen size. | 367 | // Get the screen size. |
374 | elm_win_screen_size_get(gld->win, &gld->win_x, &gld->win_y, &gld->scr_w, &gld->scr_h); | 368 | elm_win_screen_size_get(ourGlobals.win, &ourGlobals.win_x, &ourGlobals.win_y, &ourGlobals.scr_w, &ourGlobals.scr_h); |
375 | gld->win_x = gld->win_x + (gld->scr_w / 3); | 369 | ourGlobals.win_x = ourGlobals.win_x + (ourGlobals.scr_w / 3); |
376 | gld->win_w = gld->scr_w / 2; | 370 | ourGlobals.win_w = ourGlobals.scr_w / 2; |
377 | gld->win_h = gld->scr_h - 30; | 371 | ourGlobals.win_h = ourGlobals.scr_h - 30; |
378 | 372 | ||
379 | // Add a background image object. | 373 | // Add a background image object. |
380 | obj = eo_add(ELM_OBJ_IMAGE_CLASS, gld->win); | 374 | obj = eo_add(ELM_OBJ_IMAGE_CLASS, ourGlobals.win); |
381 | snprintf(buf, sizeof(buf), "%s/sky_03.jpg", elm_app_data_dir_get()); | 375 | snprintf(buf, sizeof(buf), "%s/sky_03.jpg", elm_app_data_dir_get()); |
382 | eo_do(obj, | 376 | eo_do(obj, |
383 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), | 377 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), |
@@ -385,20 +379,20 @@ EAPI_MAIN int elm_main(int argc, char **argv) | |||
385 | elm_obj_image_file_set(buf, NULL), | 379 | elm_obj_image_file_set(buf, NULL), |
386 | evas_obj_visibility_set(EINA_TRUE) | 380 | evas_obj_visibility_set(EINA_TRUE) |
387 | ); | 381 | ); |
388 | elm_win_resize_object_add(gld->win, obj); | 382 | elm_win_resize_object_add(ourGlobals.win, obj); |
389 | eo_unref(obj); | 383 | eo_unref(obj); |
390 | 384 | ||
391 | gld->bx = eo_add(ELM_OBJ_BOX_CLASS, gld->win); | 385 | ourGlobals.bx = eo_add(ELM_OBJ_BOX_CLASS, ourGlobals.win); |
392 | eo_do(gld->bx, | 386 | eo_do(ourGlobals.bx, |
393 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), | 387 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), |
394 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), | 388 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), |
395 | evas_obj_visibility_set(EINA_TRUE) | 389 | evas_obj_visibility_set(EINA_TRUE) |
396 | ); | 390 | ); |
397 | elm_win_resize_object_add(gld->win, gld->bx); | 391 | elm_win_resize_object_add(ourGlobals.win, ourGlobals.bx); |
398 | 392 | ||
399 | // overlay_add(gld); | 393 | // overlay_add(&ourGlobals); |
400 | woMan_add(gld); | 394 | woMan_add(&ourGlobals); |
401 | chat_add(gld); | 395 | chat_add(&ourGlobals); |
402 | 396 | ||
403 | // Gotta do this after adding the windows, otherwise the menu renders under the window. | 397 | // Gotta do this after adding the windows, otherwise the menu renders under the window. |
404 | // This sucks, gotta redefine this menu each time we create a new window? | 398 | // This sucks, gotta redefine this menu each time we create a new window? |
@@ -413,12 +407,12 @@ EAPI_MAIN int elm_main(int argc, char **argv) | |||
413 | evas_object_image_pixels_get_callback_set(elm_image_object_get(ourGlobals.scene->image), on_pixels, &ourGlobals); | 407 | evas_object_image_pixels_get_callback_set(elm_image_object_get(ourGlobals.scene->image), on_pixels, &ourGlobals); |
414 | 408 | ||
415 | #if USE_PHYSICS | 409 | #if USE_PHYSICS |
416 | world = ephysicsAdd(gld); | 410 | world = ephysicsAdd(&ourGlobals); |
417 | #endif | 411 | #endif |
418 | 412 | ||
419 | evas_object_move(gld->win, gld->win_x, gld->win_y); | 413 | evas_object_move(ourGlobals.win, ourGlobals.win_x, ourGlobals.win_y); |
420 | evas_object_resize(gld->win, gld->win_w, gld->win_h); | 414 | evas_object_resize(ourGlobals.win, ourGlobals.win_w, ourGlobals.win_h); |
421 | evas_object_show(gld->win); | 415 | evas_object_show(ourGlobals.win); |
422 | 416 | ||
423 | _resize_winwin(gld); | 417 | _resize_winwin(gld); |
424 | 418 | ||
@@ -429,12 +423,12 @@ EAPI_MAIN int elm_main(int argc, char **argv) | |||
429 | ephysics_shutdown(); | 423 | ephysics_shutdown(); |
430 | #endif | 424 | #endif |
431 | 425 | ||
432 | if (gld->win) | 426 | if (ourGlobals. win) |
433 | { | 427 | { |
434 | Evas_3D_Demo_fini(&ourGlobals); | 428 | Evas_3D_Demo_fini(&ourGlobals); |
435 | eo_unref(ourGlobals.tb); | 429 | eo_unref(ourGlobals.tb); |
436 | eo_unref(gld->bx); | 430 | eo_unref(ourGlobals.bx); |
437 | evas_object_del(gld->win); | 431 | evas_object_del(ourGlobals.win); |
438 | } | 432 | } |
439 | 433 | ||
440 | if (ourGlobals.logDom >= 0) | 434 | if (ourGlobals.logDom >= 0) |