diff options
author | Brian Paul <[email protected]> | 2001-02-27 22:33:59 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2001-02-27 22:33:59 +0000 |
commit | 6a9851d72d6cf9f5a6b0e3bd5bbb05706e071387 (patch) | |
tree | 87a62ce5ddf7f728d15ccd8ef0f2d3b775454430 /src/mesa/main | |
parent | bf8b5f99a11ad43bb3404ed4ae04eceb3027bbab (diff) |
fixed glitches in error checking of imaging extensions
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/enable.c | 20 | ||||
-rw-r--r-- | src/mesa/main/get.c | 34 | ||||
-rw-r--r-- | src/mesa/main/histogram.c | 22 |
3 files changed, 38 insertions, 38 deletions
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index f1870415f30..5fcc44e8e58 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -1,10 +1,10 @@ -/* $Id: enable.c,v 1.42 2001/02/16 18:14:41 keithw Exp $ */ +/* $Id: enable.c,v 1.43 2001/02/27 22:33:59 brianp Exp $ */ /* * Mesa 3-D graphics library * Version: 3.5 * - * Copyright (C) 1999-2000 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -238,7 +238,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) ctx->_Enabled ^= ENABLE_FOG; break; case GL_HISTOGRAM: - if (!ctx->Extensions.EXT_histogram) { + if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { gl_error(ctx, GL_INVALID_ENUM, "glEnable(GL_HISTOGRAM)"); return; } @@ -643,7 +643,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) /* GL_SGI_color_table */ case GL_COLOR_TABLE_SGI: - if (!ctx->Extensions.SGI_color_table) { + if (!ctx->Extensions.SGI_color_table && !ctx->Extensions.ARB_imaging) { gl_error( ctx, GL_INVALID_ENUM, state ? "glEnable": "glDisable" ); return; } @@ -653,7 +653,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) ctx->Pixel.ColorTableEnabled = state; break; case GL_POST_CONVOLUTION_COLOR_TABLE_SGI: - if (!ctx->Extensions.SGI_color_table) { + if (!ctx->Extensions.SGI_color_table && !ctx->Extensions.ARB_imaging) { gl_error( ctx, GL_INVALID_ENUM, state ? "glEnable": "glDisable" ); return; } @@ -663,7 +663,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) ctx->Pixel.PostConvolutionColorTableEnabled = state; break; case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI: - if (!ctx->Extensions.SGI_color_table) { + if (!ctx->Extensions.SGI_color_table && !ctx->Extensions.ARB_imaging) { gl_error( ctx, GL_INVALID_ENUM, state ? "glEnable": "glDisable" ); return; } @@ -675,7 +675,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) /* GL_EXT_convolution */ case GL_CONVOLUTION_1D: - if (!ctx->Extensions.EXT_convolution) { + if (!ctx->Extensions.EXT_convolution && !ctx->Extensions.ARB_imaging) { gl_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable"); return; } @@ -685,7 +685,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) ctx->Pixel.Convolution1DEnabled = state; break; case GL_CONVOLUTION_2D: - if (!ctx->Extensions.EXT_convolution) { + if (!ctx->Extensions.EXT_convolution && !ctx->Extensions.ARB_imaging) { gl_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable"); return; } @@ -695,7 +695,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) ctx->Pixel.Convolution2DEnabled = state; break; case GL_SEPARABLE_2D: - if (!ctx->Extensions.EXT_convolution) { + if (!ctx->Extensions.EXT_convolution && !ctx->Extensions.ARB_imaging) { gl_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable"); return; } @@ -818,7 +818,7 @@ _mesa_IsEnabled( GLenum cap ) case GL_FOG: return ctx->Fog.Enabled; case GL_HISTOGRAM: - if (ctx->Extensions.EXT_histogram) { + if (ctx->Extensions.EXT_histogram || ctx->Extensions.ARB_imaging) { return ctx->Pixel.HistogramEnabled; } else { diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 1cb5ebccceb..3258aadf8f8 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -1,4 +1,4 @@ -/* $Id: get.c,v 1.53 2001/02/26 23:58:12 brianp Exp $ */ +/* $Id: get.c,v 1.54 2001/02/27 22:33:59 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1147,7 +1147,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) /* GL_EXT_convolution (also in 1.2 imaging) */ case GL_CONVOLUTION_1D_EXT: - if (ctx->Extensions.EXT_convolution) { + if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) { *params = ctx->Pixel.Convolution1DEnabled; } else { @@ -1156,7 +1156,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) } break; case GL_CONVOLUTION_2D: - if (ctx->Extensions.EXT_convolution) { + if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) { *params = ctx->Pixel.Convolution2DEnabled; } else { @@ -1165,7 +1165,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) } break; case GL_SEPARABLE_2D: - if (ctx->Extensions.EXT_convolution) { + if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) { *params = ctx->Pixel.Separable2DEnabled; } else { @@ -1549,7 +1549,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) *params = (GLdouble) ctx->Pixel.GreenScale; break; case GL_HISTOGRAM: - if (ctx->Extensions.EXT_histogram) { + if (ctx->Extensions.EXT_histogram || ctx->Extensions.ARB_imaging) { *params = (GLdouble) ctx->Pixel.HistogramEnabled; } else { @@ -2335,7 +2335,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) /* GL_EXT_convolution (also in 1.2 imaging) */ case GL_CONVOLUTION_1D_EXT: - if (ctx->Extensions.EXT_convolution) { + if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) { *params = (GLdouble) ctx->Pixel.Convolution1DEnabled; } else { @@ -2344,7 +2344,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) } break; case GL_CONVOLUTION_2D: - if (ctx->Extensions.EXT_convolution) { + if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) { *params = (GLdouble) ctx->Pixel.Convolution2DEnabled; } else { @@ -2353,7 +2353,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) } break; case GL_SEPARABLE_2D: - if (ctx->Extensions.EXT_convolution) { + if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) { *params = (GLdouble) ctx->Pixel.Separable2DEnabled; } else { @@ -2737,7 +2737,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) *params = (GLfloat) ctx->Pixel.GreenScale; break; case GL_HISTOGRAM: - if (ctx->Extensions.EXT_histogram) { + if (ctx->Extensions.EXT_histogram || ctx->Extensions.ARB_imaging) { *params = (GLfloat) ctx->Pixel.HistogramEnabled; } else { @@ -3497,7 +3497,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) /* GL_EXT_convolution (also in 1.2 imaging) */ case GL_CONVOLUTION_1D_EXT: - if (ctx->Extensions.EXT_convolution) { + if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) { *params = (GLfloat) ctx->Pixel.Convolution1DEnabled; } else { @@ -3506,7 +3506,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) } break; case GL_CONVOLUTION_2D: - if (ctx->Extensions.EXT_convolution) { + if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) { *params = (GLfloat) ctx->Pixel.Convolution2DEnabled; } else { @@ -3515,7 +3515,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) } break; case GL_SEPARABLE_2D: - if (ctx->Extensions.EXT_convolution) { + if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) { *params = (GLfloat) ctx->Pixel.Separable2DEnabled; } else { @@ -3901,7 +3901,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) *params = (GLint) ctx->Pixel.GreenScale; break; case GL_HISTOGRAM: - if (ctx->Extensions.EXT_histogram) { + if (ctx->Extensions.EXT_histogram || ctx->Extensions.ARB_imaging) { *params = (GLint) ctx->Pixel.HistogramEnabled; } else { @@ -4687,7 +4687,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) /* GL_EXT_convolution (also in 1.2 imaging) */ case GL_CONVOLUTION_1D_EXT: - if (ctx->Extensions.EXT_convolution) { + if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) { *params = (GLint) ctx->Pixel.Convolution1DEnabled; } else { @@ -4696,7 +4696,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) } break; case GL_CONVOLUTION_2D: - if (ctx->Extensions.EXT_convolution) { + if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) { *params = (GLint) ctx->Pixel.Convolution2DEnabled; } else { @@ -4705,7 +4705,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) } break; case GL_SEPARABLE_2D: - if (ctx->Extensions.EXT_convolution) { + if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) { *params = (GLint) ctx->Pixel.Separable2DEnabled; } else { @@ -4912,7 +4912,7 @@ _mesa_GetString( GLenum name ) case GL_VERSION: return (const GLubyte *) version; case GL_EXTENSIONS: - return (const GLubyte *) _mesa_extensions_get_string( ctx ); + return (const GLubyte *) _mesa_extensions_get_string(ctx); default: gl_error( ctx, GL_INVALID_ENUM, "glGetString" ); return (const GLubyte *) 0; diff --git a/src/mesa/main/histogram.c b/src/mesa/main/histogram.c index dddaac39350..de5348deb4d 100644 --- a/src/mesa/main/histogram.c +++ b/src/mesa/main/histogram.c @@ -1,4 +1,4 @@ -/* $Id: histogram.c,v 1.7 2001/02/17 18:41:01 brianp Exp $ */ +/* $Id: histogram.c,v 1.8 2001/02/27 22:33:59 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -602,7 +602,7 @@ _mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvo GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (!ctx->Extensions.EXT_histogram) { + if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { gl_error(ctx, GL_INVALID_OPERATION, "glGetMinmax"); return; } @@ -669,7 +669,7 @@ _mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, G GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (!ctx->Extensions.EXT_histogram) { + if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { gl_error(ctx, GL_INVALID_OPERATION, "glGetHistogram"); return; } @@ -732,7 +732,7 @@ _mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (!ctx->Extensions.EXT_histogram) { + if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { gl_error(ctx, GL_INVALID_OPERATION, "glGetHistogramParameterfv"); return; } @@ -779,7 +779,7 @@ _mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (!ctx->Extensions.EXT_histogram) { + if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { gl_error(ctx, GL_INVALID_OPERATION, "glGetHistogramParameteriv"); return; } @@ -826,7 +826,7 @@ _mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (!ctx->Extensions.EXT_histogram) { + if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { gl_error(ctx, GL_INVALID_OPERATION, "glGetMinmaxParameterfv"); return; } @@ -852,7 +852,7 @@ _mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (!ctx->Extensions.EXT_histogram) { + if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { gl_error(ctx, GL_INVALID_OPERATION, "glGetMinmaxParameteriv"); return; } @@ -880,7 +880,7 @@ _mesa_Histogram(GLenum target, GLsizei width, GLenum internalFormat, GLboolean s GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* sideeffects */ - if (!ctx->Extensions.EXT_histogram) { + if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { gl_error(ctx, GL_INVALID_OPERATION, "glHistogram"); return; } @@ -961,7 +961,7 @@ _mesa_Minmax(GLenum target, GLenum internalFormat, GLboolean sink) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (!ctx->Extensions.EXT_histogram) { + if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { gl_error(ctx, GL_INVALID_OPERATION, "glMinmax"); return; } @@ -990,7 +990,7 @@ _mesa_ResetHistogram(GLenum target) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* sideeffects */ - if (!ctx->Extensions.EXT_histogram) { + if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { gl_error(ctx, GL_INVALID_OPERATION, "glResetHistogram"); return; } @@ -1017,7 +1017,7 @@ _mesa_ResetMinmax(GLenum target) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (!ctx->Extensions.EXT_histogram) { + if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) { gl_error(ctx, GL_INVALID_OPERATION, "glResetMinmax"); return; } |