void __glXDispSwap_Rectfv(GLbyte *pc) { __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; __GLX_SWAP_FLOAT_ARRAY(pc + 0, 2); __GLX_SWAP_FLOAT_ARRAY(pc + 8, 2); }
void __glXDispSwap_Map1f(GLbyte * pc) { GLint order, k; GLfloat u1, u2, *points; GLenum target; GLint compsize; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; __GLX_SWAP_INT(pc + 0); __GLX_SWAP_INT(pc + 12); __GLX_SWAP_FLOAT(pc + 4); __GLX_SWAP_FLOAT(pc + 8); target = *(GLenum *) (pc + 0); order = *(GLint *) (pc + 12); u1 = *(GLfloat *) (pc + 4); u2 = *(GLfloat *) (pc + 8); points = (GLfloat *) (pc + 16); k = __glMap1f_size(target); if (order <= 0 || k < 0) { /* Erroneous command. */ compsize = 0; } else { compsize = order * k; } __GLX_SWAP_FLOAT_ARRAY(points, compsize); glMap1f(target, u1, u2, k, order, points); }
void __glXDispSwap_CallLists(GLbyte *pc) { GLenum type; GLsizei n; __GLX_DECLARE_SWAP_VARIABLES; __GLX_SWAP_INT(pc + 4); __GLX_SWAP_INT(pc + 0); type = *(GLenum *)(pc + 4); n = *(GLsizei *)(pc + 0); switch (type) { case GL_BYTE: case GL_UNSIGNED_BYTE: case GL_2_BYTES: case GL_3_BYTES: case GL_4_BYTES: break; case GL_SHORT: case GL_UNSIGNED_SHORT: __GLX_SWAP_SHORT_ARRAY(pc+8, n); break; case GL_INT: case GL_UNSIGNED_INT: __GLX_SWAP_INT_ARRAY(pc+8, n); break; case GL_FLOAT: __GLX_SWAP_FLOAT_ARRAY(pc+8, n); break; } }
void __glXDispSwap_Color3fv(GLbyte *pc) { __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; __GLX_SWAP_FLOAT_ARRAY(pc + 0, 3); }
void __glXDispSwap_Vertex4fv(GLbyte *pc) { __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; __GLX_SWAP_FLOAT_ARRAY(pc + 0, 4); }
void __glXDispSwap_TexCoord1fv(GLbyte *pc) { __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; __GLX_SWAP_FLOAT_ARRAY(pc + 0, 1); }
void __glXDispSwap_MultMatrixf(GLbyte *pc) { __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; __GLX_SWAP_FLOAT_ARRAY(pc + 0, 16); }
void __glXDispSwap_EvalCoord2fv(GLbyte *pc) { __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; __GLX_SWAP_FLOAT_ARRAY(pc + 0, 2); }
void __glXDispSwap_MultiTexCoord4fvARB(GLbyte *pc) { __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; __GLX_SWAP_INT(pc + 0); __GLX_SWAP_FLOAT_ARRAY(pc + 4, 4); }
void __glXDispSwap_PrioritizeTextures(GLbyte *pc) { GLsizei n; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; __GLX_SWAP_INT(pc + 0); n = *(GLsizei *)(pc + 0); __GLX_SWAP_INT_ARRAY(pc + 4, n); __GLX_SWAP_FLOAT_ARRAY(pc + 4+n*4, n); }
void __glXDispSwap_PixelMapfv(GLbyte *pc) { GLint mapsize; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; __GLX_SWAP_INT(pc + 4); mapsize = *(GLint *)(pc + 4); __GLX_SWAP_INT(pc + 0); __GLX_SWAP_FLOAT_ARRAY(pc + 8, mapsize); }
void __glXDispSwap_LightModelfv(GLbyte *pc) { GLenum pname; GLint compsize; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; __GLX_SWAP_INT(pc + 0); pname = *(GLenum *)(pc + 0); compsize = __glLightModelfv_size(pname); if (compsize < 0) compsize = 0; __GLX_SWAP_FLOAT_ARRAY(pc + 4, compsize); }
void __glXDispSwap_ConvolutionParameterfv(GLbyte *pc) { GLenum pname; GLint compsize; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; __GLX_SWAP_INT(pc + 4); pname = *(GLenum *)(pc + 4); compsize = __glConvolutionParameterfv_size(pname); if (compsize < 0) compsize = 0; __GLX_SWAP_INT(pc + 0); __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize); }
void __glXDispSwap_Map2f(GLbyte * pc) { GLint uorder, vorder, ustride, vstride, k; GLfloat u1, u2, v1, v2, *points; GLenum target; GLint compsize; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; __GLX_SWAP_INT(pc + 0); __GLX_SWAP_INT(pc + 12); __GLX_SWAP_INT(pc + 24); __GLX_SWAP_FLOAT(pc + 4); __GLX_SWAP_FLOAT(pc + 8); __GLX_SWAP_FLOAT(pc + 16); __GLX_SWAP_FLOAT(pc + 20); target = *(GLenum *) (pc + 0); uorder = *(GLint *) (pc + 12); vorder = *(GLint *) (pc + 24); u1 = *(GLfloat *) (pc + 4); u2 = *(GLfloat *) (pc + 8); v1 = *(GLfloat *) (pc + 16); v2 = *(GLfloat *) (pc + 20); points = (GLfloat *) (pc + 28); k = __glMap2f_size(target); ustride = vorder * k; vstride = k; if (vorder <= 0 || uorder <= 0 || k < 0) { /* Erroneous command. */ compsize = 0; } else { compsize = uorder * vorder * k; } __GLX_SWAP_FLOAT_ARRAY(points, compsize); CALL_Map2f(GET_DISPATCH(), (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points)); }
int __glXDispSwap_RenderMode(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; __GLXcontext *cx; xGLXRenderModeReply reply; GLint nitems = 0, retBytes = 0, retval, newModeCheck; GLubyte *retBuffer = NULL; GLenum newMode; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; int error; REQUEST_FIXED_SIZE(xGLXSingleReq, 4); __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; } pc += __GLX_SINGLE_HDR_SIZE; __GLX_SWAP_INT(pc); newMode = *(GLenum *) pc; retval = glRenderMode(newMode); /* Check that render mode worked */ glGetIntegerv(GL_RENDER_MODE, &newModeCheck); if (newModeCheck != newMode) { /* Render mode change failed. Bail */ newMode = newModeCheck; goto noChangeAllowed; } /* ** Render mode might have still failed if we get here. But in this ** case we can't really tell, nor does it matter. If it did fail, it ** will return 0, and thus we won't send any data across the wire. */ switch (cx->renderMode) { case GL_RENDER: cx->renderMode = newMode; break; case GL_FEEDBACK: if (retval < 0) { /* Overflow happened. Copy the entire buffer */ nitems = cx->feedbackBufSize; } else { nitems = retval; } retBytes = nitems * __GLX_SIZE_FLOAT32; retBuffer = (GLubyte *) cx->feedbackBuf; __GLX_SWAP_FLOAT_ARRAY((GLbyte *) retBuffer, nitems); cx->renderMode = newMode; break; case GL_SELECT: if (retval < 0) { /* Overflow happened. Copy the entire buffer */ nitems = cx->selectBufSize; } else { GLuint *bp = cx->selectBuf; GLint i; /* ** Figure out how many bytes of data need to be sent. Parse ** the selection buffer to determine this fact as the ** return value is the number of hits, not the number of ** items in the buffer. */ nitems = 0; i = retval; while (--i >= 0) { GLuint n; /* Parse select data for this hit */ n = *bp; bp += 3 + n; } nitems = bp - cx->selectBuf; } retBytes = nitems * __GLX_SIZE_CARD32; retBuffer = (GLubyte *) cx->selectBuf; __GLX_SWAP_INT_ARRAY((GLbyte *) retBuffer, nitems); cx->renderMode = newMode; break; } /* ** First reply is the number of elements returned in the feedback or ** selection array, as per the API for glRenderMode itself. */ noChangeAllowed:; reply = (xGLXRenderModeReply) { .type = X_Reply, .sequenceNumber = client->sequence, .length = nitems, .retval = retval, .size = nitems, .newMode = newMode }; __GLX_SWAP_SHORT(&reply.sequenceNumber); __GLX_SWAP_INT(&reply.length); __GLX_SWAP_INT(&reply.retval); __GLX_SWAP_INT(&reply.size); __GLX_SWAP_INT(&reply.newMode); WriteToClient(client, sz_xGLXRenderModeReply, &reply); if (retBytes) { WriteToClient(client, retBytes, retBuffer); } return Success; } int __glXDispSwap_Flush(__GLXclientState * cl, GLbyte * pc) { ClientPtr client = cl->client; __GLXcontext *cx; int error; __GLX_DECLARE_SWAP_VARIABLES; REQUEST_SIZE_MATCH(xGLXSingleReq); __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; } glFlush(); return Success; }