summaryrefslogtreecommitdiff
path: root/cogl/cogl.c
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2012-06-20 12:42:31 +0100
committerRobert Bragg <robert@linux.intel.com>2012-08-06 14:27:45 +0100
commitdf77e8565e9822bfcdeb88b380f64f0f303aaef6 (patch)
tree435f6134372a26d28630ef7ea06ca4f39851cc13 /cogl/cogl.c
parent7cdaaf2bd5a528ef5fe11f13cfcd1f7ff5848854 (diff)
downloadcogl-df77e8565e9822bfcdeb88b380f64f0f303aaef6.tar.gz
Don't use eglGetProcAddress to retrieve core functions
According to the EGL spec, eglGetProcAddress should only be used to retrieve extension functions. It also says that returning non-NULL does not mean the extension is available so you could interpret this as saying that the function is allowed to return garbage for core functions. This seems to happen at least for the Android implementation of EGL. To workaround this the winsys's are now passed down a flag to say whether the function is from the core API. This information is already in the gl-prototypes headers as the minimum core GL version and as a pair of flags to specify whether it is available in core GLES1 and GLES2. If the function is in core the EGL winsys will now avoid using eglGetProcAddress and always fallback to querying the library directly with the GModule API. The GLX winsys is left alone because glXGetProcAddress apparently supports querying core API and extension functions. The WGL winsys could ideally be changed because wglGetProcAddress should also only be used for extension functions but the situation is slightly different because WGL considers anything from GL > 1.1 to be an extension so it would need a bit more information to determine whether to query the function directly from the library. The SDL winsys is also left alone because it's not as easy to portably determine which GL library SDL has chosen to load in order to resolve the symbols directly. Reviewed-by: Robert Bragg <robert@linux.intel.com> (cherry picked from commit 72089730ad06ccdd38a344279a893965ae68cec1) Since we aren't able to break API on the 1.12 branch cogl_get_proc_address is still supported but isn't easily able to determine whether the given name corresponds to a core symbol or not. For now we just assume the symbol being queried isn't part of the core GL api and update the documentation accordingly.
Diffstat (limited to 'cogl/cogl.c')
-rw-r--r--cogl/cogl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cogl/cogl.c b/cogl/cogl.c
index a1fa5a72..6ab38c5a 100644
--- a/cogl/cogl.c
+++ b/cogl/cogl.c
@@ -94,7 +94,7 @@ cogl_get_proc_address (const char* name)
{
_COGL_GET_CONTEXT (ctx, NULL);
- return _cogl_renderer_get_proc_address (ctx->display->renderer, name);
+ return _cogl_renderer_get_proc_address (ctx->display->renderer, name, FALSE);
}
CoglBool