We're an X client library, so we can use Xfuncproto.h.
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
#include <X11/Xlibint.h>
+#include <X11/Xfuncproto.h>
#include <X11/extensions/Xext.h>
#include <X11/extensions/extutil.h>
#include "xf86dristr.h"
-
-#if defined(__GNUC__)
-# define PUBLIC __attribute__((visibility("default")))
-# define USED __attribute__((used))
-#else
-# define PUBLIC
-# define USED
-#endif
-
-
-
static XExtensionInfo _xf86dri_info_data;
static XExtensionInfo *xf86dri_info = &_xf86dri_info_data;
static char xf86dri_extension_name[] = XF86DRINAME;
}
-PUBLIC GLXPixmap
+_X_EXPORT GLXPixmap
glXCreateGLXPixmapMESA(Display * dpy, XVisualInfo * visual,
Pixmap pixmap, Colormap cmap)
{
}
-PUBLIC int
+_X_EXPORT int
glXQueryGLXPbufferSGIX(Display * dpy, GLXDrawable drawable,
int attribute, unsigned int *value)
{
return 0;
}
-PUBLIC GLXDrawable
+_X_EXPORT GLXDrawable
glXCreateGLXPbufferSGIX(Display * dpy, GLXFBConfig config,
unsigned int width, unsigned int height,
int *attrib_list)
#if 0
/* GLX_SGIX_fbconfig */
-PUBLIC int
+_X_EXPORT int
glXGetFBConfigAttribSGIX(Display * dpy, void *config, int a, int *b)
{
(void) dpy;
return 0;
}
-PUBLIC void *
+_X_EXPORT void *
glXChooseFBConfigSGIX(Display * dpy, int a, int *b, int *c)
{
(void) dpy;
return NULL;
}
-PUBLIC GLXPixmap
+_X_EXPORT GLXPixmap
glXCreateGLXPixmapWithConfigSGIX(Display * dpy, void *config, Pixmap p)
{
(void) dpy;
return None;
}
-PUBLIC GLXContext
+_X_EXPORT GLXContext
glXCreateContextWithConfigSGIX(Display * dpy, void *config, int a,
GLXContext b, Bool c)
{
return NULL;
}
-PUBLIC XVisualInfo *
+_X_EXPORT XVisualInfo *
glXGetVisualFromFBConfigSGIX(Display * dpy, void *config)
{
(void) dpy;
return NULL;
}
-PUBLIC void *
+_X_EXPORT void *
glXGetFBConfigFromVisualSGIX(Display * dpy, XVisualInfo * visinfo)
{
(void) dpy;
#endif
-PUBLIC
+_X_EXPORT
GLX_ALIAS_VOID(glXDestroyGLXPbufferSGIX,
(Display * dpy, GLXDrawable pbuf),
(dpy, pbuf), glXDestroyPbuffer)
- PUBLIC GLX_ALIAS_VOID(glXSelectEventSGIX,
+ _X_EXPORT GLX_ALIAS_VOID(glXSelectEventSGIX,
(Display * dpy, GLXDrawable drawable,
unsigned long mask), (dpy, drawable, mask),
glXSelectEvent)
- PUBLIC GLX_ALIAS_VOID(glXGetSelectedEventSGIX,
+ _X_EXPORT GLX_ALIAS_VOID(glXGetSelectedEventSGIX,
(Display * dpy, GLXDrawable drawable,
unsigned long *mask), (dpy, drawable, mask),
glXGetSelectedEvent)
* The returned char pointer points to a static array that will be
* overwritten by subsequent calls.
*/
-PUBLIC const char *
+_X_EXPORT const char *
glXGetScreenDriver(Display * dpy, int scrNum)
{
static char ret[32];
*
* Note: The driver remains opened after this function returns.
*/
-PUBLIC const char *
+_X_EXPORT const char *
glXGetDriverConfig(const char *driverName)
{
void *handle = driOpenDriver(driverName);
/**
* Create a new pbuffer.
*/
-PUBLIC GLXPbufferSGIX
+_X_EXPORT GLXPbufferSGIX
glXCreateGLXPbufferSGIX(Display * dpy, GLXFBConfigSGIX config,
unsigned int width, unsigned int height,
int *attrib_list)
/**
* Create a new pbuffer.
*/
-PUBLIC GLXPbuffer
+_X_EXPORT GLXPbuffer
glXCreatePbuffer(Display * dpy, GLXFBConfig config, const int *attrib_list)
{
int i, width, height;
/**
* Destroy an existing pbuffer.
*/
-PUBLIC void
+_X_EXPORT void
glXDestroyPbuffer(Display * dpy, GLXPbuffer pbuf)
{
#ifdef GLX_USE_APPLEGL
/**
* Query an attribute of a drawable.
*/
-PUBLIC void
+_X_EXPORT void
glXQueryDrawable(Display * dpy, GLXDrawable drawable,
int attribute, unsigned int *value)
{
/**
* Query an attribute of a pbuffer.
*/
-PUBLIC int
+_X_EXPORT int
glXQueryGLXPbufferSGIX(Display * dpy, GLXPbufferSGIX drawable,
int attribute, unsigned int *value)
{
/**
* Select the event mask for a drawable.
*/
-PUBLIC void
+_X_EXPORT void
glXSelectEvent(Display * dpy, GLXDrawable drawable, unsigned long mask)
{
#ifdef GLX_USE_APPLEGL
/**
* Get the selected event mask for a drawable.
*/
-PUBLIC void
+_X_EXPORT void
glXGetSelectedEvent(Display * dpy, GLXDrawable drawable, unsigned long *mask)
{
#ifdef GLX_USE_APPLEGL
}
-PUBLIC GLXPixmap
+_X_EXPORT GLXPixmap
glXCreatePixmap(Display * dpy, GLXFBConfig config, Pixmap pixmap,
const int *attrib_list)
{
}
-PUBLIC GLXWindow
+_X_EXPORT GLXWindow
glXCreateWindow(Display * dpy, GLXFBConfig config, Window win,
const int *attrib_list)
{
}
-PUBLIC void
+_X_EXPORT void
glXDestroyPixmap(Display * dpy, GLXPixmap pixmap)
{
WARN_ONCE_GLX_1_3(dpy, __func__);
}
-PUBLIC void
+_X_EXPORT void
glXDestroyWindow(Display * dpy, GLXWindow win)
{
WARN_ONCE_GLX_1_3(dpy, __func__);
}
#ifndef GLX_USE_APPLEGL
-PUBLIC
+_X_EXPORT
GLX_ALIAS_VOID(glXDestroyGLXPbufferSGIX,
(Display * dpy, GLXPbufferSGIX pbuf),
(dpy, pbuf), glXDestroyPbuffer)
-PUBLIC
+_X_EXPORT
GLX_ALIAS_VOID(glXSelectEventSGIX,
(Display * dpy, GLXDrawable drawable,
unsigned long mask), (dpy, drawable, mask), glXSelectEvent)
-PUBLIC
+_X_EXPORT
GLX_ALIAS_VOID(glXGetSelectedEventSGIX,
(Display * dpy, GLXDrawable drawable,
unsigned long *mask), (dpy, drawable, mask),
#define _GLX_client_h_
#include <X11/Xproto.h>
#include <X11/Xlibint.h>
+#include <X11/Xfuncproto.h>
#include <X11/extensions/extutil.h>
#define GLX_GLXEXT_PROTOTYPES
#include <GL/glx.h>
#include "glxextensions.h"
-
-/* If we build the library with gcc's -fvisibility=hidden flag, we'll
- * use the PUBLIC macro to mark functions that are to be exported.
- *
- * We also need to define a USED attribute, so the optimizer doesn't
- * inline a static function that we later use in an alias. - ajax
- */
-#if defined(__GNUC__)
-# define PUBLIC __attribute__((visibility("default")))
-# define USED __attribute__((used))
-#else
-# define PUBLIC
-# define USED
-#endif
-
#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
#define GLX_MAJOR_VERSION 1 /* current version numbers */
#ifdef GLX_DIRECT_RENDERING
-#define containerOf(ptr, type, member) \
- (type *)( (char *)ptr - offsetof(type,member) )
-
extern void DRI_glXUseXFont(GLXContext CC,
Font font, int first, int count, int listbase);
return gc;
}
-PUBLIC GLXContext
+_X_EXPORT GLXContext
glXCreateContext(Display * dpy, XVisualInfo * vis,
GLXContext shareList, Bool allowDirect)
{
gc->vtable->destroy(gc);
}
-PUBLIC void
+_X_EXPORT void
glXDestroyContext(Display * dpy, GLXContext gc)
{
DestroyContext(dpy, gc);
/*
** Return the major and minor version #s for the GLX extension
*/
-PUBLIC Bool
+_X_EXPORT Bool
glXQueryVersion(Display * dpy, int *major, int *minor)
{
__GLXdisplayPrivate *priv;
/*
** Query the existance of the GLX extension
*/
-PUBLIC Bool
+_X_EXPORT Bool
glXQueryExtension(Display * dpy, int *errorBase, int *eventBase)
{
int major_op, erb, evb;
** Put a barrier in the token stream that forces the GL to finish its
** work before X can proceed.
*/
-PUBLIC void
+_X_EXPORT void
glXWaitGL(void)
{
GLXContext gc = __glXGetCurrentContext();
** Put a barrier in the token stream that forces X to finish its
** work before GL can proceed.
*/
-PUBLIC void
+_X_EXPORT void
glXWaitX(void)
{
GLXContext gc = __glXGetCurrentContext();
#endif
-PUBLIC void
+_X_EXPORT void
glXUseXFont(Font font, int first, int count, int listBase)
{
GLXContext gc = __glXGetCurrentContext();
** Copy the source context to the destination context using the
** attribute "mask".
*/
-PUBLIC void
+_X_EXPORT void
glXCopyContext(Display * dpy, GLXContext source,
GLXContext dest, unsigned long mask)
{
* \c GLX_DIRECT_RENDERING is not defined? Do we really need to bother with
* the GLX protocol here at all?
*/
-PUBLIC Bool
+_X_EXPORT Bool
glXIsDirect(Display * dpy, GLXContext gc)
{
if (!gc) {
#endif
}
-PUBLIC GLXPixmap
+_X_EXPORT GLXPixmap
glXCreateGLXPixmap(Display * dpy, XVisualInfo * vis, Pixmap pixmap)
{
#ifdef GLX_USE_APPLEGL
/*
** Destroy the named pixmap
*/
-PUBLIC void
+_X_EXPORT void
glXDestroyGLXPixmap(Display * dpy, GLXPixmap glxpixmap)
{
#ifdef GLX_USE_APPLEGL
#endif /* GLX_USE_APPLEGL */
}
-PUBLIC void
+_X_EXPORT void
glXSwapBuffers(Display * dpy, GLXDrawable drawable)
{
#ifdef GLX_USE_APPLEGL
** Return configuration information for the given display, screen and
** visual combination.
*/
-PUBLIC int
+_X_EXPORT int
glXGetConfig(Display * dpy, XVisualInfo * vis, int attribute,
int *value_return)
{
** Return the visual that best matches the template. Return None if no
** visual matches the template.
*/
-PUBLIC XVisualInfo *
+_X_EXPORT XVisualInfo *
glXChooseVisual(Display * dpy, int screen, int *attribList)
{
XVisualInfo *visualList = NULL;
}
-PUBLIC const char *
+_X_EXPORT const char *
glXQueryExtensionsString(Display * dpy, int screen)
{
__GLXscreenConfigs *psc;
return psc->effectiveGLXexts;
}
-PUBLIC const char *
+_X_EXPORT const char *
glXGetClientString(Display * dpy, int name)
{
(void) dpy;
}
}
-PUBLIC const char *
+_X_EXPORT const char *
glXQueryServerString(Display * dpy, int screen, int name)
{
__GLXscreenConfigs *psc;
** EXT_import_context
*/
-PUBLIC Display *
+_X_EXPORT Display *
glXGetCurrentDisplay(void)
{
GLXContext gc = __glXGetCurrentContext();
return gc->currentDpy;
}
-PUBLIC
+_X_EXPORT
GLX_ALIAS(Display *, glXGetCurrentDisplayEXT, (void), (),
glXGetCurrentDisplay)
#ifndef GLX_USE_APPLEGL
-PUBLIC GLXContext
+_X_EXPORT GLXContext
glXImportContextEXT(Display *dpy, GLXContextID contextID)
{
__GLXdisplayPrivate *priv = __glXInitialize(dpy);
#endif
-PUBLIC int
+_X_EXPORT int
glXQueryContext(Display * dpy, GLXContext ctx, int attribute, int *value)
{
switch (attribute) {
return Success;
}
-PUBLIC
+_X_EXPORT
GLX_ALIAS(int, glXQueryContextInfoEXT,
(Display * dpy, GLXContext ctx, int attribute, int *value),
(dpy, ctx, attribute, value), glXQueryContext)
-PUBLIC GLXContextID glXGetContextIDEXT(const GLXContext ctx)
+_X_EXPORT GLXContextID glXGetContextIDEXT(const GLXContext ctx)
{
return ctx->xid;
}
-PUBLIC void
+_X_EXPORT void
glXFreeContextEXT(Display * dpy, GLXContext ctx)
{
DestroyContext(dpy, ctx);
}
-PUBLIC GLXFBConfig *
+_X_EXPORT GLXFBConfig *
glXChooseFBConfig(Display * dpy, int screen,
const int *attribList, int *nitems)
{
}
-PUBLIC GLXContext
+_X_EXPORT GLXContext
glXCreateNewContext(Display * dpy, GLXFBConfig fbconfig,
int renderType, GLXContext shareList, Bool allowDirect)
{
}
-PUBLIC GLXDrawable
+_X_EXPORT GLXDrawable
glXGetCurrentReadDrawable(void)
{
GLXContext gc = __glXGetCurrentContext();
}
-PUBLIC GLXFBConfig *
+_X_EXPORT GLXFBConfig *
glXGetFBConfigs(Display * dpy, int screen, int *nelements)
{
__GLXdisplayPrivate *priv = __glXInitialize(dpy);
}
-PUBLIC int
+_X_EXPORT int
glXGetFBConfigAttrib(Display * dpy, GLXFBConfig fbconfig,
int attribute, int *value)
{
}
-PUBLIC XVisualInfo *
+_X_EXPORT XVisualInfo *
glXGetVisualFromFBConfig(Display * dpy, GLXFBConfig fbconfig)
{
XVisualInfo visualTemplate;
** GLX_functions table.
*/
-PUBLIC
+_X_EXPORT
GLX_ALIAS(int, glXGetFBConfigAttribSGIX,
(Display * dpy, GLXFBConfigSGIX config, int attribute, int *value),
(dpy, config, attribute, value), glXGetFBConfigAttrib)
-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)
-PUBLIC GLX_ALIAS(XVisualInfo *, glXGetVisualFromFBConfigSGIX,
+_X_EXPORT GLX_ALIAS(XVisualInfo *, glXGetVisualFromFBConfigSGIX,
(Display * dpy, GLXFBConfigSGIX config),
(dpy, config), glXGetVisualFromFBConfig)
-PUBLIC GLXPixmap
+_X_EXPORT GLXPixmap
glXCreateGLXPixmapWithConfigSGIX(Display * dpy,
GLXFBConfigSGIX fbconfig,
Pixmap pixmap)
#endif
}
-PUBLIC GLXContext
+_X_EXPORT GLXContext
glXCreateContextWithConfigSGIX(Display * dpy,
GLXFBConfigSGIX fbconfig, int renderType,
GLXContext shareList, Bool allowDirect)
}
-PUBLIC GLXFBConfigSGIX
+_X_EXPORT GLXFBConfigSGIX
glXGetFBConfigFromVisualSGIX(Display * dpy, XVisualInfo * vis)
{
__GLXdisplayPrivate *priv;
}
-PUBLIC GLXPixmap
+_X_EXPORT GLXPixmap
glXCreateGLXPixmapMESA(Display * dpy, XVisualInfo * visual,
Pixmap pixmap, Colormap cmap)
{
*
* \sa glXGetProcAddress
*/
-PUBLIC void (*glXGetProcAddressARB(const GLubyte * procName)) (void)
+_X_EXPORT void (*glXGetProcAddressARB(const GLubyte * procName)) (void)
{
typedef void (*gl_function) (void);
gl_function f;
*
* \sa glXGetProcAddressARB
*/
-PUBLIC void (*glXGetProcAddress(const GLubyte * procName)) (void)
+_X_EXPORT void (*glXGetProcAddress(const GLubyte * procName)) (void)
#if defined(__GNUC__) && !defined(GLX_ALIAS_UNSUPPORTED)
__attribute__ ((alias("glXGetProcAddressARB")));
#else
/************************************************************************/
-PUBLIC GLXContext
+_X_EXPORT GLXContext
glXGetCurrentContext(void)
{
GLXContext cx = __glXGetCurrentContext();
}
}
-PUBLIC GLXDrawable
+_X_EXPORT GLXDrawable
glXGetCurrentDrawable(void)
{
GLXContext gc = __glXGetCurrentContext();
}
-PUBLIC Bool
+_X_EXPORT Bool
glXMakeCurrent(Display * dpy, GLXDrawable draw, GLXContext gc)
{
return MakeContextCurrent(dpy, draw, draw, gc);
}
-PUBLIC
+_X_EXPORT
GLX_ALIAS(Bool, glXMakeCurrentReadSGI,
(Display * dpy, GLXDrawable d, GLXDrawable r, GLXContext ctx),
(dpy, d, r, ctx), MakeContextCurrent)
-PUBLIC
+_X_EXPORT
GLX_ALIAS(Bool, glXMakeContextCurrent,
(Display * dpy, GLXDrawable d, GLXDrawable r,
GLXContext ctx), (dpy, d, r, ctx), MakeContextCurrent)