-/* $Id: attrib.c,v 1.52 2001/06/18 17:26:08 brianp Exp $ */
+/* $Id: attrib.c,v 1.53 2001/06/26 01:32:48 brianp Exp $ */
/*
* Mesa 3-D graphics library
attr->Map2Vertex3 = ctx->Eval.Map2Vertex3;
attr->Map2Vertex4 = ctx->Eval.Map2Vertex4;
attr->Normalize = ctx->Transform.Normalize;
+ attr->RasterPositionUnclipped = ctx->Transform.RasterPositionUnclipped;
attr->PixelTexture = ctx->Pixel.PixelTextureEnabled;
attr->PointSmooth = ctx->Point.SmoothFlag;
attr->PolygonOffsetPoint = ctx->Polygon.OffsetPoint;
}
TEST_AND_UPDATE(ctx->Color.AlphaEnabled, enable->AlphaTest, GL_ALPHA_TEST);
- TEST_AND_UPDATE(ctx->Transform.Normalize, enable->AutoNormal, GL_NORMALIZE);
TEST_AND_UPDATE(ctx->Color.BlendEnabled, enable->Blend, GL_BLEND);
for (i=0;i<MAX_CLIP_PLANES;i++) {
GL_MAP2_VERTEX_3);
TEST_AND_UPDATE(ctx->Eval.Map2Vertex4, enable->Map2Vertex4,
GL_MAP2_VERTEX_4);
+ TEST_AND_UPDATE(ctx->Eval.AutoNormal, enable->AutoNormal, GL_AUTO_NORMAL);
TEST_AND_UPDATE(ctx->Transform.Normalize, enable->Normalize, GL_NORMALIZE);
TEST_AND_UPDATE(ctx->Transform.RescaleNormals, enable->RescaleNormals,
GL_RESCALE_NORMAL_EXT);
+ TEST_AND_UPDATE(ctx->Transform.RasterPositionUnclipped,
+ enable->RasterPositionUnclipped,
+ GL_RASTER_POSITION_UNCLIPPED_IBM);
TEST_AND_UPDATE(ctx->Pixel.PixelTextureEnabled, enable->PixelTexture,
GL_POINT_SMOOTH);
TEST_AND_UPDATE(ctx->Point.SmoothFlag, enable->PointSmooth,
-/* $Id: context.c,v 1.143 2001/06/13 14:56:14 brianp Exp $ */
+/* $Id: context.c,v 1.144 2001/06/26 01:32:48 brianp Exp $ */
/*
* Mesa 3-D graphics library
ctx->Transform.MatrixMode = GL_MODELVIEW;
ctx->Transform.Normalize = GL_FALSE;
ctx->Transform.RescaleNormals = GL_FALSE;
+ ctx->Transform.RasterPositionUnclipped = GL_FALSE;
for (i=0;i<MAX_CLIP_PLANES;i++) {
ctx->Transform.ClipEnabled[i] = GL_FALSE;
ASSIGN_4V( ctx->Transform.EyeUserPlane[i], 0.0, 0.0, 0.0, 0.0 );
-/* $Id: drawpix.c,v 1.54 2001/06/18 17:26:08 brianp Exp $ */
+/* $Id: drawpix.c,v 1.55 2001/06/26 01:32:48 brianp Exp $ */
/*
* Mesa 3-D graphics library
_mesa_update_state(ctx);
}
+#if 1
x = IROUND(ctx->Current.RasterPos[0]);
y = IROUND(ctx->Current.RasterPos[1]);
-
+#else
+ x = IFLOOR(ctx->Current.RasterPos[0]);
+ y = IFLOOR(ctx->Current.RasterPos[1]);
+#endif
ctx->OcclusionResult = GL_TRUE;
ctx->Driver.DrawPixels(ctx, x, y, width, height, format, type,
&ctx->Unpack, pixels);
if (!ctx->Current.RasterPosValid) {
return;
}
+#if 1
destx = IROUND(ctx->Current.RasterPos[0]);
desty = IROUND(ctx->Current.RasterPos[1]);
-
+#else
+ destx = IFLOOR(ctx->Current.RasterPos[0]);
+ desty = IFLOOR(ctx->Current.RasterPos[1]);
+#endif
ctx->OcclusionResult = GL_TRUE;
ctx->Driver.CopyPixels( ctx, srcx, srcy, width, height, destx, desty,
if (ctx->RenderMode==GL_RENDER) {
if (bitmap) {
+#if 0
GLint x = (GLint) ( (ctx->Current.RasterPos[0] - xorig) + 0.0F );
GLint y = (GLint) ( (ctx->Current.RasterPos[1] - yorig) + 0.0F );
-
+#else
+ GLint x = IFLOOR(ctx->Current.RasterPos[0] - xorig);
+ GLint y = IFLOOR(ctx->Current.RasterPos[1] - yorig);
+#endif
if (ctx->NewState) {
_mesa_update_state(ctx);
}
-/* $Id: enable.c,v 1.49 2001/05/29 15:23:48 brianp Exp $ */
+/* $Id: enable.c,v 1.50 2001/06/26 01:32:48 brianp Exp $ */
/*
* Mesa 3-D graphics library
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) {
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) {
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) {
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) {
return;
FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
ctx->Multisample.SampleCoverageInvert = state;
- ctx->NewState |= _NEW_MULTISAMPLE;
+ break;
+
+ /* GL_IBM_rasterpos_clip */
+ case GL_RASTER_POSITION_UNCLIPPED_IBM:
+ if (!ctx->Extensions.IBM_rasterpos_clip) {
+ _mesa_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
+ return;
+ }
+ if (ctx->Transform.RasterPositionUnclipped == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
+ ctx->Transform.RasterPositionUnclipped = state;
break;
/* GL_MESA_sprite_point */
return GL_FALSE;
}
+ /* GL_IBM_rasterpos_clip */
+ case GL_RASTER_POSITION_UNCLIPPED_IBM:
+ if (ctx->Extensions.IBM_rasterpos_clip) {
+ return ctx->Transform.RasterPositionUnclipped;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled");
+ return GL_FALSE;
+ }
+
/* GL_MESA_sprite_point */
case GL_SPRITE_POINT_MESA:
return ctx->Point.SpriteMode;
-/* $Id: extensions.c,v 1.62 2001/06/15 14:18:46 brianp Exp $ */
+/* $Id: extensions.c,v 1.63 2001/06/26 01:32:48 brianp Exp $ */
/*
* Mesa 3-D graphics library
{ ON, "GL_EXT_vertex_array", 0 },
{ OFF, "GL_EXT_vertex_array_set", F(EXT_vertex_array_set) },
{ OFF, "GL_HP_occlusion_test", F(HP_occlusion_test) },
+ { ON, "GL_IBM_rasterpos_clip", F(IBM_rasterpos_clip) },
{ OFF, "GL_INGR_blend_func_separate", F(INGR_blend_func_separate) },
{ OFF, "GL_MESA_packed_depth_stencil", 0 },
{ OFF, "GL_MESA_resize_buffers", F(MESA_resize_buffers) },
-/* $Id: get.c,v 1.64 2001/06/20 18:54:43 brianp Exp $ */
+/* $Id: get.c,v 1.65 2001/06/26 01:32:48 brianp Exp $ */
/*
* Mesa 3-D graphics library
return;
}
+ /* GL_IBM_rasterpos_clip */
+ case GL_RASTER_POSITION_UNCLIPPED_IBM:
+ if (ctx->Extensions.IBM_rasterpos_clip) {
+ *params = ctx->Transform.RasterPositionUnclipped;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetBoolean");
+ return;
+ }
+
/* GL_MESA_sprite_point */
case GL_SPRITE_POINT_MESA:
if (ctx->Extensions.MESA_sprite_point) {
return;
}
+ /* GL_IBM_rasterpos_clip */
+ case GL_RASTER_POSITION_UNCLIPPED_IBM:
+ if (ctx->Extensions.IBM_rasterpos_clip) {
+ *params = (GLdouble) ctx->Transform.RasterPositionUnclipped;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
+ return;
+ }
+
/* GL_MESA_sprite_point */
case GL_SPRITE_POINT_MESA:
if (ctx->Extensions.MESA_sprite_point) {
return;
}
+ /* GL_IBM_rasterpos_clip */
+ case GL_RASTER_POSITION_UNCLIPPED_IBM:
+ if (ctx->Extensions.IBM_rasterpos_clip) {
+ *params = (GLfloat) ctx->Transform.RasterPositionUnclipped;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetFloatn");
+ return;
+ }
+
/* GL_MESA_sprite_point */
case GL_SPRITE_POINT_MESA:
if (ctx->Extensions.MESA_sprite_point) {
return;
}
+ /* GL_IBM_rasterpos_clip */
+ case GL_RASTER_POSITION_UNCLIPPED_IBM:
+ if (ctx->Extensions.IBM_rasterpos_clip) {
+ *params = (GLint) ctx->Transform.RasterPositionUnclipped;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
+ return;
+ }
+
/* GL_MESA_sprite_point */
case GL_SPRITE_POINT_MESA:
if (ctx->Extensions.MESA_sprite_point) {
-/* $Id: mtypes.h,v 1.46 2001/06/13 14:56:14 brianp Exp $ */
+/* $Id: mtypes.h,v 1.47 2001/06/26 01:32:48 brianp Exp $ */
/*
* Mesa 3-D graphics library
GLboolean SampleAlphaToOne; /* GL_ARB_multisample */
GLboolean SampleCoverage; /* GL_ARB_multisample */
GLboolean SampleCoverageInvert; /* GL_ARB_multisample */
+ GLboolean RasterPositionUnclipped; /* GL_IBM_rasterpos_clip */
GLuint Texture[MAX_TEXTURE_UNITS];
GLuint TexGen[MAX_TEXTURE_UNITS];
};
GLubyte _AnyClip; /* How many ClipEnabled? */
GLboolean Normalize; /* Normalize all normals? */
GLboolean RescaleNormals; /* GL_EXT_rescale_normal */
+ GLboolean RasterPositionUnclipped; /* GL_IBM_rasterpos_clip */
};
GLboolean EXT_texture_lod_bias;
GLboolean EXT_vertex_array_set;
GLboolean HP_occlusion_test;
+ GLboolean IBM_rasterpos_clip;
GLboolean INGR_blend_func_separate;
GLboolean MESA_window_pos;
GLboolean MESA_resize_buffers;
-/* $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
}
+/* 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.
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;
}