Fixes query for active texture
TRAC #12374

Original-Author: Jim Hauxwell <james@dattrax.co.uk>
Signed-off-by: Shannon Woods
Signed-off-by: Daniel Koch

Author:    Shannon Woods

git-svn-id: https://angleproject.googlecode.com/svn/trunk@312 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/Context.cpp b/src/libGLESv2/Context.cpp
index 92535ca..852ab96 100644
--- a/src/libGLESv2/Context.cpp
+++ b/src/libGLESv2/Context.cpp
@@ -1322,46 +1322,46 @@
       case GL_MAX_TEXTURE_IMAGE_UNITS:          *params = gl::MAX_TEXTURE_IMAGE_UNITS;          break;
       case GL_MAX_FRAGMENT_UNIFORM_VECTORS:     *params = gl::MAX_FRAGMENT_UNIFORM_VECTORS;     break;
       case GL_MAX_RENDERBUFFER_SIZE:            *params = gl::MAX_RENDERBUFFER_SIZE;            break;
-      case GL_NUM_SHADER_BINARY_FORMATS:        *params = 0;                                break;
-      case GL_NUM_COMPRESSED_TEXTURE_FORMATS:   *params = 0;                                break;
-      case GL_COMPRESSED_TEXTURE_FORMATS: /* no compressed texture formats are supported */ break;
-      case GL_SHADER_BINARY_FORMATS:      /* no shader binary formats are supported */      break;
-      case GL_ARRAY_BUFFER_BINDING:             *params = mState.arrayBuffer;              break;
-      case GL_ELEMENT_ARRAY_BUFFER_BINDING:     *params = mState.elementArrayBuffer;       break;
-      case GL_FRAMEBUFFER_BINDING:              *params = mState.framebuffer;              break;
-      case GL_RENDERBUFFER_BINDING:             *params = mState.renderbuffer;             break;
-      case GL_CURRENT_PROGRAM:                  *params = mState.currentProgram;           break;
-      case GL_PACK_ALIGNMENT:                   *params = mState.packAlignment;            break;
-      case GL_UNPACK_ALIGNMENT:                 *params = mState.unpackAlignment;          break;
-      case GL_GENERATE_MIPMAP_HINT:             *params = mState.generateMipmapHint;       break;
-      case GL_ACTIVE_TEXTURE:                   *params = mState.activeSampler;            break;
-      case GL_STENCIL_FUNC:                     *params = mState.stencilFunc;              break;
-      case GL_STENCIL_REF:                      *params = mState.stencilRef;               break;
-      case GL_STENCIL_VALUE_MASK:               *params = mState.stencilMask;              break;
-      case GL_STENCIL_BACK_FUNC:                *params = mState.stencilBackFunc;          break;
-      case GL_STENCIL_BACK_REF:                 *params = mState.stencilBackRef;           break;
-      case GL_STENCIL_BACK_VALUE_MASK:          *params = mState.stencilBackMask;          break;
-      case GL_STENCIL_FAIL:                     *params = mState.stencilFail;              break;
-      case GL_STENCIL_PASS_DEPTH_FAIL:          *params = mState.stencilPassDepthFail;     break;
-      case GL_STENCIL_PASS_DEPTH_PASS:          *params = mState.stencilPassDepthPass;     break;
-      case GL_STENCIL_BACK_FAIL:                *params = mState.stencilBackFail;          break;
-      case GL_STENCIL_BACK_PASS_DEPTH_FAIL:     *params = mState.stencilBackPassDepthFail;     break;
-      case GL_STENCIL_BACK_PASS_DEPTH_PASS:     *params = mState.stencilBackPassDepthPass;     break;
-      case GL_DEPTH_FUNC:                       *params = mState.depthFunc;                    break;
-      case GL_BLEND_SRC_RGB:                    *params = mState.sourceBlendRGB;               break;
-      case GL_BLEND_SRC_ALPHA:                  *params = mState.sourceBlendAlpha;             break;
-      case GL_BLEND_DST_RGB:                    *params = mState.destBlendRGB;                 break;
-      case GL_BLEND_DST_ALPHA:                  *params = mState.destBlendAlpha;               break;
-      case GL_BLEND_EQUATION_RGB:               *params = mState.blendEquationRGB;             break;
-      case GL_BLEND_EQUATION_ALPHA:             *params = mState.blendEquationAlpha;           break;
-      case GL_STENCIL_WRITEMASK:                *params = mState.stencilWritemask;             break;
-      case GL_STENCIL_BACK_WRITEMASK:           *params = mState.stencilBackWritemask;         break;
-      case GL_STENCIL_CLEAR_VALUE:              *params = mState.stencilClearValue;            break;
-      case GL_SUBPIXEL_BITS:                    *params = 4;                            break;
-      case GL_MAX_TEXTURE_SIZE:                 *params = gl::MAX_TEXTURE_SIZE;             break;
-      case GL_MAX_CUBE_MAP_TEXTURE_SIZE:        *params = gl::MAX_CUBE_MAP_TEXTURE_SIZE;    break;
-      case GL_SAMPLE_BUFFERS:                   *params = 0;                                break;
-      case GL_SAMPLES:                          *params = 0;                                break;
+      case GL_NUM_SHADER_BINARY_FORMATS:        *params = 0;                                    break;
+      case GL_NUM_COMPRESSED_TEXTURE_FORMATS:   *params = 0;                                    break;
+      case GL_COMPRESSED_TEXTURE_FORMATS: /* no compressed texture formats are supported */     break;
+      case GL_SHADER_BINARY_FORMATS:      /* no shader binary formats are supported */          break;
+      case GL_ARRAY_BUFFER_BINDING:             *params = mState.arrayBuffer;                   break;
+      case GL_ELEMENT_ARRAY_BUFFER_BINDING:     *params = mState.elementArrayBuffer;            break;
+      case GL_FRAMEBUFFER_BINDING:              *params = mState.framebuffer;                   break;
+      case GL_RENDERBUFFER_BINDING:             *params = mState.renderbuffer;                  break;
+      case GL_CURRENT_PROGRAM:                  *params = mState.currentProgram;                break;
+      case GL_PACK_ALIGNMENT:                   *params = mState.packAlignment;                 break;
+      case GL_UNPACK_ALIGNMENT:                 *params = mState.unpackAlignment;               break;
+      case GL_GENERATE_MIPMAP_HINT:             *params = mState.generateMipmapHint;            break;
+      case GL_ACTIVE_TEXTURE:                   *params = (mState.activeSampler + GL_TEXTURE0); break;
+      case GL_STENCIL_FUNC:                     *params = mState.stencilFunc;                   break;
+      case GL_STENCIL_REF:                      *params = mState.stencilRef;                    break;
+      case GL_STENCIL_VALUE_MASK:               *params = mState.stencilMask;                   break;
+      case GL_STENCIL_BACK_FUNC:                *params = mState.stencilBackFunc;               break;
+      case GL_STENCIL_BACK_REF:                 *params = mState.stencilBackRef;                break;
+      case GL_STENCIL_BACK_VALUE_MASK:          *params = mState.stencilBackMask;               break;
+      case GL_STENCIL_FAIL:                     *params = mState.stencilFail;                   break;
+      case GL_STENCIL_PASS_DEPTH_FAIL:          *params = mState.stencilPassDepthFail;          break;
+      case GL_STENCIL_PASS_DEPTH_PASS:          *params = mState.stencilPassDepthPass;          break;
+      case GL_STENCIL_BACK_FAIL:                *params = mState.stencilBackFail;               break;
+      case GL_STENCIL_BACK_PASS_DEPTH_FAIL:     *params = mState.stencilBackPassDepthFail;      break;
+      case GL_STENCIL_BACK_PASS_DEPTH_PASS:     *params = mState.stencilBackPassDepthPass;      break;
+      case GL_DEPTH_FUNC:                       *params = mState.depthFunc;                     break;
+      case GL_BLEND_SRC_RGB:                    *params = mState.sourceBlendRGB;                break;
+      case GL_BLEND_SRC_ALPHA:                  *params = mState.sourceBlendAlpha;              break;
+      case GL_BLEND_DST_RGB:                    *params = mState.destBlendRGB;                  break;
+      case GL_BLEND_DST_ALPHA:                  *params = mState.destBlendAlpha;                break;
+      case GL_BLEND_EQUATION_RGB:               *params = mState.blendEquationRGB;              break;
+      case GL_BLEND_EQUATION_ALPHA:             *params = mState.blendEquationAlpha;            break;
+      case GL_STENCIL_WRITEMASK:                *params = mState.stencilWritemask;              break;
+      case GL_STENCIL_BACK_WRITEMASK:           *params = mState.stencilBackWritemask;          break;
+      case GL_STENCIL_CLEAR_VALUE:              *params = mState.stencilClearValue;             break;
+      case GL_SUBPIXEL_BITS:                    *params = 4;                                    break;
+      case GL_MAX_TEXTURE_SIZE:                 *params = gl::MAX_TEXTURE_SIZE;                 break;
+      case GL_MAX_CUBE_MAP_TEXTURE_SIZE:        *params = gl::MAX_CUBE_MAP_TEXTURE_SIZE;        break;
+      case GL_SAMPLE_BUFFERS:                   *params = 0;                                    break;
+      case GL_SAMPLES:                          *params = 0;                                    break;
       case GL_IMPLEMENTATION_COLOR_READ_TYPE:   *params = gl::IMPLEMENTATION_COLOR_READ_TYPE;   break;
       case GL_IMPLEMENTATION_COLOR_READ_FORMAT: *params = gl::IMPLEMENTATION_COLOR_READ_FORMAT; break;
       case GL_MAX_VIEWPORT_DIMS: