mesa: implement glGet queries for GL_ARB_draw_buffers_blend
authorBrian Paul <brianp@vmware.com>
Wed, 12 Jan 2011 15:08:22 +0000 (08:08 -0700)
committerBrian Paul <brianp@vmware.com>
Sun, 16 Jan 2011 01:35:45 +0000 (18:35 -0700)
src/mesa/main/get.c

index 6f47eca28cc92dac370ade59cc4b4ebd914707a2..e223cf425abdb46b48c0bc43a9776d874779c176 100644 (file)
@@ -2271,6 +2271,53 @@ find_value_indexed(const char *func, GLenum pname, int index, union value *v)
       v->value_int = (ctx->Color.BlendEnabled >> index) & 1;
       return TYPE_INT;
 
+   case GL_BLEND_SRC:
+      /* fall-through */
+   case GL_BLEND_SRC_RGB:
+      if (index >= ctx->Const.MaxDrawBuffers)
+        goto invalid_value;
+      if (!ctx->Extensions.ARB_draw_buffers_blend)
+        goto invalid_enum;
+      v->value_int = ctx->Color.Blend[index].SrcRGB;
+      return TYPE_INT;
+   case GL_BLEND_SRC_ALPHA:
+      if (index >= ctx->Const.MaxDrawBuffers)
+        goto invalid_value;
+      if (!ctx->Extensions.ARB_draw_buffers_blend)
+        goto invalid_enum;
+      v->value_int = ctx->Color.Blend[index].SrcA;
+      return TYPE_INT;
+   case GL_BLEND_DST:
+      /* fall-through */
+   case GL_BLEND_DST_RGB:
+      if (index >= ctx->Const.MaxDrawBuffers)
+        goto invalid_value;
+      if (!ctx->Extensions.ARB_draw_buffers_blend)
+        goto invalid_enum;
+      v->value_int = ctx->Color.Blend[index].DstRGB;
+      return TYPE_INT;
+   case GL_BLEND_DST_ALPHA:
+      if (index >= ctx->Const.MaxDrawBuffers)
+        goto invalid_value;
+      if (!ctx->Extensions.ARB_draw_buffers_blend)
+        goto invalid_enum;
+      v->value_int = ctx->Color.Blend[index].DstA;
+      return TYPE_INT;
+   case GL_BLEND_EQUATION_RGB:
+      if (index >= ctx->Const.MaxDrawBuffers)
+        goto invalid_value;
+      if (!ctx->Extensions.ARB_draw_buffers_blend)
+        goto invalid_enum;
+      v->value_int = ctx->Color.Blend[index].EquationRGB;
+      return TYPE_INT;
+   case GL_BLEND_EQUATION_ALPHA:
+      if (index >= ctx->Const.MaxDrawBuffers)
+        goto invalid_value;
+      if (!ctx->Extensions.ARB_draw_buffers_blend)
+        goto invalid_enum;
+      v->value_int = ctx->Color.Blend[index].EquationA;
+      return TYPE_INT;
+
    case GL_COLOR_WRITEMASK:
       if (index >= ctx->Const.MaxDrawBuffers)
         goto invalid_value;