summaryrefslogtreecommitdiff
path: root/lib/mesa/src/glx/glxcmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mesa/src/glx/glxcmds.c')
-rw-r--r--lib/mesa/src/glx/glxcmds.c249
1 files changed, 87 insertions, 162 deletions
diff --git a/lib/mesa/src/glx/glxcmds.c b/lib/mesa/src/glx/glxcmds.c
index a3af417a6..93e8db5a3 100644
--- a/lib/mesa/src/glx/glxcmds.c
+++ b/lib/mesa/src/glx/glxcmds.c
@@ -54,7 +54,6 @@
#include <X11/Xlib-xcb.h>
#include <xcb/xcb.h>
#include <xcb/glx.h>
-#include "GL/mesa_glinterop.h"
static const char __glXGLXClientVendorName[] = "Mesa Project and SGI";
static const char __glXGLXClientVersion[] = "1.4";
@@ -374,7 +373,7 @@ CreateContext(Display *dpy, int generic_id, struct glx_config *config,
return (GLXContext) gc;
}
-_GLX_PUBLIC GLXContext
+_X_EXPORT GLXContext
glXCreateContext(Display * dpy, XVisualInfo * vis,
GLXContext shareList, Bool allowDirect)
{
@@ -451,7 +450,7 @@ glx_send_destroy_context(Display *dpy, XID xid)
** Destroy the named context
*/
-_GLX_PUBLIC void
+_X_EXPORT void
glXDestroyContext(Display * dpy, GLXContext ctx)
{
struct glx_context *gc = (struct glx_context *) ctx;
@@ -479,7 +478,7 @@ glXDestroyContext(Display * dpy, GLXContext ctx)
/*
** Return the major and minor version #s for the GLX extension
*/
-_GLX_PUBLIC Bool
+_X_EXPORT Bool
glXQueryVersion(Display * dpy, int *major, int *minor)
{
struct glx_display *priv;
@@ -499,7 +498,7 @@ glXQueryVersion(Display * dpy, int *major, int *minor)
/*
** Query the existence of the GLX extension
*/
-_GLX_PUBLIC Bool
+_X_EXPORT Bool
glXQueryExtension(Display * dpy, int *errorBase, int *eventBase)
{
int major_op, erb, evb;
@@ -519,12 +518,12 @@ glXQueryExtension(Display * dpy, int *errorBase, int *eventBase)
** Put a barrier in the token stream that forces the GL to finish its
** work before X can proceed.
*/
-_GLX_PUBLIC void
+_X_EXPORT void
glXWaitGL(void)
{
struct glx_context *gc = __glXGetCurrentContext();
- if (gc != &dummyContext && gc->vtable->wait_gl)
+ if (gc && gc->vtable->wait_gl)
gc->vtable->wait_gl(gc);
}
@@ -532,21 +531,21 @@ glXWaitGL(void)
** Put a barrier in the token stream that forces X to finish its
** work before GL can proceed.
*/
-_GLX_PUBLIC void
+_X_EXPORT void
glXWaitX(void)
{
struct glx_context *gc = __glXGetCurrentContext();
- if (gc != &dummyContext && gc->vtable->wait_x)
+ if (gc && gc->vtable->wait_x)
gc->vtable->wait_x(gc);
}
-_GLX_PUBLIC void
+_X_EXPORT void
glXUseXFont(Font font, int first, int count, int listBase)
{
struct glx_context *gc = __glXGetCurrentContext();
- if (gc != &dummyContext && gc->vtable->use_x_font)
+ if (gc && gc->vtable->use_x_font)
gc->vtable->use_x_font(gc, font, first, count, listBase);
}
@@ -556,7 +555,7 @@ glXUseXFont(Font font, int first, int count, int listBase)
** Copy the source context to the destination context using the
** attribute "mask".
*/
-_GLX_PUBLIC void
+_X_EXPORT void
glXCopyContext(Display * dpy, GLXContext source_user,
GLXContext dest_user, unsigned long mask)
{
@@ -657,7 +656,7 @@ __glXIsDirect(Display * dpy, GLXContextID contextID)
* \c GLX_DIRECT_RENDERING is not defined? Do we really need to bother with
* the GLX protocol here at all?
*/
-_GLX_PUBLIC Bool
+_X_EXPORT Bool
glXIsDirect(Display * dpy, GLXContext gc_user)
{
struct glx_context *gc = (struct glx_context *) gc_user;
@@ -675,7 +674,7 @@ glXIsDirect(Display * dpy, GLXContext gc_user)
#endif
}
-_GLX_PUBLIC GLXPixmap
+_X_EXPORT GLXPixmap
glXCreateGLXPixmap(Display * dpy, XVisualInfo * vis, Pixmap pixmap)
{
#ifdef GLX_USE_APPLEGL
@@ -775,7 +774,7 @@ glXCreateGLXPixmap(Display * dpy, XVisualInfo * vis, Pixmap pixmap)
/*
** Destroy the named pixmap
*/
-_GLX_PUBLIC void
+_X_EXPORT void
glXDestroyGLXPixmap(Display * dpy, GLXPixmap glxpixmap)
{
#ifdef GLX_USE_APPLEGL
@@ -815,12 +814,12 @@ glXDestroyGLXPixmap(Display * dpy, GLXPixmap glxpixmap)
#endif /* GLX_USE_APPLEGL */
}
-_GLX_PUBLIC void
+_X_EXPORT void
glXSwapBuffers(Display * dpy, GLXDrawable drawable)
{
#ifdef GLX_USE_APPLEGL
struct glx_context * gc = __glXGetCurrentContext();
- if(gc != &DummyContext && apple_glx_is_current_drawable(dpy, gc->driContext, drawable)) {
+ if(gc && apple_glx_is_current_drawable(dpy, gc->driContext, drawable)) {
apple_glx_swap_buffers(gc->driContext);
} else {
__glXSendError(dpy, GLXBadCurrentWindow, 0, X_GLXSwapBuffers, false);
@@ -838,7 +837,7 @@ glXSwapBuffers(Display * dpy, GLXDrawable drawable)
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
if (pdraw != NULL) {
- Bool flush = gc != &dummyContext && drawable == gc->currentDrawable;
+ Bool flush = gc && drawable == gc->currentDrawable;
(*pdraw->psc->driScreen->swapBuffers)(pdraw, 0, 0, 0, flush);
return;
@@ -855,7 +854,7 @@ glXSwapBuffers(Display * dpy, GLXDrawable drawable)
** The calling thread may or may not have a current context. If it
** does, send the context tag so the server can do a flush.
*/
- if ((gc != &dummyContext) && (dpy == gc->currentDpy) &&
+ if ((gc != NULL) && (dpy == gc->currentDpy) &&
((drawable == gc->currentDrawable)
|| (drawable == gc->currentReadable))) {
tag = gc->currentContextTag;
@@ -875,7 +874,7 @@ glXSwapBuffers(Display * dpy, GLXDrawable drawable)
** Return configuration information for the given display, screen and
** visual combination.
*/
-_GLX_PUBLIC int
+_X_EXPORT int
glXGetConfig(Display * dpy, XVisualInfo * vis, int attribute,
int *value_return)
{
@@ -1162,8 +1161,8 @@ fbconfig_compare(struct glx_config **a, struct glx_config **b)
/**
* Selects and sorts a subset of the supplied configs based on the attributes.
- * This function forms to basis of \c glXChooseFBConfig and
- * \c glXChooseFBConfigSGIX.
+ * This function forms to basis of \c glXChooseVisual, \c glXChooseFBConfig,
+ * and \c glXChooseFBConfigSGIX.
*
* \param configs Array of pointers to possible configs. The elements of
* this array that do not meet the criteria will be set to
@@ -1171,16 +1170,20 @@ fbconfig_compare(struct glx_config **a, struct glx_config **b)
* the various visual / FBConfig selection rules.
* \param num_configs Number of elements in the \c configs array.
* \param attribList Attributes used select from \c configs. This array is
- * terminated by a \c None tag. The array is of the form
- * expected by \c glXChooseFBConfig (where every tag has a
- * value).
+ * terminated by a \c None tag. The array can either take
+ * the form expected by \c glXChooseVisual (where boolean
+ * tags do not have a value) or by \c glXChooseFBConfig
+ * (where every tag has a value).
+ * \param fbconfig_style_tags Selects whether \c attribList is in
+ * \c glXChooseVisual style or
+ * \c glXChooseFBConfig style.
* \returns The number of valid elements left in \c configs.
*
- * \sa glXChooseFBConfig, glXChooseFBConfigSGIX
+ * \sa glXChooseVisual, glXChooseFBConfig, glXChooseFBConfigSGIX
*/
static int
-choose_fbconfig(struct glx_config ** configs, int num_configs,
- const int *attribList)
+choose_visual(struct glx_config ** configs, int num_configs,
+ const int *attribList, GLboolean fbconfig_style_tags)
{
struct glx_config test_config;
int base;
@@ -1192,10 +1195,10 @@ choose_fbconfig(struct glx_config ** configs, int num_configs,
* list.
*/
- init_fbconfig_for_chooser(&test_config, GL_TRUE);
+ init_fbconfig_for_chooser(&test_config, fbconfig_style_tags);
__glXInitializeVisualConfigFromTags(&test_config, 512,
(const INT32 *) attribList,
- GL_TRUE, GL_TRUE);
+ GL_TRUE, fbconfig_style_tags);
base = 0;
for (i = 0; i < num_configs; i++) {
@@ -1230,7 +1233,7 @@ choose_fbconfig(struct glx_config ** configs, int num_configs,
** Return the visual that best matches the template. Return None if no
** visual matches the template.
*/
-_GLX_PUBLIC XVisualInfo *
+_X_EXPORT XVisualInfo *
glXChooseVisual(Display * dpy, int screen, int *attribList)
{
XVisualInfo *visualList = NULL;
@@ -1296,7 +1299,7 @@ glXChooseVisual(Display * dpy, int screen, int *attribList)
}
-_GLX_PUBLIC const char *
+_X_EXPORT const char *
glXQueryExtensionsString(Display * dpy, int screen)
{
struct glx_screen *psc;
@@ -1325,7 +1328,7 @@ glXQueryExtensionsString(Display * dpy, int screen)
return psc->effectiveGLXexts;
}
-_GLX_PUBLIC const char *
+_X_EXPORT const char *
glXGetClientString(Display * dpy, int name)
{
(void) dpy;
@@ -1342,7 +1345,7 @@ glXGetClientString(Display * dpy, int name)
}
}
-_GLX_PUBLIC const char *
+_X_EXPORT const char *
glXQueryServerString(Display * dpy, int screen, int name)
{
struct glx_screen *psc;
@@ -1380,21 +1383,21 @@ glXQueryServerString(Display * dpy, int screen, int name)
** EXT_import_context
*/
-_GLX_PUBLIC Display *
+_X_EXPORT Display *
glXGetCurrentDisplay(void)
{
struct glx_context *gc = __glXGetCurrentContext();
- if (gc == &dummyContext)
+ if (NULL == gc)
return NULL;
return gc->currentDpy;
}
-_GLX_PUBLIC
+_X_EXPORT
GLX_ALIAS(Display *, glXGetCurrentDisplayEXT, (void), (),
glXGetCurrentDisplay)
#ifndef GLX_USE_APPLEGL
-_GLX_PUBLIC GLXContext
+_X_EXPORT GLXContext
glXImportContextEXT(Display *dpy, GLXContextID contextID)
{
struct glx_display *priv = __glXInitialize(dpy);
@@ -1533,7 +1536,7 @@ glXImportContextEXT(Display *dpy, GLXContextID contextID)
#endif
-_GLX_PUBLIC int
+_X_EXPORT int
glXQueryContext(Display * dpy, GLXContext ctx_user, int attribute, int *value)
{
struct glx_context *ctx = (struct glx_context *) ctx_user;
@@ -1560,19 +1563,19 @@ glXQueryContext(Display * dpy, GLXContext ctx_user, int attribute, int *value)
return Success;
}
-_GLX_PUBLIC
+_X_EXPORT
GLX_ALIAS(int, glXQueryContextInfoEXT,
(Display * dpy, GLXContext ctx, int attribute, int *value),
(dpy, ctx, attribute, value), glXQueryContext)
-_GLX_PUBLIC GLXContextID glXGetContextIDEXT(const GLXContext ctx_user)
+_X_EXPORT GLXContextID glXGetContextIDEXT(const GLXContext ctx_user)
{
struct glx_context *ctx = (struct glx_context *) ctx_user;
return (ctx == NULL) ? None : ctx->xid;
}
-_GLX_PUBLIC void
+_X_EXPORT void
glXFreeContextEXT(Display *dpy, GLXContext ctx)
{
struct glx_context *gc = (struct glx_context *) ctx;
@@ -1597,7 +1600,7 @@ glXFreeContextEXT(Display *dpy, GLXContext ctx)
__glXUnlock();
}
-_GLX_PUBLIC GLXFBConfig *
+_X_EXPORT GLXFBConfig *
glXChooseFBConfig(Display * dpy, int screen,
const int *attribList, int *nitems)
{
@@ -1609,7 +1612,7 @@ glXChooseFBConfig(Display * dpy, int screen,
glXGetFBConfigs(dpy, screen, &list_size);
if ((config_list != NULL) && (list_size > 0) && (attribList != NULL)) {
- list_size = choose_fbconfig(config_list, list_size, attribList);
+ list_size = choose_visual(config_list, list_size, attribList, GL_TRUE);
if (list_size == 0) {
free(config_list);
config_list = NULL;
@@ -1621,33 +1624,11 @@ glXChooseFBConfig(Display * dpy, int screen,
}
-_GLX_PUBLIC GLXContext
+_X_EXPORT GLXContext
glXCreateNewContext(Display * dpy, GLXFBConfig fbconfig,
int renderType, GLXContext shareList, Bool allowDirect)
{
struct glx_config *config = (struct glx_config *) fbconfig;
- struct glx_config **config_list;
- int list_size;
- unsigned i;
-
- if (!config) {
- __glXSendError(dpy, GLXBadFBConfig, 0, X_GLXCreateNewContext, false);
- return NULL;
- }
-
- config_list = (struct glx_config **)
- glXGetFBConfigs(dpy, config->screen, &list_size);
-
- for (i = 0; i < list_size; i++) {
- if (config_list[i] == config)
- break;
- }
- free(config_list);
-
- if (i == list_size) {
- __glXSendError(dpy, GLXBadFBConfig, 0, X_GLXCreateNewContext, false);
- return NULL;
- }
return CreateContext(dpy, config->fbconfigID, config, shareList,
allowDirect, X_GLXCreateNewContext, renderType,
@@ -1655,7 +1636,7 @@ glXCreateNewContext(Display * dpy, GLXFBConfig fbconfig,
}
-_GLX_PUBLIC GLXDrawable
+_X_EXPORT GLXDrawable
glXGetCurrentReadDrawable(void)
{
struct glx_context *gc = __glXGetCurrentContext();
@@ -1664,7 +1645,7 @@ glXGetCurrentReadDrawable(void)
}
-_GLX_PUBLIC GLXFBConfig *
+_X_EXPORT GLXFBConfig *
glXGetFBConfigs(Display * dpy, int screen, int *nelements)
{
struct glx_display *priv = __glXInitialize(dpy);
@@ -1675,7 +1656,7 @@ glXGetFBConfigs(Display * dpy, int screen, int *nelements)
*nelements = 0;
if (priv && (priv->screens != NULL)
- && (screen >= 0) && (screen < ScreenCount(dpy))
+ && (screen >= 0) && (screen <= ScreenCount(dpy))
&& (priv->screens[screen]->configs != NULL)
&& (priv->screens[screen]->configs->fbconfigID
!= (int) GLX_DONT_CARE)) {
@@ -1705,7 +1686,7 @@ glXGetFBConfigs(Display * dpy, int screen, int *nelements)
}
-_GLX_PUBLIC int
+_X_EXPORT int
glXGetFBConfigAttrib(Display * dpy, GLXFBConfig fbconfig,
int attribute, int *value)
{
@@ -1718,7 +1699,7 @@ glXGetFBConfigAttrib(Display * dpy, GLXFBConfig fbconfig,
}
-_GLX_PUBLIC XVisualInfo *
+_X_EXPORT XVisualInfo *
glXGetVisualFromFBConfig(Display * dpy, GLXFBConfig fbconfig)
{
XVisualInfo visualTemplate;
@@ -1746,7 +1727,7 @@ __glXSwapIntervalSGI(int interval)
CARD32 *interval_ptr;
CARD8 opcode;
- if (gc == &dummyContext) {
+ if (gc == NULL) {
return GLX_BAD_CONTEXT;
}
@@ -1761,11 +1742,7 @@ __glXSwapIntervalSGI(int interval)
psc->driScreen->setSwapInterval) {
__GLXDRIdrawable *pdraw =
GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable);
- /* Simply ignore the command if the GLX drawable has been destroyed but
- * the context is still bound.
- */
- if (pdraw)
- psc->driScreen->setSwapInterval(pdraw, interval);
+ psc->driScreen->setSwapInterval(pdraw, interval);
return 0;
}
#endif
@@ -1804,21 +1781,14 @@ __glXSwapIntervalMESA(unsigned int interval)
#ifdef GLX_DIRECT_RENDERING
struct glx_context *gc = __glXGetCurrentContext();
- if (gc != &dummyContext && gc->isDirect) {
+ if (gc != NULL && gc->isDirect) {
struct glx_screen *psc;
psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen);
if (psc && psc->driScreen && psc->driScreen->setSwapInterval) {
__GLXDRIdrawable *pdraw =
GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable);
-
- /* Simply ignore the command if the GLX drawable has been destroyed but
- * the context is still bound.
- */
- if (!pdraw)
- return 0;
-
- return psc->driScreen->setSwapInterval(pdraw, interval);
+ return psc->driScreen->setSwapInterval(pdraw, interval);
}
}
#endif
@@ -1833,15 +1803,14 @@ __glXGetSwapIntervalMESA(void)
#ifdef GLX_DIRECT_RENDERING
struct glx_context *gc = __glXGetCurrentContext();
- if (gc != &dummyContext && gc->isDirect) {
+ if (gc != NULL && gc->isDirect) {
struct glx_screen *psc;
psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen);
if (psc && psc->driScreen && psc->driScreen->getSwapInterval) {
__GLXDRIdrawable *pdraw =
GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable);
- if (pdraw)
- return psc->driScreen->getSwapInterval(pdraw);
+ return psc->driScreen->getSwapInterval(pdraw);
}
}
#endif
@@ -1864,7 +1833,7 @@ __glXGetVideoSyncSGI(unsigned int *count)
__GLXDRIdrawable *pdraw;
#endif
- if (gc == &dummyContext)
+ if (!gc)
return GLX_BAD_CONTEXT;
#ifdef GLX_DIRECT_RENDERING
@@ -1906,7 +1875,7 @@ __glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count)
if (divisor <= 0 || remainder < 0)
return GLX_BAD_VALUE;
- if (gc == &dummyContext)
+ if (!gc)
return GLX_BAD_CONTEXT;
#ifdef GLX_DIRECT_RENDERING
@@ -1939,21 +1908,21 @@ __glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count)
** GLX_functions table.
*/
-_GLX_PUBLIC
+_X_EXPORT
GLX_ALIAS(int, glXGetFBConfigAttribSGIX,
(Display * dpy, GLXFBConfigSGIX config, int attribute, int *value),
(dpy, config, attribute, value), glXGetFBConfigAttrib)
-_GLX_PUBLIC GLX_ALIAS(GLXFBConfigSGIX *, glXChooseFBConfigSGIX,
+_X_EXPORT GLX_ALIAS(GLXFBConfigSGIX *, glXChooseFBConfigSGIX,
(Display * dpy, int screen, int *attrib_list,
int *nelements), (dpy, screen, attrib_list, nelements),
glXChooseFBConfig)
-_GLX_PUBLIC GLX_ALIAS(XVisualInfo *, glXGetVisualFromFBConfigSGIX,
+_X_EXPORT GLX_ALIAS(XVisualInfo *, glXGetVisualFromFBConfigSGIX,
(Display * dpy, GLXFBConfigSGIX config),
(dpy, config), glXGetVisualFromFBConfig)
-_GLX_PUBLIC GLXPixmap
+_X_EXPORT GLXPixmap
glXCreateGLXPixmapWithConfigSGIX(Display * dpy,
GLXFBConfigSGIX fbconfig,
Pixmap pixmap)
@@ -2006,7 +1975,7 @@ glXCreateGLXPixmapWithConfigSGIX(Display * dpy,
#endif
}
-_GLX_PUBLIC GLXContext
+_X_EXPORT GLXContext
glXCreateContextWithConfigSGIX(Display * dpy,
GLXFBConfigSGIX fbconfig, int renderType,
GLXContext shareList, Bool allowDirect)
@@ -2033,7 +2002,7 @@ glXCreateContextWithConfigSGIX(Display * dpy,
}
-_GLX_PUBLIC GLXFBConfigSGIX
+_X_EXPORT GLXFBConfigSGIX
glXGetFBConfigFromVisualSGIX(Display * dpy, XVisualInfo * vis)
{
struct glx_display *priv;
@@ -2219,7 +2188,7 @@ __glXSwapBuffersMscOML(Display * dpy, GLXDrawable drawable,
struct glx_screen *psc = pdraw ? pdraw->psc : NULL;
#endif
- if (gc == &dummyContext) /* no GLX for this */
+ if (!gc) /* no GLX for this */
return -1;
#ifdef GLX_DIRECT_RENDERING
@@ -2349,7 +2318,7 @@ __glXReleaseBuffersMESA(Display * dpy, GLXDrawable d)
}
-_GLX_PUBLIC GLXPixmap
+_X_EXPORT GLXPixmap
glXCreateGLXPixmapMESA(Display * dpy, XVisualInfo * visual,
Pixmap pixmap, Colormap cmap)
{
@@ -2399,7 +2368,7 @@ __glXCopySubBufferMESA(Display * dpy, GLXDrawable drawable,
** does, send the context tag so the server can do a flush.
*/
gc = __glXGetCurrentContext();
- if ((gc != &dummyContext) && (dpy == gc->currentDpy) &&
+ if ((gc != NULL) && (dpy == gc->currentDpy) &&
((drawable == gc->currentDrawable) ||
(drawable == gc->currentReadable))) {
tag = gc->currentContextTag;
@@ -2438,7 +2407,7 @@ __glXBindTexImageEXT(Display * dpy,
{
struct glx_context *gc = __glXGetCurrentContext();
- if (gc == &dummyContext || gc->vtable->bind_tex_image == NULL)
+ if (gc == NULL || gc->vtable->bind_tex_image == NULL)
return;
gc->vtable->bind_tex_image(dpy, drawable, buffer, attrib_list);
@@ -2449,7 +2418,7 @@ __glXReleaseTexImageEXT(Display * dpy, GLXDrawable drawable, int buffer)
{
struct glx_context *gc = __glXGetCurrentContext();
- if (gc == &dummyContext || gc->vtable->release_tex_image == NULL)
+ if (gc == NULL || gc->vtable->release_tex_image == NULL)
return;
gc->vtable->release_tex_image(dpy, drawable, buffer);
@@ -2636,7 +2605,7 @@ get_glx_proc_address(const char *funcName)
*
* \sa glXGetProcAddress
*/
-_GLX_PUBLIC void (*glXGetProcAddressARB(const GLubyte * procName)) (void)
+_X_EXPORT void (*glXGetProcAddressARB(const GLubyte * procName)) (void)
{
typedef void (*gl_function) (void);
gl_function f;
@@ -2651,7 +2620,7 @@ _GLX_PUBLIC void (*glXGetProcAddressARB(const GLubyte * procName)) (void)
f = (gl_function) get_glx_proc_address((const char *) procName);
if ((f == NULL) && (procName[0] == 'g') && (procName[1] == 'l')
&& (procName[2] != 'X')) {
-#ifdef GLX_INDIRECT_RENDERING
+#ifdef GLX_SHARED_GLAPI
f = (gl_function) __indirect_get_proc_address((const char *) procName);
#endif
if (!f)
@@ -2675,10 +2644,19 @@ _GLX_PUBLIC void (*glXGetProcAddressARB(const GLubyte * procName)) (void)
*
* \sa glXGetProcAddressARB
*/
-_GLX_PUBLIC
-GLX_ALIAS(__GLXextFuncPtr, glXGetProcAddress,
- (const GLubyte * procName),
- (procName), glXGetProcAddressARB)
+_X_EXPORT void (*glXGetProcAddress(const GLubyte * procName)) (void)
+#if defined(__GNUC__) && !defined(GLX_ALIAS_UNSUPPORTED)
+# if defined(USE_MGL_NAMESPACE)
+ __attribute__ ((alias("mglXGetProcAddressARB")));
+# else
+ __attribute__ ((alias("glXGetProcAddressARB")));
+# endif
+#else
+{
+ return glXGetProcAddressARB(procName);
+}
+#endif /* __GNUC__ */
+
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
/**
@@ -2713,56 +2691,3 @@ __glXGetUST(int64_t * ust)
}
}
#endif /* GLX_DIRECT_RENDERING */
-
-#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
-
-PUBLIC int
-MesaGLInteropGLXQueryDeviceInfo(Display *dpy, GLXContext context,
- struct mesa_glinterop_device_info *out)
-{
- struct glx_context *gc = (struct glx_context*)context;
- int ret;
-
- __glXLock();
-
- if (!gc || gc->xid == None || !gc->isDirect) {
- __glXUnlock();
- return MESA_GLINTEROP_INVALID_CONTEXT;
- }
-
- if (!gc->vtable->interop_query_device_info) {
- __glXUnlock();
- return MESA_GLINTEROP_UNSUPPORTED;
- }
-
- ret = gc->vtable->interop_query_device_info(gc, out);
- __glXUnlock();
- return ret;
-}
-
-PUBLIC int
-MesaGLInteropGLXExportObject(Display *dpy, GLXContext context,
- struct mesa_glinterop_export_in *in,
- struct mesa_glinterop_export_out *out)
-{
- struct glx_context *gc = (struct glx_context*)context;
- int ret;
-
- __glXLock();
-
- if (!gc || gc->xid == None || !gc->isDirect) {
- __glXUnlock();
- return MESA_GLINTEROP_INVALID_CONTEXT;
- }
-
- if (!gc->vtable->interop_export_object) {
- __glXUnlock();
- return MESA_GLINTEROP_UNSUPPORTED;
- }
-
- ret = gc->vtable->interop_export_object(gc, in, out);
- __glXUnlock();
- return ret;
-}
-
-#endif /* defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) */