-/* $Id: attrib.c,v 1.20 2000/03/19 01:10:11 brianp Exp $ */
+/* $Id: attrib.c,v 1.21 2000/04/07 16:27:54 brianp Exp $ */
/*
* Mesa 3-D graphics library
attr->Lighting = ctx->Light.Enabled;
attr->LineSmooth = ctx->Line.SmoothFlag;
attr->LineStipple = ctx->Line.StippleFlag;
+ attr->Histogram = ctx->Pixel.HistogramEnabled;
+ attr->MinMax = ctx->Pixel.MinMaxEnabled;
attr->IndexLogicOp = ctx->Color.IndexLogicOpEnabled;
attr->ColorLogicOp = ctx->Color.ColorLogicOpEnabled;
attr->Map1Color4 = ctx->Eval.Map1Color4;
attr->Map2Vertex3 = ctx->Eval.Map2Vertex3;
attr->Map2Vertex4 = ctx->Eval.Map2Vertex4;
attr->Normalize = ctx->Transform.Normalize;
+ attr->PixelTexture = ctx->Pixel.PixelTextureEnabled;
attr->PointSmooth = ctx->Point.SmoothFlag;
attr->PolygonOffsetPoint = ctx->Polygon.OffsetPoint;
attr->PolygonOffsetLine = ctx->Polygon.OffsetLine;
TEST_AND_UPDATE(ctx->Eval.Map2Vertex4, enable->Map2Vertex4, GL_MAP2_VERTEX_4);
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->Pixel.PixelTextureEnabled, enable->PixelTexture, GL_POINT_SMOOTH);
TEST_AND_UPDATE(ctx->Point.SmoothFlag, enable->PointSmooth, GL_POINT_SMOOTH);
TEST_AND_UPDATE(ctx->Polygon.OffsetPoint, enable->PolygonOffsetPoint, GL_POLYGON_OFFSET_POINT);
TEST_AND_UPDATE(ctx->Polygon.OffsetLine, enable->PolygonOffsetLine, GL_POLYGON_OFFSET_LINE);
-/* $Id: context.c,v 1.54 2000/04/07 00:19:41 brianp Exp $ */
+/* $Id: context.c,v 1.55 2000/04/07 16:27:26 brianp Exp $ */
/*
* Mesa 3-D graphics library
ctx->Pixel.MapGtoG[0] = 0.0;
ctx->Pixel.MapBtoB[0] = 0.0;
ctx->Pixel.MapAtoA[0] = 0.0;
+ ctx->Pixel.HistogramEnabled = GL_FALSE;
+ ctx->Pixel.MinMaxEnabled = GL_FALSE;
+ ctx->Pixel.PixelTextureEnabled = GL_FALSE;
+ ctx->Pixel.FragmentRgbSource = GL_PIXEL_GROUP_COLOR_SGIS;
+ ctx->Pixel.FragmentAlphaSource = GL_PIXEL_GROUP_COLOR_SGIS;
/* Point group */
ctx->Point.SmoothFlag = GL_FALSE;
-/* $Id: drawpix.c,v 1.16 2000/04/01 05:42:06 brianp Exp $ */
+/* $Id: drawpix.c,v 1.17 2000/04/07 16:27:26 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "mem.h"
#include "mmath.h"
#include "pixel.h"
+#include "pixeltex.h"
#include "span.h"
#include "state.h"
#include "stencil.h"
+#include "texture.h"
#include "types.h"
#include "zoom.h"
#endif
&& ctx->Pixel.AlphaBias==0.0 && ctx->Pixel.AlphaScale==1.0
&& ctx->Pixel.IndexShift==0 && ctx->Pixel.IndexOffset==0
&& ctx->Pixel.MapColorFlag==0
+ && ctx->Texture.ReallyEnabled == 0
&& unpack->Alignment==1
&& !unpack->SwapBytes
&& !unpack->LsbFirst) {
_mesa_unpack_ubyte_color_span(ctx, width, GL_RGBA, (void*) rgba,
format, type, source, unpack, GL_TRUE);
+ if (ctx->Texture.ReallyEnabled && ctx->Pixel.PixelTextureEnabled) {
+ GLfloat s[MAX_WIDTH], t[MAX_WIDTH], r[MAX_WIDTH], q[MAX_WIDTH];
+ GLuint unit;
+ /* XXX not sure how multitexture is supposed to work here */
+ for (unit = 0; unit < MAX_TEXTURE_UNITS; unit++) {
+ _mesa_pixeltexgen(ctx, width, (const GLubyte (*)[4]) rgba,
+ s, t, r, q);
+ gl_texture_pixels(ctx, unit, width, s, t, r, NULL, rgba);
+ }
+ }
+
if (quickDraw) {
(*ctx->Driver.WriteRGBASpan)( ctx, width, x, y,
(CONST GLubyte (*)[]) rgba, NULL);
-/* $Id: enable.c,v 1.13 2000/04/04 15:14:10 brianp Exp $ */
+/* $Id: enable.c,v 1.14 2000/04/07 16:27:26 brianp Exp $ */
/*
* Mesa 3-D graphics library
}
break;
+ /* GL_SGIS_pixel_texture */
+ case GL_PIXEL_TEXTURE_SGIS:
+ ctx->Pixel.PixelTextureEnabled = state;
+ break;
+
+ /* GL_SGIX_pixel_texture */
+ case GL_PIXEL_TEX_GEN_SGIX:
+ ctx->Pixel.PixelTextureEnabled = state;
+ break;
+
default:
if (state) {
gl_error( ctx, GL_INVALID_ENUM, "glEnable" );
return GL_FALSE;
}
+ /* GL_SGIS_pixel_texture */
+ case GL_PIXEL_TEXTURE_SGIS:
+ return ctx->Pixel.PixelTextureEnabled;
+ break;
+
+ /* GL_SGIX_pixel_texture */
+ case GL_PIXEL_TEX_GEN_SGIX:
+ return ctx->Pixel.PixelTextureEnabled;
+ break;
+
default:
gl_error( ctx, GL_INVALID_ENUM, "glIsEnabled" );
return GL_FALSE;
-/* $Id: extensions.c,v 1.21 2000/03/28 16:59:39 rjfrank Exp $ */
+/* $Id: extensions.c,v 1.22 2000/04/07 16:27:26 brianp Exp $ */
/*
* Mesa 3-D graphics library
{ DEFAULT_OFF, "GL_EXT_vertex_array_set" },
{ DEFAULT_OFF, "GL_EXT_texture_env" },
{ DEFAULT_ON, "GL_EXT_texture_lod_bias" },
- { DEFAULT_OFF, "GL_HP_occlusion_test" }
+ { DEFAULT_OFF, "GL_HP_occlusion_test" },
+ { DEFAULT_ON, "GL_SGIS_pixel_texture" },
+ { DEFAULT_ON, "GL_SGIX_pixel_texture" }
};
-/* $Id: get.c,v 1.17 2000/04/04 15:14:10 brianp Exp $ */
+/* $Id: get.c,v 1.18 2000/04/07 16:27:26 brianp Exp $ */
/*
* Mesa 3-D graphics library
#endif
+static GLenum
+pixel_texgen_mode(const GLcontext *ctx)
+{
+ if (ctx->Pixel.FragmentRgbSource == GL_CURRENT_RASTER_POSITION) {
+ if (ctx->Pixel.FragmentAlphaSource == GL_CURRENT_RASTER_POSITION) {
+ return GL_RGBA;
+ }
+ else {
+ return GL_RGB;
+ }
+ }
+ else {
+ if (ctx->Pixel.FragmentAlphaSource == GL_CURRENT_RASTER_POSITION) {
+ return GL_ALPHA;
+ }
+ else {
+ return GL_NONE;
+ }
+ }
+}
+
+
void
_mesa_GetBooleanv( GLenum pname, GLboolean *params )
}
return;
+ /* GL_SGIS_pixel_texture */
+ case GL_PIXEL_TEXTURE_SGIS:
+ *params = ctx->Pixel.PixelTextureEnabled;
+ break;
+
+ /* GL_SGIX_pixel_texture */
+ case GL_PIXEL_TEX_GEN_SGIX:
+ *params = ctx->Pixel.PixelTextureEnabled;
+ break;
+ case GL_PIXEL_TEX_GEN_MODE_SGIX:
+ *params = (GLboolean) pixel_texgen_mode(ctx);
+ break;
+
default:
gl_error( ctx, GL_INVALID_ENUM, "glGetBooleanv" );
}
}
return;
+ /* GL_SGIS_pixel_texture */
+ case GL_PIXEL_TEXTURE_SGIS:
+ *params = (GLdouble) ctx->Pixel.PixelTextureEnabled;
+ break;
+
+ /* GL_SGIX_pixel_texture */
+ case GL_PIXEL_TEX_GEN_SGIX:
+ *params = (GLdouble) ctx->Pixel.PixelTextureEnabled;
+ break;
+ case GL_PIXEL_TEX_GEN_MODE_SGIX:
+ *params = (GLdouble) pixel_texgen_mode(ctx);
+ break;
+
default:
gl_error( ctx, GL_INVALID_ENUM, "glGetDoublev" );
}
}
return;
+ /* GL_SGIS_pixel_texture */
+ case GL_PIXEL_TEXTURE_SGIS:
+ *params = (GLfloat) ctx->Pixel.PixelTextureEnabled;
+ break;
+
+ /* GL_SGIX_pixel_texture */
+ case GL_PIXEL_TEX_GEN_SGIX:
+ *params = (GLfloat) ctx->Pixel.PixelTextureEnabled;
+ break;
+ case GL_PIXEL_TEX_GEN_MODE_SGIX:
+ *params = (GLfloat) pixel_texgen_mode(ctx);
+ break;
+
default:
gl_error( ctx, GL_INVALID_ENUM, "glGetFloatv" );
}
}
return;
+ /* GL_SGIS_pixel_texture */
+ case GL_PIXEL_TEXTURE_SGIS:
+ *params = (GLint) ctx->Pixel.PixelTextureEnabled;
+ break;
+
+ /* GL_SGIX_pixel_texture */
+ case GL_PIXEL_TEX_GEN_SGIX:
+ *params = (GLint) ctx->Pixel.PixelTextureEnabled;
+ break;
+ case GL_PIXEL_TEX_GEN_MODE_SGIX:
+ *params = (GLint) pixel_texgen_mode(ctx);
+ break;
+
default:
gl_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
}
-/* $Id: state.c,v 1.6 2000/04/01 05:42:06 brianp Exp $ */
+/* $Id: state.c,v 1.7 2000/04/07 16:27:26 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "mmath.h"
#include "pipeline.h"
#include "pixel.h"
+#include "pixeltex.h"
#include "points.h"
#include "polygon.h"
#include "quads.h"
exec->GetColorTableParameterfvEXT = _mesa_GetColorTableParameterfv;
exec->GetColorTableParameterivEXT = _mesa_GetColorTableParameteriv;
+ /* GL_SGIX_pixel_texture */
+ exec->PixelTexGenSGIX = _mesa_PixelTexGenSGIX;
+
+ /* GL_SGIS_pixel_texture */
+ exec->PixelTexGenParameteriSGIS = _mesa_PixelTexGenParameteriSGIS;
+ exec->PixelTexGenParameterivSGIS = _mesa_PixelTexGenParameterivSGIS;
+ exec->PixelTexGenParameterfSGIS = _mesa_PixelTexGenParameterfSGIS;
+ exec->PixelTexGenParameterfvSGIS = _mesa_PixelTexGenParameterfvSGIS;
+ exec->GetPixelTexGenParameterivSGIS = _mesa_GetPixelTexGenParameterivSGIS;
+ exec->GetPixelTexGenParameterfvSGIS = _mesa_GetPixelTexGenParameterfvSGIS;
+
/* GL_EXT_compiled_vertex_array */
exec->LockArraysEXT = _mesa_LockArraysEXT;
exec->UnlockArraysEXT = _mesa_UnlockArraysEXT;