summaryrefslogtreecommitdiff
path: root/src/mesa/main/rastpos.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2001-06-26 01:32:48 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2001-06-26 01:32:48 +0000
commit8c2f6c5059a60d845716277973c826f4069926e6 (patch)
tree75f91539198cc4b27464469231ca0eb734dc5abc /src/mesa/main/rastpos.c
parent657323bf03a575bf40cff83119f201a9dcd1478e (diff)
added GL_IBM_rasterpos_clip extension
Diffstat (limited to 'src/mesa/main/rastpos.c')
-rw-r--r--src/mesa/main/rastpos.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c
index adc81ed478..c4f87c2ba4 100644
--- a/src/mesa/main/rastpos.c
+++ b/src/mesa/main/rastpos.c
@@ -1,4 +1,4 @@
-/* $Id: rastpos.c,v 1.26 2001/06/18 17:26:08 brianp Exp $ */
+/* $Id: rastpos.c,v 1.27 2001/06/26 01:32:48 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -66,6 +66,20 @@ viewclip_point( const GLfloat v[] )
}
+/* As above, but only clip test against far/near Z planes */
+static GLuint
+viewclip_point_z( const GLfloat v[] )
+{
+ if (v[2] > v[3] || v[2] < -v[3] ) {
+ return 0;
+ }
+ else {
+ return 1;
+ }
+}
+
+
+
/*
* Clip a point against the user clipping planes.
* Input: v - vertex-vector describing the point to clip.
@@ -292,7 +306,13 @@ raster_pos4f(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
TRANSFORM_POINT( clip, ctx->ProjectionMatrix.m, eye );
/* clip to view volume */
- if (viewclip_point( clip )==0) {
+ if (ctx->Transform.RasterPositionUnclipped) {
+ /* GL_IBM_rasterpos_clip: only clip against Z */
+ if (viewclip_point_z(clip) == 0)
+ ctx->Current.RasterPosValid = GL_FALSE;
+ }
+ else if (viewclip_point(clip) == 0) {
+ /* Normal OpenGL behaviour */
ctx->Current.RasterPosValid = GL_FALSE;
return;
}