Initial work on GL_MESA_sprite_point extension.
Still need to resolve clipping issues, finalize the spec.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: context.c,v 1.110 2000/11/27 18:22:13 brianp Exp $ */
|
/* $Id: context.c,v 1.111 2000/12/08 00:20:15 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -1094,6 +1094,7 @@ init_attrib_groups( GLcontext *ctx )
|
|||||||
ctx->Point.MinSize = 0.0;
|
ctx->Point.MinSize = 0.0;
|
||||||
ctx->Point.MaxSize = ctx->Const.MaxPointSize;
|
ctx->Point.MaxSize = ctx->Const.MaxPointSize;
|
||||||
ctx->Point.Threshold = 1.0;
|
ctx->Point.Threshold = 1.0;
|
||||||
|
ctx->Point.SpriteMode = GL_FALSE; /* GL_MESA_sprite_point */
|
||||||
|
|
||||||
/* Polygon group */
|
/* Polygon group */
|
||||||
ctx->Polygon.CullFlag = GL_FALSE;
|
ctx->Polygon.CullFlag = GL_FALSE;
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: enable.c,v 1.35 2000/11/27 18:59:09 brianp Exp $ */
|
/* $Id: enable.c,v 1.36 2000/12/08 00:20:15 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -503,46 +503,90 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
|
|||||||
|
|
||||||
/* GL_SGIS_pixel_texture */
|
/* GL_SGIS_pixel_texture */
|
||||||
case GL_PIXEL_TEXTURE_SGIS:
|
case GL_PIXEL_TEXTURE_SGIS:
|
||||||
/* XXX check for extension */
|
if (ctx->Extensions.SGIS_pixel_texture) {
|
||||||
ctx->Pixel.PixelTextureEnabled = state;
|
ctx->Pixel.PixelTextureEnabled = state;
|
||||||
ctx->NewState |= _NEW_PIXEL;
|
ctx->NewState |= _NEW_PIXEL;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
gl_error( ctx, GL_INVALID_ENUM, state ? "glEnable": "glDisable" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* GL_SGIX_pixel_texture */
|
/* GL_SGIX_pixel_texture */
|
||||||
case GL_PIXEL_TEX_GEN_SGIX:
|
case GL_PIXEL_TEX_GEN_SGIX:
|
||||||
/* XXX check for extension */
|
if (ctx->Extensions.SGIX_pixel_texture) {
|
||||||
ctx->Pixel.PixelTextureEnabled = state;
|
ctx->Pixel.PixelTextureEnabled = state;
|
||||||
ctx->NewState |= _NEW_PIXEL;
|
ctx->NewState |= _NEW_PIXEL;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
gl_error( ctx, GL_INVALID_ENUM, state ? "glEnable": "glDisable" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* GL_SGI_color_table */
|
/* GL_SGI_color_table */
|
||||||
case GL_COLOR_TABLE_SGI:
|
case GL_COLOR_TABLE_SGI:
|
||||||
/* XXX check for extension */
|
if (ctx->Extensions.SGI_color_table) {
|
||||||
ctx->Pixel.ColorTableEnabled = state;
|
ctx->Pixel.ColorTableEnabled = state;
|
||||||
ctx->NewState |= _NEW_PIXEL;
|
ctx->NewState |= _NEW_PIXEL;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
gl_error( ctx, GL_INVALID_ENUM, state ? "glEnable": "glDisable" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case GL_POST_CONVOLUTION_COLOR_TABLE_SGI:
|
case GL_POST_CONVOLUTION_COLOR_TABLE_SGI:
|
||||||
ctx->Pixel.PostConvolutionColorTableEnabled = state;
|
if (ctx->Extensions.SGI_color_table) {
|
||||||
ctx->NewState |= _NEW_PIXEL;
|
ctx->Pixel.PostConvolutionColorTableEnabled = state;
|
||||||
|
ctx->NewState |= _NEW_PIXEL;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
gl_error( ctx, GL_INVALID_ENUM, state ? "glEnable": "glDisable" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:
|
case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:
|
||||||
ctx->Pixel.PostColorMatrixColorTableEnabled = state;
|
if (ctx->Extensions.SGI_color_table) {
|
||||||
ctx->NewState |= _NEW_PIXEL;
|
ctx->Pixel.PostColorMatrixColorTableEnabled = state;
|
||||||
|
ctx->NewState |= _NEW_PIXEL;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
gl_error( ctx, GL_INVALID_ENUM, state ? "glEnable": "glDisable" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* GL_EXT_convolution */
|
/* GL_EXT_convolution */
|
||||||
case GL_CONVOLUTION_1D:
|
case GL_CONVOLUTION_1D:
|
||||||
/* XXX check for extension */
|
if (ctx->Extensions.EXT_convolution) {
|
||||||
ctx->Pixel.Convolution1DEnabled = state;
|
ctx->Pixel.Convolution1DEnabled = state;
|
||||||
ctx->NewState |= _NEW_PIXEL;
|
ctx->NewState |= _NEW_PIXEL;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
gl_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
|
||||||
|
return;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case GL_CONVOLUTION_2D:
|
case GL_CONVOLUTION_2D:
|
||||||
ctx->Pixel.Convolution2DEnabled = state;
|
if (ctx->Extensions.EXT_convolution) {
|
||||||
ctx->NewState |= _NEW_PIXEL;
|
ctx->Pixel.Convolution2DEnabled = state;
|
||||||
|
ctx->NewState |= _NEW_PIXEL;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
gl_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
|
||||||
|
return;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case GL_SEPARABLE_2D:
|
case GL_SEPARABLE_2D:
|
||||||
ctx->Pixel.Separable2DEnabled = state;
|
if (ctx->Extensions.EXT_convolution) {
|
||||||
ctx->NewState |= _NEW_PIXEL;
|
ctx->Pixel.Separable2DEnabled = state;
|
||||||
|
ctx->NewState |= _NEW_PIXEL;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
gl_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
|
||||||
|
return;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* GL_ARB_texture_cube_map */
|
/* GL_ARB_texture_cube_map */
|
||||||
@@ -568,12 +612,30 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
|
|||||||
|
|
||||||
/* GL_EXT_secondary_color */
|
/* GL_EXT_secondary_color */
|
||||||
case GL_COLOR_SUM_EXT:
|
case GL_COLOR_SUM_EXT:
|
||||||
ctx->Fog.ColorSumEnabled = state;
|
if (ctx->Extensions.EXT_secondary_color) {
|
||||||
if (state)
|
ctx->Fog.ColorSumEnabled = state;
|
||||||
SET_BITS(ctx->_TriangleCaps, DD_SEPERATE_SPECULAR);
|
if (state)
|
||||||
else if (ctx->Light.Model.ColorControl == GL_SINGLE_COLOR)
|
SET_BITS(ctx->_TriangleCaps, DD_SEPERATE_SPECULAR);
|
||||||
CLEAR_BITS(ctx->_TriangleCaps, DD_SEPERATE_SPECULAR);
|
else if (ctx->Light.Model.ColorControl == GL_SINGLE_COLOR)
|
||||||
ctx->NewState |= _NEW_FOG;
|
CLEAR_BITS(ctx->_TriangleCaps, DD_SEPERATE_SPECULAR);
|
||||||
|
ctx->NewState |= _NEW_FOG;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
gl_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* GL_MESA_sprite_point */
|
||||||
|
case GL_SPRITE_POINT_MESA:
|
||||||
|
if (ctx->Extensions.MESA_sprite_point) {
|
||||||
|
ctx->Point.SpriteMode = state;
|
||||||
|
ctx->NewState |= _NEW_POINT;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
gl_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
|
||||||
|
return;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -820,6 +882,10 @@ _mesa_IsEnabled( GLenum cap )
|
|||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* GL_MESA_sprite_point */
|
||||||
|
case GL_SPRITE_POINT_MESA:
|
||||||
|
return ctx->Point.SpriteMode;
|
||||||
|
|
||||||
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.42 2000/11/22 07:32:16 joukj Exp $ */
|
/* $Id: extensions.c,v 1.43 2000/12/08 00:20:15 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -95,6 +95,7 @@ static struct {
|
|||||||
{ ON, "GL_INGR_blend_func_separate", F(INGR_blend_func_separate) },
|
{ ON, "GL_INGR_blend_func_separate", F(INGR_blend_func_separate) },
|
||||||
{ ON, "GL_MESA_window_pos", F(MESA_window_pos) },
|
{ ON, "GL_MESA_window_pos", F(MESA_window_pos) },
|
||||||
{ ON, "GL_MESA_resize_buffers", F(MESA_resize_buffers) },
|
{ ON, "GL_MESA_resize_buffers", F(MESA_resize_buffers) },
|
||||||
|
{ OFF, "GL_MESA_sprite_point", F(MESA_sprite_point) },
|
||||||
{ OFF, "GL_NV_blend_square", F(NV_blend_square) },
|
{ OFF, "GL_NV_blend_square", F(NV_blend_square) },
|
||||||
{ ON, "GL_NV_texgen_reflection", F(NV_texgen_reflection) },
|
{ ON, "GL_NV_texgen_reflection", F(NV_texgen_reflection) },
|
||||||
{ ON, "GL_PGI_misc_hints", F(PGI_misc_hints) },
|
{ ON, "GL_PGI_misc_hints", F(PGI_misc_hints) },
|
||||||
@@ -121,6 +122,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx)
|
|||||||
gl_extensions_enable(ctx, "GL_EXT_texture_env_combine");
|
gl_extensions_enable(ctx, "GL_EXT_texture_env_combine");
|
||||||
gl_extensions_enable(ctx, "GL_HP_occlusion_test");
|
gl_extensions_enable(ctx, "GL_HP_occlusion_test");
|
||||||
gl_extensions_enable(ctx, "GL_NV_blend_square");
|
gl_extensions_enable(ctx, "GL_NV_blend_square");
|
||||||
|
gl_extensions_enable(ctx, "GL_MESA_sprite_point");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: get.c,v 1.44 2000/11/27 18:22:13 brianp Exp $ */
|
/* $Id: get.c,v 1.45 2000/12/08 00:20:15 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -1274,6 +1274,17 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
|
|||||||
*params = INT_TO_BOOL(ctx->Array.FogCoord.Stride);
|
*params = INT_TO_BOOL(ctx->Array.FogCoord.Stride);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/* GL_MESA_sprite_point */
|
||||||
|
case GL_SPRITE_POINT_MESA:
|
||||||
|
if (ctx->Extensions.MESA_sprite_point) {
|
||||||
|
*params = ctx->Point.SpriteMode;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
gl_error( ctx, GL_INVALID_ENUM, "glGetBooleanv" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
gl_error( ctx, GL_INVALID_ENUM, "glGetBooleanv" );
|
gl_error( ctx, GL_INVALID_ENUM, "glGetBooleanv" );
|
||||||
}
|
}
|
||||||
@@ -2472,6 +2483,16 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
|
|||||||
*params = (GLdouble) ctx->Array.FogCoord.Stride;
|
*params = (GLdouble) ctx->Array.FogCoord.Stride;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/* GL_MESA_sprite_point */
|
||||||
|
case GL_SPRITE_POINT_MESA:
|
||||||
|
if (ctx->Extensions.MESA_sprite_point) {
|
||||||
|
*params = (GLdouble) ctx->Point.SpriteMode;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
gl_error( ctx, GL_INVALID_ENUM, "glGetDoublev" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
gl_error( ctx, GL_INVALID_ENUM, "glGetDoublev" );
|
gl_error( ctx, GL_INVALID_ENUM, "glGetDoublev" );
|
||||||
@@ -3645,6 +3666,16 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
|
|||||||
*params = (GLfloat) ctx->Array.FogCoord.Stride;
|
*params = (GLfloat) ctx->Array.FogCoord.Stride;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/* GL_MESA_sprite_point */
|
||||||
|
case GL_SPRITE_POINT_MESA:
|
||||||
|
if (ctx->Extensions.MESA_sprite_point) {
|
||||||
|
*params = (GLfloat) ctx->Point.SpriteMode;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
gl_error( ctx, GL_INVALID_ENUM, "glGetFloatv" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
gl_error( ctx, GL_INVALID_ENUM, "glGetFloatv" );
|
gl_error( ctx, GL_INVALID_ENUM, "glGetFloatv" );
|
||||||
@@ -4834,19 +4865,50 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
|
|||||||
|
|
||||||
/* GL_EXT_fog_coord */
|
/* GL_EXT_fog_coord */
|
||||||
case GL_CURRENT_FOG_COORDINATE_EXT:
|
case GL_CURRENT_FOG_COORDINATE_EXT:
|
||||||
FLUSH_TNL( ctx, FLUSH_UPDATE_CURRENT );
|
if (ctx->Extensions.EXT_fog_coord) {
|
||||||
*params = (GLint) ctx->Current.FogCoord;
|
FLUSH_TNL( ctx, FLUSH_UPDATE_CURRENT );
|
||||||
|
*params = (GLint) ctx->Current.FogCoord;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
gl_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case GL_FOG_COORDINATE_ARRAY_EXT:
|
case GL_FOG_COORDINATE_ARRAY_EXT:
|
||||||
*params = (GLint) ctx->Array.FogCoord.Enabled;
|
if (ctx->Extensions.EXT_fog_coord) {
|
||||||
|
*params = (GLint) ctx->Array.FogCoord.Enabled;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
gl_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case GL_FOG_COORDINATE_ARRAY_TYPE_EXT:
|
case GL_FOG_COORDINATE_ARRAY_TYPE_EXT:
|
||||||
*params = (GLint) ctx->Array.FogCoord.Type;
|
if (ctx->Extensions.EXT_fog_coord) {
|
||||||
|
*params = (GLint) ctx->Array.FogCoord.Type;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
gl_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT:
|
case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT:
|
||||||
*params = (GLint) ctx->Array.FogCoord.Stride;
|
if (ctx->Extensions.EXT_fog_coord) {
|
||||||
|
*params = (GLint) ctx->Array.FogCoord.Stride;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
gl_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/* GL_MESA_sprite_point */
|
||||||
|
case GL_SPRITE_POINT_MESA:
|
||||||
|
if (ctx->Extensions.MESA_sprite_point) {
|
||||||
|
*params = (GLint) ctx->Point.SpriteMode;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
gl_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
gl_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
|
gl_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: mtypes.h,v 1.4 2000/11/28 00:07:51 brianp Exp $ */
|
/* $Id: mtypes.h,v 1.5 2000/12/08 00:20:15 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -602,6 +602,7 @@ struct gl_pixel_attrib {
|
|||||||
|
|
||||||
struct gl_point_attrib {
|
struct gl_point_attrib {
|
||||||
GLboolean SmoothFlag; /* True if GL_POINT_SMOOTH is enabled */
|
GLboolean SmoothFlag; /* True if GL_POINT_SMOOTH is enabled */
|
||||||
|
GLboolean SpriteMode; /* GL_MESA_sprite_point extension */
|
||||||
GLfloat Size; /* User-specified point size */
|
GLfloat Size; /* User-specified point size */
|
||||||
GLfloat _Size; /* Size clamped to Const.Min/MaxPointSize */
|
GLfloat _Size; /* Size clamped to Const.Min/MaxPointSize */
|
||||||
GLfloat Params[3]; /* GL_EXT_point_parameters */
|
GLfloat Params[3]; /* GL_EXT_point_parameters */
|
||||||
@@ -816,7 +817,7 @@ struct gl_texture_object {
|
|||||||
*/
|
*/
|
||||||
struct gl_texture_unit {
|
struct gl_texture_unit {
|
||||||
GLuint Enabled; /* bitmask of TEXTURE0_1D, _2D, _3D, _CUBE */
|
GLuint Enabled; /* bitmask of TEXTURE0_1D, _2D, _3D, _CUBE */
|
||||||
GLuint _ReallyEnabled; /* 0 or one of TEXTURE0_1D, _2D, _3D, _CUBE */
|
GLuint _ReallyEnabled; /* 0 or one of TEXTURE0_1D, _2D, _3D, _CUBE */
|
||||||
|
|
||||||
GLenum EnvMode; /* GL_MODULATE, GL_DECAL, GL_BLEND, etc. */
|
GLenum EnvMode; /* GL_MODULATE, GL_DECAL, GL_BLEND, etc. */
|
||||||
GLfloat EnvColor[4];
|
GLfloat EnvColor[4];
|
||||||
@@ -1214,6 +1215,7 @@ struct gl_extensions {
|
|||||||
GLboolean INGR_blend_func_separate;
|
GLboolean INGR_blend_func_separate;
|
||||||
GLboolean MESA_window_pos;
|
GLboolean MESA_window_pos;
|
||||||
GLboolean MESA_resize_buffers;
|
GLboolean MESA_resize_buffers;
|
||||||
|
GLboolean MESA_sprite_point;
|
||||||
GLboolean NV_blend_square;
|
GLboolean NV_blend_square;
|
||||||
GLboolean NV_texgen_reflection;
|
GLboolean NV_texgen_reflection;
|
||||||
GLboolean PGI_misc_hints;
|
GLboolean PGI_misc_hints;
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: points.c,v 1.24 2000/11/22 07:32:17 joukj Exp $ */
|
/* $Id: points.c,v 1.25 2000/12/08 00:20:15 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -88,6 +88,7 @@ _mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params)
|
|||||||
if (tmp != ctx->Point._Attenuated) {
|
if (tmp != ctx->Point._Attenuated) {
|
||||||
ctx->_Enabled ^= ENABLE_POINT_ATTEN;
|
ctx->_Enabled ^= ENABLE_POINT_ATTEN;
|
||||||
ctx->_TriangleCaps ^= DD_POINT_ATTEN;
|
ctx->_TriangleCaps ^= DD_POINT_ATTEN;
|
||||||
|
/* XXX why is this here and not in state.c? */
|
||||||
ctx->_NeedEyeCoords ^= NEED_EYE_POINT_ATTEN;
|
ctx->_NeedEyeCoords ^= NEED_EYE_POINT_ATTEN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: state.c,v 1.50 2000/11/28 00:07:51 brianp Exp $ */
|
/* $Id: state.c,v 1.51 2000/12/08 00:20:15 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -781,6 +781,13 @@ void gl_update_state( GLcontext *ctx )
|
|||||||
ctx->_NeedEyeCoords |= NEED_EYE_LIGHT_MODELVIEW;
|
ctx->_NeedEyeCoords |= NEED_EYE_LIGHT_MODELVIEW;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* point attenuation requires eye coords */
|
||||||
|
if (new_state & _NEW_POINT) {
|
||||||
|
if (ctx->Point._Attenuated) {
|
||||||
|
ctx->_NeedEyeCoords |= NEED_EYE_POINT_ATTEN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* ctx->_NeedEyeCoords and ctx->_NeedEyeNormals are now uptodate.
|
/* ctx->_NeedEyeCoords and ctx->_NeedEyeNormals are now uptodate.
|
||||||
*
|
*
|
||||||
* If the truth value of either has changed, update for the new
|
* If the truth value of either has changed, update for the new
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: s_points.c,v 1.8 2000/12/08 00:18:39 brianp Exp $ */
|
/* $Id: s_points.c,v 1.9 2000/12/08 00:20:15 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -838,6 +838,60 @@ dist_atten_antialiased_rgba_point( GLcontext *ctx, const SWvertex *vert )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Sprite (textured point)
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
sprite_point( GLcontext *ctx, const SWvertex *vert )
|
||||||
|
{
|
||||||
|
SWcontext *swctx = SWRAST_CONTEXT(ctx);
|
||||||
|
const GLfloat radius = vert->pointSize; /* XXX threshold, alpha */
|
||||||
|
SWvertex v0, v1, v2, v3;
|
||||||
|
GLuint unit;
|
||||||
|
|
||||||
|
/* lower left corner */
|
||||||
|
v0 = *vert;
|
||||||
|
v0.win[0] -= radius;
|
||||||
|
v0.win[1] -= radius;
|
||||||
|
|
||||||
|
/* lower right corner */
|
||||||
|
v1 = *vert;
|
||||||
|
v1.win[0] += radius;
|
||||||
|
v1.win[1] -= radius;
|
||||||
|
|
||||||
|
/* upper right corner */
|
||||||
|
v2 = *vert;
|
||||||
|
v2.win[0] += radius;
|
||||||
|
v2.win[1] += radius;
|
||||||
|
|
||||||
|
/* upper left corner */
|
||||||
|
v3 = *vert;
|
||||||
|
v3.win[0] -= radius;
|
||||||
|
v3.win[1] += radius;
|
||||||
|
|
||||||
|
for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
|
||||||
|
if (ctx->Texture.Unit[unit]._ReallyEnabled) {
|
||||||
|
v0.texcoord[unit][0] = 0.0;
|
||||||
|
v0.texcoord[unit][1] = 0.0;
|
||||||
|
v1.texcoord[unit][0] = 1.0;
|
||||||
|
v1.texcoord[unit][1] = 0.0;
|
||||||
|
v2.texcoord[unit][0] = 1.0;
|
||||||
|
v2.texcoord[unit][1] = 1.0;
|
||||||
|
v3.texcoord[unit][0] = 0.0;
|
||||||
|
v3.texcoord[unit][1] = 1.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* XXX if radius < threshold, attenuate alpha? */
|
||||||
|
/* XXX what about clipping? */
|
||||||
|
|
||||||
|
/* render */
|
||||||
|
swctx->Triangle(ctx, &v0, &v1, &v2);
|
||||||
|
swctx->Triangle(ctx, &v0, &v2, &v3);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
extern void
|
extern void
|
||||||
@@ -889,7 +943,11 @@ _swrast_choose_point( GLcontext *ctx )
|
|||||||
GLboolean rgbmode = ctx->Visual.RGBAflag;
|
GLboolean rgbmode = ctx->Visual.RGBAflag;
|
||||||
|
|
||||||
if (ctx->RenderMode==GL_RENDER) {
|
if (ctx->RenderMode==GL_RENDER) {
|
||||||
if (!ctx->Point._Attenuated) {
|
if (ctx->Point.SpriteMode) {
|
||||||
|
/* XXX this is hacked in! */
|
||||||
|
swrast->Point = sprite_point;
|
||||||
|
}
|
||||||
|
else if (!ctx->Point._Attenuated) {
|
||||||
if (ctx->Point.SmoothFlag && rgbmode) {
|
if (ctx->Point.SmoothFlag && rgbmode) {
|
||||||
swrast->Point = antialiased_rgba_point;
|
swrast->Point = antialiased_rgba_point;
|
||||||
}
|
}
|
||||||
@@ -943,3 +1001,54 @@ _swrast_choose_point( GLcontext *ctx )
|
|||||||
/*_mesa_print_points_function(ctx);*/
|
/*_mesa_print_points_function(ctx);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if 000 /* prototype of new point code */
|
||||||
|
|
||||||
|
#define RGBA 0x1
|
||||||
|
#define SMOOTH 0x2
|
||||||
|
#define LARGE 0x4
|
||||||
|
#define TEXTURE 0x8
|
||||||
|
#define ATTENUATE 0x10
|
||||||
|
#define SPRITE 0x20
|
||||||
|
|
||||||
|
#define FLAGS (RGBA | SMOOTH | LARGE)
|
||||||
|
#define NAME rgba_smooth_large
|
||||||
|
#include "s_pointtemp.h"
|
||||||
|
|
||||||
|
#define FLAGS (RGBA | TEXTURE | ATTENUATE)
|
||||||
|
#define NAME rgba_texture_smooth_attenuate
|
||||||
|
#include "s_pointtemp.h"
|
||||||
|
|
||||||
|
#define FLAGS (INDEX | LARGE | ATTENUATE)
|
||||||
|
#define NAME index_large_attenuate
|
||||||
|
#include "s_pointtemp.h"
|
||||||
|
|
||||||
|
|
||||||
|
static void* point_tab[0x20];
|
||||||
|
|
||||||
|
void
|
||||||
|
_swrast_choose_point( GLcontext *ctx )
|
||||||
|
{
|
||||||
|
GLuint index = 0;
|
||||||
|
|
||||||
|
if (ctx->RenderMode==GL_RENDER) {
|
||||||
|
if (ctx->Visual.RGBAflag)
|
||||||
|
index |= RGBA;
|
||||||
|
if (ctx->Point.SmoothFlag)
|
||||||
|
index |= SMOOTH;
|
||||||
|
if (ctx->Point._Attenuated || ctx->Point.Size > 1.0)
|
||||||
|
index |= SIZED;
|
||||||
|
if (ctx->Texture.ReallyEnabled)
|
||||||
|
index |= TEXTURE;
|
||||||
|
swrast->Point = point_tab[index];
|
||||||
|
}
|
||||||
|
else if (ctx->RenderMode==GL_FEEDBACK) {
|
||||||
|
swrast->Point = gl_feedback_point;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/* GL_SELECT mode */
|
||||||
|
swrast->Point = gl_select_point;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
Reference in New Issue
Block a user