Example #1
0
void __indirect_glMapGrid1d(GLint un, GLdouble u1, GLdouble u2)
{
	__GLX_DECLARE_VARIABLES();
	__GLX_LOAD_VARIABLES();
	__GLX_BEGIN(X_GLrop_MapGrid1d,24);
	__GLX_PUT_DOUBLE(4,u1);
	__GLX_PUT_DOUBLE(12,u2);
	__GLX_PUT_LONG(20,un);
	__GLX_END(24);
}
Example #2
0
void __indirect_glRectdv(const GLdouble *v1, const GLdouble *v2)
{
	__GLX_DECLARE_VARIABLES();
	__GLX_LOAD_VARIABLES();
	__GLX_BEGIN(X_GLrop_Rectdv,36);
	__GLX_PUT_DOUBLE(4,v1[0]);
	__GLX_PUT_DOUBLE(12,v1[1]);
	__GLX_PUT_DOUBLE(20,v2[0]);
	__GLX_PUT_DOUBLE(28,v2[1]);
	__GLX_END(36);
}
Example #3
0
void __indirect_glMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2)
{
	__GLX_DECLARE_VARIABLES();
	__GLX_LOAD_VARIABLES();
	__GLX_BEGIN(X_GLrop_MapGrid2d,44);
	__GLX_PUT_DOUBLE(4,u1);
	__GLX_PUT_DOUBLE(12,u2);
	__GLX_PUT_DOUBLE(20,v1);
	__GLX_PUT_DOUBLE(28,v2);
	__GLX_PUT_LONG(36,un);
	__GLX_PUT_LONG(40,vn);
	__GLX_END(44);
}
Example #4
0
int __glXDisp_GetMapdv(__GLXclientState *cl, GLbyte *pc)
{
	GLenum target;
	GLenum query;
	GLint compsize;
	__GLXcontext *cx;
	ClientPtr client = cl->client;
	int error;
	GLdouble answerBuffer[200];
	char *answer;

	cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
	if (!cx) {
		return error;
	}
	pc += __GLX_SINGLE_HDR_SIZE;
	target = *(GLenum *)(pc + 0);
	query = *(GLenum *)(pc + 4);
	compsize = __glGetMapdv_size(target,query);
	if (compsize < 0) compsize = 0;

	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*8,8);
	__glXClearErrorOccured();
	glGetMapdv( 
		*(GLenum   *)(pc + 0),
		*(GLenum   *)(pc + 4),
		(GLdouble *) answer
	);
	if (__glXErrorOccured()) {
	    __GLX_BEGIN_REPLY(0);
	    __GLX_PUT_SIZE(0);
	    __GLX_SEND_HEADER();
	} else if (compsize == 1) {
	    __GLX_BEGIN_REPLY(0);
	    __GLX_PUT_SIZE(1);
	    __GLX_PUT_DOUBLE();
	    __GLX_SEND_HEADER();
	} else {
	    __GLX_BEGIN_REPLY(compsize*8);
	    __GLX_PUT_SIZE(compsize);
	    __GLX_SEND_HEADER();
	    __GLX_SEND_DOUBLE_ARRAY(compsize);
	}
	return Success;
}
Example #5
0
void
__indirect_glMap1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride,
                   GLint order, const GLdouble * pnts)
{
   __GLX_DECLARE_VARIABLES();
   GLint k;

   __GLX_LOAD_VARIABLES();
   k = __glMap1d_size(target);
   if (k == 0) {
      __glXSetError(gc, GL_INVALID_ENUM);
      return;
   }
   else if (stride < k || order <= 0) {
      __glXSetError(gc, GL_INVALID_VALUE);
      return;
   }
   compsize = k * order * __GLX_SIZE_FLOAT64;
   cmdlen = 28 + compsize;
   if (!gc->currentDpy)
      return;

   if (cmdlen <= gc->maxSmallRenderCommandSize) {
      /* Use GLXRender protocol to send small command */
      __GLX_BEGIN_VARIABLE(X_GLrop_Map1d, cmdlen);
      __GLX_PUT_DOUBLE(4, u1);
      __GLX_PUT_DOUBLE(12, u2);
      __GLX_PUT_LONG(20, target);
      __GLX_PUT_LONG(24, order);
      /*
       ** NOTE: the doubles that follow are not aligned because of 3
       ** longs preceeding
       */
      __glFillMap1d(k, order, stride, pnts, (pc + 28));
      __GLX_END(cmdlen);
   }
   else {
      /* Use GLXRenderLarge protocol to send command */
      __GLX_BEGIN_VARIABLE_LARGE(X_GLrop_Map1d, cmdlen + 4);
      __GLX_PUT_DOUBLE(8, u1);
      __GLX_PUT_DOUBLE(16, u2);
      __GLX_PUT_LONG(24, target);
      __GLX_PUT_LONG(28, order);

      /*
       ** NOTE: the doubles that follow are not aligned because of 3
       ** longs preceeding
       */
      if (stride != k) {
         GLubyte *buf;

         buf = (GLubyte *) Xmalloc(compsize);
         if (!buf) {
            __glXSetError(gc, GL_OUT_OF_MEMORY);
            return;
         }
         __glFillMap1d(k, order, stride, pnts, buf);
         __glXSendLargeCommand(gc, pc, 32, buf, compsize);
         Xfree((char *) buf);
      }
      else {
         /* Data is already packed.  Just send it out */
         __glXSendLargeCommand(gc, pc, 32, pnts, compsize);
      }
   }
}
Example #6
0
void
__indirect_glMap2d(GLenum target, GLdouble u1, GLdouble u2, GLint ustr,
                   GLint uord, GLdouble v1, GLdouble v2, GLint vstr,
                   GLint vord, const GLdouble * pnts)
{
   __GLX_DECLARE_VARIABLES();
   GLint k;

   __GLX_LOAD_VARIABLES();
   k = __glMap2d_size(target);
   if (k == 0) {
      __glXSetError(gc, GL_INVALID_ENUM);
      return;
   }
   else if (vstr < k || ustr < k || vord <= 0 || uord <= 0) {
      __glXSetError(gc, GL_INVALID_VALUE);
      return;
   }
   compsize = k * uord * vord * __GLX_SIZE_FLOAT64;
   cmdlen = 48 + compsize;
   if (!gc->currentDpy)
      return;

   if (cmdlen <= gc->maxSmallRenderCommandSize) {
      /* Use GLXRender protocol to send small command */
      __GLX_BEGIN_VARIABLE(X_GLrop_Map2d, cmdlen);
      __GLX_PUT_DOUBLE(4, u1);
      __GLX_PUT_DOUBLE(12, u2);
      __GLX_PUT_DOUBLE(20, v1);
      __GLX_PUT_DOUBLE(28, v2);
      __GLX_PUT_LONG(36, target);
      __GLX_PUT_LONG(40, uord);
      __GLX_PUT_LONG(44, vord);
      /*
       ** Pack into a u-major ordering.
       ** NOTE: the doubles that follow are not aligned because of 5
       ** longs preceeding
       */
      __glFillMap2d(k, uord, vord, ustr, vstr, pnts, (GLdouble *) (pc + 48));
      __GLX_END(cmdlen);
   }
   else {
      /* Use GLXRenderLarge protocol to send command */
      __GLX_BEGIN_VARIABLE_LARGE(X_GLrop_Map2d, cmdlen + 4);
      __GLX_PUT_DOUBLE(8, u1);
      __GLX_PUT_DOUBLE(16, u2);
      __GLX_PUT_DOUBLE(24, v1);
      __GLX_PUT_DOUBLE(32, v2);
      __GLX_PUT_LONG(40, target);
      __GLX_PUT_LONG(44, uord);
      __GLX_PUT_LONG(48, vord);

      /*
       ** NOTE: the doubles that follow are not aligned because of 5
       ** longs preceeding
       */
      if ((vstr != k) || (ustr != k * vord)) {
         GLdouble *buf;

         buf = (GLdouble *) Xmalloc(compsize);
         if (!buf) {
            __glXSetError(gc, GL_OUT_OF_MEMORY);
            return;
         }
         /*
          ** Pack into a u-major ordering.
          */
         __glFillMap2d(k, uord, vord, ustr, vstr, pnts, buf);
         __glXSendLargeCommand(gc, pc, 52, buf, compsize);
         Xfree((char *) buf);
      }
      else {
         /* Data is already packed.  Just send it out */
         __glXSendLargeCommand(gc, pc, 52, pnts, compsize);
      }
   }
}