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"
45 #include "glx_error.h"
47 #define WARN_ONCE_GLX_1_3(a, b) { \
48 static int warned=1; \
50 warn_GLX_1_3((a), b ); \
56 * Emit a warning when clients use GLX 1.3 functions on pre-1.3 systems.
59 warn_GLX_1_3(Display
* dpy
, const char *function_name
)
61 struct glx_display
*priv
= __glXInitialize(dpy
);
63 if (priv
->minorVersion
< 3) {
65 "WARNING: Application calling GLX 1.3 function \"%s\" "
66 "when GLX 1.3 is not supported! This is an application bug!\n",
71 #ifndef GLX_USE_APPLEGL
73 * Change a drawable's attribute.
75 * This function is used to implement \c glXSelectEvent and
76 * \c glXSelectEventSGIX.
79 * This function dynamically determines whether to use the SGIX_pbuffer
80 * version of the protocol or the GLX 1.3 version of the protocol.
83 ChangeDrawableAttribute(Display
* dpy
, GLXDrawable drawable
,
84 const CARD32
* attribs
, size_t num_attribs
)
86 struct glx_display
*priv
= __glXInitialize(dpy
);
87 #ifdef GLX_DIRECT_RENDERING
88 __GLXDRIdrawable
*pdraw
;
94 if ((dpy
== NULL
) || (drawable
== 0)) {
98 opcode
= __glXSetupForCommand(dpy
);
104 if ((priv
->majorVersion
> 1) || (priv
->minorVersion
>= 3)) {
105 xGLXChangeDrawableAttributesReq
*req
;
107 GetReqExtra(GLXChangeDrawableAttributes
, 8 * num_attribs
, req
);
108 output
= (CARD32
*) (req
+ 1);
110 req
->reqType
= opcode
;
111 req
->glxCode
= X_GLXChangeDrawableAttributes
;
112 req
->drawable
= drawable
;
113 req
->numAttribs
= (CARD32
) num_attribs
;
116 xGLXVendorPrivateWithReplyReq
*vpreq
;
118 GetReqExtra(GLXVendorPrivateWithReply
, 8 + (8 * num_attribs
), vpreq
);
119 output
= (CARD32
*) (vpreq
+ 1);
121 vpreq
->reqType
= opcode
;
122 vpreq
->glxCode
= X_GLXVendorPrivateWithReply
;
123 vpreq
->vendorCode
= X_GLXvop_ChangeDrawableAttributesSGIX
;
125 output
[0] = (CARD32
) drawable
;
126 output
[1] = num_attribs
;
130 (void) memcpy(output
, attribs
, sizeof(CARD32
) * 2 * num_attribs
);
135 #ifdef GLX_DIRECT_RENDERING
136 pdraw
= GetGLXDRIDrawable(dpy
, drawable
);
141 for (i
= 0; i
< num_attribs
; i
++) {
142 switch(attribs
[i
* 2]) {
144 /* Keep a local copy for masking out DRI2 proto events as needed */
145 pdraw
->eventMask
= attribs
[i
* 2 + 1];
155 #ifdef GLX_DIRECT_RENDERING
157 determineTextureTarget(const int *attribs
, int numAttribs
)
162 for (i
= 0; i
< numAttribs
; i
++) {
163 if (attribs
[2 * i
] == GLX_TEXTURE_TARGET_EXT
) {
164 switch (attribs
[2 * i
+ 1]) {
165 case GLX_TEXTURE_2D_EXT
:
166 target
= GL_TEXTURE_2D
;
168 case GLX_TEXTURE_RECTANGLE_EXT
:
169 target
= GL_TEXTURE_RECTANGLE_ARB
;
179 determineTextureFormat(const int *attribs
, int numAttribs
)
183 for (i
= 0; i
< numAttribs
; i
++) {
184 if (attribs
[2 * i
] == GLX_TEXTURE_FORMAT_EXT
)
185 return attribs
[2 * i
+ 1];
192 CreateDRIDrawable(Display
*dpy
, struct glx_config
*config
,
193 XID drawable
, XID glxdrawable
,
194 const int *attrib_list
, size_t num_attribs
)
196 struct glx_display
*const priv
= __glXInitialize(dpy
);
197 __GLXDRIdrawable
*pdraw
;
198 struct glx_screen
*psc
;
200 psc
= priv
->screens
[config
->screen
];
201 if (psc
->driScreen
== NULL
)
204 pdraw
= psc
->driScreen
->createDrawable(psc
, drawable
,
205 glxdrawable
, config
);
207 fprintf(stderr
, "failed to create drawable\n");
211 if (__glxHashInsert(priv
->drawHash
, glxdrawable
, pdraw
)) {
212 (*pdraw
->destroyDrawable
) (pdraw
);
216 pdraw
->textureTarget
= determineTextureTarget(attrib_list
, num_attribs
);
217 pdraw
->textureFormat
= determineTextureFormat(attrib_list
, num_attribs
);
223 DestroyDRIDrawable(Display
*dpy
, GLXDrawable drawable
, int destroy_xdrawable
)
225 struct glx_display
*const priv
= __glXInitialize(dpy
);
226 __GLXDRIdrawable
*pdraw
= GetGLXDRIDrawable(dpy
, drawable
);
230 xid
= pdraw
->xDrawable
;
231 (*pdraw
->destroyDrawable
) (pdraw
);
232 __glxHashDelete(priv
->drawHash
, drawable
);
233 if (destroy_xdrawable
)
234 XFreePixmap(priv
->dpy
, xid
);
241 CreateDRIDrawable(Display
*dpy
, const struct glx_config
* fbconfig
,
242 XID drawable
, XID glxdrawable
,
243 const int *attrib_list
, size_t num_attribs
)
249 DestroyDRIDrawable(Display
*dpy
, GLXDrawable drawable
, int destroy_xdrawable
)
256 * Get a drawable's attribute.
258 * This function is used to implement \c glXGetSelectedEvent and
259 * \c glXGetSelectedEventSGIX.
262 * This function dynamically determines whether to use the SGIX_pbuffer
263 * version of the protocol or the GLX 1.3 version of the protocol.
266 * The number of attributes returned is likely to be small, probably less than
267 * 10. Given that, this routine should try to use an array on the stack to
268 * capture the reply rather than always calling Xmalloc.
271 GetDrawableAttribute(Display
* dpy
, GLXDrawable drawable
,
272 int attribute
, unsigned int *value
)
274 struct glx_display
*priv
;
275 xGLXGetDrawableAttributesReply reply
;
280 unsigned int num_attributes
;
281 GLboolean use_glx_1_3
;
286 /* Page 38 (page 52 of the PDF) of glxencode1.3.pdf says:
288 * "If drawable is not a valid GLX drawable, a GLXBadDrawable error is
292 __glXSendError(dpy
, GLXBadDrawable
, 0, X_GLXGetDrawableAttributes
, false);
296 priv
= __glXInitialize(dpy
);
297 use_glx_1_3
= ((priv
->majorVersion
> 1) || (priv
->minorVersion
>= 3));
302 opcode
= __glXSetupForCommand(dpy
);
309 xGLXGetDrawableAttributesReq
*req
;
311 GetReq(GLXGetDrawableAttributes
, req
);
312 req
->reqType
= opcode
;
313 req
->glxCode
= X_GLXGetDrawableAttributes
;
314 req
->drawable
= drawable
;
317 xGLXVendorPrivateWithReplyReq
*vpreq
;
319 GetReqExtra(GLXVendorPrivateWithReply
, 4, vpreq
);
320 data
= (CARD32
*) (vpreq
+ 1);
321 data
[0] = (CARD32
) drawable
;
323 vpreq
->reqType
= opcode
;
324 vpreq
->glxCode
= X_GLXVendorPrivateWithReply
;
325 vpreq
->vendorCode
= X_GLXvop_GetDrawableAttributesSGIX
;
328 _XReply(dpy
, (xReply
*) & reply
, 0, False
);
330 if (reply
.type
== X_Error
) {
336 length
= reply
.length
;
338 num_attributes
= (use_glx_1_3
) ? reply
.numAttribs
: length
/ 2;
339 data
= malloc(length
* sizeof(CARD32
));
341 /* Throw data on the floor */
342 _XEatData(dpy
, length
);
345 _XRead(dpy
, (char *) data
, length
* sizeof(CARD32
));
347 /* Search the set of returned attributes for the attribute requested by
350 for (i
= 0; i
< num_attributes
; i
++) {
351 if (data
[i
* 2] == attribute
) {
352 *value
= data
[(i
* 2) + 1];
357 #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
359 __GLXDRIdrawable
*pdraw
= GetGLXDRIDrawable(dpy
, drawable
);
361 if (pdraw
!= NULL
&& !pdraw
->textureTarget
)
362 pdraw
->textureTarget
=
363 determineTextureTarget((const int *) data
, num_attributes
);
364 if (pdraw
!= NULL
&& !pdraw
->textureFormat
)
365 pdraw
->textureFormat
=
366 determineTextureFormat((const int *) data
, num_attributes
);
381 protocolDestroyDrawable(Display
*dpy
, GLXDrawable drawable
, CARD32 glxCode
)
383 xGLXDestroyPbufferReq
*req
;
386 opcode
= __glXSetupForCommand(dpy
);
392 GetReq(GLXDestroyPbuffer
, req
);
393 req
->reqType
= opcode
;
394 req
->glxCode
= glxCode
;
395 req
->pbuffer
= (GLXPbuffer
) drawable
;
402 * Create a non-pbuffer GLX drawable.
405 CreateDrawable(Display
*dpy
, struct glx_config
*config
,
406 Drawable drawable
, const int *attrib_list
, CARD8 glxCode
)
408 xGLXCreateWindowReq
*req
;
409 struct glx_drawable
*glxDraw
;
417 while (attrib_list
[i
* 2] != None
)
421 opcode
= __glXSetupForCommand(dpy
);
425 glxDraw
= malloc(sizeof(*glxDraw
));
430 GetReqExtra(GLXCreateWindow
, 8 * i
, req
);
431 data
= (CARD32
*) (req
+ 1);
433 req
->reqType
= opcode
;
434 req
->glxCode
= glxCode
;
435 req
->screen
= config
->screen
;
436 req
->fbconfig
= config
->fbconfigID
;
437 req
->window
= drawable
;
438 req
->glxwindow
= xid
= XAllocID(dpy
);
442 memcpy(data
, attrib_list
, 8 * i
);
447 if (InitGLXDrawable(dpy
, glxDraw
, drawable
, xid
)) {
452 if (!CreateDRIDrawable(dpy
, config
, drawable
, xid
, attrib_list
, i
)) {
453 if (glxCode
== X_GLXCreatePixmap
)
454 glxCode
= X_GLXDestroyPixmap
;
456 glxCode
= X_GLXDestroyWindow
;
457 protocolDestroyDrawable(dpy
, xid
, glxCode
);
466 * Destroy a non-pbuffer GLX drawable.
469 DestroyDrawable(Display
* dpy
, GLXDrawable drawable
, CARD32 glxCode
)
471 if ((dpy
== NULL
) || (drawable
== 0)) {
475 protocolDestroyDrawable(dpy
, drawable
, glxCode
);
477 DestroyGLXDrawable(dpy
, drawable
);
478 DestroyDRIDrawable(dpy
, drawable
, GL_FALSE
);
487 * This function is used to implement \c glXCreatePbuffer and
488 * \c glXCreateGLXPbufferSGIX.
491 * This function dynamically determines whether to use the SGIX_pbuffer
492 * version of the protocol or the GLX 1.3 version of the protocol.
495 CreatePbuffer(Display
* dpy
, struct glx_config
*config
,
496 unsigned int width
, unsigned int height
,
497 const int *attrib_list
, GLboolean size_in_attribs
)
499 struct glx_display
*priv
= __glXInitialize(dpy
);
505 GLboolean glx_1_3
= GL_FALSE
;
509 while (attrib_list
[i
* 2])
513 opcode
= __glXSetupForCommand(dpy
);
520 if ((priv
->majorVersion
> 1) || (priv
->minorVersion
>= 3)) {
521 xGLXCreatePbufferReq
*req
;
522 unsigned int extra
= (size_in_attribs
) ? 0 : 2;
526 GetReqExtra(GLXCreatePbuffer
, (8 * (i
+ extra
)), req
);
527 data
= (CARD32
*) (req
+ 1);
529 req
->reqType
= opcode
;
530 req
->glxCode
= X_GLXCreatePbuffer
;
531 req
->screen
= config
->screen
;
532 req
->fbconfig
= config
->fbconfigID
;
534 req
->numAttribs
= i
+ extra
;
536 if (!size_in_attribs
) {
537 data
[(2 * i
) + 0] = GLX_PBUFFER_WIDTH
;
538 data
[(2 * i
) + 1] = width
;
539 data
[(2 * i
) + 2] = GLX_PBUFFER_HEIGHT
;
540 data
[(2 * i
) + 3] = height
;
545 xGLXVendorPrivateReq
*vpreq
;
547 GetReqExtra(GLXVendorPrivate
, 20 + (8 * i
), vpreq
);
548 data
= (CARD32
*) (vpreq
+ 1);
550 vpreq
->reqType
= opcode
;
551 vpreq
->glxCode
= X_GLXVendorPrivate
;
552 vpreq
->vendorCode
= X_GLXvop_CreateGLXPbufferSGIX
;
554 data
[0] = config
->screen
;
555 data
[1] = config
->fbconfigID
;
562 (void) memcpy(data
, attrib_list
, sizeof(CARD32
) * 2 * i
);
567 pixmap
= XCreatePixmap(dpy
, RootWindow(dpy
, config
->screen
),
568 width
, height
, config
->rgbBits
);
570 if (!CreateDRIDrawable(dpy
, config
, pixmap
, id
, attrib_list
, i
)) {
571 CARD32 o
= glx_1_3
? X_GLXDestroyPbuffer
: X_GLXvop_DestroyGLXPbufferSGIX
;
572 XFreePixmap(dpy
, pixmap
);
573 protocolDestroyDrawable(dpy
, id
, o
);
583 * This function is used to implement \c glXDestroyPbuffer and
584 * \c glXDestroyGLXPbufferSGIX.
587 * This function dynamically determines whether to use the SGIX_pbuffer
588 * version of the protocol or the GLX 1.3 version of the protocol.
591 DestroyPbuffer(Display
* dpy
, GLXDrawable drawable
)
593 struct glx_display
*priv
= __glXInitialize(dpy
);
596 if ((dpy
== NULL
) || (drawable
== 0)) {
600 opcode
= __glXSetupForCommand(dpy
);
606 if ((priv
->majorVersion
> 1) || (priv
->minorVersion
>= 3)) {
607 xGLXDestroyPbufferReq
*req
;
609 GetReq(GLXDestroyPbuffer
, req
);
610 req
->reqType
= opcode
;
611 req
->glxCode
= X_GLXDestroyPbuffer
;
612 req
->pbuffer
= (GLXPbuffer
) drawable
;
615 xGLXVendorPrivateWithReplyReq
*vpreq
;
618 GetReqExtra(GLXVendorPrivateWithReply
, 4, vpreq
);
619 data
= (CARD32
*) (vpreq
+ 1);
621 data
[0] = (CARD32
) drawable
;
623 vpreq
->reqType
= opcode
;
624 vpreq
->glxCode
= X_GLXVendorPrivateWithReply
;
625 vpreq
->vendorCode
= X_GLXvop_DestroyGLXPbufferSGIX
;
631 DestroyDRIDrawable(dpy
, drawable
, GL_TRUE
);
637 * Create a new pbuffer.
639 _X_EXPORT GLXPbufferSGIX
640 glXCreateGLXPbufferSGIX(Display
* dpy
, GLXFBConfigSGIX config
,
641 unsigned int width
, unsigned int height
,
644 return (GLXPbufferSGIX
) CreatePbuffer(dpy
, (struct glx_config
*) config
,
646 attrib_list
, GL_FALSE
);
649 #endif /* GLX_USE_APPLEGL */
652 * Create a new pbuffer.
655 glXCreatePbuffer(Display
* dpy
, GLXFBConfig config
, const int *attrib_list
)
657 int i
, width
, height
;
658 #ifdef GLX_USE_APPLEGL
666 WARN_ONCE_GLX_1_3(dpy
, __func__
);
668 #ifdef GLX_USE_APPLEGL
669 for (i
= 0; attrib_list
[i
]; ++i
) {
670 switch (attrib_list
[i
]) {
671 case GLX_PBUFFER_WIDTH
:
672 width
= attrib_list
[i
+ 1];
676 case GLX_PBUFFER_HEIGHT
:
677 height
= attrib_list
[i
+ 1];
681 case GLX_LARGEST_PBUFFER
:
682 /* This is a hint we should probably handle, but how? */
686 case GLX_PRESERVED_CONTENTS
:
687 /* The contents are always preserved with AppleSGLX with CGL. */
696 if (apple_glx_pbuffer_create(dpy
, config
, width
, height
, &errorcode
,
699 * apple_glx_pbuffer_create only sets the errorcode to core X11
702 __glXSendError(dpy
, errorcode
, 0, X_GLXCreatePbuffer
, true);
709 for (i
= 0; attrib_list
[i
* 2]; i
++) {
710 switch (attrib_list
[i
* 2]) {
711 case GLX_PBUFFER_WIDTH
:
712 width
= attrib_list
[i
* 2 + 1];
714 case GLX_PBUFFER_HEIGHT
:
715 height
= attrib_list
[i
* 2 + 1];
720 return (GLXPbuffer
) CreatePbuffer(dpy
, (struct glx_config
*) config
,
721 width
, height
, attrib_list
, GL_TRUE
);
727 * Destroy an existing pbuffer.
730 glXDestroyPbuffer(Display
* dpy
, GLXPbuffer pbuf
)
732 #ifdef GLX_USE_APPLEGL
733 if (apple_glx_pbuffer_destroy(dpy
, pbuf
)) {
734 __glXSendError(dpy
, GLXBadPbuffer
, pbuf
, X_GLXDestroyPbuffer
, false);
737 DestroyPbuffer(dpy
, pbuf
);
743 * Query an attribute of a drawable.
746 glXQueryDrawable(Display
* dpy
, GLXDrawable drawable
,
747 int attribute
, unsigned int *value
)
749 WARN_ONCE_GLX_1_3(dpy
, __func__
);
750 #ifdef GLX_USE_APPLEGL
753 unsigned int width
, height
, bd
, depth
;
755 if (apple_glx_pixmap_query(drawable
, attribute
, value
))
758 if (apple_glx_pbuffer_query(drawable
, attribute
, value
))
762 * The OpenGL spec states that we should report GLXBadDrawable if
763 * the drawable is invalid, however doing so would require that we
764 * use XSetErrorHandler(), which is known to not be thread safe.
765 * If we use a round-trip call to validate the drawable, there could
766 * be a race, so instead we just opt in favor of letting the
767 * XGetGeometry request fail with a GetGeometry request X error
768 * rather than GLXBadDrawable, in what is hoped to be a rare
769 * case of an invalid drawable. In practice most and possibly all
770 * X11 apps using GLX shouldn't notice a difference.
773 (dpy
, drawable
, &root
, &x
, &y
, &width
, &height
, &bd
, &depth
)) {
785 GetDrawableAttribute(dpy
, drawable
, attribute
, value
);
790 #ifndef GLX_USE_APPLEGL
792 * Query an attribute of a pbuffer.
795 glXQueryGLXPbufferSGIX(Display
* dpy
, GLXPbufferSGIX drawable
,
796 int attribute
, unsigned int *value
)
798 return GetDrawableAttribute(dpy
, drawable
, attribute
, value
);
803 * Select the event mask for a drawable.
806 glXSelectEvent(Display
* dpy
, GLXDrawable drawable
, unsigned long mask
)
808 #ifdef GLX_USE_APPLEGL
809 XWindowAttributes xwattr
;
811 if (apple_glx_pbuffer_set_event_mask(drawable
, mask
))
815 * The spec allows a window, but currently there are no valid
816 * events for a window, so do nothing.
818 if (XGetWindowAttributes(dpy
, drawable
, &xwattr
))
820 /* The drawable seems to be invalid. Report an error. */
822 __glXSendError(dpy
, GLXBadDrawable
, drawable
,
823 X_GLXChangeDrawableAttributes
, false);
827 attribs
[0] = (CARD32
) GLX_EVENT_MASK
;
828 attribs
[1] = (CARD32
) mask
;
830 ChangeDrawableAttribute(dpy
, drawable
, attribs
, 1);
836 * Get the selected event mask for a drawable.
839 glXGetSelectedEvent(Display
* dpy
, GLXDrawable drawable
, unsigned long *mask
)
841 #ifdef GLX_USE_APPLEGL
842 XWindowAttributes xwattr
;
844 if (apple_glx_pbuffer_get_event_mask(drawable
, mask
))
848 * The spec allows a window, but currently there are no valid
849 * events for a window, so do nothing, but set the mask to 0.
851 if (XGetWindowAttributes(dpy
, drawable
, &xwattr
)) {
852 /* The window is valid, so set the mask to 0. */
856 /* The drawable seems to be invalid. Report an error. */
858 __glXSendError(dpy
, GLXBadDrawable
, drawable
, X_GLXGetDrawableAttributes
,
864 /* The non-sense with value is required because on LP64 platforms
865 * sizeof(unsigned int) != sizeof(unsigned long). On little-endian
866 * we could just type-cast the pointer, but why?
869 GetDrawableAttribute(dpy
, drawable
, GLX_EVENT_MASK_SGIX
, &value
);
876 glXCreatePixmap(Display
* dpy
, GLXFBConfig config
, Pixmap pixmap
,
877 const int *attrib_list
)
879 WARN_ONCE_GLX_1_3(dpy
, __func__
);
881 #ifdef GLX_USE_APPLEGL
882 const struct glx_config
*modes
= (const struct glx_config
*) config
;
884 if (apple_glx_pixmap_create(dpy
, modes
->screen
, pixmap
, modes
))
889 return CreateDrawable(dpy
, (struct glx_config
*) config
,
890 (Drawable
) pixmap
, attrib_list
, X_GLXCreatePixmap
);
896 glXCreateWindow(Display
* dpy
, GLXFBConfig config
, Window win
,
897 const int *attrib_list
)
899 WARN_ONCE_GLX_1_3(dpy
, __func__
);
900 #ifdef GLX_USE_APPLEGL
901 XWindowAttributes xwattr
;
902 XVisualInfo
*visinfo
;
904 (void) attrib_list
; /*unused according to GLX 1.4 */
906 XGetWindowAttributes(dpy
, win
, &xwattr
);
908 visinfo
= glXGetVisualFromFBConfig(dpy
, config
);
910 if (NULL
== visinfo
) {
911 __glXSendError(dpy
, GLXBadFBConfig
, 0, X_GLXCreateWindow
, false);
915 if (visinfo
->visualid
!= XVisualIDFromVisual(xwattr
.visual
)) {
916 __glXSendError(dpy
, BadMatch
, 0, X_GLXCreateWindow
, true);
924 return CreateDrawable(dpy
, (struct glx_config
*) config
,
925 (Drawable
) win
, attrib_list
, X_GLXCreateWindow
);
931 glXDestroyPixmap(Display
* dpy
, GLXPixmap pixmap
)
933 WARN_ONCE_GLX_1_3(dpy
, __func__
);
934 #ifdef GLX_USE_APPLEGL
935 if (apple_glx_pixmap_destroy(dpy
, pixmap
))
936 __glXSendError(dpy
, GLXBadPixmap
, pixmap
, X_GLXDestroyPixmap
, false);
938 DestroyDrawable(dpy
, (GLXDrawable
) pixmap
, X_GLXDestroyPixmap
);
944 glXDestroyWindow(Display
* dpy
, GLXWindow win
)
946 WARN_ONCE_GLX_1_3(dpy
, __func__
);
947 #ifndef GLX_USE_APPLEGL
948 DestroyDrawable(dpy
, (GLXDrawable
) win
, X_GLXDestroyWindow
);
952 #ifndef GLX_USE_APPLEGL
954 GLX_ALIAS_VOID(glXDestroyGLXPbufferSGIX
,
955 (Display
* dpy
, GLXPbufferSGIX pbuf
),
956 (dpy
, pbuf
), glXDestroyPbuffer
)
959 GLX_ALIAS_VOID(glXSelectEventSGIX
,
960 (Display
* dpy
, GLXDrawable drawable
,
961 unsigned long mask
), (dpy
, drawable
, mask
), glXSelectEvent
)
964 GLX_ALIAS_VOID(glXGetSelectedEventSGIX
,
965 (Display
* dpy
, GLXDrawable drawable
,
966 unsigned long *mask
), (dpy
, drawable
, mask
),