2006-11-26 11:13:41 -07:00
|
|
|
/*
|
2009-09-06 13:44:18 -06:00
|
|
|
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
|
|
|
|
* Copyright (C) 1991-2000 Silicon Graphics, Inc. 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
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* 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 including the dates of first publication and
|
|
|
|
* either this permission notice or a reference to
|
|
|
|
* http://oss.sgi.com/projects/FreeB/
|
|
|
|
* 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 NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* SILICON GRAPHICS, INC. 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.
|
|
|
|
*
|
|
|
|
* Except as contained in this notice, the name of Silicon Graphics, Inc.
|
|
|
|
* shall not be used in advertising or otherwise to promote the sale, use or
|
|
|
|
* other dealings in this Software without prior written authorization from
|
|
|
|
* Silicon Graphics, Inc.
|
|
|
|
*/
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
#include "glxserver.h"
|
|
|
|
#include "glxutil.h"
|
|
|
|
#include <GL/glxtokens.h>
|
|
|
|
#include <g_disptab.h>
|
|
|
|
#include <pixmapstr.h>
|
|
|
|
#include <windowstr.h>
|
|
|
|
#include "unpack.h"
|
2011-12-18 09:08:59 -07:00
|
|
|
#include "glxcmds.h"
|
2006-11-26 11:13:41 -07:00
|
|
|
#include "glxext.h"
|
|
|
|
#include "glxvendor.h"
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
extern int glxIsExtensionSupported(char *ext);
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int __glXSwapGetFBConfigsSGIX(__GLXclientState * cl, GLbyte * pc);
|
2011-12-18 09:08:59 -07:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
/************************************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
** Byteswapping versions of GLX commands. In most cases they just swap
|
|
|
|
** the incoming arguments and then call the unswapped routine. For commands
|
|
|
|
** that have replies, a separate swapping routine for the reply is provided;
|
|
|
|
** it is called at the end of the unswapped routine.
|
|
|
|
*/
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapCreateContext(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->context);
|
|
|
|
__GLX_SWAP_INT(&req->visual);
|
|
|
|
__GLX_SWAP_INT(&req->screen);
|
|
|
|
__GLX_SWAP_INT(&req->shareList);
|
|
|
|
|
|
|
|
return __glXCreateContext(cl, pc);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapCreateNewContext(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->context);
|
|
|
|
__GLX_SWAP_INT(&req->fbconfig);
|
|
|
|
__GLX_SWAP_INT(&req->screen);
|
|
|
|
__GLX_SWAP_INT(&req->shareList);
|
|
|
|
|
|
|
|
return __glXCreateNewContext(cl, pc);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapCreateContextWithConfigSGIX(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
2012-06-10 07:21:05 -06:00
|
|
|
xGLXCreateContextWithConfigSGIXReq *req =
|
|
|
|
(xGLXCreateContextWithConfigSGIXReq *) pc;
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->context);
|
|
|
|
__GLX_SWAP_INT(&req->fbconfig);
|
|
|
|
__GLX_SWAP_INT(&req->screen);
|
|
|
|
__GLX_SWAP_INT(&req->shareList);
|
|
|
|
|
|
|
|
return __glXCreateContextWithConfigSGIX(cl, pc);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapQueryMaxSwapBarriersSGIX(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xGLXQueryMaxSwapBarriersSGIXReq *req =
|
2012-06-10 07:21:05 -06:00
|
|
|
(xGLXQueryMaxSwapBarriersSGIXReq *) pc;
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->screen);
|
|
|
|
|
|
|
|
return __glXQueryMaxSwapBarriersSGIX(cl, pc);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapBindSwapBarrierSGIX(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
2012-06-10 07:21:05 -06:00
|
|
|
xGLXBindSwapBarrierSGIXReq *req = (xGLXBindSwapBarrierSGIXReq *) pc;
|
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->drawable);
|
|
|
|
__GLX_SWAP_INT(&req->barrier);
|
|
|
|
|
|
|
|
return __glXBindSwapBarrierSGIX(cl, pc);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapJoinSwapGroupSGIX(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
2012-06-10 07:21:05 -06:00
|
|
|
xGLXJoinSwapGroupSGIXReq *req = (xGLXJoinSwapGroupSGIXReq *) pc;
|
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->drawable);
|
|
|
|
__GLX_SWAP_INT(&req->member);
|
|
|
|
|
|
|
|
return __glXJoinSwapGroupSGIX(cl, pc);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapDestroyContext(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->context);
|
|
|
|
|
|
|
|
return __glXDestroyContext(cl, pc);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapMakeCurrent(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->drawable);
|
|
|
|
__GLX_SWAP_INT(&req->context);
|
|
|
|
__GLX_SWAP_INT(&req->oldContextTag);
|
|
|
|
|
|
|
|
return __glXMakeCurrent(cl, pc);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapMakeContextCurrent(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->drawable);
|
|
|
|
__GLX_SWAP_INT(&req->readdrawable);
|
|
|
|
__GLX_SWAP_INT(&req->context);
|
|
|
|
__GLX_SWAP_INT(&req->oldContextTag);
|
|
|
|
|
|
|
|
return __glXMakeContextCurrent(cl, pc);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapMakeCurrentReadSGI(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->drawable);
|
|
|
|
__GLX_SWAP_INT(&req->readable);
|
|
|
|
__GLX_SWAP_INT(&req->context);
|
|
|
|
__GLX_SWAP_INT(&req->oldContextTag);
|
|
|
|
|
|
|
|
return __glXMakeCurrentReadSGI(cl, pc);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapIsDirect(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->context);
|
|
|
|
|
|
|
|
return __glXIsDirect(cl, pc);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapQueryVersion(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->majorVersion);
|
|
|
|
__GLX_SWAP_INT(&req->minorVersion);
|
|
|
|
|
|
|
|
return __glXQueryVersion(cl, pc);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapWaitGL(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xGLXWaitGLReq *req = (xGLXWaitGLReq *) pc;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->contextTag);
|
|
|
|
|
|
|
|
return __glXWaitGL(cl, pc);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapWaitX(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xGLXWaitXReq *req = (xGLXWaitXReq *) pc;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->contextTag);
|
|
|
|
|
|
|
|
return __glXWaitX(cl, pc);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapCopyContext(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->source);
|
|
|
|
__GLX_SWAP_INT(&req->dest);
|
|
|
|
__GLX_SWAP_INT(&req->mask);
|
|
|
|
|
|
|
|
return __glXCopyContext(cl, pc);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapGetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
2012-06-10 07:21:05 -06:00
|
|
|
ClientPtr client = cl->client;
|
2006-11-26 11:13:41 -07:00
|
|
|
xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc;
|
|
|
|
xGLXGetVisualConfigsReply reply;
|
|
|
|
__GLXscreenInfo *pGlxScreen;
|
|
|
|
__GLXvisualConfig *pGlxVisual;
|
|
|
|
CARD32 buf[__GLX_TOTAL_CONFIG];
|
|
|
|
unsigned int screen;
|
|
|
|
int i, p;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
2010-12-05 08:36:02 -07:00
|
|
|
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
__GLX_SWAP_INT(&req->screen);
|
|
|
|
screen = req->screen;
|
2010-12-21 13:10:44 -07:00
|
|
|
if (screen >= screenInfo.numScreens) {
|
2012-06-10 07:21:05 -06:00
|
|
|
/* The client library must send a valid screen number. */
|
|
|
|
client->errorValue = screen;
|
|
|
|
return BadValue;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
pGlxScreen = &__glXActiveScreens[screen];
|
|
|
|
|
|
|
|
reply.numVisuals = pGlxScreen->numGLXVisuals;
|
|
|
|
reply.numProps = __GLX_TOTAL_CONFIG;
|
|
|
|
reply.length = (pGlxScreen->numGLXVisuals * __GLX_SIZE_CARD32 *
|
2012-06-10 07:21:05 -06:00
|
|
|
__GLX_TOTAL_CONFIG) >> 2;
|
2006-11-26 11:13:41 -07:00
|
|
|
reply.type = X_Reply;
|
|
|
|
reply.sequenceNumber = client->sequence;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_SWAP_SHORT(&reply.sequenceNumber);
|
|
|
|
__GLX_SWAP_INT(&reply.length);
|
|
|
|
__GLX_SWAP_INT(&reply.numVisuals);
|
|
|
|
__GLX_SWAP_INT(&reply.numProps);
|
2012-06-10 07:21:05 -06:00
|
|
|
WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *) &reply);
|
|
|
|
|
|
|
|
for (i = 0; i < pGlxScreen->numVisuals; i++) {
|
|
|
|
pGlxVisual = &pGlxScreen->pGlxVisual[i];
|
|
|
|
if (!pGlxScreen->isGLXvis[i] || pGlxVisual->vid == 0) {
|
|
|
|
/* not a usable visual */
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
p = 0;
|
|
|
|
buf[p++] = pGlxVisual->vid;
|
|
|
|
buf[p++] = pGlxVisual->class;
|
|
|
|
buf[p++] = pGlxVisual->rgba;
|
|
|
|
|
|
|
|
buf[p++] = pGlxVisual->redSize;
|
|
|
|
buf[p++] = pGlxVisual->greenSize;
|
|
|
|
buf[p++] = pGlxVisual->blueSize;
|
|
|
|
buf[p++] = pGlxVisual->alphaSize;
|
|
|
|
buf[p++] = pGlxVisual->accumRedSize;
|
|
|
|
buf[p++] = pGlxVisual->accumGreenSize;
|
|
|
|
buf[p++] = pGlxVisual->accumBlueSize;
|
|
|
|
buf[p++] = pGlxVisual->accumAlphaSize;
|
|
|
|
|
|
|
|
buf[p++] = pGlxVisual->doubleBuffer;
|
|
|
|
buf[p++] = pGlxVisual->stereo;
|
|
|
|
|
|
|
|
buf[p++] = pGlxVisual->bufferSize;
|
|
|
|
buf[p++] = pGlxVisual->depthSize;
|
|
|
|
buf[p++] = pGlxVisual->stencilSize;
|
|
|
|
buf[p++] = pGlxVisual->auxBuffers;
|
|
|
|
buf[p++] = pGlxVisual->level;
|
2006-11-26 11:13:41 -07:00
|
|
|
/*
|
2012-06-10 07:21:05 -06:00
|
|
|
** Add token/value pairs for extensions.
|
|
|
|
*/
|
2006-11-26 11:13:41 -07:00
|
|
|
buf[p++] = GLX_VISUAL_CAVEAT_EXT;
|
|
|
|
buf[p++] = pGlxVisual->visualRating;
|
|
|
|
buf[p++] = GLX_TRANSPARENT_TYPE_EXT;
|
|
|
|
buf[p++] = pGlxVisual->transparentPixel;
|
|
|
|
buf[p++] = GLX_TRANSPARENT_RED_VALUE_EXT;
|
|
|
|
buf[p++] = pGlxVisual->transparentRed;
|
|
|
|
buf[p++] = GLX_TRANSPARENT_GREEN_VALUE_EXT;
|
|
|
|
buf[p++] = pGlxVisual->transparentGreen;
|
|
|
|
buf[p++] = GLX_TRANSPARENT_BLUE_VALUE_EXT;
|
|
|
|
buf[p++] = pGlxVisual->transparentBlue;
|
|
|
|
buf[p++] = GLX_TRANSPARENT_ALPHA_VALUE_EXT;
|
|
|
|
buf[p++] = pGlxVisual->transparentAlpha;
|
|
|
|
buf[p++] = GLX_TRANSPARENT_INDEX_VALUE_EXT;
|
|
|
|
buf[p++] = pGlxVisual->transparentIndex;
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
__GLX_SWAP_INT_ARRAY(buf, __GLX_TOTAL_CONFIG);
|
|
|
|
WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG,
|
|
|
|
(char *) buf);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapCreateGLXPixmap(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->screen);
|
|
|
|
__GLX_SWAP_INT(&req->visual);
|
|
|
|
__GLX_SWAP_INT(&req->pixmap);
|
|
|
|
__GLX_SWAP_INT(&req->glxpixmap);
|
|
|
|
|
|
|
|
return __glXCreateGLXPixmap(cl, pc);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapCreatePixmap(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->screen);
|
|
|
|
__GLX_SWAP_INT(&req->fbconfig);
|
|
|
|
__GLX_SWAP_INT(&req->pixmap);
|
|
|
|
__GLX_SWAP_INT(&req->glxpixmap);
|
|
|
|
__GLX_SWAP_INT(&req->numAttribs);
|
|
|
|
|
|
|
|
return __glXCreatePixmap(cl, pc);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapDestroyGLXPixmap(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->glxpixmap);
|
|
|
|
|
|
|
|
return __glXDestroyGLXPixmap(cl, pc);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapSwapBuffers(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->contextTag);
|
|
|
|
__GLX_SWAP_INT(&req->drawable);
|
|
|
|
|
|
|
|
return __glXSwapBuffers(cl, pc);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapUseXFont(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xGLXUseXFontReq *req = (xGLXUseXFontReq *) pc;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->contextTag);
|
|
|
|
__GLX_SWAP_INT(&req->font);
|
|
|
|
__GLX_SWAP_INT(&req->first);
|
|
|
|
__GLX_SWAP_INT(&req->count);
|
|
|
|
__GLX_SWAP_INT(&req->listBase);
|
|
|
|
|
|
|
|
return __glXUseXFont(cl, pc);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapQueryExtensionsString(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xGLXQueryExtensionsStringReq *req = NULL;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->screen);
|
|
|
|
|
|
|
|
return __glXQueryExtensionsString(cl, pc);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapQueryServerString(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
2012-06-10 07:21:05 -06:00
|
|
|
xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *) pc;
|
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->screen);
|
|
|
|
__GLX_SWAP_INT(&req->name);
|
|
|
|
|
|
|
|
return __glXQueryServerString(cl, pc);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapClientInfo(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
2012-06-10 07:21:05 -06:00
|
|
|
xGLXClientInfoReq *req = (xGLXClientInfoReq *) pc;
|
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->major);
|
|
|
|
__GLX_SWAP_INT(&req->minor);
|
|
|
|
__GLX_SWAP_INT(&req->numbytes);
|
|
|
|
|
|
|
|
return __glXClientInfo(cl, pc);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapQueryContextInfoEXT(__GLXclientState * cl, char *pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xGLXQueryContextInfoEXTReq *req = (xGLXQueryContextInfoEXTReq *) pc;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->context);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
return __glXQueryContextInfoEXT(cl, (GLbyte *) pc);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/************************************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
** Swap replies.
|
|
|
|
*/
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
void
|
|
|
|
__glXSwapMakeCurrentReply(ClientPtr client, xGLXMakeCurrentReadSGIReply * reply)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
__GLX_SWAP_SHORT(&reply->sequenceNumber);
|
|
|
|
__GLX_SWAP_INT(&reply->length);
|
|
|
|
__GLX_SWAP_INT(&reply->contextTag);
|
|
|
|
__GLX_SWAP_INT(&reply->writeVid);
|
|
|
|
__GLX_SWAP_INT(&reply->writeType);
|
|
|
|
__GLX_SWAP_INT(&reply->readVid);
|
|
|
|
__GLX_SWAP_INT(&reply->readType);
|
2012-06-10 07:21:05 -06:00
|
|
|
WriteToClient(client, sz_xGLXMakeCurrentReadSGIReply, (char *) reply);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
void
|
|
|
|
__glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply * reply)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
__GLX_SWAP_SHORT(&reply->sequenceNumber);
|
|
|
|
__GLX_SWAP_INT(&reply->length);
|
2012-06-10 07:21:05 -06:00
|
|
|
WriteToClient(client, sz_xGLXIsDirectReply, (char *) reply);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
void
|
|
|
|
__glXSwapQueryVersionReply(ClientPtr client, xGLXQueryVersionReply * reply)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
__GLX_SWAP_SHORT(&reply->sequenceNumber);
|
|
|
|
__GLX_SWAP_INT(&reply->length);
|
|
|
|
__GLX_SWAP_INT(&reply->majorVersion);
|
|
|
|
__GLX_SWAP_INT(&reply->minorVersion);
|
2012-06-10 07:21:05 -06:00
|
|
|
WriteToClient(client, sz_xGLXQueryVersionReply, (char *) reply);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
void
|
|
|
|
glxSwapQueryExtensionsStringReply(ClientPtr client,
|
|
|
|
xGLXQueryExtensionsStringReply * reply,
|
|
|
|
char *buf)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
int length = reply->length;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
2010-12-05 08:36:02 -07:00
|
|
|
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_SWAP_SHORT(&reply->sequenceNumber);
|
|
|
|
__GLX_SWAP_INT(&reply->length);
|
|
|
|
__GLX_SWAP_INT(&reply->n);
|
2012-06-10 07:21:05 -06:00
|
|
|
WriteToClient(client, sz_xGLXQueryExtensionsStringReply, (char *) reply);
|
|
|
|
__GLX_SWAP_INT_ARRAY((int *) buf, length);
|
2006-11-26 11:13:41 -07:00
|
|
|
WriteToClient(client, length << 2, buf);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
void
|
|
|
|
glxSwapQueryServerStringReply(ClientPtr client,
|
|
|
|
xGLXQueryServerStringReply * reply, char *buf)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
int length = reply->length;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
__GLX_SWAP_SHORT(&reply->sequenceNumber);
|
|
|
|
__GLX_SWAP_INT(&reply->length);
|
|
|
|
__GLX_SWAP_INT(&reply->n);
|
2012-06-10 07:21:05 -06:00
|
|
|
WriteToClient(client, sz_xGLXQueryServerStringReply, (char *) reply);
|
2006-11-26 11:13:41 -07:00
|
|
|
/** no swap is needed for an array of chars **/
|
|
|
|
/* __GLX_SWAP_INT_ARRAY((int *)buf, length); */
|
|
|
|
WriteToClient(client, length << 2, buf);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
void
|
|
|
|
__glXSwapQueryContextInfoEXTReply(ClientPtr client,
|
|
|
|
xGLXQueryContextInfoEXTReply * reply,
|
|
|
|
int *buf)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
int length = reply->length;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
2010-12-05 08:36:02 -07:00
|
|
|
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_SWAP_SHORT(&reply->sequenceNumber);
|
|
|
|
__GLX_SWAP_INT(&reply->length);
|
|
|
|
__GLX_SWAP_INT(&reply->n);
|
2012-06-10 07:21:05 -06:00
|
|
|
WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *) reply);
|
|
|
|
__GLX_SWAP_INT_ARRAY((int *) buf, length);
|
|
|
|
WriteToClient(client, length << 2, (char *) buf);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
void
|
|
|
|
__glXSwapQueryContextReply(ClientPtr client,
|
|
|
|
xGLXQueryContextReply * reply, int *buf)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
int length = reply->length;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
2010-12-05 08:36:02 -07:00
|
|
|
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_SWAP_SHORT(&reply->sequenceNumber);
|
|
|
|
__GLX_SWAP_INT(&reply->length);
|
|
|
|
__GLX_SWAP_INT(&reply->n);
|
2012-06-10 07:21:05 -06:00
|
|
|
WriteToClient(client, sz_xGLXQueryContextReply, (char *) reply);
|
|
|
|
__GLX_SWAP_INT_ARRAY((int *) buf, length);
|
|
|
|
WriteToClient(client, length << 2, (char *) buf);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
void
|
|
|
|
__glXSwapGetDrawableAttributesReply(ClientPtr client,
|
|
|
|
xGLXGetDrawableAttributesReply * reply,
|
|
|
|
int *buf)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
2010-12-05 08:36:02 -07:00
|
|
|
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_SWAP_SHORT(&reply->sequenceNumber);
|
|
|
|
__GLX_SWAP_INT(&reply->length);
|
|
|
|
__GLX_SWAP_INT(&reply->numAttribs);
|
2012-06-10 07:21:05 -06:00
|
|
|
__GLX_SWAP_INT_ARRAY(buf, reply->length);
|
|
|
|
WriteToClient(client, sz_xGLXGetDrawableAttributesReply, (char *) reply);
|
|
|
|
WriteToClient(client, reply->length << 2, (char *) buf);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
void
|
|
|
|
__glXSwapQueryMaxSwapBarriersSGIXReply(ClientPtr client,
|
|
|
|
xGLXQueryMaxSwapBarriersSGIXReply *
|
|
|
|
reply)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
__GLX_SWAP_SHORT(&reply->sequenceNumber);
|
|
|
|
__GLX_SWAP_INT(&reply->length);
|
|
|
|
__GLX_SWAP_INT(&reply->max);
|
2012-06-10 07:21:05 -06:00
|
|
|
WriteToClient(client, sz_xGLXQueryMaxSwapBarriersSGIXReply, (char *) reply);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/************************************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
** Render and Renderlarge are not in the GLX API. They are used by the GLX
|
|
|
|
** client library to send batches of GL rendering commands.
|
|
|
|
*/
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapRender(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xGLXRenderReq *req;
|
|
|
|
int left;
|
|
|
|
__GLXrenderHeader *hdr;
|
|
|
|
ClientPtr client = cl->client;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
2010-12-05 08:36:02 -07:00
|
|
|
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
/*
|
2012-06-10 07:21:05 -06:00
|
|
|
** NOTE: much of this code also appears in the nonswapping version of this
|
|
|
|
** routine, __glXRender(). Any changes made here should also be
|
|
|
|
** duplicated there.
|
|
|
|
*/
|
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
req = (xGLXRenderReq *) pc;
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->contextTag);
|
|
|
|
|
|
|
|
pc += sz_xGLXRenderReq;
|
|
|
|
left = (req->length << 2) - sz_xGLXRenderReq;
|
|
|
|
while (left > 0) {
|
2012-06-10 07:21:05 -06:00
|
|
|
void (*proc) (GLbyte *);
|
|
|
|
CARD16 opcode;
|
|
|
|
|
|
|
|
/*
|
|
|
|
** Verify that the header length and the overall length agree.
|
|
|
|
** Also, each command must be word aligned.
|
|
|
|
*/
|
|
|
|
hdr = (__GLXrenderHeader *) pc;
|
|
|
|
__GLX_SWAP_SHORT(&hdr->length);
|
|
|
|
__GLX_SWAP_SHORT(&hdr->opcode);
|
|
|
|
|
|
|
|
/*
|
2006-11-26 11:13:41 -07:00
|
|
|
* call the command procedure to swap any arguments
|
2012-06-10 07:21:05 -06:00
|
|
|
*/
|
|
|
|
opcode = hdr->opcode;
|
|
|
|
if ((opcode >= __GLX_MIN_RENDER_OPCODE) &&
|
|
|
|
(opcode <= __GLX_MAX_RENDER_OPCODE)) {
|
|
|
|
proc = __glXSwapRenderTable[opcode];
|
2006-11-26 11:13:41 -07:00
|
|
|
#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
|
2012-06-10 07:21:05 -06:00
|
|
|
}
|
|
|
|
else if ((opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
|
|
|
|
(opcode <= __GLX_MAX_RENDER_OPCODE_EXT)) {
|
|
|
|
int index = opcode - __GLX_MIN_RENDER_OPCODE_EXT;
|
|
|
|
__GLXRenderSwapInfo *info = &__glXSwapRenderTable_EXT[index];
|
|
|
|
|
|
|
|
if (info->swapfunc) {
|
|
|
|
proc = info->swapfunc;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
proc = NULL;
|
|
|
|
if (info->elem_size == 4 && info->nelems > 0) {
|
|
|
|
__GLX_SWAP_INT_ARRAY((int *) (pc + __GLX_RENDER_HDR_SIZE),
|
|
|
|
info->nelems);
|
|
|
|
}
|
|
|
|
else if (info->elem_size == 2 && info->nelems > 0) {
|
|
|
|
__GLX_SWAP_SHORT_ARRAY((short *) (pc +
|
|
|
|
__GLX_RENDER_HDR_SIZE),
|
|
|
|
info->nelems);
|
|
|
|
}
|
|
|
|
else if (info->elem_size == 8 && info->nelems > 0) {
|
|
|
|
__GLX_SWAP_DOUBLE_ARRAY((double *) (pc +
|
|
|
|
__GLX_RENDER_HDR_SIZE),
|
|
|
|
info->nelems);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
client->errorValue = 0;
|
|
|
|
return __glXBadRenderRequest;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (proc != NULL)
|
|
|
|
(*proc) (pc + __GLX_RENDER_HDR_SIZE);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* proceed to the next command
|
|
|
|
*/
|
|
|
|
pc += hdr->length;
|
|
|
|
left -= hdr->length;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
return __glXRender(cl, (GLbyte *) req);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
** Execute a large rendering request (one that spans multiple X requests).
|
|
|
|
*/
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapRenderLarge(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
2012-06-10 07:21:05 -06:00
|
|
|
ClientPtr client = cl->client;
|
2006-11-26 11:13:41 -07:00
|
|
|
xGLXRenderLargeReq *req;
|
|
|
|
__GLXrenderLargeHeader *hdr;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
2010-12-05 08:36:02 -07:00
|
|
|
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
req = (xGLXRenderLargeReq *) pc;
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->contextTag);
|
|
|
|
__GLX_SWAP_INT(&req->dataBytes);
|
|
|
|
__GLX_SWAP_SHORT(&req->requestNumber);
|
|
|
|
__GLX_SWAP_SHORT(&req->requestTotal);
|
|
|
|
|
|
|
|
pc += sz_xGLXRenderLargeReq;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
if (req->requestNumber == 1) {
|
2012-06-10 07:21:05 -06:00
|
|
|
void (*proc) (GLbyte *) = NULL;
|
|
|
|
__GLXRenderSwapInfo *info = NULL;
|
|
|
|
CARD16 opcode;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
hdr = (__GLXrenderLargeHeader *) pc;
|
|
|
|
__GLX_SWAP_INT(&hdr->length);
|
|
|
|
__GLX_SWAP_INT(&hdr->opcode);
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
/*
|
2006-11-26 11:13:41 -07:00
|
|
|
* call the command procedure to swap any arguments
|
2012-06-10 07:21:05 -06:00
|
|
|
* Note that we are assuming that all arguments that needs to be
|
|
|
|
* swaped are on the first req only !
|
|
|
|
*/
|
|
|
|
opcode = hdr->opcode;
|
|
|
|
if ((opcode >= __GLX_MIN_RENDER_OPCODE) &&
|
|
|
|
(opcode <= __GLX_MAX_RENDER_OPCODE)) {
|
|
|
|
proc = __glXSwapRenderTable[opcode];
|
2006-11-26 11:13:41 -07:00
|
|
|
#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
|
2012-06-10 07:21:05 -06:00
|
|
|
}
|
|
|
|
else if ((opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
|
|
|
|
(opcode <= __GLX_MAX_RENDER_OPCODE_EXT)) {
|
|
|
|
int index = opcode - __GLX_MIN_RENDER_OPCODE_EXT;
|
|
|
|
|
|
|
|
info = &__glXSwapRenderTable_EXT[index];
|
|
|
|
if (info->swapfunc) {
|
|
|
|
proc = info->swapfunc;
|
|
|
|
}
|
|
|
|
#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
client->errorValue = 0;
|
|
|
|
cl->largeCmdRequestsTotal = 0;
|
|
|
|
return __glXBadLargeRequest;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
** Make enough space in the buffer, then copy the entire request.
|
|
|
|
*/
|
|
|
|
if (cl->largeCmdBufSize < hdr->length) {
|
|
|
|
if (!cl->largeCmdBuf) {
|
|
|
|
cl->largeCmdBuf = (GLbyte *) malloc(hdr->length);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
cl->largeCmdBuf =
|
|
|
|
(GLbyte *) realloc(cl->largeCmdBuf, hdr->length);
|
|
|
|
}
|
|
|
|
if (!cl->largeCmdBuf) {
|
|
|
|
cl->largeCmdRequestsTotal = 0;
|
|
|
|
return BadAlloc;
|
|
|
|
}
|
|
|
|
cl->largeCmdBufSize = hdr->length;
|
|
|
|
}
|
|
|
|
memcpy(cl->largeCmdBuf, pc, req->dataBytes);
|
|
|
|
|
|
|
|
cl->largeCmdBytesSoFar = req->dataBytes;
|
|
|
|
cl->largeCmdBytesTotal = hdr->length;
|
|
|
|
cl->largeCmdRequestsSoFar = 1;
|
|
|
|
cl->largeCmdRequestsTotal = req->requestTotal;
|
|
|
|
cl->largeCmdRequestsSwapProc = proc;
|
|
|
|
cl->largeCmdMaxReqDataSize = req->dataBytes;
|
|
|
|
cl->largeCmdRequestsSwap_info = info;
|
|
|
|
|
|
|
|
return Success;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
}
|
|
|
|
else if (req->requestNumber < cl->largeCmdRequestsTotal) {
|
2012-06-10 07:21:05 -06:00
|
|
|
/*
|
|
|
|
* This is not the first nor last request - just copy the data
|
|
|
|
*/
|
|
|
|
if (cl->largeCmdBytesSoFar + req->dataBytes > cl->largeCmdBytesTotal) {
|
|
|
|
cl->largeCmdRequestsTotal = 0;
|
|
|
|
return __glXBadLargeRequest;
|
|
|
|
}
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
memcpy(cl->largeCmdBuf + cl->largeCmdBytesSoFar, pc, req->dataBytes);
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
cl->largeCmdBytesSoFar += req->dataBytes;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
if (req->dataBytes > cl->largeCmdMaxReqDataSize)
|
|
|
|
cl->largeCmdMaxReqDataSize = req->dataBytes;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
return Success;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
else if (req->requestNumber == cl->largeCmdRequestsTotal) {
|
2012-06-10 07:21:05 -06:00
|
|
|
/*
|
|
|
|
* this is the last request
|
|
|
|
* copy the remainder bytes, call the procedure to swap any
|
|
|
|
* needed data, and then call to transfer the command to all
|
|
|
|
* back-end servers
|
|
|
|
*/
|
|
|
|
if (cl->largeCmdBytesSoFar + req->dataBytes > cl->largeCmdBytesTotal) {
|
|
|
|
cl->largeCmdRequestsTotal = 0;
|
|
|
|
return __glXBadLargeRequest;
|
|
|
|
}
|
|
|
|
|
|
|
|
memcpy(cl->largeCmdBuf + cl->largeCmdBytesSoFar, pc, req->dataBytes);
|
|
|
|
|
|
|
|
cl->largeCmdBytesSoFar += req->dataBytes;
|
|
|
|
|
|
|
|
if (req->dataBytes > cl->largeCmdMaxReqDataSize)
|
|
|
|
cl->largeCmdMaxReqDataSize = req->dataBytes;
|
|
|
|
|
|
|
|
if (cl->largeCmdRequestsSwapProc != NULL) {
|
|
|
|
(*cl->largeCmdRequestsSwapProc) (cl->largeCmdBuf +
|
|
|
|
__GLX_RENDER_LARGE_HDR_SIZE);
|
|
|
|
}
|
|
|
|
else if (cl->largeCmdRequestsSwap_info &&
|
|
|
|
cl->largeCmdRequestsSwap_info->nelems > 0) {
|
|
|
|
if (cl->largeCmdRequestsSwap_info->elem_size == 4) {
|
|
|
|
__GLX_SWAP_INT_ARRAY((int *) (pc + __GLX_RENDER_LARGE_HDR_SIZE),
|
|
|
|
cl->largeCmdRequestsSwap_info->nelems);
|
|
|
|
}
|
|
|
|
else if (cl->largeCmdRequestsSwap_info->elem_size == 2) {
|
|
|
|
__GLX_SWAP_SHORT_ARRAY((short *) (pc +
|
|
|
|
__GLX_RENDER_LARGE_HDR_SIZE),
|
|
|
|
cl->largeCmdRequestsSwap_info->nelems);
|
|
|
|
}
|
|
|
|
else if (cl->largeCmdRequestsSwap_info->elem_size == 8) {
|
|
|
|
__GLX_SWAP_DOUBLE_ARRAY((double *) (pc +
|
|
|
|
__GLX_RENDER_LARGE_HDR_SIZE),
|
|
|
|
cl->largeCmdRequestsSwap_info->nelems);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
cl->largeCmdRequestsTotal = 0;
|
|
|
|
return (__glXSendLargeCommand(cl, req->contextTag));
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
}
|
|
|
|
else {
|
2012-06-10 07:21:05 -06:00
|
|
|
cl->largeCmdRequestsTotal = 0;
|
|
|
|
return __glXBadLargeRequest;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/************************************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
** No support is provided for the vendor-private requests other than
|
|
|
|
** allocating these entry points in the dispatch table.
|
|
|
|
*/
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapVendorPrivate(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xGLXVendorPrivateReq *req;
|
|
|
|
CARD32 vendorCode;
|
|
|
|
|
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
req = (xGLXVendorPrivateReq *) pc;
|
|
|
|
vendorCode = req->vendorCode;
|
|
|
|
__GLX_SWAP_INT(&vendorCode);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
switch (vendorCode) {
|
|
|
|
|
|
|
|
case X_GLvop_DeleteTexturesEXT:
|
|
|
|
return __glXVForwardSingleReqSwap(cl, pc);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case X_GLXvop_SwapIntervalSGI:
|
|
|
|
if (glxIsExtensionSupported("SGI_swap_control")) {
|
|
|
|
return __glXVForwardSingleReqSwap(cl, pc);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
#if 0 /* glx 1.3 */
|
|
|
|
case X_GLXvop_CreateGLXVideoSourceSGIX:
|
|
|
|
break;
|
|
|
|
case X_GLXvop_DestroyGLXVideoSourceSGIX:
|
|
|
|
break;
|
|
|
|
case X_GLXvop_CreateGLXPixmapWithConfigSGIX:
|
|
|
|
break;
|
|
|
|
case X_GLXvop_DestroyGLXPbufferSGIX:
|
|
|
|
break;
|
|
|
|
case X_GLXvop_ChangeDrawableAttributesSGIX:
|
|
|
|
break;
|
2006-11-26 11:13:41 -07:00
|
|
|
#endif
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
case X_GLXvop_JoinSwapGroupSGIX:
|
|
|
|
return __glXSwapJoinSwapGroupSGIX(cl, pc);
|
|
|
|
break;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
case X_GLXvop_BindSwapBarrierSGIX:
|
|
|
|
return __glXSwapBindSwapBarrierSGIX(cl, pc);
|
|
|
|
break;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
case X_GLXvop_CreateContextWithConfigSGIX:
|
|
|
|
return __glXSwapCreateContextWithConfigSGIX(cl, pc);
|
|
|
|
break;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
default:
|
|
|
|
/*
|
|
|
|
** unsupported private request
|
|
|
|
*/
|
|
|
|
cl->client->errorValue = req->vendorCode;
|
|
|
|
return __glXUnsupportedPrivateRequest;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapVendorPrivateWithReply(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xGLXVendorPrivateWithReplyReq *req;
|
|
|
|
CARD32 vendorCode;
|
|
|
|
|
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
req = (xGLXVendorPrivateWithReplyReq *) pc;
|
|
|
|
vendorCode = req->vendorCode;
|
|
|
|
__GLX_SWAP_INT(&vendorCode);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
switch (vendorCode) {
|
|
|
|
|
|
|
|
case X_GLvop_GetConvolutionFilterEXT:
|
|
|
|
case X_GLvop_GetSeparableFilterEXT:
|
|
|
|
case X_GLvop_GetHistogramEXT:
|
|
|
|
case X_GLvop_GetMinmaxEXT:
|
|
|
|
return (__glXNoSuchSingleOpcode(cl, pc));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case X_GLvop_GetConvolutionParameterfvEXT:
|
|
|
|
case X_GLvop_GetConvolutionParameterivEXT:
|
|
|
|
case X_GLvop_GetHistogramParameterivEXT:
|
|
|
|
case X_GLvop_GetMinmaxParameterfvEXT:
|
|
|
|
case X_GLvop_GetMinmaxParameterivEXT:
|
|
|
|
case X_GLvop_GenTexturesEXT:
|
|
|
|
return (__glXVForwardAllWithReplySwapiv(cl, pc));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case X_GLvop_AreTexturesResidentEXT:
|
|
|
|
case X_GLvop_IsTextureEXT:
|
|
|
|
return (__glXVForwardPipe0WithReplySwap(cl, pc));
|
|
|
|
break;
|
|
|
|
|
|
|
|
#if 0 /* glx1.3 */
|
|
|
|
case X_GLvop_GetDetailTexFuncSGIS:
|
|
|
|
case X_GLvop_GetSharpenTexFuncSGIS:
|
|
|
|
case X_GLvop_GetColorTableSGI:
|
|
|
|
case X_GLvop_GetColorTableParameterfvSGI:
|
|
|
|
case X_GLvop_GetColorTableParameterivSGI:
|
|
|
|
case X_GLvop_GetTexFilterFuncSGIS:
|
|
|
|
case X_GLvop_GetInstrumentsSGIX:
|
|
|
|
case X_GLvop_InstrumentsBufferSGIX:
|
|
|
|
case X_GLvop_PollInstrumentsSGIX:
|
|
|
|
case X_GLvop_FlushRasterSGIX:
|
|
|
|
case X_GLXvop_CreateGLXPbufferSGIX:
|
|
|
|
case X_GLXvop_GetDrawableAttributesSGIX:
|
|
|
|
case X_GLXvop_QueryHyperpipeNetworkSGIX:
|
|
|
|
case X_GLXvop_QueryHyperpipeConfigSGIX:
|
|
|
|
case X_GLXvop_HyperpipeConfigSGIX:
|
|
|
|
case X_GLXvop_DestroyHyperpipeConfigSGIX:
|
2006-11-26 11:13:41 -07:00
|
|
|
#endif
|
2012-06-10 07:21:05 -06:00
|
|
|
case X_GLXvop_QueryMaxSwapBarriersSGIX:
|
|
|
|
return (__glXSwapQueryMaxSwapBarriersSGIX(cl, pc));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case X_GLXvop_GetFBConfigsSGIX:
|
|
|
|
return (__glXSwapGetFBConfigsSGIX(cl, pc));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case X_GLXvop_MakeCurrentReadSGI:
|
|
|
|
return (__glXSwapMakeCurrentReadSGI(cl, pc));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case X_GLXvop_QueryContextInfoEXT:
|
|
|
|
return (__glXSwapQueryContextInfoEXT(cl, (char *) pc));
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
/*
|
|
|
|
** unsupported private request
|
|
|
|
*/
|
|
|
|
cl->client->errorValue = req->vendorCode;
|
|
|
|
return __glXUnsupportedPrivateRequest;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapGetFBConfigs(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->screen);
|
|
|
|
|
|
|
|
return __glXGetFBConfigs(cl, pc);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapGetFBConfigsSGIX(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
2012-06-10 07:21:05 -06:00
|
|
|
xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) pc;
|
|
|
|
xGLXGetFBConfigsReq new_req;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
new_req.reqType = req->reqType;
|
|
|
|
new_req.glxCode = req->glxCode;
|
|
|
|
new_req.length = req->length;
|
|
|
|
new_req.screen = req->screen;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
return (__glXSwapGetFBConfigs(cl, (GLbyte *) & new_req));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapCreateWindow(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xGLXCreateWindowReq *req = (xGLXCreateWindowReq *) pc;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->screen);
|
|
|
|
__GLX_SWAP_INT(&req->fbconfig);
|
|
|
|
__GLX_SWAP_INT(&req->window);
|
|
|
|
__GLX_SWAP_INT(&req->glxwindow);
|
|
|
|
__GLX_SWAP_INT(&req->numAttribs);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
return (__glXCreateWindow(cl, (GLbyte *) pc));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapDestroyWindow(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xGLXDestroyWindowReq *req = (xGLXDestroyWindowReq *) pc;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->glxwindow);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
return (__glXDestroyWindow(cl, (GLbyte *) pc));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapQueryContext(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
2012-06-10 07:21:05 -06:00
|
|
|
xGLXQueryContextReq *req = (xGLXQueryContextReq *) pc;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->context);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
return (__glXQueryContext(cl, (GLbyte *) pc));
|
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapCreatePbuffer(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
2012-06-10 07:21:05 -06:00
|
|
|
xGLXCreatePbufferReq *req = (xGLXCreatePbufferReq *) pc;
|
2006-11-26 11:13:41 -07:00
|
|
|
int nattr = req->numAttribs;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
2010-12-05 08:36:02 -07:00
|
|
|
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->screen);
|
|
|
|
__GLX_SWAP_INT(&req->fbconfig);
|
|
|
|
__GLX_SWAP_INT(&req->pbuffer);
|
|
|
|
__GLX_SWAP_INT(&req->numAttribs);
|
2012-06-10 07:21:05 -06:00
|
|
|
__GLX_SWAP_INT_ARRAY((int *) (req + 1), nattr * 2);
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
return (__glXCreatePbuffer(cl, pc));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapDestroyPbuffer(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->pbuffer);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
return (__glXDestroyPbuffer(cl, (GLbyte *) pc));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapGetDrawableAttributes(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
2012-06-10 07:21:05 -06:00
|
|
|
xGLXGetDrawableAttributesReq *req = (xGLXGetDrawableAttributesReq *) pc;
|
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->drawable);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
return (__glXGetDrawableAttributes(cl, pc));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
__glXSwapChangeDrawableAttributes(__GLXclientState * cl, GLbyte * pc)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
2012-06-10 07:21:05 -06:00
|
|
|
xGLXChangeDrawableAttributesReq *req =
|
|
|
|
(xGLXChangeDrawableAttributesReq *) pc;
|
2006-11-26 11:13:41 -07:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
2010-12-05 08:36:02 -07:00
|
|
|
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->drawable);
|
|
|
|
__GLX_SWAP_INT(&req->numAttribs);
|
2012-06-10 07:21:05 -06:00
|
|
|
__GLX_SWAP_INT_ARRAY((int *) (req + 1), req->numAttribs * 2);
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
return (__glXChangeDrawableAttributes(cl, pc));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|