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
This commit is contained in:
Mike Blumenkrantz 2019-03-18 13:27:57 -04:00 committed by Cedric BAIL
parent b8ff87fc1d
commit 4792bb8239
3 changed files with 3 additions and 3 deletions

View File

@ -428,6 +428,7 @@ _init_gl(Evas_Object *obj)
{
GLData *gld = evas_object_data_get(obj, "gld");
gld->glapi = elm_glview_gl_api_get(obj);
printf("GL_VERSION: %s\n", gld->glapi->glGetString(GL_VERSION));
fflush(stdout);
@ -684,7 +685,6 @@ _test_glview_do(Evas_GL_Context_Version version)
// Animator and other vars
ani = ecore_animator_add(_anim, gl);
gld->glapi = elm_glview_gl_api_get(gl);
evas_object_data_set(gl, "ani", ani);
evas_object_data_set(gl, "gld", gld);
evas_object_event_callback_add(gl, EVAS_CALLBACK_DEL, _del, gl);

View File

@ -673,6 +673,7 @@ _init_gl(Evas_Object *obj)
{
GLData *gld = evas_object_data_get(obj, "gld");
if (!gld) return;
gld->glapi = elm_glview_gl_api_get(obj);
gears_init(gld);
}
@ -892,7 +893,6 @@ test_glview_manygears(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
// Add animator for rendering
ani = ecore_animator_add(_anim, gl);
gld->glapi = elm_glview_gl_api_get(gl);
evas_object_data_set(gl, "ani", ani);
evas_object_data_set(gl, "gld", gld);
evas_object_event_callback_add(gl, EVAS_CALLBACK_DEL, _del, gl);

View File

@ -121,6 +121,7 @@ static void
_init_gl(Evas_Object *obj)
{
GL_Data *gld = evas_object_data_get(obj, "gld");
gld->glapi = elm_glview_gl_api_get(obj);
Evas_GL_API *gl = gld->glapi;
GLfloat vVertices[] = { 0.0f, 0.5f, 0.0f,
-0.5f, -0.5f, 0.0f,
@ -259,7 +260,6 @@ test_glview_simple(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
elm_object_focus_set(gl, EINA_TRUE);
ani = ecore_animator_add(_anim, gl);
gld->glapi = elm_glview_gl_api_get(gl);
evas_object_data_set(gl, "gld", gld);
evas_object_event_callback_add(gl, EVAS_CALLBACK_DEL, _gl_del_cb, ani);
}