2 * (C) Copyright IBM Corporation 2004
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * on the rights to use, copy, modify, merge, publish, distribute, sub
9 * license, and/or sell copies of the Software, and to permit persons to whom
10 * the Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
19 * IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
27 * Implementation of pbuffer related functions.
29 * \author Ian Romanick <idr@us.ibm.com>
33 #include "glxclient.h"
34 #include <X11/extensions/extutil.h>
35 #include <X11/extensions/Xext.h>
38 #include "glxextensions.h"
40 #ifdef GLX_USE_APPLEGL
42 #include "apple_glx_drawable.h"
43 #include "glx_error.h"
46 #define WARN_ONCE_GLX_1_3(a, b) { \
47 static int warned=1; \
49 warn_GLX_1_3((a), b ); \
55 * Emit a warning when clients use GLX 1.3 functions on pre-1.3 systems.
58 warn_GLX_1_3(Display
* dpy
, const char *function_name
)
60 __GLXdisplayPrivate
*priv
= __glXInitialize(dpy
);
62 if (priv
->minorVersion
< 3) {
64 "WARNING: Application calling GLX 1.3 function \"%s\" "
65 "when GLX 1.3 is not supported! This is an application bug!\n",
70 #ifndef GLX_USE_APPLEGL
72 * Change a drawable's attribute.
74 * This function is used to implement \c glXSelectEvent and
75 * \c glXSelectEventSGIX.
78 * This function dynamically determines whether to use the SGIX_pbuffer
79 * version of the protocol or the GLX 1.3 version of the protocol.
82 * This function needs to be modified to work with direct-rendering drivers.
85 ChangeDrawableAttribute(Display
* dpy
, GLXDrawable drawable
,
86 const CARD32
* attribs
, size_t num_attribs
)
88 __GLXdisplayPrivate
*priv
= __glXInitialize(dpy
);
89 __GLXDRIdrawable
*pdraw
;
94 if ((dpy
== NULL
) || (drawable
== 0)) {
98 pdraw
= GetGLXDRIDrawable(dpy
, drawable
, NULL
);
100 opcode
= __glXSetupForCommand(dpy
);
106 if ((priv
->majorVersion
> 1) || (priv
->minorVersion
>= 3)) {
107 xGLXChangeDrawableAttributesReq
*req
;
109 GetReqExtra(GLXChangeDrawableAttributes
, 8 + (8 * num_attribs
), req
);
110 output
= (CARD32
*) (req
+ 1);
112 req
->reqType
= opcode
;
113 req
->glxCode
= X_GLXChangeDrawableAttributes
;
114 req
->drawable
= drawable
;
115 req
->numAttribs
= (CARD32
) num_attribs
;
118 xGLXVendorPrivateWithReplyReq
*vpreq
;
120 GetReqExtra(GLXVendorPrivateWithReply
, 4 + (8 * num_attribs
), vpreq
);
121 output
= (CARD32
*) (vpreq
+ 1);
123 vpreq
->reqType
= opcode
;
124 vpreq
->glxCode
= X_GLXVendorPrivateWithReply
;
125 vpreq
->vendorCode
= X_GLXvop_ChangeDrawableAttributesSGIX
;
127 output
[0] = (CARD32
) drawable
;
131 (void) memcpy(output
, attribs
, sizeof(CARD32
) * 2 * num_attribs
);
136 for (i
= 0; i
< num_attribs
; i
++) {
137 switch(attribs
[i
* 2]) {
139 /* Keep a local copy for masking out DRI2 proto events as needed */
140 pdraw
->eventMask
= attribs
[i
* 2 + 1];
149 #ifdef GLX_DIRECT_RENDERING
151 determineTextureTarget(const int *attribs
, int numAttribs
)
156 for (i
= 0; i
< numAttribs
; i
++) {
157 if (attribs
[2 * i
] == GLX_TEXTURE_TARGET_EXT
) {
158 switch (attribs
[2 * i
+ 1]) {
159 case GLX_TEXTURE_2D_EXT
:
160 target
= GL_TEXTURE_2D
;
162 case GLX_TEXTURE_RECTANGLE_EXT
:
163 target
= GL_TEXTURE_RECTANGLE_ARB
;
173 determineTextureFormat(const int *attribs
, int numAttribs
)
177 for (i
= 0; i
< numAttribs
; i
++) {
178 if (attribs
[2 * i
] == GLX_TEXTURE_FORMAT_EXT
)
179 return attribs
[2 * i
+ 1];
186 CreateDRIDrawable(Display
*dpy
, const __GLcontextModes
*fbconfig
,
187 XID drawable
, XID glxdrawable
,
188 const int *attrib_list
, size_t num_attribs
)
190 __GLXdisplayPrivate
*const priv
= __glXInitialize(dpy
);
191 __GLXDRIdrawable
*pdraw
;
192 __GLXscreenConfigs
*psc
;
194 psc
= priv
->screenConfigs
[fbconfig
->screen
];
195 if (psc
->driScreen
== NULL
)
198 pdraw
= psc
->driScreen
->createDrawable(psc
, drawable
,
199 glxdrawable
, fbconfig
);
201 fprintf(stderr
, "failed to create drawable\n");
205 if (__glxHashInsert(priv
->drawHash
, glxdrawable
, pdraw
)) {
206 (*pdraw
->destroyDrawable
) (pdraw
);
207 return; /* FIXME: Check what we're supposed to do here... */
210 pdraw
->textureTarget
= determineTextureTarget(attrib_list
, num_attribs
);
211 pdraw
->textureFormat
= determineTextureFormat(attrib_list
, num_attribs
);
215 DestroyDRIDrawable(Display
*dpy
, GLXDrawable drawable
, int destroy_xdrawable
)
218 __GLXdisplayPrivate
*const priv
= __glXInitialize(dpy
);
219 __GLXDRIdrawable
*pdraw
= GetGLXDRIDrawable(dpy
, drawable
, &screen
);
220 __GLXscreenConfigs
*psc
= priv
->screenConfigs
[screen
];
223 if (destroy_xdrawable
)
224 XFreePixmap(psc
->dpy
, pdraw
->xDrawable
);
225 (*pdraw
->destroyDrawable
) (pdraw
);
226 __glxHashDelete(priv
->drawHash
, drawable
);
233 CreateDRIDrawable(Display
*dpy
, const __GLcontextModes
* fbconfig
,
234 XID drawable
, XID glxdrawable
,
235 const int *attrib_list
, size_t num_attribs
)
240 DestroyDRIDrawable(Display
*dpy
, GLXDrawable drawable
, int destroy_xdrawable
)
247 * Get a drawable's attribute.
249 * This function is used to implement \c glXGetSelectedEvent and
250 * \c glXGetSelectedEventSGIX.
253 * This function dynamically determines whether to use the SGIX_pbuffer
254 * version of the protocol or the GLX 1.3 version of the protocol.
257 * The number of attributes returned is likely to be small, probably less than
258 * 10. Given that, this routine should try to use an array on the stack to
259 * capture the reply rather than always calling Xmalloc.
262 * This function needs to be modified to work with direct-rendering drivers.
265 GetDrawableAttribute(Display
* dpy
, GLXDrawable drawable
,
266 int attribute
, unsigned int *value
)
268 __GLXdisplayPrivate
*priv
;
269 xGLXGetDrawableAttributesReply reply
;
274 unsigned int num_attributes
;
275 GLboolean use_glx_1_3
;
277 if ((dpy
== NULL
) || (drawable
== 0)) {
281 priv
= __glXInitialize(dpy
);
282 use_glx_1_3
= ((priv
->majorVersion
> 1) || (priv
->minorVersion
>= 3));
287 opcode
= __glXSetupForCommand(dpy
);
294 xGLXGetDrawableAttributesReq
*req
;
296 GetReqExtra(GLXGetDrawableAttributes
, 4, req
);
297 req
->reqType
= opcode
;
298 req
->glxCode
= X_GLXGetDrawableAttributes
;
299 req
->drawable
= drawable
;
302 xGLXVendorPrivateWithReplyReq
*vpreq
;
304 GetReqExtra(GLXVendorPrivateWithReply
, 4, vpreq
);
305 data
= (CARD32
*) (vpreq
+ 1);
306 data
[0] = (CARD32
) drawable
;
308 vpreq
->reqType
= opcode
;
309 vpreq
->glxCode
= X_GLXVendorPrivateWithReply
;
310 vpreq
->vendorCode
= X_GLXvop_GetDrawableAttributesSGIX
;
313 _XReply(dpy
, (xReply
*) & reply
, 0, False
);
315 if (reply
.type
== X_Error
) {
321 length
= reply
.length
;
323 num_attributes
= (use_glx_1_3
) ? reply
.numAttribs
: length
/ 2;
324 data
= (CARD32
*) Xmalloc(length
* sizeof(CARD32
));
326 /* Throw data on the floor */
327 _XEatData(dpy
, length
);
330 _XRead(dpy
, (char *) data
, length
* sizeof(CARD32
));
332 /* Search the set of returned attributes for the attribute requested by
335 for (i
= 0; i
< num_attributes
; i
++) {
336 if (data
[i
* 2] == attribute
) {
337 *value
= data
[(i
* 2) + 1];
342 #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
344 __GLXDRIdrawable
*pdraw
= GetGLXDRIDrawable(dpy
, drawable
, NULL
);
346 if (pdraw
!= NULL
&& !pdraw
->textureTarget
)
347 pdraw
->textureTarget
=
348 determineTextureTarget((const int *) data
, num_attributes
);
349 if (pdraw
!= NULL
&& !pdraw
->textureFormat
)
350 pdraw
->textureFormat
=
351 determineTextureFormat((const int *) data
, num_attributes
);
366 * Create a non-pbuffer GLX drawable.
369 * This function needs to be modified to work with direct-rendering drivers.
372 CreateDrawable(Display
* dpy
, const __GLcontextModes
* fbconfig
,
373 Drawable drawable
, const int *attrib_list
, CARD8 glxCode
)
375 xGLXCreateWindowReq
*req
;
382 while (attrib_list
[i
* 2] != None
)
386 opcode
= __glXSetupForCommand(dpy
);
391 GetReqExtra(GLXCreateWindow
, 8 * i
, req
);
392 data
= (CARD32
*) (req
+ 1);
394 req
->reqType
= opcode
;
395 req
->glxCode
= glxCode
;
396 req
->screen
= (CARD32
) fbconfig
->screen
;
397 req
->fbconfig
= fbconfig
->fbconfigID
;
398 req
->window
= (CARD32
) drawable
;
399 req
->glxwindow
= (GLXWindow
) XAllocID(dpy
);
400 req
->numAttribs
= (CARD32
) i
;
403 memcpy(data
, attrib_list
, 8 * i
);
408 CreateDRIDrawable(dpy
, fbconfig
, drawable
, req
->glxwindow
, attrib_list
, i
);
410 return (GLXDrawable
) req
->glxwindow
;
415 * Destroy a non-pbuffer GLX drawable.
418 DestroyDrawable(Display
* dpy
, GLXDrawable drawable
, CARD32 glxCode
)
420 xGLXDestroyPbufferReq
*req
;
423 if ((dpy
== NULL
) || (drawable
== 0)) {
428 opcode
= __glXSetupForCommand(dpy
);
434 GetReqExtra(GLXDestroyPbuffer
, 4, req
);
435 req
->reqType
= opcode
;
436 req
->glxCode
= glxCode
;
437 req
->pbuffer
= (GLXPbuffer
) drawable
;
442 DestroyDRIDrawable(dpy
, drawable
, GL_FALSE
);
451 * This function is used to implement \c glXCreatePbuffer and
452 * \c glXCreateGLXPbufferSGIX.
455 * This function dynamically determines whether to use the SGIX_pbuffer
456 * version of the protocol or the GLX 1.3 version of the protocol.
459 * This function needs to be modified to work with direct-rendering drivers.
462 CreatePbuffer(Display
* dpy
, const __GLcontextModes
* fbconfig
,
463 unsigned int width
, unsigned int height
,
464 const int *attrib_list
, GLboolean size_in_attribs
)
466 __GLXdisplayPrivate
*priv
= __glXInitialize(dpy
);
475 while (attrib_list
[i
* 2])
479 opcode
= __glXSetupForCommand(dpy
);
486 if ((priv
->majorVersion
> 1) || (priv
->minorVersion
>= 3)) {
487 xGLXCreatePbufferReq
*req
;
488 unsigned int extra
= (size_in_attribs
) ? 0 : 2;
490 GetReqExtra(GLXCreatePbuffer
, (8 * (i
+ extra
)), req
);
491 data
= (CARD32
*) (req
+ 1);
493 req
->reqType
= opcode
;
494 req
->glxCode
= X_GLXCreatePbuffer
;
495 req
->screen
= (CARD32
) fbconfig
->screen
;
496 req
->fbconfig
= fbconfig
->fbconfigID
;
497 req
->pbuffer
= (GLXPbuffer
) id
;
498 req
->numAttribs
= (CARD32
) (i
+ extra
);
500 if (!size_in_attribs
) {
501 data
[(2 * i
) + 0] = GLX_PBUFFER_WIDTH
;
502 data
[(2 * i
) + 1] = width
;
503 data
[(2 * i
) + 2] = GLX_PBUFFER_HEIGHT
;
504 data
[(2 * i
) + 3] = height
;
509 xGLXVendorPrivateReq
*vpreq
;
511 GetReqExtra(GLXVendorPrivate
, 20 + (8 * i
), vpreq
);
512 data
= (CARD32
*) (vpreq
+ 1);
514 vpreq
->reqType
= opcode
;
515 vpreq
->glxCode
= X_GLXVendorPrivate
;
516 vpreq
->vendorCode
= X_GLXvop_CreateGLXPbufferSGIX
;
518 data
[0] = (CARD32
) fbconfig
->screen
;
519 data
[1] = (CARD32
) fbconfig
->fbconfigID
;
520 data
[2] = (CARD32
) id
;
521 data
[3] = (CARD32
) width
;
522 data
[4] = (CARD32
) height
;
526 (void) memcpy(data
, attrib_list
, sizeof(CARD32
) * 2 * i
);
531 pixmap
= XCreatePixmap(dpy
, RootWindow(dpy
, fbconfig
->screen
),
532 width
, height
, fbconfig
->rgbBits
);
534 CreateDRIDrawable(dpy
, fbconfig
, pixmap
, id
, attrib_list
, i
);
542 * This function is used to implement \c glXDestroyPbuffer and
543 * \c glXDestroyGLXPbufferSGIX.
546 * This function dynamically determines whether to use the SGIX_pbuffer
547 * version of the protocol or the GLX 1.3 version of the protocol.
550 DestroyPbuffer(Display
* dpy
, GLXDrawable drawable
)
552 __GLXdisplayPrivate
*priv
= __glXInitialize(dpy
);
555 if ((dpy
== NULL
) || (drawable
== 0)) {
559 opcode
= __glXSetupForCommand(dpy
);
565 if ((priv
->majorVersion
> 1) || (priv
->minorVersion
>= 3)) {
566 xGLXDestroyPbufferReq
*req
;
568 GetReq(GLXDestroyPbuffer
, req
);
569 req
->reqType
= opcode
;
570 req
->glxCode
= X_GLXDestroyPbuffer
;
571 req
->pbuffer
= (GLXPbuffer
) drawable
;
574 xGLXVendorPrivateWithReplyReq
*vpreq
;
577 GetReqExtra(GLXVendorPrivateWithReply
, 4, vpreq
);
578 data
= (CARD32
*) (vpreq
+ 1);
580 data
[0] = (CARD32
) drawable
;
582 vpreq
->reqType
= opcode
;
583 vpreq
->glxCode
= X_GLXVendorPrivateWithReply
;
584 vpreq
->vendorCode
= X_GLXvop_DestroyGLXPbufferSGIX
;
590 DestroyDRIDrawable(dpy
, drawable
, GL_TRUE
);
596 * Create a new pbuffer.
598 PUBLIC GLXPbufferSGIX
599 glXCreateGLXPbufferSGIX(Display
* dpy
, GLXFBConfigSGIX config
,
600 unsigned int width
, unsigned int height
,
603 return (GLXPbufferSGIX
) CreatePbuffer(dpy
, (__GLcontextModes
*) config
,
605 attrib_list
, GL_FALSE
);
608 #endif /* GLX_USE_APPLEGL */
611 * Create a new pbuffer.
614 glXCreatePbuffer(Display
* dpy
, GLXFBConfig config
, const int *attrib_list
)
616 int i
, width
, height
;
617 #ifdef GLX_USE_APPLEGL
625 WARN_ONCE_GLX_1_3(dpy
, __func__
);
627 #ifdef GLX_USE_APPLEGL
628 for (i
= 0; attrib_list
[i
]; ++i
) {
629 switch (attrib_list
[i
]) {
630 case GLX_PBUFFER_WIDTH
:
631 width
= attrib_list
[i
+ 1];
635 case GLX_PBUFFER_HEIGHT
:
636 height
= attrib_list
[i
+ 1];
640 case GLX_LARGEST_PBUFFER
:
641 /* This is a hint we should probably handle, but how? */
645 case GLX_PRESERVED_CONTENTS
:
646 /* The contents are always preserved with AppleSGLX with CGL. */
655 if (apple_glx_pbuffer_create(dpy
, config
, width
, height
, &errorcode
,
658 * apple_glx_pbuffer_create only sets the errorcode to core X11
661 __glXSendError(dpy
, errorcode
, 0, X_GLXCreatePbuffer
, true);
668 for (i
= 0; attrib_list
[i
* 2]; i
++) {
669 switch (attrib_list
[i
* 2]) {
670 case GLX_PBUFFER_WIDTH
:
671 width
= attrib_list
[i
* 2 + 1];
673 case GLX_PBUFFER_HEIGHT
:
674 height
= attrib_list
[i
* 2 + 1];
679 return (GLXPbuffer
) CreatePbuffer(dpy
, (__GLcontextModes
*) config
,
680 width
, height
, attrib_list
, GL_TRUE
);
686 * Destroy an existing pbuffer.
689 glXDestroyPbuffer(Display
* dpy
, GLXPbuffer pbuf
)
691 #ifdef GLX_USE_APPLEGL
692 if (apple_glx_pbuffer_destroy(dpy
, pbuf
)) {
693 __glXSendError(dpy
, GLXBadPbuffer
, pbuf
, X_GLXDestroyPbuffer
, false);
696 DestroyPbuffer(dpy
, pbuf
);
702 * Query an attribute of a drawable.
705 glXQueryDrawable(Display
* dpy
, GLXDrawable drawable
,
706 int attribute
, unsigned int *value
)
708 WARN_ONCE_GLX_1_3(dpy
, __func__
);
709 #ifdef GLX_USE_APPLEGL
712 unsigned int width
, height
, bd
, depth
;
714 if (apple_glx_pixmap_query(drawable
, attribute
, value
))
717 if (apple_glx_pbuffer_query(drawable
, attribute
, value
))
721 * The OpenGL spec states that we should report GLXBadDrawable if
722 * the drawable is invalid, however doing so would require that we
723 * use XSetErrorHandler(), which is known to not be thread safe.
724 * If we use a round-trip call to validate the drawable, there could
725 * be a race, so instead we just opt in favor of letting the
726 * XGetGeometry request fail with a GetGeometry request X error
727 * rather than GLXBadDrawable, in what is hoped to be a rare
728 * case of an invalid drawable. In practice most and possibly all
729 * X11 apps using GLX shouldn't notice a difference.
732 (dpy
, drawable
, &root
, &x
, &y
, &width
, &height
, &bd
, &depth
)) {
744 GetDrawableAttribute(dpy
, drawable
, attribute
, value
);
749 #ifndef GLX_USE_APPLEGL
751 * Query an attribute of a pbuffer.
754 glXQueryGLXPbufferSGIX(Display
* dpy
, GLXPbufferSGIX drawable
,
755 int attribute
, unsigned int *value
)
757 return GetDrawableAttribute(dpy
, drawable
, attribute
, value
);
762 * Select the event mask for a drawable.
765 glXSelectEvent(Display
* dpy
, GLXDrawable drawable
, unsigned long mask
)
767 #ifdef GLX_USE_APPLEGL
768 XWindowAttributes xwattr
;
770 if (apple_glx_pbuffer_set_event_mask(drawable
, mask
))
774 * The spec allows a window, but currently there are no valid
775 * events for a window, so do nothing.
777 if (XGetWindowAttributes(dpy
, drawable
, &xwattr
))
779 /* The drawable seems to be invalid. Report an error. */
781 __glXSendError(dpy
, GLXBadDrawable
, drawable
,
782 X_GLXChangeDrawableAttributes
, false);
786 attribs
[0] = (CARD32
) GLX_EVENT_MASK
;
787 attribs
[1] = (CARD32
) mask
;
789 ChangeDrawableAttribute(dpy
, drawable
, attribs
, 1);
795 * Get the selected event mask for a drawable.
798 glXGetSelectedEvent(Display
* dpy
, GLXDrawable drawable
, unsigned long *mask
)
800 #ifdef GLX_USE_APPLEGL
801 XWindowAttributes xwattr
;
803 if (apple_glx_pbuffer_get_event_mask(drawable
, mask
))
807 * The spec allows a window, but currently there are no valid
808 * events for a window, so do nothing, but set the mask to 0.
810 if (XGetWindowAttributes(dpy
, drawable
, &xwattr
)) {
811 /* The window is valid, so set the mask to 0. */
815 /* The drawable seems to be invalid. Report an error. */
817 __glXSendError(dpy
, GLXBadDrawable
, drawable
, X_GLXGetDrawableAttributes
,
823 /* The non-sense with value is required because on LP64 platforms
824 * sizeof(unsigned int) != sizeof(unsigned long). On little-endian
825 * we could just type-cast the pointer, but why?
828 GetDrawableAttribute(dpy
, drawable
, GLX_EVENT_MASK_SGIX
, &value
);
835 glXCreatePixmap(Display
* dpy
, GLXFBConfig config
, Pixmap pixmap
,
836 const int *attrib_list
)
838 WARN_ONCE_GLX_1_3(dpy
, __func__
);
840 #ifdef GLX_USE_APPLEGL
841 const __GLcontextModes
*modes
= (const __GLcontextModes
*) config
;
843 if (apple_glx_pixmap_create(dpy
, modes
->screen
, pixmap
, modes
))
848 return CreateDrawable(dpy
, (__GLcontextModes
*) config
,
849 (Drawable
) pixmap
, attrib_list
, X_GLXCreatePixmap
);
855 glXCreateWindow(Display
* dpy
, GLXFBConfig config
, Window win
,
856 const int *attrib_list
)
858 WARN_ONCE_GLX_1_3(dpy
, __func__
);
859 #ifdef GLX_USE_APPLEGL
860 XWindowAttributes xwattr
;
861 XVisualInfo
*visinfo
;
863 (void) attrib_list
; /*unused according to GLX 1.4 */
865 XGetWindowAttributes(dpy
, win
, &xwattr
);
867 visinfo
= glXGetVisualFromFBConfig(dpy
, config
);
869 if (NULL
== visinfo
) {
870 __glXSendError(dpy
, GLXBadFBConfig
, 0, X_GLXCreateWindow
, false);
874 if (visinfo
->visualid
!= XVisualIDFromVisual(xwattr
.visual
)) {
875 __glXSendError(dpy
, BadMatch
, 0, X_GLXCreateWindow
, true);
883 return CreateDrawable(dpy
, (__GLcontextModes
*) config
,
884 (Drawable
) win
, attrib_list
, X_GLXCreateWindow
);
890 glXDestroyPixmap(Display
* dpy
, GLXPixmap pixmap
)
892 WARN_ONCE_GLX_1_3(dpy
, __func__
);
893 #ifdef GLX_USE_APPLEGL
894 if (apple_glx_pixmap_destroy(dpy
, pixmap
))
895 __glXSendError(dpy
, GLXBadPixmap
, pixmap
, X_GLXDestroyPixmap
, false);
897 DestroyDrawable(dpy
, (GLXDrawable
) pixmap
, X_GLXDestroyPixmap
);
903 glXDestroyWindow(Display
* dpy
, GLXWindow win
)
905 WARN_ONCE_GLX_1_3(dpy
, __func__
);
906 #ifndef GLX_USE_APPLEGL
907 DestroyDrawable(dpy
, (GLXDrawable
) win
, X_GLXDestroyWindow
);
911 #ifndef GLX_USE_APPLEGL
913 GLX_ALIAS_VOID(glXDestroyGLXPbufferSGIX
,
914 (Display
* dpy
, GLXPbufferSGIX pbuf
),
915 (dpy
, pbuf
), glXDestroyPbuffer
)
918 GLX_ALIAS_VOID(glXSelectEventSGIX
,
919 (Display
* dpy
, GLXDrawable drawable
,
920 unsigned long mask
), (dpy
, drawable
, mask
), glXSelectEvent
)
923 GLX_ALIAS_VOID(glXGetSelectedEventSGIX
,
924 (Display
* dpy
, GLXDrawable drawable
,
925 unsigned long *mask
), (dpy
, drawable
, mask
),