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 struct glx_display
*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 ChangeDrawableAttribute(Display
* dpy
, GLXDrawable drawable
,
83 const CARD32
* attribs
, size_t num_attribs
)
85 struct glx_display
*priv
= __glXInitialize(dpy
);
86 #ifdef GLX_DIRECT_RENDERING
87 __GLXDRIdrawable
*pdraw
;
93 if ((dpy
== NULL
) || (drawable
== 0)) {
97 opcode
= __glXSetupForCommand(dpy
);
103 if ((priv
->majorVersion
> 1) || (priv
->minorVersion
>= 3)) {
104 xGLXChangeDrawableAttributesReq
*req
;
106 GetReqExtra(GLXChangeDrawableAttributes
, 8 * num_attribs
, req
);
107 output
= (CARD32
*) (req
+ 1);
109 req
->reqType
= opcode
;
110 req
->glxCode
= X_GLXChangeDrawableAttributes
;
111 req
->drawable
= drawable
;
112 req
->numAttribs
= (CARD32
) num_attribs
;
115 xGLXVendorPrivateWithReplyReq
*vpreq
;
117 GetReqExtra(GLXVendorPrivateWithReply
, 8 + (8 * num_attribs
), vpreq
);
118 output
= (CARD32
*) (vpreq
+ 1);
120 vpreq
->reqType
= opcode
;
121 vpreq
->glxCode
= X_GLXVendorPrivateWithReply
;
122 vpreq
->vendorCode
= X_GLXvop_ChangeDrawableAttributesSGIX
;
124 output
[0] = (CARD32
) drawable
;
125 output
[1] = num_attribs
;
129 (void) memcpy(output
, attribs
, sizeof(CARD32
) * 2 * num_attribs
);
134 #ifdef GLX_DIRECT_RENDERING
135 pdraw
= GetGLXDRIDrawable(dpy
, drawable
);
140 for (i
= 0; i
< num_attribs
; i
++) {
141 switch(attribs
[i
* 2]) {
143 /* Keep a local copy for masking out DRI2 proto events as needed */
144 pdraw
->eventMask
= attribs
[i
* 2 + 1];
154 #ifdef GLX_DIRECT_RENDERING
156 determineTextureTarget(const int *attribs
, int numAttribs
)
161 for (i
= 0; i
< numAttribs
; i
++) {
162 if (attribs
[2 * i
] == GLX_TEXTURE_TARGET_EXT
) {
163 switch (attribs
[2 * i
+ 1]) {
164 case GLX_TEXTURE_2D_EXT
:
165 target
= GL_TEXTURE_2D
;
167 case GLX_TEXTURE_RECTANGLE_EXT
:
168 target
= GL_TEXTURE_RECTANGLE_ARB
;
178 determineTextureFormat(const int *attribs
, int numAttribs
)
182 for (i
= 0; i
< numAttribs
; i
++) {
183 if (attribs
[2 * i
] == GLX_TEXTURE_FORMAT_EXT
)
184 return attribs
[2 * i
+ 1];
191 CreateDRIDrawable(Display
*dpy
, struct glx_config
*config
,
192 XID drawable
, XID glxdrawable
,
193 const int *attrib_list
, size_t num_attribs
)
195 struct glx_display
*const priv
= __glXInitialize(dpy
);
196 __GLXDRIdrawable
*pdraw
;
197 struct glx_screen
*psc
;
199 psc
= priv
->screens
[config
->screen
];
200 if (psc
->driScreen
== NULL
)
203 pdraw
= psc
->driScreen
->createDrawable(psc
, drawable
,
204 glxdrawable
, config
);
206 fprintf(stderr
, "failed to create drawable\n");
210 if (__glxHashInsert(priv
->drawHash
, glxdrawable
, pdraw
)) {
211 (*pdraw
->destroyDrawable
) (pdraw
);
215 pdraw
->textureTarget
= determineTextureTarget(attrib_list
, num_attribs
);
216 pdraw
->textureFormat
= determineTextureFormat(attrib_list
, num_attribs
);
222 DestroyDRIDrawable(Display
*dpy
, GLXDrawable drawable
, int destroy_xdrawable
)
224 struct glx_display
*const priv
= __glXInitialize(dpy
);
225 __GLXDRIdrawable
*pdraw
= GetGLXDRIDrawable(dpy
, drawable
);
229 xid
= pdraw
->xDrawable
;
230 (*pdraw
->destroyDrawable
) (pdraw
);
231 __glxHashDelete(priv
->drawHash
, drawable
);
232 if (destroy_xdrawable
)
233 XFreePixmap(priv
->dpy
, xid
);
240 CreateDRIDrawable(Display
*dpy
, const struct glx_config
* fbconfig
,
241 XID drawable
, XID glxdrawable
,
242 const int *attrib_list
, size_t num_attribs
)
248 DestroyDRIDrawable(Display
*dpy
, GLXDrawable drawable
, int destroy_xdrawable
)
255 * Get a drawable's attribute.
257 * This function is used to implement \c glXGetSelectedEvent and
258 * \c glXGetSelectedEventSGIX.
261 * This function dynamically determines whether to use the SGIX_pbuffer
262 * version of the protocol or the GLX 1.3 version of the protocol.
265 * The number of attributes returned is likely to be small, probably less than
266 * 10. Given that, this routine should try to use an array on the stack to
267 * capture the reply rather than always calling Xmalloc.
270 GetDrawableAttribute(Display
* dpy
, GLXDrawable drawable
,
271 int attribute
, unsigned int *value
)
273 struct glx_display
*priv
;
274 xGLXGetDrawableAttributesReply reply
;
279 unsigned int num_attributes
;
280 GLboolean use_glx_1_3
;
282 if ((dpy
== NULL
) || (drawable
== 0)) {
286 priv
= __glXInitialize(dpy
);
287 use_glx_1_3
= ((priv
->majorVersion
> 1) || (priv
->minorVersion
>= 3));
292 opcode
= __glXSetupForCommand(dpy
);
299 xGLXGetDrawableAttributesReq
*req
;
301 GetReq(GLXGetDrawableAttributes
, req
);
302 req
->reqType
= opcode
;
303 req
->glxCode
= X_GLXGetDrawableAttributes
;
304 req
->drawable
= drawable
;
307 xGLXVendorPrivateWithReplyReq
*vpreq
;
309 GetReqExtra(GLXVendorPrivateWithReply
, 4, vpreq
);
310 data
= (CARD32
*) (vpreq
+ 1);
311 data
[0] = (CARD32
) drawable
;
313 vpreq
->reqType
= opcode
;
314 vpreq
->glxCode
= X_GLXVendorPrivateWithReply
;
315 vpreq
->vendorCode
= X_GLXvop_GetDrawableAttributesSGIX
;
318 _XReply(dpy
, (xReply
*) & reply
, 0, False
);
320 if (reply
.type
== X_Error
) {
326 length
= reply
.length
;
328 num_attributes
= (use_glx_1_3
) ? reply
.numAttribs
: length
/ 2;
329 data
= (CARD32
*) Xmalloc(length
* sizeof(CARD32
));
331 /* Throw data on the floor */
332 _XEatData(dpy
, length
);
335 _XRead(dpy
, (char *) data
, length
* sizeof(CARD32
));
337 /* Search the set of returned attributes for the attribute requested by
340 for (i
= 0; i
< num_attributes
; i
++) {
341 if (data
[i
* 2] == attribute
) {
342 *value
= data
[(i
* 2) + 1];
347 #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
349 __GLXDRIdrawable
*pdraw
= GetGLXDRIDrawable(dpy
, drawable
);
351 if (pdraw
!= NULL
&& !pdraw
->textureTarget
)
352 pdraw
->textureTarget
=
353 determineTextureTarget((const int *) data
, num_attributes
);
354 if (pdraw
!= NULL
&& !pdraw
->textureFormat
)
355 pdraw
->textureFormat
=
356 determineTextureFormat((const int *) data
, num_attributes
);
371 protocolDestroyDrawable(Display
*dpy
, GLXDrawable drawable
, CARD32 glxCode
)
373 xGLXDestroyPbufferReq
*req
;
376 opcode
= __glXSetupForCommand(dpy
);
382 GetReq(GLXDestroyPbuffer
, req
);
383 req
->reqType
= opcode
;
384 req
->glxCode
= glxCode
;
385 req
->pbuffer
= (GLXPbuffer
) drawable
;
392 * Create a non-pbuffer GLX drawable.
395 CreateDrawable(Display
*dpy
, struct glx_config
*config
,
396 Drawable drawable
, const int *attrib_list
, CARD8 glxCode
)
398 xGLXCreateWindowReq
*req
;
406 while (attrib_list
[i
* 2] != None
)
410 opcode
= __glXSetupForCommand(dpy
);
415 GetReqExtra(GLXCreateWindow
, 8 * i
, req
);
416 data
= (CARD32
*) (req
+ 1);
418 req
->reqType
= opcode
;
419 req
->glxCode
= glxCode
;
420 req
->screen
= config
->screen
;
421 req
->fbconfig
= config
->fbconfigID
;
422 req
->window
= drawable
;
423 req
->glxwindow
= xid
= XAllocID(dpy
);
427 memcpy(data
, attrib_list
, 8 * i
);
432 if (!CreateDRIDrawable(dpy
, config
, drawable
, xid
, attrib_list
, i
)) {
433 if (glxCode
== X_GLXCreatePixmap
)
434 glxCode
= X_GLXDestroyPixmap
;
436 glxCode
= X_GLXDestroyWindow
;
437 protocolDestroyDrawable(dpy
, xid
, glxCode
);
446 * Destroy a non-pbuffer GLX drawable.
449 DestroyDrawable(Display
* dpy
, GLXDrawable drawable
, CARD32 glxCode
)
451 if ((dpy
== NULL
) || (drawable
== 0)) {
455 protocolDestroyDrawable(dpy
, drawable
, glxCode
);
457 DestroyDRIDrawable(dpy
, drawable
, GL_FALSE
);
466 * This function is used to implement \c glXCreatePbuffer and
467 * \c glXCreateGLXPbufferSGIX.
470 * This function dynamically determines whether to use the SGIX_pbuffer
471 * version of the protocol or the GLX 1.3 version of the protocol.
474 CreatePbuffer(Display
* dpy
, struct glx_config
*config
,
475 unsigned int width
, unsigned int height
,
476 const int *attrib_list
, GLboolean size_in_attribs
)
478 struct glx_display
*priv
= __glXInitialize(dpy
);
484 GLboolean glx_1_3
= GL_FALSE
;
488 while (attrib_list
[i
* 2])
492 opcode
= __glXSetupForCommand(dpy
);
499 if ((priv
->majorVersion
> 1) || (priv
->minorVersion
>= 3)) {
500 xGLXCreatePbufferReq
*req
;
501 unsigned int extra
= (size_in_attribs
) ? 0 : 2;
505 GetReqExtra(GLXCreatePbuffer
, (8 * (i
+ extra
)), req
);
506 data
= (CARD32
*) (req
+ 1);
508 req
->reqType
= opcode
;
509 req
->glxCode
= X_GLXCreatePbuffer
;
510 req
->screen
= config
->screen
;
511 req
->fbconfig
= config
->fbconfigID
;
513 req
->numAttribs
= i
+ extra
;
515 if (!size_in_attribs
) {
516 data
[(2 * i
) + 0] = GLX_PBUFFER_WIDTH
;
517 data
[(2 * i
) + 1] = width
;
518 data
[(2 * i
) + 2] = GLX_PBUFFER_HEIGHT
;
519 data
[(2 * i
) + 3] = height
;
524 xGLXVendorPrivateReq
*vpreq
;
526 GetReqExtra(GLXVendorPrivate
, 20 + (8 * i
), vpreq
);
527 data
= (CARD32
*) (vpreq
+ 1);
529 vpreq
->reqType
= opcode
;
530 vpreq
->glxCode
= X_GLXVendorPrivate
;
531 vpreq
->vendorCode
= X_GLXvop_CreateGLXPbufferSGIX
;
533 data
[0] = config
->screen
;
534 data
[1] = config
->fbconfigID
;
541 (void) memcpy(data
, attrib_list
, sizeof(CARD32
) * 2 * i
);
546 pixmap
= XCreatePixmap(dpy
, RootWindow(dpy
, config
->screen
),
547 width
, height
, config
->rgbBits
);
549 if (!CreateDRIDrawable(dpy
, config
, pixmap
, id
, attrib_list
, i
)) {
550 CARD32 o
= glx_1_3
? X_GLXDestroyPbuffer
: X_GLXvop_DestroyGLXPbufferSGIX
;
551 XFreePixmap(dpy
, pixmap
);
552 protocolDestroyDrawable(dpy
, id
, o
);
562 * This function is used to implement \c glXDestroyPbuffer and
563 * \c glXDestroyGLXPbufferSGIX.
566 * This function dynamically determines whether to use the SGIX_pbuffer
567 * version of the protocol or the GLX 1.3 version of the protocol.
570 DestroyPbuffer(Display
* dpy
, GLXDrawable drawable
)
572 struct glx_display
*priv
= __glXInitialize(dpy
);
575 if ((dpy
== NULL
) || (drawable
== 0)) {
579 opcode
= __glXSetupForCommand(dpy
);
585 if ((priv
->majorVersion
> 1) || (priv
->minorVersion
>= 3)) {
586 xGLXDestroyPbufferReq
*req
;
588 GetReq(GLXDestroyPbuffer
, req
);
589 req
->reqType
= opcode
;
590 req
->glxCode
= X_GLXDestroyPbuffer
;
591 req
->pbuffer
= (GLXPbuffer
) drawable
;
594 xGLXVendorPrivateWithReplyReq
*vpreq
;
597 GetReqExtra(GLXVendorPrivateWithReply
, 4, vpreq
);
598 data
= (CARD32
*) (vpreq
+ 1);
600 data
[0] = (CARD32
) drawable
;
602 vpreq
->reqType
= opcode
;
603 vpreq
->glxCode
= X_GLXVendorPrivateWithReply
;
604 vpreq
->vendorCode
= X_GLXvop_DestroyGLXPbufferSGIX
;
610 DestroyDRIDrawable(dpy
, drawable
, GL_TRUE
);
616 * Create a new pbuffer.
618 _X_EXPORT GLXPbufferSGIX
619 glXCreateGLXPbufferSGIX(Display
* dpy
, GLXFBConfigSGIX config
,
620 unsigned int width
, unsigned int height
,
623 return (GLXPbufferSGIX
) CreatePbuffer(dpy
, (struct glx_config
*) config
,
625 attrib_list
, GL_FALSE
);
628 #endif /* GLX_USE_APPLEGL */
631 * Create a new pbuffer.
634 glXCreatePbuffer(Display
* dpy
, GLXFBConfig config
, const int *attrib_list
)
636 int i
, width
, height
;
637 #ifdef GLX_USE_APPLEGL
645 WARN_ONCE_GLX_1_3(dpy
, __func__
);
647 #ifdef GLX_USE_APPLEGL
648 for (i
= 0; attrib_list
[i
]; ++i
) {
649 switch (attrib_list
[i
]) {
650 case GLX_PBUFFER_WIDTH
:
651 width
= attrib_list
[i
+ 1];
655 case GLX_PBUFFER_HEIGHT
:
656 height
= attrib_list
[i
+ 1];
660 case GLX_LARGEST_PBUFFER
:
661 /* This is a hint we should probably handle, but how? */
665 case GLX_PRESERVED_CONTENTS
:
666 /* The contents are always preserved with AppleSGLX with CGL. */
675 if (apple_glx_pbuffer_create(dpy
, config
, width
, height
, &errorcode
,
678 * apple_glx_pbuffer_create only sets the errorcode to core X11
681 __glXSendError(dpy
, errorcode
, 0, X_GLXCreatePbuffer
, true);
688 for (i
= 0; attrib_list
[i
* 2]; i
++) {
689 switch (attrib_list
[i
* 2]) {
690 case GLX_PBUFFER_WIDTH
:
691 width
= attrib_list
[i
* 2 + 1];
693 case GLX_PBUFFER_HEIGHT
:
694 height
= attrib_list
[i
* 2 + 1];
699 return (GLXPbuffer
) CreatePbuffer(dpy
, (struct glx_config
*) config
,
700 width
, height
, attrib_list
, GL_TRUE
);
706 * Destroy an existing pbuffer.
709 glXDestroyPbuffer(Display
* dpy
, GLXPbuffer pbuf
)
711 #ifdef GLX_USE_APPLEGL
712 if (apple_glx_pbuffer_destroy(dpy
, pbuf
)) {
713 __glXSendError(dpy
, GLXBadPbuffer
, pbuf
, X_GLXDestroyPbuffer
, false);
716 DestroyPbuffer(dpy
, pbuf
);
722 * Query an attribute of a drawable.
725 glXQueryDrawable(Display
* dpy
, GLXDrawable drawable
,
726 int attribute
, unsigned int *value
)
728 WARN_ONCE_GLX_1_3(dpy
, __func__
);
729 #ifdef GLX_USE_APPLEGL
732 unsigned int width
, height
, bd
, depth
;
734 if (apple_glx_pixmap_query(drawable
, attribute
, value
))
737 if (apple_glx_pbuffer_query(drawable
, attribute
, value
))
741 * The OpenGL spec states that we should report GLXBadDrawable if
742 * the drawable is invalid, however doing so would require that we
743 * use XSetErrorHandler(), which is known to not be thread safe.
744 * If we use a round-trip call to validate the drawable, there could
745 * be a race, so instead we just opt in favor of letting the
746 * XGetGeometry request fail with a GetGeometry request X error
747 * rather than GLXBadDrawable, in what is hoped to be a rare
748 * case of an invalid drawable. In practice most and possibly all
749 * X11 apps using GLX shouldn't notice a difference.
752 (dpy
, drawable
, &root
, &x
, &y
, &width
, &height
, &bd
, &depth
)) {
764 GetDrawableAttribute(dpy
, drawable
, attribute
, value
);
769 #ifndef GLX_USE_APPLEGL
771 * Query an attribute of a pbuffer.
774 glXQueryGLXPbufferSGIX(Display
* dpy
, GLXPbufferSGIX drawable
,
775 int attribute
, unsigned int *value
)
777 return GetDrawableAttribute(dpy
, drawable
, attribute
, value
);
782 * Select the event mask for a drawable.
785 glXSelectEvent(Display
* dpy
, GLXDrawable drawable
, unsigned long mask
)
787 #ifdef GLX_USE_APPLEGL
788 XWindowAttributes xwattr
;
790 if (apple_glx_pbuffer_set_event_mask(drawable
, mask
))
794 * The spec allows a window, but currently there are no valid
795 * events for a window, so do nothing.
797 if (XGetWindowAttributes(dpy
, drawable
, &xwattr
))
799 /* The drawable seems to be invalid. Report an error. */
801 __glXSendError(dpy
, GLXBadDrawable
, drawable
,
802 X_GLXChangeDrawableAttributes
, false);
806 attribs
[0] = (CARD32
) GLX_EVENT_MASK
;
807 attribs
[1] = (CARD32
) mask
;
809 ChangeDrawableAttribute(dpy
, drawable
, attribs
, 1);
815 * Get the selected event mask for a drawable.
818 glXGetSelectedEvent(Display
* dpy
, GLXDrawable drawable
, unsigned long *mask
)
820 #ifdef GLX_USE_APPLEGL
821 XWindowAttributes xwattr
;
823 if (apple_glx_pbuffer_get_event_mask(drawable
, mask
))
827 * The spec allows a window, but currently there are no valid
828 * events for a window, so do nothing, but set the mask to 0.
830 if (XGetWindowAttributes(dpy
, drawable
, &xwattr
)) {
831 /* The window is valid, so set the mask to 0. */
835 /* The drawable seems to be invalid. Report an error. */
837 __glXSendError(dpy
, GLXBadDrawable
, drawable
, X_GLXGetDrawableAttributes
,
843 /* The non-sense with value is required because on LP64 platforms
844 * sizeof(unsigned int) != sizeof(unsigned long). On little-endian
845 * we could just type-cast the pointer, but why?
848 GetDrawableAttribute(dpy
, drawable
, GLX_EVENT_MASK_SGIX
, &value
);
855 glXCreatePixmap(Display
* dpy
, GLXFBConfig config
, Pixmap pixmap
,
856 const int *attrib_list
)
858 WARN_ONCE_GLX_1_3(dpy
, __func__
);
860 #ifdef GLX_USE_APPLEGL
861 const struct glx_config
*modes
= (const struct glx_config
*) config
;
863 if (apple_glx_pixmap_create(dpy
, modes
->screen
, pixmap
, modes
))
868 return CreateDrawable(dpy
, (struct glx_config
*) config
,
869 (Drawable
) pixmap
, attrib_list
, X_GLXCreatePixmap
);
875 glXCreateWindow(Display
* dpy
, GLXFBConfig config
, Window win
,
876 const int *attrib_list
)
878 WARN_ONCE_GLX_1_3(dpy
, __func__
);
879 #ifdef GLX_USE_APPLEGL
880 XWindowAttributes xwattr
;
881 XVisualInfo
*visinfo
;
883 (void) attrib_list
; /*unused according to GLX 1.4 */
885 XGetWindowAttributes(dpy
, win
, &xwattr
);
887 visinfo
= glXGetVisualFromFBConfig(dpy
, config
);
889 if (NULL
== visinfo
) {
890 __glXSendError(dpy
, GLXBadFBConfig
, 0, X_GLXCreateWindow
, false);
894 if (visinfo
->visualid
!= XVisualIDFromVisual(xwattr
.visual
)) {
895 __glXSendError(dpy
, BadMatch
, 0, X_GLXCreateWindow
, true);
903 return CreateDrawable(dpy
, (struct glx_config
*) config
,
904 (Drawable
) win
, attrib_list
, X_GLXCreateWindow
);
910 glXDestroyPixmap(Display
* dpy
, GLXPixmap pixmap
)
912 WARN_ONCE_GLX_1_3(dpy
, __func__
);
913 #ifdef GLX_USE_APPLEGL
914 if (apple_glx_pixmap_destroy(dpy
, pixmap
))
915 __glXSendError(dpy
, GLXBadPixmap
, pixmap
, X_GLXDestroyPixmap
, false);
917 DestroyDrawable(dpy
, (GLXDrawable
) pixmap
, X_GLXDestroyPixmap
);
923 glXDestroyWindow(Display
* dpy
, GLXWindow win
)
925 WARN_ONCE_GLX_1_3(dpy
, __func__
);
926 #ifndef GLX_USE_APPLEGL
927 DestroyDrawable(dpy
, (GLXDrawable
) win
, X_GLXDestroyWindow
);
931 #ifndef GLX_USE_APPLEGL
933 GLX_ALIAS_VOID(glXDestroyGLXPbufferSGIX
,
934 (Display
* dpy
, GLXPbufferSGIX pbuf
),
935 (dpy
, pbuf
), glXDestroyPbuffer
)
938 GLX_ALIAS_VOID(glXSelectEventSGIX
,
939 (Display
* dpy
, GLXDrawable drawable
,
940 unsigned long mask
), (dpy
, drawable
, mask
), glXSelectEvent
)
943 GLX_ALIAS_VOID(glXGetSelectedEventSGIX
,
944 (Display
* dpy
, GLXDrawable drawable
,
945 unsigned long *mask
), (dpy
, drawable
, mask
),