/************************************************************************** * * Copyright 2008 VMware, Inc. * All Rights Reserved. * **************************************************************************/ /** * Code to implement GL_OES_query_matrix. See the spec at: * http://www.khronos.org/registry/gles/extensions/OES/OES_query_matrix.txt */ #include #include "c99_math.h" #include "glheader.h" #include "querymatrix.h" #include "main/get.h" /** * This is from the GL_OES_query_matrix extension specification: * * GLbitfield glQueryMatrixxOES( GLfixed mantissa[16], * GLint exponent[16] ) * mantissa[16] contains the contents of the current matrix in GLfixed * format. exponent[16] contains the unbiased exponents applied to the * matrix components, so that the internal representation of component i * is close to mantissa[i] * 2^exponent[i]. The function returns a status * word which is zero if all the components are valid. If * status & (1< 0) { mantissa[i] = INT_TO_FIXED(1); } else { mantissa[i] = -INT_TO_FIXED(1); } exponent[i] = (GLint) 0; rv |= bit; break; default: /* We should never get here; but here's a catching case * in case fpclassify() is returnings something unexpected. */ mantissa[i] = INT_TO_FIXED(2); exponent[i] = (GLint) 0; rv |= bit; break; } } /* for each component */ /* All done */ return rv; }