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 #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
354 __GLXDRIdrawable
*pdraw
= GetGLXDRIDrawable(dpy
, drawable
);
356 _XRead(dpy
, (char *) data
, length
* sizeof(CARD32
));
358 /* Search the set of returned attributes for the attribute requested by
361 for (i
= 0; i
< num_attributes
; i
++) {
362 if (data
[i
* 2] == attribute
) {
363 *value
= data
[(i
* 2) + 1];
368 #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
370 if (!pdraw
->textureTarget
)
371 pdraw
->textureTarget
=
372 determineTextureTarget((const int *) data
, num_attributes
);
373 if (!pdraw
->textureFormat
)
374 pdraw
->textureFormat
=
375 determineTextureFormat((const int *) data
, num_attributes
);
390 protocolDestroyDrawable(Display
*dpy
, GLXDrawable drawable
, CARD32 glxCode
)
392 xGLXDestroyPbufferReq
*req
;
395 opcode
= __glXSetupForCommand(dpy
);
401 GetReq(GLXDestroyPbuffer
, req
);
402 req
->reqType
= opcode
;
403 req
->glxCode
= glxCode
;
404 req
->pbuffer
= (GLXPbuffer
) drawable
;
411 * Create a non-pbuffer GLX drawable.
414 CreateDrawable(Display
*dpy
, struct glx_config
*config
,
415 Drawable drawable
, const int *attrib_list
, CARD8 glxCode
)
417 xGLXCreateWindowReq
*req
;
418 struct glx_drawable
*glxDraw
;
426 while (attrib_list
[i
* 2] != None
)
430 opcode
= __glXSetupForCommand(dpy
);
434 glxDraw
= malloc(sizeof(*glxDraw
));
439 GetReqExtra(GLXCreateWindow
, 8 * i
, req
);
440 data
= (CARD32
*) (req
+ 1);
442 req
->reqType
= opcode
;
443 req
->glxCode
= glxCode
;
444 req
->screen
= config
->screen
;
445 req
->fbconfig
= config
->fbconfigID
;
446 req
->window
= drawable
;
447 req
->glxwindow
= xid
= XAllocID(dpy
);
451 memcpy(data
, attrib_list
, 8 * i
);
456 if (InitGLXDrawable(dpy
, glxDraw
, drawable
, xid
)) {
461 if (!CreateDRIDrawable(dpy
, config
, drawable
, xid
, attrib_list
, i
)) {
462 if (glxCode
== X_GLXCreatePixmap
)
463 glxCode
= X_GLXDestroyPixmap
;
465 glxCode
= X_GLXDestroyWindow
;
466 protocolDestroyDrawable(dpy
, xid
, glxCode
);
475 * Destroy a non-pbuffer GLX drawable.
478 DestroyDrawable(Display
* dpy
, GLXDrawable drawable
, CARD32 glxCode
)
480 if ((dpy
== NULL
) || (drawable
== 0)) {
484 protocolDestroyDrawable(dpy
, drawable
, glxCode
);
486 DestroyGLXDrawable(dpy
, drawable
);
487 DestroyDRIDrawable(dpy
, drawable
, GL_FALSE
);
496 * This function is used to implement \c glXCreatePbuffer and
497 * \c glXCreateGLXPbufferSGIX.
500 * This function dynamically determines whether to use the SGIX_pbuffer
501 * version of the protocol or the GLX 1.3 version of the protocol.
504 CreatePbuffer(Display
* dpy
, struct glx_config
*config
,
505 unsigned int width
, unsigned int height
,
506 const int *attrib_list
, GLboolean size_in_attribs
)
508 struct glx_display
*priv
= __glXInitialize(dpy
);
514 GLboolean glx_1_3
= GL_FALSE
;
521 while (attrib_list
[i
* 2])
525 opcode
= __glXSetupForCommand(dpy
);
532 if ((priv
->majorVersion
> 1) || (priv
->minorVersion
>= 3)) {
533 xGLXCreatePbufferReq
*req
;
534 unsigned int extra
= (size_in_attribs
) ? 0 : 2;
538 GetReqExtra(GLXCreatePbuffer
, (8 * (i
+ extra
)), req
);
539 data
= (CARD32
*) (req
+ 1);
541 req
->reqType
= opcode
;
542 req
->glxCode
= X_GLXCreatePbuffer
;
543 req
->screen
= config
->screen
;
544 req
->fbconfig
= config
->fbconfigID
;
546 req
->numAttribs
= i
+ extra
;
548 if (!size_in_attribs
) {
549 data
[(2 * i
) + 0] = GLX_PBUFFER_WIDTH
;
550 data
[(2 * i
) + 1] = width
;
551 data
[(2 * i
) + 2] = GLX_PBUFFER_HEIGHT
;
552 data
[(2 * i
) + 3] = height
;
557 xGLXVendorPrivateReq
*vpreq
;
559 GetReqExtra(GLXVendorPrivate
, 20 + (8 * i
), vpreq
);
560 data
= (CARD32
*) (vpreq
+ 1);
562 vpreq
->reqType
= opcode
;
563 vpreq
->glxCode
= X_GLXVendorPrivate
;
564 vpreq
->vendorCode
= X_GLXvop_CreateGLXPbufferSGIX
;
566 data
[0] = config
->screen
;
567 data
[1] = config
->fbconfigID
;
574 (void) memcpy(data
, attrib_list
, sizeof(CARD32
) * 2 * i
);
579 pixmap
= XCreatePixmap(dpy
, RootWindow(dpy
, config
->screen
),
580 width
, height
, config
->rgbBits
);
582 if (!CreateDRIDrawable(dpy
, config
, pixmap
, id
, attrib_list
, i
)) {
583 CARD32 o
= glx_1_3
? X_GLXDestroyPbuffer
: X_GLXvop_DestroyGLXPbufferSGIX
;
584 XFreePixmap(dpy
, pixmap
);
585 protocolDestroyDrawable(dpy
, id
, o
);
595 * This function is used to implement \c glXDestroyPbuffer and
596 * \c glXDestroyGLXPbufferSGIX.
599 * This function dynamically determines whether to use the SGIX_pbuffer
600 * version of the protocol or the GLX 1.3 version of the protocol.
603 DestroyPbuffer(Display
* dpy
, GLXDrawable drawable
)
605 struct glx_display
*priv
= __glXInitialize(dpy
);
608 if ((priv
== NULL
) || (dpy
== NULL
) || (drawable
== 0)) {
612 opcode
= __glXSetupForCommand(dpy
);
618 if ((priv
->majorVersion
> 1) || (priv
->minorVersion
>= 3)) {
619 xGLXDestroyPbufferReq
*req
;
621 GetReq(GLXDestroyPbuffer
, req
);
622 req
->reqType
= opcode
;
623 req
->glxCode
= X_GLXDestroyPbuffer
;
624 req
->pbuffer
= (GLXPbuffer
) drawable
;
627 xGLXVendorPrivateWithReplyReq
*vpreq
;
630 GetReqExtra(GLXVendorPrivateWithReply
, 4, vpreq
);
631 data
= (CARD32
*) (vpreq
+ 1);
633 data
[0] = (CARD32
) drawable
;
635 vpreq
->reqType
= opcode
;
636 vpreq
->glxCode
= X_GLXVendorPrivateWithReply
;
637 vpreq
->vendorCode
= X_GLXvop_DestroyGLXPbufferSGIX
;
643 DestroyDRIDrawable(dpy
, drawable
, GL_TRUE
);
649 * Create a new pbuffer.
651 _X_EXPORT GLXPbufferSGIX
652 glXCreateGLXPbufferSGIX(Display
* dpy
, GLXFBConfigSGIX config
,
653 unsigned int width
, unsigned int height
,
656 return (GLXPbufferSGIX
) CreatePbuffer(dpy
, (struct glx_config
*) config
,
658 attrib_list
, GL_FALSE
);
661 #endif /* GLX_USE_APPLEGL */
664 * Create a new pbuffer.
667 glXCreatePbuffer(Display
* dpy
, GLXFBConfig config
, const int *attrib_list
)
669 int i
, width
, height
;
670 #ifdef GLX_USE_APPLEGL
678 WARN_ONCE_GLX_1_3(dpy
, __func__
);
680 #ifdef GLX_USE_APPLEGL
681 for (i
= 0; attrib_list
[i
]; ++i
) {
682 switch (attrib_list
[i
]) {
683 case GLX_PBUFFER_WIDTH
:
684 width
= attrib_list
[i
+ 1];
688 case GLX_PBUFFER_HEIGHT
:
689 height
= attrib_list
[i
+ 1];
693 case GLX_LARGEST_PBUFFER
:
694 /* This is a hint we should probably handle, but how? */
698 case GLX_PRESERVED_CONTENTS
:
699 /* The contents are always preserved with AppleSGLX with CGL. */
708 if (apple_glx_pbuffer_create(dpy
, config
, width
, height
, &errorcode
,
711 * apple_glx_pbuffer_create only sets the errorcode to core X11
714 __glXSendError(dpy
, errorcode
, 0, X_GLXCreatePbuffer
, true);
721 for (i
= 0; attrib_list
[i
* 2]; i
++) {
722 switch (attrib_list
[i
* 2]) {
723 case GLX_PBUFFER_WIDTH
:
724 width
= attrib_list
[i
* 2 + 1];
726 case GLX_PBUFFER_HEIGHT
:
727 height
= attrib_list
[i
* 2 + 1];
732 return (GLXPbuffer
) CreatePbuffer(dpy
, (struct glx_config
*) config
,
733 width
, height
, attrib_list
, GL_TRUE
);
739 * Destroy an existing pbuffer.
742 glXDestroyPbuffer(Display
* dpy
, GLXPbuffer pbuf
)
744 #ifdef GLX_USE_APPLEGL
745 if (apple_glx_pbuffer_destroy(dpy
, pbuf
)) {
746 __glXSendError(dpy
, GLXBadPbuffer
, pbuf
, X_GLXDestroyPbuffer
, false);
749 DestroyPbuffer(dpy
, pbuf
);
755 * Query an attribute of a drawable.
758 glXQueryDrawable(Display
* dpy
, GLXDrawable drawable
,
759 int attribute
, unsigned int *value
)
761 WARN_ONCE_GLX_1_3(dpy
, __func__
);
762 #ifdef GLX_USE_APPLEGL
765 unsigned int width
, height
, bd
, depth
;
767 if (apple_glx_pixmap_query(drawable
, attribute
, value
))
770 if (apple_glx_pbuffer_query(drawable
, attribute
, value
))
774 * The OpenGL spec states that we should report GLXBadDrawable if
775 * the drawable is invalid, however doing so would require that we
776 * use XSetErrorHandler(), which is known to not be thread safe.
777 * If we use a round-trip call to validate the drawable, there could
778 * be a race, so instead we just opt in favor of letting the
779 * XGetGeometry request fail with a GetGeometry request X error
780 * rather than GLXBadDrawable, in what is hoped to be a rare
781 * case of an invalid drawable. In practice most and possibly all
782 * X11 apps using GLX shouldn't notice a difference.
785 (dpy
, drawable
, &root
, &x
, &y
, &width
, &height
, &bd
, &depth
)) {
797 GetDrawableAttribute(dpy
, drawable
, attribute
, value
);
802 #ifndef GLX_USE_APPLEGL
804 * Query an attribute of a pbuffer.
807 glXQueryGLXPbufferSGIX(Display
* dpy
, GLXPbufferSGIX drawable
,
808 int attribute
, unsigned int *value
)
810 return GetDrawableAttribute(dpy
, drawable
, attribute
, value
);
815 * Select the event mask for a drawable.
818 glXSelectEvent(Display
* dpy
, GLXDrawable drawable
, unsigned long mask
)
820 #ifdef GLX_USE_APPLEGL
821 XWindowAttributes xwattr
;
823 if (apple_glx_pbuffer_set_event_mask(drawable
, mask
))
827 * The spec allows a window, but currently there are no valid
828 * events for a window, so do nothing.
830 if (XGetWindowAttributes(dpy
, drawable
, &xwattr
))
832 /* The drawable seems to be invalid. Report an error. */
834 __glXSendError(dpy
, GLXBadDrawable
, drawable
,
835 X_GLXChangeDrawableAttributes
, false);
839 attribs
[0] = (CARD32
) GLX_EVENT_MASK
;
840 attribs
[1] = (CARD32
) mask
;
842 ChangeDrawableAttribute(dpy
, drawable
, attribs
, 1);
848 * Get the selected event mask for a drawable.
851 glXGetSelectedEvent(Display
* dpy
, GLXDrawable drawable
, unsigned long *mask
)
853 #ifdef GLX_USE_APPLEGL
854 XWindowAttributes xwattr
;
856 if (apple_glx_pbuffer_get_event_mask(drawable
, mask
))
860 * The spec allows a window, but currently there are no valid
861 * events for a window, so do nothing, but set the mask to 0.
863 if (XGetWindowAttributes(dpy
, drawable
, &xwattr
)) {
864 /* The window is valid, so set the mask to 0. */
868 /* The drawable seems to be invalid. Report an error. */
870 __glXSendError(dpy
, GLXBadDrawable
, drawable
, X_GLXGetDrawableAttributes
,
876 /* The non-sense with value is required because on LP64 platforms
877 * sizeof(unsigned int) != sizeof(unsigned long). On little-endian
878 * we could just type-cast the pointer, but why?
881 GetDrawableAttribute(dpy
, drawable
, GLX_EVENT_MASK_SGIX
, &value
);
888 glXCreatePixmap(Display
* dpy
, GLXFBConfig config
, Pixmap pixmap
,
889 const int *attrib_list
)
891 WARN_ONCE_GLX_1_3(dpy
, __func__
);
893 #ifdef GLX_USE_APPLEGL
894 const struct glx_config
*modes
= (const struct glx_config
*) config
;
896 if (apple_glx_pixmap_create(dpy
, modes
->screen
, pixmap
, modes
))
901 return CreateDrawable(dpy
, (struct glx_config
*) config
,
902 (Drawable
) pixmap
, attrib_list
, X_GLXCreatePixmap
);
908 glXCreateWindow(Display
* dpy
, GLXFBConfig config
, Window win
,
909 const int *attrib_list
)
911 WARN_ONCE_GLX_1_3(dpy
, __func__
);
912 #ifdef GLX_USE_APPLEGL
913 XWindowAttributes xwattr
;
914 XVisualInfo
*visinfo
;
916 (void) attrib_list
; /*unused according to GLX 1.4 */
918 XGetWindowAttributes(dpy
, win
, &xwattr
);
920 visinfo
= glXGetVisualFromFBConfig(dpy
, config
);
922 if (NULL
== visinfo
) {
923 __glXSendError(dpy
, GLXBadFBConfig
, 0, X_GLXCreateWindow
, false);
927 if (visinfo
->visualid
!= XVisualIDFromVisual(xwattr
.visual
)) {
928 __glXSendError(dpy
, BadMatch
, 0, X_GLXCreateWindow
, true);
936 return CreateDrawable(dpy
, (struct glx_config
*) config
,
937 (Drawable
) win
, attrib_list
, X_GLXCreateWindow
);
943 glXDestroyPixmap(Display
* dpy
, GLXPixmap pixmap
)
945 WARN_ONCE_GLX_1_3(dpy
, __func__
);
946 #ifdef GLX_USE_APPLEGL
947 if (apple_glx_pixmap_destroy(dpy
, pixmap
))
948 __glXSendError(dpy
, GLXBadPixmap
, pixmap
, X_GLXDestroyPixmap
, false);
950 DestroyDrawable(dpy
, (GLXDrawable
) pixmap
, X_GLXDestroyPixmap
);
956 glXDestroyWindow(Display
* dpy
, GLXWindow win
)
958 WARN_ONCE_GLX_1_3(dpy
, __func__
);
959 #ifndef GLX_USE_APPLEGL
960 DestroyDrawable(dpy
, (GLXDrawable
) win
, X_GLXDestroyWindow
);
964 #ifndef GLX_USE_APPLEGL
966 GLX_ALIAS_VOID(glXDestroyGLXPbufferSGIX
,
967 (Display
* dpy
, GLXPbufferSGIX pbuf
),
968 (dpy
, pbuf
), glXDestroyPbuffer
)
971 GLX_ALIAS_VOID(glXSelectEventSGIX
,
972 (Display
* dpy
, GLXDrawable drawable
,
973 unsigned long mask
), (dpy
, drawable
, mask
), glXSelectEvent
)
976 GLX_ALIAS_VOID(glXGetSelectedEventSGIX
,
977 (Display
* dpy
, GLXDrawable drawable
,
978 unsigned long *mask
), (dpy
, drawable
, mask
),