summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-03-18 13:27:57 -0400
committerCedric BAIL <cedric.bail@free.fr>2019-03-20 12:36:52 -0700
commit4792bb8239e710b80b615d94d24a414581a66024 (patch)
tree0133169959dce360c4e5a5d21319b12be6eb58b8
parentb8ff87fc1d4945ca0a78f9eaffceba1c4a3cb1c0 (diff)
elm_test: move gl api creation to glview init function
this needs to happen when the gl context is current to avoid a billion errors and overall general failure Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D8390
-rw-r--r--src/bin/elementary/test_glview.c2
-rw-r--r--src/bin/elementary/test_glview_manygears.c2
-rw-r--r--src/bin/elementary/test_glview_simple.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/bin/elementary/test_glview.c b/src/bin/elementary/test_glview.c
index edc116d..2ddb819 100644
--- a/src/bin/elementary/test_glview.c
+++ b/src/bin/elementary/test_glview.c
@@ -428,6 +428,7 @@ _init_gl(Evas_Object *obj)
428{ 428{
429 GLData *gld = evas_object_data_get(obj, "gld"); 429 GLData *gld = evas_object_data_get(obj, "gld");
430 430
431 gld->glapi = elm_glview_gl_api_get(obj);
431 printf("GL_VERSION: %s\n", gld->glapi->glGetString(GL_VERSION)); 432 printf("GL_VERSION: %s\n", gld->glapi->glGetString(GL_VERSION));
432 fflush(stdout); 433 fflush(stdout);
433 434
@@ -684,7 +685,6 @@ _test_glview_do(Evas_GL_Context_Version version)
684 685
685 // Animator and other vars 686 // Animator and other vars
686 ani = ecore_animator_add(_anim, gl); 687 ani = ecore_animator_add(_anim, gl);
687 gld->glapi = elm_glview_gl_api_get(gl);
688 evas_object_data_set(gl, "ani", ani); 688 evas_object_data_set(gl, "ani", ani);
689 evas_object_data_set(gl, "gld", gld); 689 evas_object_data_set(gl, "gld", gld);
690 evas_object_event_callback_add(gl, EVAS_CALLBACK_DEL, _del, gl); 690 evas_object_event_callback_add(gl, EVAS_CALLBACK_DEL, _del, gl);
diff --git a/src/bin/elementary/test_glview_manygears.c b/src/bin/elementary/test_glview_manygears.c
index 97e9e88..8ddac2a 100644
--- a/src/bin/elementary/test_glview_manygears.c
+++ b/src/bin/elementary/test_glview_manygears.c
@@ -673,6 +673,7 @@ _init_gl(Evas_Object *obj)
673{ 673{
674 GLData *gld = evas_object_data_get(obj, "gld"); 674 GLData *gld = evas_object_data_get(obj, "gld");
675 if (!gld) return; 675 if (!gld) return;
676 gld->glapi = elm_glview_gl_api_get(obj);
676 677
677 gears_init(gld); 678 gears_init(gld);
678} 679}
@@ -892,7 +893,6 @@ test_glview_manygears(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
892 893
893 // Add animator for rendering 894 // Add animator for rendering
894 ani = ecore_animator_add(_anim, gl); 895 ani = ecore_animator_add(_anim, gl);
895 gld->glapi = elm_glview_gl_api_get(gl);
896 evas_object_data_set(gl, "ani", ani); 896 evas_object_data_set(gl, "ani", ani);
897 evas_object_data_set(gl, "gld", gld); 897 evas_object_data_set(gl, "gld", gld);
898 evas_object_event_callback_add(gl, EVAS_CALLBACK_DEL, _del, gl); 898 evas_object_event_callback_add(gl, EVAS_CALLBACK_DEL, _del, gl);
diff --git a/src/bin/elementary/test_glview_simple.c b/src/bin/elementary/test_glview_simple.c
index ae6eece..d621a98 100644
--- a/src/bin/elementary/test_glview_simple.c
+++ b/src/bin/elementary/test_glview_simple.c
@@ -121,6 +121,7 @@ static void
121_init_gl(Evas_Object *obj) 121_init_gl(Evas_Object *obj)
122{ 122{
123 GL_Data *gld = evas_object_data_get(obj, "gld"); 123 GL_Data *gld = evas_object_data_get(obj, "gld");
124 gld->glapi = elm_glview_gl_api_get(obj);
124 Evas_GL_API *gl = gld->glapi; 125 Evas_GL_API *gl = gld->glapi;
125 GLfloat vVertices[] = { 0.0f, 0.5f, 0.0f, 126 GLfloat vVertices[] = { 0.0f, 0.5f, 0.0f,
126 -0.5f, -0.5f, 0.0f, 127 -0.5f, -0.5f, 0.0f,
@@ -259,7 +260,6 @@ test_glview_simple(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
259 elm_object_focus_set(gl, EINA_TRUE); 260 elm_object_focus_set(gl, EINA_TRUE);
260 261
261 ani = ecore_animator_add(_anim, gl); 262 ani = ecore_animator_add(_anim, gl);
262 gld->glapi = elm_glview_gl_api_get(gl);
263 evas_object_data_set(gl, "gld", gld); 263 evas_object_data_set(gl, "gld", gld);
264 evas_object_event_callback_add(gl, EVAS_CALLBACK_DEL, _gl_del_cb, ani); 264 evas_object_event_callback_add(gl, EVAS_CALLBACK_DEL, _gl_del_cb, ani);
265 } 265 }