elm_test: (GLView) reset accel_preference after win_add
authorJean-Philippe Andre <jp.andre@samsung.com>
Tue, 7 Apr 2015 06:03:19 +0000 (15:03 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Tue, 7 Apr 2015 06:03:49 +0000 (15:03 +0900)
This might even make the application run with two different engines.

src/bin/test_glview.c

index 4f7c367..6a7dad9 100644 (file)
@@ -617,19 +617,23 @@ test_glview(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
    Evas_Object *win, *bx, *bt, *gl, *lb;
    Ecore_Animator *ani;
    GLData *gld = NULL;
-
-   // since we want a depth buffer and direct rendering, we need the window
-   // itself to have a depth buffer
-   elm_config_accel_preference_set("gl:depth");
+   const char *accel;
 
    // alloc a data struct to hold our relevant gl info in
    if (!(gld = calloc(1, sizeof(GLData)))) return;
    gldata_init(gld);
 
+   // add a Z-depth buffer to the window and try to use GL
+   accel = elm_config_accel_preference_get();
+   elm_config_accel_preference_set("gl:depth");
+
    // new window - do the usual and give it a name, title and delete handler
    win = elm_win_util_standard_add("glview", "GLView");
    elm_win_autodel_set(win, EINA_TRUE);
 
+   // restore previous accel preference
+   elm_config_accel_preference_set(accel);
+
    bx = elm_box_add(win);
    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    elm_win_resize_object_add(win, bx);