added GL_SGIX/SGIS_pixel_texture extension
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
/* $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
|
* Mesa 3-D graphics library
|
||||||
@@ -177,6 +177,8 @@ _mesa_PushAttrib(GLbitfield mask)
|
|||||||
attr->Lighting = ctx->Light.Enabled;
|
attr->Lighting = ctx->Light.Enabled;
|
||||||
attr->LineSmooth = ctx->Line.SmoothFlag;
|
attr->LineSmooth = ctx->Line.SmoothFlag;
|
||||||
attr->LineStipple = ctx->Line.StippleFlag;
|
attr->LineStipple = ctx->Line.StippleFlag;
|
||||||
|
attr->Histogram = ctx->Pixel.HistogramEnabled;
|
||||||
|
attr->MinMax = ctx->Pixel.MinMaxEnabled;
|
||||||
attr->IndexLogicOp = ctx->Color.IndexLogicOpEnabled;
|
attr->IndexLogicOp = ctx->Color.IndexLogicOpEnabled;
|
||||||
attr->ColorLogicOp = ctx->Color.ColorLogicOpEnabled;
|
attr->ColorLogicOp = ctx->Color.ColorLogicOpEnabled;
|
||||||
attr->Map1Color4 = ctx->Eval.Map1Color4;
|
attr->Map1Color4 = ctx->Eval.Map1Color4;
|
||||||
@@ -198,6 +200,7 @@ _mesa_PushAttrib(GLbitfield mask)
|
|||||||
attr->Map2Vertex3 = ctx->Eval.Map2Vertex3;
|
attr->Map2Vertex3 = ctx->Eval.Map2Vertex3;
|
||||||
attr->Map2Vertex4 = ctx->Eval.Map2Vertex4;
|
attr->Map2Vertex4 = ctx->Eval.Map2Vertex4;
|
||||||
attr->Normalize = ctx->Transform.Normalize;
|
attr->Normalize = ctx->Transform.Normalize;
|
||||||
|
attr->PixelTexture = ctx->Pixel.PixelTextureEnabled;
|
||||||
attr->PointSmooth = ctx->Point.SmoothFlag;
|
attr->PointSmooth = ctx->Point.SmoothFlag;
|
||||||
attr->PolygonOffsetPoint = ctx->Polygon.OffsetPoint;
|
attr->PolygonOffsetPoint = ctx->Polygon.OffsetPoint;
|
||||||
attr->PolygonOffsetLine = ctx->Polygon.OffsetLine;
|
attr->PolygonOffsetLine = ctx->Polygon.OffsetLine;
|
||||||
@@ -531,6 +534,7 @@ _mesa_PopAttrib(void)
|
|||||||
TEST_AND_UPDATE(ctx->Eval.Map2Vertex4, enable->Map2Vertex4, GL_MAP2_VERTEX_4);
|
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.Normalize, enable->Normalize, GL_NORMALIZE);
|
||||||
TEST_AND_UPDATE(ctx->Transform.RescaleNormals, enable->RescaleNormals, GL_RESCALE_NORMAL_EXT);
|
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->Point.SmoothFlag, enable->PointSmooth, GL_POINT_SMOOTH);
|
||||||
TEST_AND_UPDATE(ctx->Polygon.OffsetPoint, enable->PolygonOffsetPoint, GL_POLYGON_OFFSET_POINT);
|
TEST_AND_UPDATE(ctx->Polygon.OffsetPoint, enable->PolygonOffsetPoint, GL_POLYGON_OFFSET_POINT);
|
||||||
TEST_AND_UPDATE(ctx->Polygon.OffsetLine, enable->PolygonOffsetLine, GL_POLYGON_OFFSET_LINE);
|
TEST_AND_UPDATE(ctx->Polygon.OffsetLine, enable->PolygonOffsetLine, GL_POLYGON_OFFSET_LINE);
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $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
|
* Mesa 3-D graphics library
|
||||||
@@ -1115,6 +1115,11 @@ static void init_attrib_groups( GLcontext *ctx )
|
|||||||
ctx->Pixel.MapGtoG[0] = 0.0;
|
ctx->Pixel.MapGtoG[0] = 0.0;
|
||||||
ctx->Pixel.MapBtoB[0] = 0.0;
|
ctx->Pixel.MapBtoB[0] = 0.0;
|
||||||
ctx->Pixel.MapAtoA[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 */
|
/* Point group */
|
||||||
ctx->Point.SmoothFlag = GL_FALSE;
|
ctx->Point.SmoothFlag = GL_FALSE;
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $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
|
* Mesa 3-D graphics library
|
||||||
@@ -37,9 +37,11 @@
|
|||||||
#include "mem.h"
|
#include "mem.h"
|
||||||
#include "mmath.h"
|
#include "mmath.h"
|
||||||
#include "pixel.h"
|
#include "pixel.h"
|
||||||
|
#include "pixeltex.h"
|
||||||
#include "span.h"
|
#include "span.h"
|
||||||
#include "state.h"
|
#include "state.h"
|
||||||
#include "stencil.h"
|
#include "stencil.h"
|
||||||
|
#include "texture.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "zoom.h"
|
#include "zoom.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -125,6 +127,7 @@ simple_DrawPixels( GLcontext *ctx, GLint x, GLint y,
|
|||||||
&& ctx->Pixel.AlphaBias==0.0 && ctx->Pixel.AlphaScale==1.0
|
&& ctx->Pixel.AlphaBias==0.0 && ctx->Pixel.AlphaScale==1.0
|
||||||
&& ctx->Pixel.IndexShift==0 && ctx->Pixel.IndexOffset==0
|
&& ctx->Pixel.IndexShift==0 && ctx->Pixel.IndexOffset==0
|
||||||
&& ctx->Pixel.MapColorFlag==0
|
&& ctx->Pixel.MapColorFlag==0
|
||||||
|
&& ctx->Texture.ReallyEnabled == 0
|
||||||
&& unpack->Alignment==1
|
&& unpack->Alignment==1
|
||||||
&& !unpack->SwapBytes
|
&& !unpack->SwapBytes
|
||||||
&& !unpack->LsbFirst) {
|
&& !unpack->LsbFirst) {
|
||||||
@@ -645,6 +648,17 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y,
|
|||||||
_mesa_unpack_ubyte_color_span(ctx, width, GL_RGBA, (void*) rgba,
|
_mesa_unpack_ubyte_color_span(ctx, width, GL_RGBA, (void*) rgba,
|
||||||
format, type, source, unpack, GL_TRUE);
|
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) {
|
if (quickDraw) {
|
||||||
(*ctx->Driver.WriteRGBASpan)( ctx, width, x, y,
|
(*ctx->Driver.WriteRGBASpan)( ctx, width, x, y,
|
||||||
(CONST GLubyte (*)[]) rgba, NULL);
|
(CONST GLubyte (*)[]) rgba, NULL);
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $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
|
* Mesa 3-D graphics library
|
||||||
@@ -467,6 +467,16 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
|
|||||||
}
|
}
|
||||||
break;
|
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:
|
default:
|
||||||
if (state) {
|
if (state) {
|
||||||
gl_error( ctx, GL_INVALID_ENUM, "glEnable" );
|
gl_error( ctx, GL_INVALID_ENUM, "glEnable" );
|
||||||
@@ -671,6 +681,16 @@ _mesa_IsEnabled( GLenum cap )
|
|||||||
return GL_FALSE;
|
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:
|
default:
|
||||||
gl_error( ctx, GL_INVALID_ENUM, "glIsEnabled" );
|
gl_error( ctx, GL_INVALID_ENUM, "glIsEnabled" );
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $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
|
* Mesa 3-D graphics library
|
||||||
@@ -78,7 +78,9 @@ static struct { int enabled; const char *name; } default_extensions[] = {
|
|||||||
{ DEFAULT_OFF, "GL_EXT_vertex_array_set" },
|
{ DEFAULT_OFF, "GL_EXT_vertex_array_set" },
|
||||||
{ DEFAULT_OFF, "GL_EXT_texture_env" },
|
{ DEFAULT_OFF, "GL_EXT_texture_env" },
|
||||||
{ DEFAULT_ON, "GL_EXT_texture_lod_bias" },
|
{ 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" }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $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
|
* Mesa 3-D graphics library
|
||||||
@@ -58,6 +58,28 @@
|
|||||||
#endif
|
#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
|
void
|
||||||
_mesa_GetBooleanv( GLenum pname, GLboolean *params )
|
_mesa_GetBooleanv( GLenum pname, GLboolean *params )
|
||||||
@@ -1042,6 +1064,19 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
|
|||||||
}
|
}
|
||||||
return;
|
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:
|
default:
|
||||||
gl_error( ctx, GL_INVALID_ENUM, "glGetBooleanv" );
|
gl_error( ctx, GL_INVALID_ENUM, "glGetBooleanv" );
|
||||||
}
|
}
|
||||||
@@ -2034,6 +2069,19 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
|
|||||||
}
|
}
|
||||||
return;
|
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:
|
default:
|
||||||
gl_error( ctx, GL_INVALID_ENUM, "glGetDoublev" );
|
gl_error( ctx, GL_INVALID_ENUM, "glGetDoublev" );
|
||||||
}
|
}
|
||||||
@@ -3003,6 +3051,19 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
|
|||||||
}
|
}
|
||||||
return;
|
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:
|
default:
|
||||||
gl_error( ctx, GL_INVALID_ENUM, "glGetFloatv" );
|
gl_error( ctx, GL_INVALID_ENUM, "glGetFloatv" );
|
||||||
}
|
}
|
||||||
@@ -3995,6 +4056,19 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
|
|||||||
}
|
}
|
||||||
return;
|
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:
|
default:
|
||||||
gl_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
|
gl_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $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
|
* Mesa 3-D graphics library
|
||||||
@@ -64,6 +64,7 @@
|
|||||||
#include "mmath.h"
|
#include "mmath.h"
|
||||||
#include "pipeline.h"
|
#include "pipeline.h"
|
||||||
#include "pixel.h"
|
#include "pixel.h"
|
||||||
|
#include "pixeltex.h"
|
||||||
#include "points.h"
|
#include "points.h"
|
||||||
#include "polygon.h"
|
#include "polygon.h"
|
||||||
#include "quads.h"
|
#include "quads.h"
|
||||||
@@ -525,6 +526,17 @@ _mesa_init_exec_table(struct _glapi_table *exec)
|
|||||||
exec->GetColorTableParameterfvEXT = _mesa_GetColorTableParameterfv;
|
exec->GetColorTableParameterfvEXT = _mesa_GetColorTableParameterfv;
|
||||||
exec->GetColorTableParameterivEXT = _mesa_GetColorTableParameteriv;
|
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 */
|
/* GL_EXT_compiled_vertex_array */
|
||||||
exec->LockArraysEXT = _mesa_LockArraysEXT;
|
exec->LockArraysEXT = _mesa_LockArraysEXT;
|
||||||
exec->UnlockArraysEXT = _mesa_UnlockArraysEXT;
|
exec->UnlockArraysEXT = _mesa_UnlockArraysEXT;
|
||||||
|
Reference in New Issue
Block a user