aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/evas/src/lib/canvas/evas_gl.c
diff options
context:
space:
mode:
authorSung Park <sungwoo@gmail.com>2012-01-12 13:54:06 +0000
committerSung Park <sungwoo@gmail.com>2012-01-12 13:54:06 +0000
commit20b3d52669db738a4d95f5765e1aa2744d71a337 (patch)
tree7e7bbda7f323126ed7a35f5861ef603dbc7e7f23 /legacy/evas/src/lib/canvas/evas_gl.c
parentEvas (wayland_egl): Remove printfs (done debugging that). (diff)
downloadefl-20b3d52669db738a4d95f5765e1aa2744d71a337.tar.gz
Added new Evas GL api called evas_gl_config_new/free()
to ensure backward compatibility. Previously, the user simply declared a Evas_GL_Config object but this can cause problems if more config options are added. So, we have Evas allocate the config object for the user so it can handle addition in the future. Also, added some safety code around _extensions_init SVN revision: 67141
Diffstat (limited to 'legacy/evas/src/lib/canvas/evas_gl.c')
-rw-r--r--legacy/evas/src/lib/canvas/evas_gl.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/legacy/evas/src/lib/canvas/evas_gl.c b/legacy/evas/src/lib/canvas/evas_gl.c
index 08edbc44a0..85ed851bb4 100644
--- a/legacy/evas/src/lib/canvas/evas_gl.c
+++ b/legacy/evas/src/lib/canvas/evas_gl.c
@@ -37,6 +37,13 @@ evas_gl_new(Evas *e)
evas_gl->magic = MAGIC_EVAS_GL;
evas_gl->evas = e;
+ if (!evas_gl->evas->engine.func->gl_context_create)
+ {
+ ERR("GL engine not available\n");
+ free(evas_gl);
+ return NULL;
+ }
+
return evas_gl;
}
@@ -60,6 +67,24 @@ evas_gl_free(Evas_GL *evas_gl)
free(evas_gl);
}
+EAPI Evas_GL_Config *
+evas_gl_config_new()
+{
+ Evas_GL_Config *cfg;
+
+ cfg = calloc(1, sizeof(Evas_GL_Config));
+
+ if (!cfg) return NULL;
+
+ return cfg;
+}
+
+EAPI void
+evas_gl_config_free(Evas_GL_Config *cfg)
+{
+ if (cfg) free(cfg);
+}
+
EAPI Evas_GL_Surface *
evas_gl_surface_create(Evas_GL *evas_gl, Evas_GL_Config *config, int width, int height)
{
@@ -77,6 +102,8 @@ evas_gl_surface_create(Evas_GL *evas_gl, Evas_GL_Config *config, int width, int
surf = calloc(1, sizeof(Evas_GL_Surface));
+ if (!surf) return NULL;
+
surf->data = evas_gl->evas->engine.func->gl_surface_create(evas_gl->evas->engine.data.output, config, width, height);
if (!surf->data)
@@ -135,12 +162,6 @@ evas_gl_context_create(Evas_GL *evas_gl, Evas_GL_Context *share_ctx)
return NULL;
}
- if (!evas_gl->evas->engine.func->gl_context_create)
- {
- ERR("GL engine not available\n");
- return NULL;
- }
-
// Call engine->gl_create_context
if (share_ctx)
{