From 8e053916c8052b47c191f68991c126f47c72c3f3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 30 Aug 2000 18:21:06 +0000 Subject: added more extensions testing code --- src/mesa/main/enable.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'src/mesa/main/enable.c') diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 537d2dda88..731bbe72dd 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -1,4 +1,4 @@ -/* $Id: enable.c,v 1.22 2000/08/21 14:22:24 brianp Exp $ */ +/* $Id: enable.c,v 1.23 2000/08/30 18:21:06 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -155,7 +155,13 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) } break; case GL_HISTOGRAM: - ctx->Pixel.HistogramEnabled = state; + if (ctx->Extensions.HaveHistogram) { + ctx->Pixel.HistogramEnabled = state; + } + else { + gl_error( ctx, GL_INVALID_ENUM, state ? "glEnable": "glDisable" ); + return; + } break; case GL_LIGHT0: case GL_LIGHT1: @@ -165,8 +171,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) case GL_LIGHT5: case GL_LIGHT6: case GL_LIGHT7: - if (ctx->Light.Light[cap-GL_LIGHT0].Enabled != state) - { + if (ctx->Light.Light[cap-GL_LIGHT0].Enabled != state) { ctx->Light.Light[cap-GL_LIGHT0].Enabled = state; if (state) { @@ -608,7 +613,13 @@ _mesa_IsEnabled( GLenum cap ) case GL_FOG: return ctx->Fog.Enabled; case GL_HISTOGRAM: - return ctx->Pixel.HistogramEnabled; + if (ctx->Extensions.HaveHistogram) { + return ctx->Pixel.HistogramEnabled; + } + else { + gl_error(ctx, GL_INVALID_ENUM, "glIsEnabled"); + return GL_FALSE; + } case GL_LIGHTING: return ctx->Light.Enabled; case GL_LIGHT0: -- cgit v1.2.3