From e5b244ff7f984805c1bcc020342f1300f2639c71 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 21 Apr 2003 15:02:17 +0000 Subject: Implemented GL_EXT_depth_bounds_test. --- src/mesa/main/depth.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) (limited to 'src/mesa/main/depth.c') diff --git a/src/mesa/main/depth.c b/src/mesa/main/depth.c index 8383bcc608..9d95500fca 100644 --- a/src/mesa/main/depth.c +++ b/src/mesa/main/depth.c @@ -1,10 +1,8 @@ -/* $Id: depth.c,v 1.31 2002/10/24 23:57:20 brianp Exp $ */ - /* * Mesa 3-D graphics library - * Version: 4.1 + * Version: 5.1 * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2003 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"), @@ -116,3 +114,29 @@ _mesa_DepthMask( GLboolean flag ) if (ctx->Driver.DepthMask) ctx->Driver.DepthMask( ctx, flag ); } + + + +/* GL_EXT_depth_bounds_test */ +void +_mesa_DepthBoundsEXT( GLclampd zmin, GLclampd zmax ) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (zmin > zmax) { + _mesa_error(ctx, GL_INVALID_VALUE, "glDepthBoundsEXT(zmin > zmax)"); + return; + } + + zmin = CLAMP(zmin, 0.0, 1.0); + zmax = CLAMP(zmax, 0.0, 1.0); + + if (ctx->Depth.BoundsMin == zmin && ctx->Depth.BoundsMax == zmax) + return; + + FLUSH_VERTICES(ctx, _NEW_DEPTH); + ctx->Depth.BoundsMin = zmin; + ctx->Depth.BoundsMax = zmax; +} + -- cgit v1.2.3