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
&& 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 ((priv
== NULL
) || (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
;
201 fprintf(stderr
, "failed to create drawable\n");
205 psc
= priv
->screens
[config
->screen
];
206 if (psc
->driScreen
== NULL
)
209 pdraw
= psc
->driScreen
->createDrawable(psc
, drawable
,
210 glxdrawable
, config
);
212 fprintf(stderr
, "failed to create drawable\n");
216 if (__glxHashInsert(priv
->drawHash
, glxdrawable
, pdraw
)) {
217 (*pdraw
->destroyDrawable
) (pdraw
);
221 pdraw
->textureTarget
= determineTextureTarget(attrib_list
, num_attribs
);
222 pdraw
->textureFormat
= determineTextureFormat(attrib_list
, num_attribs
);
228 DestroyDRIDrawable(Display
*dpy
, GLXDrawable drawable
, int destroy_xdrawable
)
230 struct glx_display
*const priv
= __glXInitialize(dpy
);
231 __GLXDRIdrawable
*pdraw
= GetGLXDRIDrawable(dpy
, drawable
);
234 if (priv
!= NULL
&& pdraw
!= NULL
) {
235 xid
= pdraw
->xDrawable
;
236 (*pdraw
->destroyDrawable
) (pdraw
);
237 __glxHashDelete(priv
->drawHash
, drawable
);
238 if (destroy_xdrawable
)
239 XFreePixmap(priv
->dpy
, xid
);
246 CreateDRIDrawable(Display
*dpy
, const struct glx_config
* fbconfig
,
247 XID drawable
, XID glxdrawable
,
248 const int *attrib_list
, size_t num_attribs
)
254 DestroyDRIDrawable(Display
*dpy
, GLXDrawable drawable
, int destroy_xdrawable
)
261 * Get a drawable's attribute.
263 * This function is used to implement \c glXGetSelectedEvent and
264 * \c glXGetSelectedEventSGIX.
267 * This function dynamically determines whether to use the SGIX_pbuffer
268 * version of the protocol or the GLX 1.3 version of the protocol.
271 * The number of attributes returned is likely to be small, probably less than
272 * 10. Given that, this routine should try to use an array on the stack to
273 * capture the reply rather than always calling Xmalloc.
276 GetDrawableAttribute(Display
* dpy
, GLXDrawable drawable
,
277 int attribute
, unsigned int *value
)
279 struct glx_display
*priv
;
280 xGLXGetDrawableAttributesReply reply
;
285 unsigned int num_attributes
;
286 GLboolean use_glx_1_3
;
291 /* Page 38 (page 52 of the PDF) of glxencode1.3.pdf says:
293 * "If drawable is not a valid GLX drawable, a GLXBadDrawable error is
297 __glXSendError(dpy
, GLXBadDrawable
, 0, X_GLXGetDrawableAttributes
, false);
301 priv
= __glXInitialize(dpy
);
305 use_glx_1_3
= ((priv
->majorVersion
> 1) || (priv
->minorVersion
>= 3));
310 opcode
= __glXSetupForCommand(dpy
);
317 xGLXGetDrawableAttributesReq
*req
;
319 GetReq(GLXGetDrawableAttributes
, req
);
320 req
->reqType
= opcode
;
321 req
->glxCode
= X_GLXGetDrawableAttributes
;
322 req
->drawable
= drawable
;
325 xGLXVendorPrivateWithReplyReq
*vpreq
;
327 GetReqExtra(GLXVendorPrivateWithReply
, 4, vpreq
);
328 data
= (CARD32
*) (vpreq
+ 1);
329 data
[0] = (CARD32
) drawable
;
331 vpreq
->reqType
= opcode
;
332 vpreq
->glxCode
= X_GLXVendorPrivateWithReply
;
333 vpreq
->vendorCode
= X_GLXvop_GetDrawableAttributesSGIX
;
336 _XReply(dpy
, (xReply
*) & reply
, 0, False
);
338 if (reply
.type
== X_Error
) {
344 length
= reply
.length
;
346 num_attributes
= (use_glx_1_3
) ? reply
.numAttribs
: length
/ 2;
347 data
= malloc(length
* sizeof(CARD32
));
349 /* Throw data on the floor */
350 _XEatData(dpy
, length
);
353 _XRead(dpy
, (char *) data
, length
* sizeof(CARD32
));
355 /* Search the set of returned attributes for the attribute requested by
358 for (i
= 0; i
< num_attributes
; i
++) {
359 if (data
[i
* 2] == attribute
) {
360 *value
= data
[(i
* 2) + 1];
365 #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
367 __GLXDRIdrawable
*pdraw
= GetGLXDRIDrawable(dpy
, drawable
);
369 if (pdraw
!= NULL
&& !pdraw
->textureTarget
)
370 pdraw
->textureTarget
=
371 determineTextureTarget((const int *) data
, num_attributes
);
372 if (pdraw
!= NULL
&& !pdraw
->textureFormat
)
373 pdraw
->textureFormat
=
374 determineTextureFormat((const int *) data
, num_attributes
);
389 protocolDestroyDrawable(Display
*dpy
, GLXDrawable drawable
, CARD32 glxCode
)
391 xGLXDestroyPbufferReq
*req
;
394 opcode
= __glXSetupForCommand(dpy
);
400 GetReq(GLXDestroyPbuffer
, req
);
401 req
->reqType
= opcode
;
402 req
->glxCode
= glxCode
;
403 req
->pbuffer
= (GLXPbuffer
) drawable
;
410 * Create a non-pbuffer GLX drawable.
413 CreateDrawable(Display
*dpy
, struct glx_config
*config
,
414 Drawable drawable
, const int *attrib_list
, CARD8 glxCode
)
416 xGLXCreateWindowReq
*req
;
417 struct glx_drawable
*glxDraw
;
425 while (attrib_list
[i
* 2] != None
)
429 opcode
= __glXSetupForCommand(dpy
);
433 glxDraw
= malloc(sizeof(*glxDraw
));
438 GetReqExtra(GLXCreateWindow
, 8 * i
, req
);
439 data
= (CARD32
*) (req
+ 1);
441 req
->reqType
= opcode
;
442 req
->glxCode
= glxCode
;
443 req
->screen
= config
->screen
;
444 req
->fbconfig
= config
->fbconfigID
;
445 req
->window
= drawable
;
446 req
->glxwindow
= xid
= XAllocID(dpy
);
450 memcpy(data
, attrib_list
, 8 * i
);
455 if (InitGLXDrawable(dpy
, glxDraw
, drawable
, xid
)) {
460 if (!CreateDRIDrawable(dpy
, config
, drawable
, xid
, attrib_list
, i
)) {
461 if (glxCode
== X_GLXCreatePixmap
)
462 glxCode
= X_GLXDestroyPixmap
;
464 glxCode
= X_GLXDestroyWindow
;
465 protocolDestroyDrawable(dpy
, xid
, glxCode
);
474 * Destroy a non-pbuffer GLX drawable.
477 DestroyDrawable(Display
* dpy
, GLXDrawable drawable
, CARD32 glxCode
)
479 if ((dpy
== NULL
) || (drawable
== 0)) {
483 protocolDestroyDrawable(dpy
, drawable
, glxCode
);
485 DestroyGLXDrawable(dpy
, drawable
);
486 DestroyDRIDrawable(dpy
, drawable
, GL_FALSE
);
495 * This function is used to implement \c glXCreatePbuffer and
496 * \c glXCreateGLXPbufferSGIX.
499 * This function dynamically determines whether to use the SGIX_pbuffer
500 * version of the protocol or the GLX 1.3 version of the protocol.
503 CreatePbuffer(Display
* dpy
, struct glx_config
*config
,
504 unsigned int width
, unsigned int height
,
505 const int *attrib_list
, GLboolean size_in_attribs
)
507 struct glx_display
*priv
= __glXInitialize(dpy
);
513 GLboolean glx_1_3
= GL_FALSE
;
520 while (attrib_list
[i
* 2])
524 opcode
= __glXSetupForCommand(dpy
);
531 if ((priv
->majorVersion
> 1) || (priv
->minorVersion
>= 3)) {
532 xGLXCreatePbufferReq
*req
;
533 unsigned int extra
= (size_in_attribs
) ? 0 : 2;
537 GetReqExtra(GLXCreatePbuffer
, (8 * (i
+ extra
)), req
);
538 data
= (CARD32
*) (req
+ 1);
540 req
->reqType
= opcode
;
541 req
->glxCode
= X_GLXCreatePbuffer
;
542 req
->screen
= config
->screen
;
543 req
->fbconfig
= config
->fbconfigID
;
545 req
->numAttribs
= i
+ extra
;
547 if (!size_in_attribs
) {
548 data
[(2 * i
) + 0] = GLX_PBUFFER_WIDTH
;
549 data
[(2 * i
) + 1] = width
;
550 data
[(2 * i
) + 2] = GLX_PBUFFER_HEIGHT
;
551 data
[(2 * i
) + 3] = height
;
556 xGLXVendorPrivateReq
*vpreq
;
558 GetReqExtra(GLXVendorPrivate
, 20 + (8 * i
), vpreq
);
559 data
= (CARD32
*) (vpreq
+ 1);
561 vpreq
->reqType
= opcode
;
562 vpreq
->glxCode
= X_GLXVendorPrivate
;
563 vpreq
->vendorCode
= X_GLXvop_CreateGLXPbufferSGIX
;
565 data
[0] = config
->screen
;
566 data
[1] = config
->fbconfigID
;
573 (void) memcpy(data
, attrib_list
, sizeof(CARD32
) * 2 * i
);
578 pixmap
= XCreatePixmap(dpy
, RootWindow(dpy
, config
->screen
),
579 width
, height
, config
->rgbBits
);
581 if (!CreateDRIDrawable(dpy
, config
, pixmap
, id
, attrib_list
, i
)) {
582 CARD32 o
= glx_1_3
? X_GLXDestroyPbuffer
: X_GLXvop_DestroyGLXPbufferSGIX
;
583 XFreePixmap(dpy
, pixmap
);
584 protocolDestroyDrawable(dpy
, id
, o
);
594 * This function is used to implement \c glXDestroyPbuffer and
595 * \c glXDestroyGLXPbufferSGIX.
598 * This function dynamically determines whether to use the SGIX_pbuffer
599 * version of the protocol or the GLX 1.3 version of the protocol.
602 DestroyPbuffer(Display
* dpy
, GLXDrawable drawable
)
604 struct glx_display
*priv
= __glXInitialize(dpy
);
607 if ((priv
== NULL
) || (dpy
== NULL
) || (drawable
== 0)) {
611 opcode
= __glXSetupForCommand(dpy
);
617 if ((priv
->majorVersion
> 1) || (priv
->minorVersion
>= 3)) {
618 xGLXDestroyPbufferReq
*req
;
620 GetReq(GLXDestroyPbuffer
, req
);
621 req
->reqType
= opcode
;
622 req
->glxCode
= X_GLXDestroyPbuffer
;
623 req
->pbuffer
= (GLXPbuffer
) drawable
;
626 xGLXVendorPrivateWithReplyReq
*vpreq
;
629 GetReqExtra(GLXVendorPrivateWithReply
, 4, vpreq
);
630 data
= (CARD32
*) (vpreq
+ 1);
632 data
[0] = (CARD32
) drawable
;
634 vpreq
->reqType
= opcode
;
635 vpreq
->glxCode
= X_GLXVendorPrivateWithReply
;
636 vpreq
->vendorCode
= X_GLXvop_DestroyGLXPbufferSGIX
;
642 DestroyDRIDrawable(dpy
, drawable
, GL_TRUE
);
648 * Create a new pbuffer.
650 _X_EXPORT GLXPbufferSGIX
651 glXCreateGLXPbufferSGIX(Display
* dpy
, GLXFBConfigSGIX config
,
652 unsigned int width
, unsigned int height
,
655 return (GLXPbufferSGIX
) CreatePbuffer(dpy
, (struct glx_config
*) config
,
657 attrib_list
, GL_FALSE
);
660 #endif /* GLX_USE_APPLEGL */
663 * Create a new pbuffer.
666 glXCreatePbuffer(Display
* dpy
, GLXFBConfig config
, const int *attrib_list
)
668 int i
, width
, height
;
669 #ifdef GLX_USE_APPLEGL
677 WARN_ONCE_GLX_1_3(dpy
, __func__
);
679 #ifdef GLX_USE_APPLEGL
680 for (i
= 0; attrib_list
[i
]; ++i
) {
681 switch (attrib_list
[i
]) {
682 case GLX_PBUFFER_WIDTH
:
683 width
= attrib_list
[i
+ 1];
687 case GLX_PBUFFER_HEIGHT
:
688 height
= attrib_list
[i
+ 1];
692 case GLX_LARGEST_PBUFFER
:
693 /* This is a hint we should probably handle, but how? */
697 case GLX_PRESERVED_CONTENTS
:
698 /* The contents are always preserved with AppleSGLX with CGL. */
707 if (apple_glx_pbuffer_create(dpy
, config
, width
, height
, &errorcode
,
710 * apple_glx_pbuffer_create only sets the errorcode to core X11
713 __glXSendError(dpy
, errorcode
, 0, X_GLXCreatePbuffer
, true);
720 for (i
= 0; attrib_list
[i
* 2]; i
++) {
721 switch (attrib_list
[i
* 2]) {
722 case GLX_PBUFFER_WIDTH
:
723 width
= attrib_list
[i
* 2 + 1];
725 case GLX_PBUFFER_HEIGHT
:
726 height
= attrib_list
[i
* 2 + 1];
731 return (GLXPbuffer
) CreatePbuffer(dpy
, (struct glx_config
*) config
,
732 width
, height
, attrib_list
, GL_TRUE
);
738 * Destroy an existing pbuffer.
741 glXDestroyPbuffer(Display
* dpy
, GLXPbuffer pbuf
)
743 #ifdef GLX_USE_APPLEGL
744 if (apple_glx_pbuffer_destroy(dpy
, pbuf
)) {
745 __glXSendError(dpy
, GLXBadPbuffer
, pbuf
, X_GLXDestroyPbuffer
, false);
748 DestroyPbuffer(dpy
, pbuf
);
754 * Query an attribute of a drawable.
757 glXQueryDrawable(Display
* dpy
, GLXDrawable drawable
,
758 int attribute
, unsigned int *value
)
760 WARN_ONCE_GLX_1_3(dpy
, __func__
);
761 #ifdef GLX_USE_APPLEGL
764 unsigned int width
, height
, bd
, depth
;
766 if (apple_glx_pixmap_query(drawable
, attribute
, value
))
769 if (apple_glx_pbuffer_query(drawable
, attribute
, value
))
773 * The OpenGL spec states that we should report GLXBadDrawable if
774 * the drawable is invalid, however doing so would require that we
775 * use XSetErrorHandler(), which is known to not be thread safe.
776 * If we use a round-trip call to validate the drawable, there could
777 * be a race, so instead we just opt in favor of letting the
778 * XGetGeometry request fail with a GetGeometry request X error
779 * rather than GLXBadDrawable, in what is hoped to be a rare
780 * case of an invalid drawable. In practice most and possibly all
781 * X11 apps using GLX shouldn't notice a difference.
784 (dpy
, drawable
, &root
, &x
, &y
, &width
, &height
, &bd
, &depth
)) {
796 GetDrawableAttribute(dpy
, drawable
, attribute
, value
);
801 #ifndef GLX_USE_APPLEGL
803 * Query an attribute of a pbuffer.
806 glXQueryGLXPbufferSGIX(Display
* dpy
, GLXPbufferSGIX drawable
,
807 int attribute
, unsigned int *value
)
809 return GetDrawableAttribute(dpy
, drawable
, attribute
, value
);
814 * Select the event mask for a drawable.
817 glXSelectEvent(Display
* dpy
, GLXDrawable drawable
, unsigned long mask
)
819 #ifdef GLX_USE_APPLEGL
820 XWindowAttributes xwattr
;
822 if (apple_glx_pbuffer_set_event_mask(drawable
, mask
))
826 * The spec allows a window, but currently there are no valid
827 * events for a window, so do nothing.
829 if (XGetWindowAttributes(dpy
, drawable
, &xwattr
))
831 /* The drawable seems to be invalid. Report an error. */
833 __glXSendError(dpy
, GLXBadDrawable
, drawable
,
834 X_GLXChangeDrawableAttributes
, false);
838 attribs
[0] = (CARD32
) GLX_EVENT_MASK
;
839 attribs
[1] = (CARD32
) mask
;
841 ChangeDrawableAttribute(dpy
, drawable
, attribs
, 1);
847 * Get the selected event mask for a drawable.
850 glXGetSelectedEvent(Display
* dpy
, GLXDrawable drawable
, unsigned long *mask
)
852 #ifdef GLX_USE_APPLEGL
853 XWindowAttributes xwattr
;
855 if (apple_glx_pbuffer_get_event_mask(drawable
, mask
))
859 * The spec allows a window, but currently there are no valid
860 * events for a window, so do nothing, but set the mask to 0.
862 if (XGetWindowAttributes(dpy
, drawable
, &xwattr
)) {
863 /* The window is valid, so set the mask to 0. */
867 /* The drawable seems to be invalid. Report an error. */
869 __glXSendError(dpy
, GLXBadDrawable
, drawable
, X_GLXGetDrawableAttributes
,
875 /* The non-sense with value is required because on LP64 platforms
876 * sizeof(unsigned int) != sizeof(unsigned long). On little-endian
877 * we could just type-cast the pointer, but why?
880 GetDrawableAttribute(dpy
, drawable
, GLX_EVENT_MASK_SGIX
, &value
);
887 glXCreatePixmap(Display
* dpy
, GLXFBConfig config
, Pixmap pixmap
,
888 const int *attrib_list
)
890 WARN_ONCE_GLX_1_3(dpy
, __func__
);
892 #ifdef GLX_USE_APPLEGL
893 const struct glx_config
*modes
= (const struct glx_config
*) config
;
895 if (apple_glx_pixmap_create(dpy
, modes
->screen
, pixmap
, modes
))
900 return CreateDrawable(dpy
, (struct glx_config
*) config
,
901 (Drawable
) pixmap
, attrib_list
, X_GLXCreatePixmap
);
907 glXCreateWindow(Display
* dpy
, GLXFBConfig config
, Window win
,
908 const int *attrib_list
)
910 WARN_ONCE_GLX_1_3(dpy
, __func__
);
911 #ifdef GLX_USE_APPLEGL
912 XWindowAttributes xwattr
;
913 XVisualInfo
*visinfo
;
915 (void) attrib_list
; /*unused according to GLX 1.4 */
917 XGetWindowAttributes(dpy
, win
, &xwattr
);
919 visinfo
= glXGetVisualFromFBConfig(dpy
, config
);
921 if (NULL
== visinfo
) {
922 __glXSendError(dpy
, GLXBadFBConfig
, 0, X_GLXCreateWindow
, false);
926 if (visinfo
->visualid
!= XVisualIDFromVisual(xwattr
.visual
)) {
927 __glXSendError(dpy
, BadMatch
, 0, X_GLXCreateWindow
, true);
935 return CreateDrawable(dpy
, (struct glx_config
*) config
,
936 (Drawable
) win
, attrib_list
, X_GLXCreateWindow
);
942 glXDestroyPixmap(Display
* dpy
, GLXPixmap pixmap
)
944 WARN_ONCE_GLX_1_3(dpy
, __func__
);
945 #ifdef GLX_USE_APPLEGL
946 if (apple_glx_pixmap_destroy(dpy
, pixmap
))
947 __glXSendError(dpy
, GLXBadPixmap
, pixmap
, X_GLXDestroyPixmap
, false);
949 DestroyDrawable(dpy
, (GLXDrawable
) pixmap
, X_GLXDestroyPixmap
);
955 glXDestroyWindow(Display
* dpy
, GLXWindow win
)
957 WARN_ONCE_GLX_1_3(dpy
, __func__
);
958 #ifndef GLX_USE_APPLEGL
959 DestroyDrawable(dpy
, (GLXDrawable
) win
, X_GLXDestroyWindow
);
963 #ifndef GLX_USE_APPLEGL
965 GLX_ALIAS_VOID(glXDestroyGLXPbufferSGIX
,
966 (Display
* dpy
, GLXPbufferSGIX pbuf
),
967 (dpy
, pbuf
), glXDestroyPbuffer
)
970 GLX_ALIAS_VOID(glXSelectEventSGIX
,
971 (Display
* dpy
, GLXDrawable drawable
,
972 unsigned long mask
), (dpy
, drawable
, mask
), glXSelectEvent
)
975 GLX_ALIAS_VOID(glXGetSelectedEventSGIX
,
976 (Display
* dpy
, GLXDrawable drawable
,
977 unsigned long *mask
), (dpy
, drawable
, mask
),