* 10. Given that, this routine should try to use an array on the stack to
* capture the reply rather than always calling Xmalloc.
*/
-static int
-GetDrawableAttribute(Display * dpy, GLXDrawable drawable,
- int attribute, unsigned int *value)
+int
+__glXGetDrawableAttribute(Display * dpy, GLXDrawable drawable,
+ int attribute, unsigned int *value)
{
struct glx_display *priv;
xGLXGetDrawableAttributesReply reply;
* the calling thread's current context a GLXBadDrawable error is
* generated."
*/
- if (pdraw == NULL || gc == NULL || gc->currentDpy != dpy ||
+ if (pdraw == NULL || gc == &dummyContext || gc->currentDpy != dpy ||
(gc->currentDrawable != drawable &&
gc->currentReadable != drawable)) {
__glXSendError(dpy, GLXBadDrawable, drawable,
UnlockDisplay(dpy);
SyncHandle();
- return 0;
+ return 1;
}
static void
/**
* Create a new pbuffer.
*/
-_X_EXPORT GLXPbufferSGIX
+_GLX_PUBLIC GLXPbufferSGIX
glXCreateGLXPbufferSGIX(Display * dpy, GLXFBConfigSGIX config,
unsigned int width, unsigned int height,
int *attrib_list)
/**
* Create a new pbuffer.
*/
-_X_EXPORT GLXPbuffer
+_GLX_PUBLIC GLXPbuffer
glXCreatePbuffer(Display * dpy, GLXFBConfig config, const int *attrib_list)
{
int i, width, height;
/**
* Destroy an existing pbuffer.
*/
-_X_EXPORT void
+_GLX_PUBLIC void
glXDestroyPbuffer(Display * dpy, GLXPbuffer pbuf)
{
#ifdef GLX_USE_APPLEGL
/**
* Query an attribute of a drawable.
*/
-_X_EXPORT void
+_GLX_PUBLIC void
glXQueryDrawable(Display * dpy, GLXDrawable drawable,
int attribute, unsigned int *value)
{
}
}
#else
- GetDrawableAttribute(dpy, drawable, attribute, value);
+ __glXGetDrawableAttribute(dpy, drawable, attribute, value);
#endif
}
/**
* Query an attribute of a pbuffer.
*/
-_X_EXPORT int
+_GLX_PUBLIC void
glXQueryGLXPbufferSGIX(Display * dpy, GLXPbufferSGIX drawable,
int attribute, unsigned int *value)
{
- return GetDrawableAttribute(dpy, drawable, attribute, value);
+ __glXGetDrawableAttribute(dpy, drawable, attribute, value);
}
#endif
/**
* Select the event mask for a drawable.
*/
-_X_EXPORT void
+_GLX_PUBLIC void
glXSelectEvent(Display * dpy, GLXDrawable drawable, unsigned long mask)
{
#ifdef GLX_USE_APPLEGL
/**
* Get the selected event mask for a drawable.
*/
-_X_EXPORT void
+_GLX_PUBLIC void
glXGetSelectedEvent(Display * dpy, GLXDrawable drawable, unsigned long *mask)
{
#ifdef GLX_USE_APPLEGL
__glXSendError(dpy, GLXBadDrawable, drawable, X_GLXGetDrawableAttributes,
true);
#else
- unsigned int value;
+ unsigned int value = 0;
/* The non-sense with value is required because on LP64 platforms
* we could just type-cast the pointer, but why?
*/
- GetDrawableAttribute(dpy, drawable, GLX_EVENT_MASK_SGIX, &value);
+ __glXGetDrawableAttribute(dpy, drawable, GLX_EVENT_MASK_SGIX, &value);
*mask = value;
#endif
}
-_X_EXPORT GLXPixmap
+_GLX_PUBLIC GLXPixmap
glXCreatePixmap(Display * dpy, GLXFBConfig config, Pixmap pixmap,
const int *attrib_list)
{
}
-_X_EXPORT GLXWindow
+_GLX_PUBLIC GLXWindow
glXCreateWindow(Display * dpy, GLXFBConfig config, Window win,
const int *attrib_list)
{
}
-_X_EXPORT void
+_GLX_PUBLIC void
glXDestroyPixmap(Display * dpy, GLXPixmap pixmap)
{
WARN_ONCE_GLX_1_3(dpy, __func__);
}
-_X_EXPORT void
+_GLX_PUBLIC void
glXDestroyWindow(Display * dpy, GLXWindow win)
{
WARN_ONCE_GLX_1_3(dpy, __func__);
#endif
}
-#ifndef GLX_USE_APPLEGL
-_X_EXPORT
+_GLX_PUBLIC
GLX_ALIAS_VOID(glXDestroyGLXPbufferSGIX,
(Display * dpy, GLXPbufferSGIX pbuf),
(dpy, pbuf), glXDestroyPbuffer)
-_X_EXPORT
+_GLX_PUBLIC
GLX_ALIAS_VOID(glXSelectEventSGIX,
(Display * dpy, GLXDrawable drawable,
unsigned long mask), (dpy, drawable, mask), glXSelectEvent)
-_X_EXPORT
+_GLX_PUBLIC
GLX_ALIAS_VOID(glXGetSelectedEventSGIX,
(Display * dpy, GLXDrawable drawable,
unsigned long *mask), (dpy, drawable, mask),
glXGetSelectedEvent)
-#endif