Do pop for GL_VIEWPORT_BIT via. the api

This commit is contained in:
Keith Whitwell
1999-09-16 11:54:56 +00:00
parent 0099981b1c
commit e3f37862d2

View File

@@ -1,4 +1,4 @@
/* $Id: attrib.c,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ /* $Id: attrib.c,v 1.2 1999/09/16 11:54:56 keithw Exp $ */
/* /*
* Mesa 3-D graphics library * Mesa 3-D graphics library
@@ -700,6 +700,10 @@ void gl_PopAttrib( GLcontext* ctx )
(*ctx->Driver.ClearStencil)( ctx, ctx->Stencil.Clear ); (*ctx->Driver.ClearStencil)( ctx, ctx->Stencil.Clear );
if (ctx->Driver.Enable) if (ctx->Driver.Enable)
(*ctx->Driver.Enable)( ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled ); (*ctx->Driver.Enable)( ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled );
/* ctx->TriangleCaps &= ~DD_STENCIL; */
/* if (ctx->Stencil.Enabled) */
/* ctx->TriangleCaps |= DD_STENCIL; */
break; break;
case GL_TRANSFORM_BIT: case GL_TRANSFORM_BIT:
MEMCPY( &ctx->Transform, attr->data, MEMCPY( &ctx->Transform, attr->data,
@@ -738,18 +742,15 @@ void gl_PopAttrib( GLcontext* ctx )
} }
} }
break; break;
case GL_VIEWPORT_BIT: case GL_VIEWPORT_BIT:
MEMCPY( &ctx->Viewport, attr->data, {
sizeof(struct gl_viewport_attrib) ); struct gl_viewport_attrib *v =
if (ctx->Driver.Viewport) { (struct gl_viewport_attrib *)attr->data;
(*ctx->Driver.Viewport)( ctx, ctx->Viewport.X, ctx->Viewport.Y,
ctx->Viewport.Width, ctx->Viewport.Height ); gl_Viewport( ctx, v->X, v->Y, v->Width, v->Height );
} gl_DepthRange( ctx, v->Near, v->Far );
if (ctx->Driver.DepthRange) { break;
(*ctx->Driver.DepthRange)( ctx, ctx->Viewport.Near, }
ctx->Viewport.Far );
}
break;
default: default:
gl_problem( ctx, "Bad attrib flag in PopAttrib"); gl_problem( ctx, "Bad attrib flag in PopAttrib");
break; break;