Exemplo n.º 1
0
void
__indirect_glGetFloatv(GLenum val, GLfloat * f)
{
   const GLenum origVal = val;
   __GLX_SINGLE_DECLARE_VARIABLES();
   xGLXSingleReply reply;

   val = RemapTransposeEnum(val);

   __GLX_SINGLE_LOAD_VARIABLES();
   __GLX_SINGLE_BEGIN(X_GLsop_GetFloatv, 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)) {
         *f = (GLfloat) data;
      }
      else {
         /*
          ** Not a local value, so use what we got from the server.
          */
         if (compsize == 1) {
            __GLX_SINGLE_GET_FLOAT(f);
         }
         else {
            __GLX_SINGLE_GET_FLOAT_ARRAY(f, compsize);
            if (val != origVal) {
               /* matrix transpose */
               TransposeMatrixf(f);
            }
         }
      }
   }
   __GLX_SINGLE_END();
}
Exemplo n.º 2
0
void glGetPixelMapfv(GLenum map, GLfloat *values)
{
	__GLX_SINGLE_DECLARE_VARIABLES();
	xGLXSingleReply reply;
	__GLX_SINGLE_LOAD_VARIABLES();
	__GLX_SINGLE_BEGIN(X_GLsop_GetPixelMapfv,4);
	__GLX_SINGLE_PUT_LONG(0,map);
	__GLX_SINGLE_READ_XREPLY();
	__GLX_SINGLE_GET_SIZE(compsize);
	if (compsize == 1) {
	    __GLX_SINGLE_GET_FLOAT(values);
	} else {
	    __GLX_SINGLE_GET_FLOAT_ARRAY(values,compsize);
	}
	__GLX_SINGLE_END();
}
Exemplo n.º 3
0
void glGetLightfv(GLenum light, GLenum pname, GLfloat *params)
{
	__GLX_SINGLE_DECLARE_VARIABLES();
	xGLXSingleReply reply;
	__GLX_SINGLE_LOAD_VARIABLES();
	__GLX_SINGLE_BEGIN(X_GLsop_GetLightfv,8);
	__GLX_SINGLE_PUT_LONG(0,light);
	__GLX_SINGLE_PUT_LONG(4,pname);
	__GLX_SINGLE_READ_XREPLY();
	__GLX_SINGLE_GET_SIZE(compsize);
	if (compsize == 1) {
	    __GLX_SINGLE_GET_FLOAT(params);
	} else {
	    __GLX_SINGLE_GET_FLOAT_ARRAY(params,compsize);
	}
	__GLX_SINGLE_END();
}
Exemplo n.º 4
0
void glGetMapfv(GLenum target, GLenum query, GLfloat *v)
{
	__GLX_SINGLE_DECLARE_VARIABLES();
	xGLXSingleReply reply;
	__GLX_SINGLE_LOAD_VARIABLES();
	__GLX_SINGLE_BEGIN(X_GLsop_GetMapfv,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_FLOAT(v);
	} else {
	    __GLX_SINGLE_GET_FLOAT_ARRAY(v,compsize);
	}
	__GLX_SINGLE_END();
}
Exemplo n.º 5
0
void glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat *params)
{
	__GLX_SINGLE_DECLARE_VARIABLES();
	xGLXSingleReply reply;
	__GLX_SINGLE_LOAD_VARIABLES();
	__GLX_SINGLE_BEGIN(X_GLsop_GetTexLevelParameterfv,12);
	__GLX_SINGLE_PUT_LONG(0,target);
	__GLX_SINGLE_PUT_LONG(4,level);
	__GLX_SINGLE_PUT_LONG(8,pname);
	__GLX_SINGLE_READ_XREPLY();
	__GLX_SINGLE_GET_SIZE(compsize);
	if (compsize == 1) {
	    __GLX_SINGLE_GET_FLOAT(params);
	} else {
	    __GLX_SINGLE_GET_FLOAT_ARRAY(params,compsize);
	}
	__GLX_SINGLE_END();
}
Exemplo n.º 6
0
Arquivo: single2.c Projeto: aosm/X11
void glGetFloatv(GLenum val, GLfloat *f)
{
    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_GetFloatv,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:
	    *f = (GLfloat)state->storePack.rowLength;
	    break;
	  case GL_PACK_IMAGE_HEIGHT:
	    *f = (GLfloat)state->storePack.imageHeight;
	    break;
	  case GL_PACK_SKIP_ROWS:
	    *f = (GLfloat)state->storePack.skipRows;
	    break;
	  case GL_PACK_SKIP_PIXELS:
	    *f = (GLfloat)state->storePack.skipPixels;
	    break;
	  case GL_PACK_SKIP_IMAGES:
	    *f = (GLfloat)state->storePack.skipImages;
	    break;
	  case GL_PACK_ALIGNMENT:
	    *f = (GLfloat)state->storePack.alignment;
	    break;
	  case GL_PACK_SWAP_BYTES:
	    *f = (GLfloat)state->storePack.swapEndian;
	    break;
	  case GL_PACK_LSB_FIRST:
	    *f = (GLfloat)state->storePack.lsbFirst;
	    break;
	  case GL_UNPACK_ROW_LENGTH:
	    *f = (GLfloat)state->storeUnpack.rowLength;
	    break;
	  case GL_UNPACK_IMAGE_HEIGHT:
	    *f = (GLfloat)state->storeUnpack.imageHeight;
	    break;
	  case GL_UNPACK_SKIP_ROWS:
	    *f = (GLfloat)state->storeUnpack.skipRows;
	    break;
	  case GL_UNPACK_SKIP_PIXELS:
	    *f = (GLfloat)state->storeUnpack.skipPixels;
	    break;
	  case GL_UNPACK_SKIP_IMAGES:
	    *f = (GLfloat)state->storeUnpack.skipImages;
	    break;
	  case GL_UNPACK_ALIGNMENT:
	    *f = (GLfloat)state->storeUnpack.alignment;
	    break;
	  case GL_UNPACK_SWAP_BYTES:
	    *f = (GLfloat)state->storeUnpack.swapEndian;
	    break;
	  case GL_UNPACK_LSB_FIRST:
	    *f = (GLfloat)state->storeUnpack.lsbFirst;
	    break;
	  case GL_VERTEX_ARRAY:
	    *f = (GLfloat)state->vertArray.vertex.enable;
	    break;
	  case GL_VERTEX_ARRAY_SIZE:
	    *f = (GLfloat)state->vertArray.vertex.size;
	    break;
	  case GL_VERTEX_ARRAY_TYPE:
	    *f = (GLfloat)state->vertArray.vertex.type;
	    break;
	  case GL_VERTEX_ARRAY_STRIDE:
	    *f = (GLfloat)state->vertArray.vertex.stride;
	    break;
	  case GL_NORMAL_ARRAY:
	    *f = (GLfloat)state->vertArray.normal.enable;
	    break;
	  case GL_NORMAL_ARRAY_TYPE:
	    *f = (GLfloat)state->vertArray.normal.type;
	    break;
	  case GL_NORMAL_ARRAY_STRIDE:
	    *f = (GLfloat)state->vertArray.normal.stride;
	    break;
	  case GL_COLOR_ARRAY:
	    *f = (GLfloat)state->vertArray.color.enable;
	    break;
	  case GL_COLOR_ARRAY_SIZE:
	    *f = (GLfloat)state->vertArray.color.size;
	    break;
	  case GL_COLOR_ARRAY_TYPE:
	    *f = (GLfloat)state->vertArray.color.type;
	    break;
	  case GL_COLOR_ARRAY_STRIDE:
	    *f = (GLfloat)state->vertArray.color.stride;
	    break;
	  case GL_INDEX_ARRAY:
	    *f = (GLfloat)state->vertArray.index.enable;
	    break;
	  case GL_INDEX_ARRAY_TYPE:
	    *f = (GLfloat)state->vertArray.index.type;
	    break;
	  case GL_INDEX_ARRAY_STRIDE:
	    *f = (GLfloat)state->vertArray.index.stride;
	    break;
	  case GL_TEXTURE_COORD_ARRAY:
	    *f = (GLfloat)state->vertArray.texCoord[state->vertArray.activeTexture].enable;
	    break;
	  case GL_TEXTURE_COORD_ARRAY_SIZE:
	    *f = (GLfloat)state->vertArray.texCoord[state->vertArray.activeTexture].size;
	    break;
	  case GL_TEXTURE_COORD_ARRAY_TYPE:
	    *f = (GLfloat)state->vertArray.texCoord[state->vertArray.activeTexture].type;
	    break;
	  case GL_TEXTURE_COORD_ARRAY_STRIDE:
	    *f = (GLfloat)state->vertArray.texCoord[state->vertArray.activeTexture].stride;
	    break;
	  case GL_EDGE_FLAG_ARRAY:
	    *f = (GLfloat)state->vertArray.edgeFlag.enable;
	    break;
	  case GL_EDGE_FLAG_ARRAY_STRIDE:
	    *f = (GLfloat)state->vertArray.edgeFlag.stride;
	    break;

	  CASE_ARRAY_ALL(SECONDARY_COLOR, secondaryColor, f, GLfloat);

	  CASE_ARRAY_ENABLE(FOG_COORDINATE, fogCoord, f, GLfloat);
	  CASE_ARRAY_TYPE(FOG_COORDINATE, fogCoord, f, GLfloat);
	  CASE_ARRAY_STRIDE(FOG_COORDINATE, fogCoord, f, GLfloat);

	  case GL_MAX_ELEMENTS_VERTICES:
	    *f = (GLfloat)state->vertArray.maxElementsVertices;
	    break;
	  case GL_MAX_ELEMENTS_INDICES:
	    *f = (GLfloat)state->vertArray.maxElementsIndices;
	    break;
	  case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH:
	    *f = (GLfloat)__GL_CLIENT_ATTRIB_STACK_DEPTH;
	    break;
	  case GL_CLIENT_ACTIVE_TEXTURE_ARB:
	    *f = (GLfloat)(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_FLOAT(f);
	    } else {
		__GLX_SINGLE_GET_FLOAT_ARRAY(f,compsize);
                if (val != origVal) {
                   /* matrix transpose */
                   TransposeMatrixf(f);
                }
	    }
	}
    }
    __GLX_SINGLE_END();
}