Exemple #1
0
void
__indirect_glGetDoublev(GLenum val, GLdouble * d)
{
   const GLenum origVal = val;
   __GLX_SINGLE_DECLARE_VARIABLES();
   xGLXSingleReply reply;

   val = RemapTransposeEnum(val);

   __GLX_SINGLE_LOAD_VARIABLES();
   __GLX_SINGLE_BEGIN(X_GLsop_GetDoublev, 4);
   __GLX_SINGLE_PUT_LONG(0, val);
   __GLX_SINGLE_READ_XREPLY();
   __GLX_SINGLE_GET_SIZE(compsize);

   if (compsize == 0) {
      /*
       ** Error occured; don't modify user's buffer.
       */
   }
   else {
      GLintptr data;

      /*
       ** We still needed to send the request to the server in order to
       ** find out whether it was legal to make a query (it's illegal,
       ** for example, to call a query between glBegin() and glEnd()).
       */

      if (get_client_data(gc, val, &data)) {
         *d = (GLdouble) data;
      }
      else {
         /*
          ** Not a local value, so use what we got from the server.
          */
         if (compsize == 1) {
            __GLX_SINGLE_GET_DOUBLE(d);
         }
         else {
            __GLX_SINGLE_GET_DOUBLE_ARRAY(d, compsize);
            if (val != origVal) {
               /* matrix transpose */
               TransposeMatrixd(d);
            }
         }
      }
   }
   __GLX_SINGLE_END();
}
void glGetMapdv(GLenum target, GLenum query, GLdouble *v)
{
	__GLX_SINGLE_DECLARE_VARIABLES();
	xGLXSingleReply reply;
	__GLX_SINGLE_LOAD_VARIABLES();
	__GLX_SINGLE_BEGIN(X_GLsop_GetMapdv,8);
	__GLX_SINGLE_PUT_LONG(0,target);
	__GLX_SINGLE_PUT_LONG(4,query);
	__GLX_SINGLE_READ_XREPLY();
	__GLX_SINGLE_GET_SIZE(compsize);
	if (compsize == 1) {
	    __GLX_SINGLE_GET_DOUBLE(v);
	} else {
	    __GLX_SINGLE_GET_DOUBLE_ARRAY(v,compsize);
	}
	__GLX_SINGLE_END();
}
void glGetTexGendv(GLenum coord, GLenum pname, GLdouble *params)
{
	__GLX_SINGLE_DECLARE_VARIABLES();
	xGLXSingleReply reply;
	__GLX_SINGLE_LOAD_VARIABLES();
	__GLX_SINGLE_BEGIN(X_GLsop_GetTexGendv,8);
	__GLX_SINGLE_PUT_LONG(0,coord);
	__GLX_SINGLE_PUT_LONG(4,pname);
	__GLX_SINGLE_READ_XREPLY();
	__GLX_SINGLE_GET_SIZE(compsize);
	if (compsize == 1) {
	    __GLX_SINGLE_GET_DOUBLE(params);
	} else {
	    __GLX_SINGLE_GET_DOUBLE_ARRAY(params,compsize);
	}
	__GLX_SINGLE_END();
}
Exemple #4
0
void glGetDoublev(GLenum val, GLdouble *d)
{
    const GLenum origVal = val;
    __GLX_SINGLE_DECLARE_VARIABLES();
    __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
    xGLXSingleReply reply;

    if (val == GL_TRANSPOSE_MODELVIEW_MATRIX_ARB) {
       val = GL_MODELVIEW_MATRIX;
    }
    else if (val == GL_TRANSPOSE_PROJECTION_MATRIX_ARB) {
       val = GL_PROJECTION_MATRIX;
    }
    else if (val == GL_TRANSPOSE_TEXTURE_MATRIX_ARB) {
       val = GL_TEXTURE_MATRIX;
    }
    else if (val == GL_TRANSPOSE_COLOR_MATRIX_ARB) {
       val = GL_COLOR_MATRIX;
    }

    __GLX_SINGLE_LOAD_VARIABLES();
    __GLX_SINGLE_BEGIN(X_GLsop_GetDoublev,4);
    __GLX_SINGLE_PUT_LONG(0,val);
    __GLX_SINGLE_READ_XREPLY();
    __GLX_SINGLE_GET_SIZE(compsize);

    if (compsize == 0) {
	/*
	** Error occured; don't modify user's buffer.
	*/
    } else {
	/*
	** For all the queries listed here, we use the locally stored
	** values rather than the one returned by the server.  Note that
	** we still needed to send the request to the server in order to
	** find out whether it was legal to make a query (it's illegal,
	** for example, to call a query between glBegin() and glEnd()).
	*/
	switch (val) {
	  case GL_PACK_ROW_LENGTH:
	    *d = (GLdouble)state->storePack.rowLength;
	    break;
	  case GL_PACK_IMAGE_HEIGHT:
	    *d = (GLdouble)state->storePack.imageHeight;
	    break;
	  case GL_PACK_SKIP_ROWS:
	    *d = (GLdouble)state->storePack.skipRows;
	    break;
	  case GL_PACK_SKIP_PIXELS:
	    *d = (GLdouble)state->storePack.skipPixels;
	    break;
	  case GL_PACK_SKIP_IMAGES:
	    *d = (GLdouble)state->storePack.skipImages;
	    break;
	  case GL_PACK_ALIGNMENT:
	    *d = (GLdouble)state->storePack.alignment;
	    break;
	  case GL_PACK_SWAP_BYTES:
	    *d = (GLdouble)state->storePack.swapEndian;
	    break;
	  case GL_PACK_LSB_FIRST:
	    *d = (GLdouble)state->storePack.lsbFirst;
	    break;
	  case GL_UNPACK_ROW_LENGTH:
	    *d = (GLdouble)state->storeUnpack.rowLength;
	    break;
	  case GL_UNPACK_IMAGE_HEIGHT:
	    *d = (GLdouble)state->storeUnpack.imageHeight;
	    break;
	  case GL_UNPACK_SKIP_ROWS:
	    *d = (GLdouble)state->storeUnpack.skipRows;
	    break;
	  case GL_UNPACK_SKIP_PIXELS:
	    *d = (GLdouble)state->storeUnpack.skipPixels;
	    break;
	  case GL_UNPACK_SKIP_IMAGES:
	    *d = (GLdouble)state->storeUnpack.skipImages;
	    break;
	  case GL_UNPACK_ALIGNMENT:
	    *d = (GLdouble)state->storeUnpack.alignment;
	    break;
	  case GL_UNPACK_SWAP_BYTES:
	    *d = (GLdouble)state->storeUnpack.swapEndian;
	    break;
	  case GL_UNPACK_LSB_FIRST:
	    *d = (GLdouble)state->storeUnpack.lsbFirst;
	    break;
	  case GL_VERTEX_ARRAY:
	    *d = (GLdouble)state->vertArray.vertex.enable;
	    break;
	  case GL_VERTEX_ARRAY_SIZE:
	    *d = (GLdouble)state->vertArray.vertex.size;
	    break;
	  case GL_VERTEX_ARRAY_TYPE:
	    *d = (GLdouble)state->vertArray.vertex.type;
	    break;
	  case GL_VERTEX_ARRAY_STRIDE:
	    *d = (GLdouble)state->vertArray.vertex.stride;
	    break;
	  case GL_NORMAL_ARRAY:
	    *d = (GLdouble)state->vertArray.normal.enable;
	    break;
	  case GL_NORMAL_ARRAY_TYPE:
	    *d = (GLdouble)state->vertArray.normal.type;
	    break;
	  case GL_NORMAL_ARRAY_STRIDE:
	    *d = (GLdouble)state->vertArray.normal.stride;
	    break;
	  case GL_COLOR_ARRAY:
	    *d = (GLdouble)state->vertArray.color.enable;
	    break;
	  case GL_COLOR_ARRAY_SIZE:
	    *d = (GLdouble)state->vertArray.color.size;
	    break;
	  case GL_COLOR_ARRAY_TYPE:
	    *d = (GLdouble)state->vertArray.color.type;
	    break;
	  case GL_COLOR_ARRAY_STRIDE:
	    *d = (GLdouble)state->vertArray.color.stride;
	    break;
	  case GL_INDEX_ARRAY:
	    *d = (GLdouble)state->vertArray.index.enable;
	    break;
	  case GL_INDEX_ARRAY_TYPE:
	    *d = (GLdouble)state->vertArray.index.type;
	    break;
	  case GL_INDEX_ARRAY_STRIDE:
	    *d = (GLdouble)state->vertArray.index.stride;
	    break;
	  case GL_TEXTURE_COORD_ARRAY:
	    *d = (GLdouble)state->vertArray.texCoord[state->vertArray.activeTexture].enable;
	    break;
	  case GL_TEXTURE_COORD_ARRAY_SIZE:
	    *d = (GLdouble)state->vertArray.texCoord[state->vertArray.activeTexture].size;
	    break;
	  case GL_TEXTURE_COORD_ARRAY_TYPE:
	    *d = (GLdouble)state->vertArray.texCoord[state->vertArray.activeTexture].type;
	    break;
	  case GL_TEXTURE_COORD_ARRAY_STRIDE:
	    *d = (GLdouble)state->vertArray.texCoord[state->vertArray.activeTexture].stride;
	    break;
	  case GL_EDGE_FLAG_ARRAY:
	    *d = (GLdouble)state->vertArray.edgeFlag.enable;
	    break;
	  case GL_EDGE_FLAG_ARRAY_STRIDE:
	    *d = (GLdouble)state->vertArray.edgeFlag.stride;
	    break;

	  CASE_ARRAY_ALL(SECONDARY_COLOR, secondaryColor, d, GLdouble);

	  CASE_ARRAY_ENABLE(FOG_COORDINATE, fogCoord, d, GLdouble);
	  CASE_ARRAY_TYPE(FOG_COORDINATE, fogCoord, d, GLdouble);
	  CASE_ARRAY_STRIDE(FOG_COORDINATE, fogCoord, d, GLdouble);

	  case GL_MAX_ELEMENTS_VERTICES:
	    *d = (GLdouble)state->vertArray.maxElementsVertices;
	    break;
	  case GL_MAX_ELEMENTS_INDICES:
	    *d = (GLdouble)state->vertArray.maxElementsIndices;
	    break;
	  case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH:
	    *d = (GLdouble)__GL_CLIENT_ATTRIB_STACK_DEPTH;
	    break;
	  case GL_CLIENT_ACTIVE_TEXTURE_ARB:
	    *d = (GLdouble)(state->vertArray.activeTexture + GL_TEXTURE0_ARB);
	    break;
	  default:
	    /*
	     ** Not a local value, so use what we got from the server.
	     */
	    if (compsize == 1) {
		__GLX_SINGLE_GET_DOUBLE(d);
	    } else {
		__GLX_SINGLE_GET_DOUBLE_ARRAY(d,compsize);
                if (val != origVal) {
                   /* matrix transpose */
                   TransposeMatrixd(d);
                }
	    }
	}
    }
    __GLX_SINGLE_END();
}