2004-10-25 22:09:16 +01:00
|
|
|
/*
|
|
|
|
* (C) Copyright IBM Corporation 2004
|
|
|
|
* All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* on the rights to use, copy, modify, merge, publish, distribute, sub
|
|
|
|
* license, and/or sell copies of the Software, and to permit persons to whom
|
|
|
|
* the Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice (including the next
|
|
|
|
* paragraph) shall be included in all copies or substantial portions of the
|
|
|
|
* Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
* DEALINGS IN THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \file glx_pbuffer.c
|
|
|
|
* Implementation of pbuffer related functions.
|
|
|
|
*
|
|
|
|
* \author Ian Romanick <idr@us.ibm.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <inttypes.h>
|
|
|
|
#include "glxclient.h"
|
2005-08-11 15:18:53 +01:00
|
|
|
#include <X11/extensions/extutil.h>
|
|
|
|
#include <X11/extensions/Xext.h>
|
2004-10-25 22:09:16 +01:00
|
|
|
#include <assert.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include "glapi.h"
|
|
|
|
#include "glxextensions.h"
|
|
|
|
#include "glcontextmodes.h"
|
|
|
|
|
|
|
|
|
2009-09-15 21:12:22 +01:00
|
|
|
/**
|
|
|
|
* Emit a warning when clients use GLX 1.3 functions on pre-1.3 systems.
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
warn_GLX_1_3(Display *dpy, const char *function_name)
|
|
|
|
{
|
|
|
|
__GLXdisplayPrivate *priv = __glXInitialize(dpy);
|
|
|
|
|
|
|
|
if (priv->minorVersion < 3) {
|
|
|
|
fprintf(stderr,
|
|
|
|
"WARNING: Application calling GLX 1.3 function \"%s\" "
|
|
|
|
"when GLX 1.3 is not supported! This is an application bug!\n",
|
|
|
|
function_name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-10-25 22:09:16 +01:00
|
|
|
/**
|
|
|
|
* Change a drawable's attribute.
|
|
|
|
*
|
|
|
|
* This function is used to implement \c glXSelectEvent and
|
|
|
|
* \c glXSelectEventSGIX.
|
|
|
|
*
|
|
|
|
* \note
|
|
|
|
* This function dynamically determines whether to use the SGIX_pbuffer
|
|
|
|
* version of the protocol or the GLX 1.3 version of the protocol.
|
|
|
|
*
|
|
|
|
* \todo
|
|
|
|
* This function needs to be modified to work with direct-rendering drivers.
|
|
|
|
*/
|
|
|
|
static void
|
2008-10-13 13:12:02 +01:00
|
|
|
ChangeDrawableAttribute(Display * dpy, GLXDrawable drawable,
|
|
|
|
const CARD32 * attribs, size_t num_attribs)
|
2004-10-25 22:09:16 +01:00
|
|
|
{
|
|
|
|
__GLXdisplayPrivate *priv = __glXInitialize(dpy);
|
2008-10-13 13:12:02 +01:00
|
|
|
CARD32 *output;
|
2006-06-13 02:41:18 +01:00
|
|
|
CARD8 opcode;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
if ((dpy == NULL) || (drawable == 0)) {
|
2004-10-25 22:09:16 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2006-06-13 02:41:18 +01:00
|
|
|
opcode = __glXSetupForCommand(dpy);
|
|
|
|
if (!opcode)
|
|
|
|
return;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
LockDisplay(dpy);
|
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
if ((priv->majorVersion > 1) || (priv->minorVersion >= 3)) {
|
2004-10-25 22:09:16 +01:00
|
|
|
xGLXChangeDrawableAttributesReq *req;
|
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
GetReqExtra(GLXChangeDrawableAttributes, 8 + (8 * num_attribs), req);
|
2004-10-25 22:09:16 +01:00
|
|
|
output = (CARD32 *) (req + 1);
|
|
|
|
|
2006-06-13 02:41:18 +01:00
|
|
|
req->reqType = opcode;
|
2004-10-25 22:09:16 +01:00
|
|
|
req->glxCode = X_GLXChangeDrawableAttributes;
|
|
|
|
req->drawable = drawable;
|
|
|
|
req->numAttribs = (CARD32) num_attribs;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
xGLXVendorPrivateWithReplyReq *vpreq;
|
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
GetReqExtra(GLXVendorPrivateWithReply, 4 + (8 * num_attribs), vpreq);
|
2004-10-25 22:09:16 +01:00
|
|
|
output = (CARD32 *) (vpreq + 1);
|
|
|
|
|
2006-06-13 02:41:18 +01:00
|
|
|
vpreq->reqType = opcode;
|
2004-10-25 22:09:16 +01:00
|
|
|
vpreq->glxCode = X_GLXVendorPrivateWithReply;
|
|
|
|
vpreq->vendorCode = X_GLXvop_ChangeDrawableAttributesSGIX;
|
|
|
|
|
|
|
|
output[0] = (CARD32) drawable;
|
|
|
|
output++;
|
|
|
|
}
|
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
(void) memcpy(output, attribs, sizeof(CARD32) * 2 * num_attribs);
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
UnlockDisplay(dpy);
|
|
|
|
SyncHandle();
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destroy a pbuffer.
|
|
|
|
*
|
|
|
|
* This function is used to implement \c glXDestroyPbuffer and
|
|
|
|
* \c glXDestroyGLXPbufferSGIX.
|
|
|
|
*
|
|
|
|
* \note
|
|
|
|
* This function dynamically determines whether to use the SGIX_pbuffer
|
|
|
|
* version of the protocol or the GLX 1.3 version of the protocol.
|
|
|
|
*
|
|
|
|
* \todo
|
|
|
|
* This function needs to be modified to work with direct-rendering drivers.
|
|
|
|
*/
|
|
|
|
static void
|
2008-10-13 13:12:02 +01:00
|
|
|
DestroyPbuffer(Display * dpy, GLXDrawable drawable)
|
2004-10-25 22:09:16 +01:00
|
|
|
{
|
|
|
|
__GLXdisplayPrivate *priv = __glXInitialize(dpy);
|
2006-06-13 02:41:18 +01:00
|
|
|
CARD8 opcode;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
if ((dpy == NULL) || (drawable == 0)) {
|
2004-10-25 22:09:16 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2006-06-13 02:41:18 +01:00
|
|
|
opcode = __glXSetupForCommand(dpy);
|
|
|
|
if (!opcode)
|
|
|
|
return;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
LockDisplay(dpy);
|
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
if ((priv->majorVersion > 1) || (priv->minorVersion >= 3)) {
|
|
|
|
xGLXDestroyPbufferReq *req;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
GetReq(GLXDestroyPbuffer, req);
|
2006-06-13 02:41:18 +01:00
|
|
|
req->reqType = opcode;
|
2004-10-25 22:09:16 +01:00
|
|
|
req->glxCode = X_GLXDestroyPbuffer;
|
|
|
|
req->pbuffer = (GLXPbuffer) drawable;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
xGLXVendorPrivateWithReplyReq *vpreq;
|
2008-10-13 13:12:02 +01:00
|
|
|
CARD32 *data;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
GetReqExtra(GLXVendorPrivateWithReply, 4, vpreq);
|
2004-10-25 22:09:16 +01:00
|
|
|
data = (CARD32 *) (vpreq + 1);
|
|
|
|
|
|
|
|
data[0] = (CARD32) drawable;
|
|
|
|
|
2006-06-13 02:41:18 +01:00
|
|
|
vpreq->reqType = opcode;
|
2004-10-25 22:09:16 +01:00
|
|
|
vpreq->glxCode = X_GLXVendorPrivateWithReply;
|
|
|
|
vpreq->vendorCode = X_GLXvop_DestroyGLXPbufferSGIX;
|
|
|
|
}
|
|
|
|
|
|
|
|
UnlockDisplay(dpy);
|
|
|
|
SyncHandle();
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-04-10 20:45:52 +01:00
|
|
|
#ifdef GLX_DIRECT_RENDERING
|
2008-10-13 13:12:02 +01:00
|
|
|
extern __GLXDRIdrawable *GetGLXDRIDrawable(Display * dpy,
|
|
|
|
GLXDrawable drawable,
|
|
|
|
int *const scrn_num);
|
2008-04-10 20:45:52 +01:00
|
|
|
|
|
|
|
static GLenum
|
|
|
|
determineTextureTarget(const int *attribs, int numAttribs)
|
|
|
|
{
|
2008-10-13 13:12:02 +01:00
|
|
|
GLenum target = 0;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < numAttribs; i++) {
|
|
|
|
if (attribs[2 * i] == GLX_TEXTURE_TARGET_EXT) {
|
|
|
|
switch (attribs[2 * i + 1]) {
|
|
|
|
case GLX_TEXTURE_2D_EXT:
|
|
|
|
target = GL_TEXTURE_2D;
|
|
|
|
break;
|
|
|
|
case GLX_TEXTURE_RECTANGLE_EXT:
|
|
|
|
target = GL_TEXTURE_RECTANGLE_ARB;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return target;
|
2008-04-10 20:45:52 +01:00
|
|
|
}
|
2009-03-18 19:07:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
static GLenum
|
|
|
|
determineTextureFormat(const int *attribs, int numAttribs)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < numAttribs; i++) {
|
|
|
|
if (attribs[2 * i] == GLX_TEXTURE_FORMAT_EXT)
|
|
|
|
return attribs[2 * i + 1];
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2008-04-10 20:45:52 +01:00
|
|
|
#endif
|
|
|
|
|
2004-10-25 22:09:16 +01:00
|
|
|
/**
|
|
|
|
* Get a drawable's attribute.
|
|
|
|
*
|
|
|
|
* This function is used to implement \c glXGetSelectedEvent and
|
|
|
|
* \c glXGetSelectedEventSGIX.
|
|
|
|
*
|
|
|
|
* \note
|
|
|
|
* This function dynamically determines whether to use the SGIX_pbuffer
|
|
|
|
* version of the protocol or the GLX 1.3 version of the protocol.
|
|
|
|
*
|
|
|
|
* \todo
|
|
|
|
* The number of attributes returned is likely to be small, probably less than
|
|
|
|
* 10. Given that, this routine should try to use an array on the stack to
|
|
|
|
* capture the reply rather than always calling Xmalloc.
|
|
|
|
*
|
|
|
|
* \todo
|
|
|
|
* This function needs to be modified to work with direct-rendering drivers.
|
|
|
|
*/
|
|
|
|
static int
|
2008-10-13 13:12:02 +01:00
|
|
|
GetDrawableAttribute(Display * dpy, GLXDrawable drawable,
|
|
|
|
int attribute, unsigned int *value)
|
2004-10-25 22:09:16 +01:00
|
|
|
{
|
2006-04-07 01:05:50 +01:00
|
|
|
__GLXdisplayPrivate *priv;
|
2004-10-25 22:09:16 +01:00
|
|
|
xGLXGetDrawableAttributesReply reply;
|
2008-10-13 13:12:02 +01:00
|
|
|
CARD32 *data;
|
2006-06-13 02:41:18 +01:00
|
|
|
CARD8 opcode;
|
2004-10-25 22:09:16 +01:00
|
|
|
unsigned int length;
|
|
|
|
unsigned int i;
|
|
|
|
unsigned int num_attributes;
|
2009-01-11 20:40:07 +00:00
|
|
|
GLboolean use_glx_1_3;
|
2006-04-07 01:05:50 +01:00
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
if ((dpy == NULL) || (drawable == 0)) {
|
2006-04-07 01:05:50 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
priv = __glXInitialize(dpy);
|
2009-01-11 20:40:07 +00:00
|
|
|
use_glx_1_3 = ((priv->majorVersion > 1) || (priv->minorVersion >= 3));
|
2004-10-25 22:09:16 +01:00
|
|
|
|
2006-02-07 00:39:56 +00:00
|
|
|
*value = 0;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
|
2006-06-13 02:41:18 +01:00
|
|
|
opcode = __glXSetupForCommand(dpy);
|
|
|
|
if (!opcode)
|
|
|
|
return 0;
|
|
|
|
|
2004-10-25 22:09:16 +01:00
|
|
|
LockDisplay(dpy);
|
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
if (use_glx_1_3) {
|
2004-10-25 22:09:16 +01:00
|
|
|
xGLXGetDrawableAttributesReq *req;
|
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
GetReqExtra(GLXGetDrawableAttributes, 4, req);
|
2006-06-13 02:41:18 +01:00
|
|
|
req->reqType = opcode;
|
2004-10-25 22:09:16 +01:00
|
|
|
req->glxCode = X_GLXGetDrawableAttributes;
|
|
|
|
req->drawable = drawable;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
xGLXVendorPrivateWithReplyReq *vpreq;
|
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
GetReqExtra(GLXVendorPrivateWithReply, 4, vpreq);
|
2004-10-25 22:09:16 +01:00
|
|
|
data = (CARD32 *) (vpreq + 1);
|
|
|
|
data[0] = (CARD32) drawable;
|
|
|
|
|
2006-06-13 02:41:18 +01:00
|
|
|
vpreq->reqType = opcode;
|
2004-10-25 22:09:16 +01:00
|
|
|
vpreq->glxCode = X_GLXVendorPrivateWithReply;
|
|
|
|
vpreq->vendorCode = X_GLXvop_GetDrawableAttributesSGIX;
|
|
|
|
}
|
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
_XReply(dpy, (xReply *) & reply, 0, False);
|
2004-10-25 22:09:16 +01:00
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
if (reply.type == X_Error) {
|
|
|
|
UnlockDisplay(dpy);
|
|
|
|
SyncHandle();
|
|
|
|
return 0;
|
2006-02-07 00:39:56 +00:00
|
|
|
}
|
|
|
|
|
2004-10-25 22:09:16 +01:00
|
|
|
length = reply.length;
|
2008-10-13 13:12:02 +01:00
|
|
|
if (length) {
|
|
|
|
num_attributes = (use_glx_1_3) ? reply.numAttribs : length / 2;
|
|
|
|
data = (CARD32 *) Xmalloc(length * sizeof(CARD32));
|
|
|
|
if (data == NULL) {
|
|
|
|
/* Throw data on the floor */
|
|
|
|
_XEatData(dpy, length);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
_XRead(dpy, (char *) data, length * sizeof(CARD32));
|
|
|
|
|
|
|
|
/* Search the set of returned attributes for the attribute requested by
|
|
|
|
* the caller.
|
|
|
|
*/
|
|
|
|
for (i = 0; i < num_attributes; i++) {
|
|
|
|
if (data[i * 2] == attribute) {
|
|
|
|
*value = data[(i * 2) + 1];
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2006-02-07 00:39:56 +00:00
|
|
|
|
2008-04-10 20:45:52 +01:00
|
|
|
#ifdef GLX_DIRECT_RENDERING
|
2008-10-13 13:12:02 +01:00
|
|
|
{
|
|
|
|
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, NULL);
|
2008-04-10 20:45:52 +01:00
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
if (pdraw != NULL && !pdraw->textureTarget)
|
|
|
|
pdraw->textureTarget =
|
|
|
|
determineTextureTarget((const int *) data, num_attributes);
|
2009-03-18 19:07:09 +00:00
|
|
|
if (pdraw != NULL && !pdraw->textureFormat)
|
|
|
|
pdraw->textureFormat =
|
|
|
|
determineTextureFormat((const int *) data, num_attributes);
|
2008-10-13 13:12:02 +01:00
|
|
|
}
|
2008-04-10 20:45:52 +01:00
|
|
|
#endif
|
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
Xfree(data);
|
|
|
|
}
|
2004-10-25 22:09:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
UnlockDisplay(dpy);
|
|
|
|
SyncHandle();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a non-pbuffer GLX drawable.
|
|
|
|
*
|
|
|
|
* \todo
|
|
|
|
* This function needs to be modified to work with direct-rendering drivers.
|
|
|
|
*/
|
|
|
|
static GLXDrawable
|
2008-10-13 13:12:02 +01:00
|
|
|
CreateDrawable(Display * dpy, const __GLcontextModes * fbconfig,
|
|
|
|
Drawable drawable, const int *attrib_list, CARD8 glxCode)
|
2004-10-25 22:09:16 +01:00
|
|
|
{
|
2008-10-13 13:12:02 +01:00
|
|
|
xGLXCreateWindowReq *req;
|
|
|
|
CARD32 *data;
|
2005-03-04 17:53:24 +00:00
|
|
|
unsigned int i;
|
2006-04-11 13:07:41 +01:00
|
|
|
CARD8 opcode;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
2005-03-04 17:53:24 +00:00
|
|
|
i = 0;
|
|
|
|
if (attrib_list) {
|
2008-10-13 13:12:02 +01:00
|
|
|
while (attrib_list[i * 2] != None)
|
|
|
|
i++;
|
2005-03-04 17:53:24 +00:00
|
|
|
}
|
2004-10-25 22:09:16 +01:00
|
|
|
|
2006-06-13 02:41:18 +01:00
|
|
|
opcode = __glXSetupForCommand(dpy);
|
|
|
|
if (!opcode)
|
|
|
|
return None;
|
2006-04-11 13:07:41 +01:00
|
|
|
|
2004-10-25 22:09:16 +01:00
|
|
|
LockDisplay(dpy);
|
2008-10-13 13:12:02 +01:00
|
|
|
GetReqExtra(GLXCreateWindow, 8 * i, req);
|
2004-10-25 22:09:16 +01:00
|
|
|
data = (CARD32 *) (req + 1);
|
|
|
|
|
2006-04-11 13:07:41 +01:00
|
|
|
req->reqType = opcode;
|
2004-10-25 22:09:16 +01:00
|
|
|
req->glxCode = glxCode;
|
|
|
|
req->screen = (CARD32) fbconfig->screen;
|
|
|
|
req->fbconfig = fbconfig->fbconfigID;
|
DRI interface changes and DRI2 direct rendering support.
Add DRI2 direct rendering support to libGL and add DRI2 client side
protocol code. Extend the GLX 1.3 create drawable functions in
glx_pbuffer.c to call into the DRI driver when possible.
Introduce __DRIconfig, opaque struct that represents a DRI driver
configuration. Get's rid of the open coded __GLcontextModes in the
DRI driver interface and the context modes create and destroy
functions that the loader was requires to provide. glcore.h is no
longer part of the DRI driver interface. The DRI config is GL binding
agnostic, that is, not specific to GLX, EGL or other bindings.
The core API is now also an extension, and the driver exports a list
of extensions as the symbol __driDriverExtensions, which the loader
must dlsym() for. The list of extension will always include the DRI
core extension, which allows creating and manipulating DRI screens,
drawables and contexts. The DRI legacy extension, when available,
provides alternative entry points for creating the DRI objects that
work with the XF86DRI infrastructure.
Change DRI2 client code to not use drm drawables or contexts. We
never used drm_drawable_t's and the only use for drm_context_t was as
a unique identifier when taking the lock. We now just allocate a
unique lock ID out of the DRILock sarea block. Once we get rid of the
lock entirely, we can drop this hack.
Change the interface between dri_util.c and the drivers, so that the
drivers now export the DriverAPI struct as driDriverAPI instead of the
InitScreen entry point. This lets us avoid dlsym()'ing for the DRI2
init screen function to see if DRI2 is supported by the driver.
2008-03-26 23:26:59 +00:00
|
|
|
req->window = (CARD32) drawable;
|
2005-03-04 17:53:24 +00:00
|
|
|
req->glxwindow = (GLXWindow) XAllocID(dpy);
|
2004-10-25 22:09:16 +01:00
|
|
|
req->numAttribs = (CARD32) i;
|
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
memcpy(data, attrib_list, 8 * i);
|
|
|
|
|
2004-10-25 22:09:16 +01:00
|
|
|
UnlockDisplay(dpy);
|
|
|
|
SyncHandle();
|
2008-10-13 13:12:02 +01:00
|
|
|
|
DRI interface changes and DRI2 direct rendering support.
Add DRI2 direct rendering support to libGL and add DRI2 client side
protocol code. Extend the GLX 1.3 create drawable functions in
glx_pbuffer.c to call into the DRI driver when possible.
Introduce __DRIconfig, opaque struct that represents a DRI driver
configuration. Get's rid of the open coded __GLcontextModes in the
DRI driver interface and the context modes create and destroy
functions that the loader was requires to provide. glcore.h is no
longer part of the DRI driver interface. The DRI config is GL binding
agnostic, that is, not specific to GLX, EGL or other bindings.
The core API is now also an extension, and the driver exports a list
of extensions as the symbol __driDriverExtensions, which the loader
must dlsym() for. The list of extension will always include the DRI
core extension, which allows creating and manipulating DRI screens,
drawables and contexts. The DRI legacy extension, when available,
provides alternative entry points for creating the DRI objects that
work with the XF86DRI infrastructure.
Change DRI2 client code to not use drm drawables or contexts. We
never used drm_drawable_t's and the only use for drm_context_t was as
a unique identifier when taking the lock. We now just allocate a
unique lock ID out of the DRILock sarea block. Once we get rid of the
lock entirely, we can drop this hack.
Change the interface between dri_util.c and the drivers, so that the
drivers now export the DriverAPI struct as driDriverAPI instead of the
InitScreen entry point. This lets us avoid dlsym()'ing for the DRI2
init screen function to see if DRI2 is supported by the driver.
2008-03-26 23:26:59 +00:00
|
|
|
#ifdef GLX_DIRECT_RENDERING
|
|
|
|
do {
|
2008-10-13 13:12:02 +01:00
|
|
|
/* FIXME: Maybe delay __DRIdrawable creation until the drawable
|
|
|
|
* is actually bound to a context... */
|
|
|
|
|
|
|
|
__GLXdisplayPrivate *const priv = __glXInitialize(dpy);
|
|
|
|
__GLXDRIdrawable *pdraw;
|
|
|
|
__GLXscreenConfigs *psc;
|
|
|
|
|
|
|
|
psc = &priv->screenConfigs[fbconfig->screen];
|
|
|
|
if (psc->driScreen == NULL)
|
|
|
|
break;
|
|
|
|
pdraw = psc->driScreen->createDrawable(psc, drawable,
|
|
|
|
req->glxwindow, fbconfig);
|
|
|
|
if (pdraw == NULL) {
|
|
|
|
fprintf(stderr, "failed to create drawable\n");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (__glxHashInsert(psc->drawHash, req->glxwindow, pdraw)) {
|
|
|
|
(*pdraw->destroyDrawable) (pdraw);
|
|
|
|
return None; /* FIXME: Check what we're supposed to do here... */
|
|
|
|
}
|
|
|
|
|
|
|
|
pdraw->textureTarget = determineTextureTarget(attrib_list, i);
|
2009-03-18 19:07:09 +00:00
|
|
|
pdraw->textureFormat = determineTextureFormat(attrib_list, i);
|
DRI interface changes and DRI2 direct rendering support.
Add DRI2 direct rendering support to libGL and add DRI2 client side
protocol code. Extend the GLX 1.3 create drawable functions in
glx_pbuffer.c to call into the DRI driver when possible.
Introduce __DRIconfig, opaque struct that represents a DRI driver
configuration. Get's rid of the open coded __GLcontextModes in the
DRI driver interface and the context modes create and destroy
functions that the loader was requires to provide. glcore.h is no
longer part of the DRI driver interface. The DRI config is GL binding
agnostic, that is, not specific to GLX, EGL or other bindings.
The core API is now also an extension, and the driver exports a list
of extensions as the symbol __driDriverExtensions, which the loader
must dlsym() for. The list of extension will always include the DRI
core extension, which allows creating and manipulating DRI screens,
drawables and contexts. The DRI legacy extension, when available,
provides alternative entry points for creating the DRI objects that
work with the XF86DRI infrastructure.
Change DRI2 client code to not use drm drawables or contexts. We
never used drm_drawable_t's and the only use for drm_context_t was as
a unique identifier when taking the lock. We now just allocate a
unique lock ID out of the DRILock sarea block. Once we get rid of the
lock entirely, we can drop this hack.
Change the interface between dri_util.c and the drivers, so that the
drivers now export the DriverAPI struct as driDriverAPI instead of the
InitScreen entry point. This lets us avoid dlsym()'ing for the DRI2
init screen function to see if DRI2 is supported by the driver.
2008-03-26 23:26:59 +00:00
|
|
|
} while (0);
|
|
|
|
#endif
|
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
return (GLXDrawable) req->glxwindow;
|
2004-10-25 22:09:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destroy a non-pbuffer GLX drawable.
|
|
|
|
*
|
|
|
|
* \todo
|
|
|
|
* This function needs to be modified to work with direct-rendering drivers.
|
|
|
|
*/
|
|
|
|
static void
|
2008-10-13 13:12:02 +01:00
|
|
|
DestroyDrawable(Display * dpy, GLXDrawable drawable, CARD32 glxCode)
|
2004-10-25 22:09:16 +01:00
|
|
|
{
|
2008-10-13 13:12:02 +01:00
|
|
|
xGLXDestroyPbufferReq *req;
|
2006-06-13 02:41:18 +01:00
|
|
|
CARD8 opcode;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
if ((dpy == NULL) || (drawable == 0)) {
|
2004-10-25 22:09:16 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-06-13 02:41:18 +01:00
|
|
|
opcode = __glXSetupForCommand(dpy);
|
|
|
|
if (!opcode)
|
|
|
|
return;
|
|
|
|
|
2004-10-25 22:09:16 +01:00
|
|
|
LockDisplay(dpy);
|
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
GetReqExtra(GLXDestroyPbuffer, 4, req);
|
2006-06-13 02:41:18 +01:00
|
|
|
req->reqType = opcode;
|
2004-10-25 22:09:16 +01:00
|
|
|
req->glxCode = glxCode;
|
|
|
|
req->pbuffer = (GLXPbuffer) drawable;
|
|
|
|
|
|
|
|
UnlockDisplay(dpy);
|
|
|
|
SyncHandle();
|
|
|
|
|
DRI interface changes and DRI2 direct rendering support.
Add DRI2 direct rendering support to libGL and add DRI2 client side
protocol code. Extend the GLX 1.3 create drawable functions in
glx_pbuffer.c to call into the DRI driver when possible.
Introduce __DRIconfig, opaque struct that represents a DRI driver
configuration. Get's rid of the open coded __GLcontextModes in the
DRI driver interface and the context modes create and destroy
functions that the loader was requires to provide. glcore.h is no
longer part of the DRI driver interface. The DRI config is GL binding
agnostic, that is, not specific to GLX, EGL or other bindings.
The core API is now also an extension, and the driver exports a list
of extensions as the symbol __driDriverExtensions, which the loader
must dlsym() for. The list of extension will always include the DRI
core extension, which allows creating and manipulating DRI screens,
drawables and contexts. The DRI legacy extension, when available,
provides alternative entry points for creating the DRI objects that
work with the XF86DRI infrastructure.
Change DRI2 client code to not use drm drawables or contexts. We
never used drm_drawable_t's and the only use for drm_context_t was as
a unique identifier when taking the lock. We now just allocate a
unique lock ID out of the DRILock sarea block. Once we get rid of the
lock entirely, we can drop this hack.
Change the interface between dri_util.c and the drivers, so that the
drivers now export the DriverAPI struct as driDriverAPI instead of the
InitScreen entry point. This lets us avoid dlsym()'ing for the DRI2
init screen function to see if DRI2 is supported by the driver.
2008-03-26 23:26:59 +00:00
|
|
|
#ifdef GLX_DIRECT_RENDERING
|
|
|
|
{
|
2008-10-13 13:12:02 +01:00
|
|
|
int screen;
|
|
|
|
__GLXdisplayPrivate *const priv = __glXInitialize(dpy);
|
|
|
|
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, &screen);
|
|
|
|
__GLXscreenConfigs *psc = &priv->screenConfigs[screen];
|
|
|
|
|
|
|
|
if (pdraw != NULL) {
|
|
|
|
(*pdraw->destroyDrawable) (pdraw);
|
|
|
|
__glxHashDelete(psc->drawHash, drawable);
|
|
|
|
}
|
DRI interface changes and DRI2 direct rendering support.
Add DRI2 direct rendering support to libGL and add DRI2 client side
protocol code. Extend the GLX 1.3 create drawable functions in
glx_pbuffer.c to call into the DRI driver when possible.
Introduce __DRIconfig, opaque struct that represents a DRI driver
configuration. Get's rid of the open coded __GLcontextModes in the
DRI driver interface and the context modes create and destroy
functions that the loader was requires to provide. glcore.h is no
longer part of the DRI driver interface. The DRI config is GL binding
agnostic, that is, not specific to GLX, EGL or other bindings.
The core API is now also an extension, and the driver exports a list
of extensions as the symbol __driDriverExtensions, which the loader
must dlsym() for. The list of extension will always include the DRI
core extension, which allows creating and manipulating DRI screens,
drawables and contexts. The DRI legacy extension, when available,
provides alternative entry points for creating the DRI objects that
work with the XF86DRI infrastructure.
Change DRI2 client code to not use drm drawables or contexts. We
never used drm_drawable_t's and the only use for drm_context_t was as
a unique identifier when taking the lock. We now just allocate a
unique lock ID out of the DRILock sarea block. Once we get rid of the
lock entirely, we can drop this hack.
Change the interface between dri_util.c and the drivers, so that the
drivers now export the DriverAPI struct as driDriverAPI instead of the
InitScreen entry point. This lets us avoid dlsym()'ing for the DRI2
init screen function to see if DRI2 is supported by the driver.
2008-03-26 23:26:59 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2004-10-25 22:09:16 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a pbuffer.
|
|
|
|
*
|
|
|
|
* This function is used to implement \c glXCreatePbuffer and
|
|
|
|
* \c glXCreateGLXPbufferSGIX.
|
|
|
|
*
|
|
|
|
* \note
|
|
|
|
* This function dynamically determines whether to use the SGIX_pbuffer
|
|
|
|
* version of the protocol or the GLX 1.3 version of the protocol.
|
|
|
|
*
|
|
|
|
* \todo
|
|
|
|
* This function needs to be modified to work with direct-rendering drivers.
|
|
|
|
*/
|
|
|
|
static GLXDrawable
|
2008-10-13 13:12:02 +01:00
|
|
|
CreatePbuffer(Display * dpy, const __GLcontextModes * fbconfig,
|
|
|
|
unsigned int width, unsigned int height,
|
|
|
|
const int *attrib_list, GLboolean size_in_attribs)
|
2004-10-25 22:09:16 +01:00
|
|
|
{
|
|
|
|
__GLXdisplayPrivate *priv = __glXInitialize(dpy);
|
|
|
|
GLXDrawable id = 0;
|
2008-10-13 13:12:02 +01:00
|
|
|
CARD32 *data;
|
2006-06-13 02:41:18 +01:00
|
|
|
CARD8 opcode;
|
2008-10-13 13:12:02 +01:00
|
|
|
unsigned int i;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
2005-03-04 17:53:24 +00:00
|
|
|
i = 0;
|
|
|
|
if (attrib_list) {
|
2008-10-13 13:12:02 +01:00
|
|
|
while (attrib_list[i * 2])
|
|
|
|
i++;
|
2005-03-04 17:53:24 +00:00
|
|
|
}
|
2004-10-25 22:09:16 +01:00
|
|
|
|
2006-06-13 02:41:18 +01:00
|
|
|
opcode = __glXSetupForCommand(dpy);
|
|
|
|
if (!opcode)
|
|
|
|
return None;
|
|
|
|
|
2004-10-25 22:09:16 +01:00
|
|
|
LockDisplay(dpy);
|
|
|
|
id = XAllocID(dpy);
|
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
if ((priv->majorVersion > 1) || (priv->minorVersion >= 3)) {
|
|
|
|
xGLXCreatePbufferReq *req;
|
2004-10-25 22:09:16 +01:00
|
|
|
unsigned int extra = (size_in_attribs) ? 0 : 2;
|
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
GetReqExtra(GLXCreatePbuffer, (8 * (i + extra)), req);
|
2004-10-25 22:09:16 +01:00
|
|
|
data = (CARD32 *) (req + 1);
|
|
|
|
|
2006-06-13 02:41:18 +01:00
|
|
|
req->reqType = opcode;
|
2004-10-25 22:09:16 +01:00
|
|
|
req->glxCode = X_GLXCreatePbuffer;
|
|
|
|
req->screen = (CARD32) fbconfig->screen;
|
|
|
|
req->fbconfig = fbconfig->fbconfigID;
|
|
|
|
req->pbuffer = (GLXPbuffer) id;
|
|
|
|
req->numAttribs = (CARD32) (i + extra);
|
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
if (!size_in_attribs) {
|
|
|
|
data[(2 * i) + 0] = GLX_PBUFFER_WIDTH;
|
|
|
|
data[(2 * i) + 1] = width;
|
|
|
|
data[(2 * i) + 2] = GLX_PBUFFER_HEIGHT;
|
|
|
|
data[(2 * i) + 3] = height;
|
|
|
|
data += 4;
|
2004-10-25 22:09:16 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
xGLXVendorPrivateReq *vpreq;
|
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
GetReqExtra(GLXVendorPrivate, 20 + (8 * i), vpreq);
|
2004-10-25 22:09:16 +01:00
|
|
|
data = (CARD32 *) (vpreq + 1);
|
|
|
|
|
2006-06-13 02:41:18 +01:00
|
|
|
vpreq->reqType = opcode;
|
2004-10-25 22:09:16 +01:00
|
|
|
vpreq->glxCode = X_GLXVendorPrivate;
|
|
|
|
vpreq->vendorCode = X_GLXvop_CreateGLXPbufferSGIX;
|
|
|
|
|
|
|
|
data[0] = (CARD32) fbconfig->screen;
|
|
|
|
data[1] = (CARD32) fbconfig->fbconfigID;
|
|
|
|
data[2] = (CARD32) id;
|
|
|
|
data[3] = (CARD32) width;
|
|
|
|
data[4] = (CARD32) height;
|
|
|
|
data += 5;
|
|
|
|
}
|
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
(void) memcpy(data, attrib_list, sizeof(CARD32) * 2 * i);
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
UnlockDisplay(dpy);
|
|
|
|
SyncHandle();
|
|
|
|
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new pbuffer.
|
|
|
|
*/
|
2004-12-15 17:18:06 +00:00
|
|
|
PUBLIC GLXPbufferSGIX
|
2008-10-13 13:12:02 +01:00
|
|
|
glXCreateGLXPbufferSGIX(Display * dpy, GLXFBConfigSGIX config,
|
|
|
|
unsigned int width, unsigned int height,
|
|
|
|
int *attrib_list)
|
2004-10-25 22:09:16 +01:00
|
|
|
{
|
2008-10-13 13:12:02 +01:00
|
|
|
return (GLXPbufferSGIX) CreatePbuffer(dpy, (__GLcontextModes *) config,
|
|
|
|
width, height,
|
|
|
|
attrib_list, GL_FALSE);
|
2004-10-25 22:09:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new pbuffer.
|
|
|
|
*/
|
2004-12-15 17:18:06 +00:00
|
|
|
PUBLIC GLXPbuffer
|
2008-10-13 13:12:02 +01:00
|
|
|
glXCreatePbuffer(Display * dpy, GLXFBConfig config, const int *attrib_list)
|
2004-10-25 22:09:16 +01:00
|
|
|
{
|
2007-08-27 19:16:30 +01:00
|
|
|
int i, width, height;
|
|
|
|
|
|
|
|
width = 0;
|
|
|
|
height = 0;
|
|
|
|
|
2009-09-15 21:12:22 +01:00
|
|
|
warn_GLX_1_3(dpy, __func__);
|
|
|
|
|
2007-08-27 19:16:30 +01:00
|
|
|
for (i = 0; attrib_list[i * 2]; i++) {
|
|
|
|
switch (attrib_list[i * 2]) {
|
|
|
|
case GLX_PBUFFER_WIDTH:
|
2008-10-13 13:12:02 +01:00
|
|
|
width = attrib_list[i * 2 + 1];
|
|
|
|
break;
|
2007-08-27 19:16:30 +01:00
|
|
|
case GLX_PBUFFER_HEIGHT:
|
2008-10-13 13:12:02 +01:00
|
|
|
height = attrib_list[i * 2 + 1];
|
|
|
|
break;
|
2007-08-27 19:16:30 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
return (GLXPbuffer) CreatePbuffer(dpy, (__GLcontextModes *) config,
|
|
|
|
width, height, attrib_list, GL_TRUE);
|
2004-10-25 22:09:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destroy an existing pbuffer.
|
|
|
|
*/
|
2004-12-15 17:18:06 +00:00
|
|
|
PUBLIC void
|
2008-10-13 13:12:02 +01:00
|
|
|
glXDestroyPbuffer(Display * dpy, GLXPbuffer pbuf)
|
2004-10-25 22:09:16 +01:00
|
|
|
{
|
2008-10-13 13:12:02 +01:00
|
|
|
DestroyPbuffer(dpy, pbuf);
|
2004-10-25 22:09:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Query an attribute of a drawable.
|
|
|
|
*/
|
2004-12-15 17:18:06 +00:00
|
|
|
PUBLIC void
|
2008-10-13 13:12:02 +01:00
|
|
|
glXQueryDrawable(Display * dpy, GLXDrawable drawable,
|
|
|
|
int attribute, unsigned int *value)
|
2004-10-25 22:09:16 +01:00
|
|
|
{
|
2009-09-15 21:12:22 +01:00
|
|
|
warn_GLX_1_3(dpy, __func__);
|
2008-10-13 13:12:02 +01:00
|
|
|
GetDrawableAttribute(dpy, drawable, attribute, value);
|
2004-10-25 22:09:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Query an attribute of a pbuffer.
|
|
|
|
*/
|
2004-12-15 17:18:06 +00:00
|
|
|
PUBLIC int
|
2008-10-13 13:12:02 +01:00
|
|
|
glXQueryGLXPbufferSGIX(Display * dpy, GLXPbufferSGIX drawable,
|
|
|
|
int attribute, unsigned int *value)
|
2004-10-25 22:09:16 +01:00
|
|
|
{
|
2008-10-13 13:12:02 +01:00
|
|
|
return GetDrawableAttribute(dpy, drawable, attribute, value);
|
2004-10-25 22:09:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Select the event mask for a drawable.
|
|
|
|
*/
|
2004-12-15 17:18:06 +00:00
|
|
|
PUBLIC void
|
2008-10-13 13:12:02 +01:00
|
|
|
glXSelectEvent(Display * dpy, GLXDrawable drawable, unsigned long mask)
|
2004-10-25 22:09:16 +01:00
|
|
|
{
|
|
|
|
CARD32 attribs[2];
|
|
|
|
|
|
|
|
attribs[0] = (CARD32) GLX_EVENT_MASK;
|
|
|
|
attribs[1] = (CARD32) mask;
|
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
ChangeDrawableAttribute(dpy, drawable, attribs, 1);
|
2004-10-25 22:09:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the selected event mask for a drawable.
|
|
|
|
*/
|
2004-12-15 17:18:06 +00:00
|
|
|
PUBLIC void
|
2008-10-13 13:12:02 +01:00
|
|
|
glXGetSelectedEvent(Display * dpy, GLXDrawable drawable, unsigned long *mask)
|
2004-10-25 22:09:16 +01:00
|
|
|
{
|
|
|
|
unsigned int value;
|
|
|
|
|
|
|
|
|
|
|
|
/* The non-sense with value is required because on LP64 platforms
|
|
|
|
* sizeof(unsigned int) != sizeof(unsigned long). On little-endian
|
|
|
|
* we could just type-cast the pointer, but why?
|
|
|
|
*/
|
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
GetDrawableAttribute(dpy, drawable, GLX_EVENT_MASK_SGIX, &value);
|
2004-10-25 22:09:16 +01:00
|
|
|
*mask = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-12-15 17:18:06 +00:00
|
|
|
PUBLIC GLXPixmap
|
2008-10-13 13:12:02 +01:00
|
|
|
glXCreatePixmap(Display * dpy, GLXFBConfig config, Pixmap pixmap,
|
|
|
|
const int *attrib_list)
|
2004-10-25 22:09:16 +01:00
|
|
|
{
|
2009-09-15 21:12:22 +01:00
|
|
|
warn_GLX_1_3(dpy, __func__);
|
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
return CreateDrawable(dpy, (__GLcontextModes *) config,
|
|
|
|
(Drawable) pixmap, attrib_list, X_GLXCreatePixmap);
|
2004-10-25 22:09:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-12-15 17:18:06 +00:00
|
|
|
PUBLIC GLXWindow
|
2008-10-13 13:12:02 +01:00
|
|
|
glXCreateWindow(Display * dpy, GLXFBConfig config, Window win,
|
|
|
|
const int *attrib_list)
|
2004-10-25 22:09:16 +01:00
|
|
|
{
|
2009-09-15 21:12:22 +01:00
|
|
|
warn_GLX_1_3(dpy, __func__);
|
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
return CreateDrawable(dpy, (__GLcontextModes *) config,
|
|
|
|
(Drawable) win, attrib_list, X_GLXCreateWindow);
|
2004-10-25 22:09:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-12-15 17:18:06 +00:00
|
|
|
PUBLIC void
|
2008-10-13 13:12:02 +01:00
|
|
|
glXDestroyPixmap(Display * dpy, GLXPixmap pixmap)
|
2004-10-25 22:09:16 +01:00
|
|
|
{
|
2009-09-15 21:12:22 +01:00
|
|
|
warn_GLX_1_3(dpy, __func__);
|
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
DestroyDrawable(dpy, (GLXDrawable) pixmap, X_GLXDestroyPixmap);
|
2004-10-25 22:09:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-12-15 17:18:06 +00:00
|
|
|
PUBLIC void
|
2008-10-13 13:12:02 +01:00
|
|
|
glXDestroyWindow(Display * dpy, GLXWindow win)
|
2004-10-25 22:09:16 +01:00
|
|
|
{
|
2009-09-15 21:12:22 +01:00
|
|
|
warn_GLX_1_3(dpy, __func__);
|
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
DestroyDrawable(dpy, (GLXDrawable) win, X_GLXDestroyWindow);
|
2004-10-25 22:09:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
PUBLIC
|
|
|
|
GLX_ALIAS_VOID(glXDestroyGLXPbufferSGIX,
|
|
|
|
(Display * dpy, GLXPbufferSGIX pbuf),
|
|
|
|
(dpy, pbuf), glXDestroyPbuffer)
|
2004-10-25 22:09:16 +01:00
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
PUBLIC
|
|
|
|
GLX_ALIAS_VOID(glXSelectEventSGIX,
|
|
|
|
(Display * dpy, GLXDrawable drawable,
|
|
|
|
unsigned long mask), (dpy, drawable, mask),
|
|
|
|
glXSelectEvent)
|
2004-10-25 22:09:16 +01:00
|
|
|
|
2008-10-13 13:12:02 +01:00
|
|
|
PUBLIC
|
|
|
|
GLX_ALIAS_VOID(glXGetSelectedEventSGIX,
|
|
|
|
(Display * dpy, GLXDrawable drawable,
|
|
|
|
unsigned long *mask), (dpy, drawable, mask),
|
|
|
|
glXGetSelectedEvent)
|