summaryrefslogtreecommitdiff
path: root/src/mesa/main/enable.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2001-05-29 15:23:48 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2001-05-29 15:23:48 +0000
commit736fcbec4732830e7976fb5eb309b13e03be132c (patch)
tree746d1eb07d2e140c2a6d7964767403f131e86080 /src/mesa/main/enable.c
parent5ff1c613ea25be455eda9037a4955d47669a8c79 (diff)
infrastructure for GL_ARB_multisample
Diffstat (limited to 'src/mesa/main/enable.c')
-rw-r--r--src/mesa/main/enable.c101
1 files changed, 100 insertions, 1 deletions
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 173b4b0f22..4516f48f84 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -1,4 +1,4 @@
-/* $Id: enable.c,v 1.48 2001/03/29 21:16:25 keithw Exp $ */
+/* $Id: enable.c,v 1.49 2001/05/29 15:23:48 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -733,6 +733,63 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
break;
+ /* GL_ARB_multisample */
+ case GL_MULTISAMPLE_ARB:
+ if (!ctx->Extensions.ARB_multisample) {
+ _mesa_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
+ return;
+ }
+ if (ctx->Multisample.Enabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
+ ctx->Multisample.Enabled = state;
+ ctx->NewState |= _NEW_MULTISAMPLE;
+ break;
+ case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
+ if (!ctx->Extensions.ARB_multisample) {
+ _mesa_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
+ return;
+ }
+ if (ctx->Multisample.SampleAlphaToCoverage == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
+ ctx->Multisample.SampleAlphaToCoverage = state;
+ ctx->NewState |= _NEW_MULTISAMPLE;
+ break;
+ case GL_SAMPLE_ALPHA_TO_ONE_ARB:
+ if (!ctx->Extensions.ARB_multisample) {
+ _mesa_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
+ return;
+ }
+ if (ctx->Multisample.SampleAlphaToOne == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
+ ctx->Multisample.SampleAlphaToOne = state;
+ ctx->NewState |= _NEW_MULTISAMPLE;
+ break;
+ case GL_SAMPLE_COVERAGE_ARB:
+ if (!ctx->Extensions.ARB_multisample) {
+ _mesa_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
+ return;
+ }
+ if (ctx->Multisample.SampleCoverage == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
+ ctx->Multisample.SampleCoverage = state;
+ ctx->NewState |= _NEW_MULTISAMPLE;
+ break;
+ case GL_SAMPLE_COVERAGE_INVERT_ARB:
+ if (!ctx->Extensions.ARB_multisample) {
+ _mesa_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
+ return;
+ }
+ if (ctx->Multisample.SampleCoverageInvert == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
+ ctx->Multisample.SampleCoverageInvert = state;
+ ctx->NewState |= _NEW_MULTISAMPLE;
+ break;
+
/* GL_MESA_sprite_point */
case GL_SPRITE_POINT_MESA:
if (!ctx->Extensions.MESA_sprite_point) {
@@ -993,6 +1050,48 @@ _mesa_IsEnabled( GLenum cap )
return GL_FALSE;
}
+ /* GL_ARB_multisample */
+ case GL_MULTISAMPLE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ return ctx->Multisample.Enabled;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled");
+ return GL_FALSE;
+ }
+ case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ return ctx->Multisample.SampleAlphaToCoverage;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled");
+ return GL_FALSE;
+ }
+ case GL_SAMPLE_ALPHA_TO_ONE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ return ctx->Multisample.SampleAlphaToOne;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled");
+ return GL_FALSE;
+ }
+ case GL_SAMPLE_COVERAGE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ return ctx->Multisample.SampleCoverage;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled");
+ return GL_FALSE;
+ }
+ case GL_SAMPLE_COVERAGE_INVERT_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ return ctx->Multisample.SampleCoverageInvert;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled");
+ return GL_FALSE;
+ }
+
/* GL_MESA_sprite_point */
case GL_SPRITE_POINT_MESA:
return ctx->Point.SpriteMode;