mutter/cogl/winsys
Neil Roberts fe3aa8b8b3 Query glX* functions before getting the context to fix GL3 driver
The GL3 context is created using the glXCreateContextAttribs function
which is part of the GLX_ARB_create_context extension. However
previously the function pointers from GLX extensions were only
retrieved once the GL context is created. That meant that the GL3
context creation function would always assume that the extension is
not supported so it would always fail.

This patch changes it to query the functions when the renderer is set
up instead. The base winsys feature flags that are determined while
querying the functions are stored in a member of CoglGLXRenderer.
These are then copied to the CoglContext when it is initialised.

The spec for glXGetProcAddress says that the functions returned are
context-independent. That implies that it is safe to call it without
binding a context although that is not explicitly stated as far as I
can tell. A big of googling finds this DRI documentation which says it
can be used without a context:

http://dri.freedesktop.org/wiki/glXGetProcAddressNeverReturnsNULL

And also this code sample:

http://www.opengl.org/wiki/Tutorial:_OpenGL_3.0_Context_Creation_%28GLX%29

One point that makes me concerned that this might not always work in
practice is that the code in SDL2 to create a GL3 context first
creates a dummy GL2 context in order to have something bound before it
calls glXGetProcAddress. I think this may just be a misunderstanding
based on how wglGetProcAddress works however.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 04a7aca9a98e84e43ac5559305a1358112902e30)
2013-01-22 17:48:18 +00:00
..
cogl-texture-pixmap-x11-private.h texture: add width/height members to base CoglTexture 2013-01-22 17:48:17 +00:00
cogl-texture-pixmap-x11.c Allow lazy texture storage allocation 2013-01-22 17:48:17 +00:00
cogl-texture-pixmap-x11.h Fixes for --disable-glib 2013-01-22 17:48:05 +00:00
cogl-winsys-egl-android-private.h Add a separate winsys vtable for each EGL platform 2011-12-08 17:38:25 +00:00
cogl-winsys-egl-android.c Adds CoglError api 2013-01-22 17:47:39 +00:00
cogl-winsys-egl-feature-functions.h Add a GL 3 driver 2013-01-22 17:48:01 +00:00
cogl-winsys-egl-gdl-private.h Add a separate winsys vtable for each EGL platform 2011-12-08 17:38:25 +00:00
cogl-winsys-egl-gdl.c Adds CoglError api 2013-01-22 17:47:39 +00:00
cogl-winsys-egl-kms-private.h egl: Split out the KMS winsys as overrides of the EGL winsys 2011-12-09 17:29:49 +00:00
cogl-winsys-egl-kms.c Adds CoglError api 2013-01-22 17:47:39 +00:00
cogl-winsys-egl-null-private.h Add a separate winsys vtable for each EGL platform 2011-12-08 17:38:25 +00:00
cogl-winsys-egl-null.c Adds CoglError api 2013-01-22 17:47:39 +00:00
cogl-winsys-egl-private.h Add a GL 3 driver 2013-01-22 17:48:01 +00:00
cogl-winsys-egl-wayland-private.h Add a separate winsys vtable for each EGL platform 2011-12-08 17:38:25 +00:00
cogl-winsys-egl-wayland.c Adds CoglError api 2013-01-22 17:47:39 +00:00
cogl-winsys-egl-x11-private.h Rename the EGL_X11 winsys to EGL_XLIB 2011-12-14 16:40:26 +00:00
cogl-winsys-egl-x11.c texture: add width/height members to base CoglTexture 2013-01-22 17:48:17 +00:00
cogl-winsys-egl.c Add a GL 3 driver 2013-01-22 17:48:01 +00:00
cogl-winsys-glx-feature-functions.h Query glX* functions before getting the context to fix GL3 driver 2013-01-22 17:48:18 +00:00
cogl-winsys-glx-private.h Add -Wmissing-declarations to maintainer flags and fix problems 2012-03-06 18:45:44 +00:00
cogl-winsys-glx.c Query glX* functions before getting the context to fix GL3 driver 2013-01-22 17:48:18 +00:00
cogl-winsys-private.h Adds CoglError api 2013-01-22 17:47:39 +00:00
cogl-winsys-sdl2.c sdl: Bind the default window when currently bound window is destroyed 2013-01-22 17:48:11 +00:00
cogl-winsys-sdl-private.h Add -Wmissing-declarations to maintainer flags and fix problems 2012-03-06 18:45:44 +00:00
cogl-winsys-sdl.c sdl: Support setting resizable before allocate in SDL 1 2013-01-22 17:48:04 +00:00
cogl-winsys-stub-private.h Make stub winsys into a proper winsys backend 2011-06-01 20:44:41 +01:00
cogl-winsys-stub.c Adds CoglError api 2013-01-22 17:47:39 +00:00
cogl-winsys-wgl-feature-functions.h Add a WGL winsys 2011-05-10 17:58:41 +01:00
cogl-winsys-wgl-private.h Add -Wmissing-declarations to maintainer flags and fix problems 2012-03-06 18:45:44 +00:00
cogl-winsys-wgl.c Add a GL 3 driver 2013-01-22 17:48:01 +00:00
cogl-winsys.c Adds CoglError api 2013-01-22 17:47:39 +00:00