mesa: fix error handling for glIsEnabled
authorYuanhan Liu <yuanhan.liu@linux.intel.com>
Mon, 19 Sep 2011 07:03:01 +0000 (15:03 +0800)
committerBrian Paul <brianp@vmware.com>
Mon, 19 Sep 2011 14:11:52 +0000 (08:11 -0600)
According the man page, GL_INVALID_OPERATION should be generated if
glIsEnabled is executed betwwen the execution of glBegin and the
correspoding execution of glEnd.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
src/mesa/main/enable.c

index 4bf1809e7fa429405c7d32f0398f5bda7ac11d8a..2d857c1481c78f88f9c27d97de2f3da3f239a8ae 100644 (file)
@@ -1072,6 +1072,8 @@ GLboolean GLAPIENTRY
 _mesa_IsEnabled( GLenum cap )
 {
    GET_CURRENT_CONTEXT(ctx);
+   ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
+
    switch (cap) {
       case GL_ALPHA_TEST:
          return ctx->Color.AlphaEnabled;