-# $Id: Makefile.X11,v 1.27 2000/10/31 18:09:44 keithw Exp $
+# $Id: Makefile.X11,v 1.28 2000/11/05 18:40:57 keithw Exp $
# Mesa 3-D graphics library
# Version: 3.5
swrast/s_context.c \
swrast/s_depth.c \
swrast/s_drawpix.c \
+ swrast/s_feedback.c \
swrast/s_fog.c \
swrast/s_imaging.c \
swrast/s_lines.c \
swrast/s_stencil.c \
swrast/s_texture.c \
swrast/s_triangle.c \
- swrast/s_zoom.c
+ swrast/s_zoom.c \
+ swrast_setup/ss_context.c \
+ swrast_setup/ss_triangle.c \
+ swrast_setup/ss_vb.c
+
+
DRIVER_SOURCES = \
+ FX/fxapi.c \
+ FX/fxdd.c \
+ FX/fxddspan.c \
+ FX/fxddtex.c \
+ FX/fxfastpath.c \
+ FX/fxpipeline.c \
+ FX/fxsetup.c \
+ FX/fxtexman.c \
+ FX/fxtrifuncs.c \
+ FX/fxvsetup.c \
+ FX/fxglidew.c \
X/glxapi.c \
X/fakeglx.c \
X/xfonts.c \
SVGA/svgamesa16.c \
SVGA/svgamesa24.c \
SVGA/svgamesa32.c \
- FX/fxapi.c \
- FX/fxclip.c \
- FX/fxdd.c \
- FX/fxddspan.c \
- FX/fxddtex.c \
- FX/fxfastpath.c \
- FX/fxpipeline.c \
- FX/fxrender.c \
- FX/fxsanity.c \
- FX/fxsetup.c \
- FX/fxtexman.c \
- FX/fxtrifuncs.c \
- FX/fxvsetup.c \
- FX/fxglidew.c \
Trace/tr_2string.c \
Trace/tr_attrib.c \
Trace/tr_context.c \
ADDITIONAL_OBJ =
OBJECTS = $(ASM_SOURCES:.S=.o) \
- $(CORE_SOURCES:.c=.o) \
$(DRIVER_SOURCES:.c=.o) \
+ $(CORE_SOURCES:.c=.o) \
$(ADDITIONAL_OBJ)
DPF(( DBG_FUNC, "RenderTriangleVB" ));
- if ( (!(ctx->IndirectTriangles & DD_SW_SETUP)) && !VB->ClipOrMask )
+ if ( !VB->ClipOrMask )
{
DPF(( DBG_PRIM_INFO, "DirectTriangles( %d )", (end-start) ));
for( index = start, cVertex = 0; index < end; )
DPF(( DBG_FUNC, "RenderTriangleFanVB();" ));
/* Special case that we can blast the fan without culling, offset, etc... */
- if ( (!(ctx->IndirectTriangles & DD_SW_SETUP)) && !VB->ClipOrMask && (ctx->Light.ShadeModel != GL_FLAT) )
+ if ( !VB->ClipOrMask && (ctx->Light.ShadeModel != GL_FLAT) )
{
DPF(( DBG_PRIM_INFO, "DirectTriangles( %d )", (end-start) ));
DPF(( DBG_FUNC, "RenderTriangleStripVB();" ));
/* Special case that we can blast the fan without culling, offset, etc... */
- if ( (!(ctx->IndirectTriangles & DD_SW_SETUP)) && !VB->ClipOrMask && (ctx->Light.ShadeModel != GL_FLAT) )
+ if ( !VB->ClipOrMask && (ctx->Light.ShadeModel != GL_FLAT) )
{
DPF(( DBG_PRIM_PROFILE, "DirectTriangles" ));
#define v3 (index+2)
#define v4 (index+3)
- if ( (!(ctx->IndirectTriangles & DD_SW_SETUP)) && !VB->ClipOrMask )
+ if ( !VB->ClipOrMask )
{
DPF(( DBG_PRIM_PROFILE, "DirectTriangles" ));
/*================================================*/
/* Check too see if there are new TEXTURE states. */
/*================================================*/
- if ( ctx->Texture.ReallyEnabled )
+ if ( ctx->Texture._ReallyEnabled )
{
switch( ctx->Texture.Set[ctx->Texture.CurrentSet].EnvMode )
{
/*================================================*/
/* Check too see if there are new TEXTURE states. */
/*================================================*/
- if ( texture != ctx->Texture.ReallyEnabled )
+ if ( texture != ctx->Texture._ReallyEnabled )
{
- texture = ctx->Texture.ReallyEnabled;
+ texture = ctx->Texture._ReallyEnabled;
DPF(( 0, "\tTexture\t\t%s", (texture) ? "ENABLED" : "--------" ));
}
if (ctx->Stencil.Enabled) return NULL;
if (ctx->Polygon.SmoothFlag) return NULL;
if (ctx->Polygon.StippleFlag) return NULL;
- if (ctx->Texture.ReallyEnabled) return NULL;
+ if (ctx->Texture._ReallyEnabled) return NULL;
if (ctx->Light.ShadeModel==GL_SMOOTH) return NULL;
if (ctx->Depth.Test && ctx->Depth.Func != GL_LESS) return NULL;
-/* $Id: wmesa.c,v 1.9 2000/09/28 22:44:32 brianp Exp $ */
+/* $Id: wmesa.c,v 1.10 2000/11/05 18:41:00 keithw Exp $ */
/*
* Windows (Win32) device driver for Mesa 3.4
extern points_func choose_points_function( GLcontext* ctx )
{
STARTPROFILE
- if (ctx->Point.Size==1.0 && !ctx->Point.SmoothFlag && ctx->RasterMask==0
- && !ctx->Texture.ReallyEnabled && ctx->Visual->RGBAflag) {
+ if (ctx->Point.Size==1.0 && !ctx->Point.SmoothFlag && ctx->_RasterMask==0
+ && !ctx->Texture._ReallyEnabled && ctx->Visual->RGBAflag) {
ENDPROFILE(choose_points_function)
return fast_rgb_points;
}
{
STARTPROFILE
if (ctx->Line.Width==1.0 && !ctx->Line.SmoothFlag && !ctx->Line.StippleFlag
- && ctx->Light.ShadeModel==GL_FLAT && ctx->RasterMask==0
- && !ctx->Texture.ReallyEnabled && Current->rgb_flag) {
+ && ctx->Light.ShadeModel==GL_FLAT && ctx->_RasterMask==0
+ && !ctx->Texture._ReallyEnabled && Current->rgb_flag) {
ENDPROFILE(choose_line_function)
return fast_flat_rgb_line;
}
int depth = wmesa->cColorBits;
if (ctx->Polygon.SmoothFlag) return NULL;
- if (ctx->Texture.ReallyEnabled) return NULL;
+ if (ctx->Texture._ReallyEnabled) return NULL;
if (!wmesa->db_flag) return NULL;
/*if (wmesa->xm_buffer->buffer==XIMAGE)*/ {
if ( ctx->Light.ShadeModel==GL_SMOOTH
- && ctx->RasterMask==DEPTH_BIT
+ && ctx->_RasterMask==DEPTH_BIT
&& ctx->Depth.Func==GL_LESS
&& ctx->Depth.Mask==GL_TRUE
&& ctx->Polygon.StippleFlag==GL_FALSE) {
}
}
if ( ctx->Light.ShadeModel==GL_FLAT
- && ctx->RasterMask==DEPTH_BIT
+ && ctx->_RasterMask==DEPTH_BIT
&& ctx->Depth.Func==GL_LESS
&& ctx->Depth.Mask==GL_TRUE
&& ctx->Polygon.StippleFlag==GL_FALSE) {
return NULL;
}
}
- if ( ctx->RasterMask==0 /* no depth test */
+ if ( ctx->_RasterMask==0 /* no depth test */
&& ctx->Light.ShadeModel==GL_SMOOTH
&& ctx->Polygon.StippleFlag==GL_FALSE) {
switch (wmesa->pixelformat) {
}
}
- if ( ctx->RasterMask==0 /* no depth test */
+ if ( ctx->_RasterMask==0 /* no depth test */
&& ctx->Light.ShadeModel==GL_FLAT
&& ctx->Polygon.StippleFlag==GL_FALSE) {
switch (wmesa->pixelformat) {
-/* $Id: wmesaBackup.c,v 1.1 1999/08/19 00:55:42 jtg Exp $ */
+/* $Id: wmesaBackup.c,v 1.2 2000/11/05 18:41:00 keithw Exp $ */
/*
* File name : wmesa.c
/*
* $Log: wmesaBackup.c,v $
- * Revision 1.1 1999/08/19 00:55:42 jtg
- * Initial revision
+ * Revision 1.2 2000/11/05 18:41:00 keithw
+ * - Changes for new software rasterizer modules
+ * - Remove support for choosing software fallbacks from core code
+ * - Remove partial fallback code from vbrender.c -- drivers are now
+ * expected to be able to find a triangle/quad function for every state,
+ * even if they have to use _swsetup_Triangle or _swsetup_Quad.
+ * - Marked derived variables in the GLcontext struct with a leading
+ * underscore '_'.
+ *
+ * Revision 1.1.1.1 1999/08/19 00:55:42 jtg
+ * Imported sources
*
* Revision 1.1 1999/01/03 03:08:57 brianp
* Initial revision
extern points_func choose_points_function( GLcontext* ctx )
{
STARTPROFILE
- if (ctx->Point.Size==1.0 && !ctx->Point.SmoothFlag && ctx->RasterMask==0
+ if (ctx->Point.Size==1.0 && !ctx->Point.SmoothFlag && ctx->_RasterMask==0
&& !ctx->Texture.Enabled && ctx->Visual->RGBAflag) {
ENDPROFILE(choose_points_function)
return fast_rgb_points;
{
STARTPROFILE
if (ctx->Line.Width==1.0 && !ctx->Line.SmoothFlag && !ctx->Line.StippleFlag
- && ctx->Light.ShadeModel==GL_FLAT && ctx->RasterMask==0
+ && ctx->Light.ShadeModel==GL_FLAT && ctx->_RasterMask==0
&& !ctx->Texture.Enabled && Current->rgb_flag) {
ENDPROFILE(choose_line_function)
return fast_flat_rgb_line;
if (!wmesa->db_flag) return NULL;
/*if (wmesa->xm_buffer->buffer==XIMAGE)*/ {
if ( ctx->Light.ShadeModel==GL_SMOOTH
- && ctx->RasterMask==DEPTH_BIT
+ && ctx->_RasterMask==DEPTH_BIT
&& ctx->Depth.Func==GL_LESS
&& ctx->Depth.Mask==GL_TRUE
&& ctx->Polygon.StippleFlag==GL_FALSE) {
}
}
if ( ctx->Light.ShadeModel==GL_FLAT
- && ctx->RasterMask==DEPTH_BIT
+ && ctx->_RasterMask==DEPTH_BIT
&& ctx->Depth.Func==GL_LESS
&& ctx->Depth.Mask==GL_TRUE
&& ctx->Polygon.StippleFlag==GL_FALSE) {
return NULL;
}
}
- if ( ctx->RasterMask==0 /* no depth test */
+ if ( ctx->_RasterMask==0 /* no depth test */
&& ctx->Light.ShadeModel==GL_SMOOTH
&& ctx->Polygon.StippleFlag==GL_FALSE) {
switch (wmesa->pixelformat) {
}
}
- if ( ctx->RasterMask==0 /* no depth test */
+ if ( ctx->_RasterMask==0 /* no depth test */
&& ctx->Light.ShadeModel==GL_FLAT
&& ctx->Polygon.StippleFlag==GL_FALSE) {
switch (wmesa->pixelformat) {
\r
/*\r
* $Log: wmesaOld.c,v $
- * Revision 1.1 1999/08/19 00:55:42 jtg
- * Initial revision
+ * Revision 1.2 2000/11/05 18:41:00 keithw
+ * - Changes for new software rasterizer modules
+ * - Remove support for choosing software fallbacks from core code
+ * - Remove partial fallback code from vbrender.c -- drivers are now
+ * expected to be able to find a triangle/quad function for every state,
+ * even if they have to use _swsetup_Triangle or _swsetup_Quad.
+ * - Marked derived variables in the GLcontext struct with a leading
+ * underscore '_'.
+ *
+ * Revision 1.1.1.1 1999/08/19 00:55:42 jtg
+ * Imported sources
*
* Revision 1.2 1999/01/03 03:08:57 brianp
* Ted Jump's changes
extern points_func choose_points_function( GLcontext* ctx )\r
{\r
STARTPROFILE\r
- if (ctx->Point.Size==1.0 && !ctx->Point.SmoothFlag && ctx->RasterMask==0\r
+ if (ctx->Point.Size==1.0 && !ctx->Point.SmoothFlag && ctx->_RasterMask==0\r
&& !ctx->Texture.Enabled && ctx->Visual->RGBAflag) {\r
ENDPROFILE(choose_points_function)\r
return fast_rgb_points;\r
{\r
STARTPROFILE\r
if (ctx->Line.Width==1.0 && !ctx->Line.SmoothFlag && !ctx->Line.StippleFlag\r
- && ctx->Light.ShadeModel==GL_FLAT && ctx->RasterMask==0\r
+ && ctx->Light.ShadeModel==GL_FLAT && ctx->_RasterMask==0\r
&& !ctx->Texture.Enabled && Current->rgb_flag) {\r
ENDPROFILE(choose_line_function)\r
return fast_flat_rgb_line;\r
if (!wmesa->db_flag) return NULL;\r
/*if (wmesa->xm_buffer->buffer==XIMAGE)*/ {\r
if ( ctx->Light.ShadeModel==GL_SMOOTH\r
- && ctx->RasterMask==DEPTH_BIT\r
+ && ctx->_RasterMask==DEPTH_BIT\r
&& ctx->Depth.Func==GL_LESS\r
&& ctx->Depth.Mask==GL_TRUE\r
&& ctx->Polygon.StippleFlag==GL_FALSE) {\r
}\r
}\r
if ( ctx->Light.ShadeModel==GL_FLAT\r
- && ctx->RasterMask==DEPTH_BIT\r
+ && ctx->_RasterMask==DEPTH_BIT\r
&& ctx->Depth.Func==GL_LESS\r
&& ctx->Depth.Mask==GL_TRUE\r
&& ctx->Polygon.StippleFlag==GL_FALSE) {\r
return NULL;\r
}\r
}\r
- if ( ctx->RasterMask==0 /* no depth test */\r
+ if ( ctx->_RasterMask==0 /* no depth test */\r
&& ctx->Light.ShadeModel==GL_SMOOTH\r
&& ctx->Polygon.StippleFlag==GL_FALSE) {\r
switch (wmesa->pixelformat) {\r
}\r
}\r
\r
- if ( ctx->RasterMask==0 /* no depth test */\r
+ if ( ctx->_RasterMask==0 /* no depth test */\r
&& ctx->Light.ShadeModel==GL_FLAT\r
&& ctx->Polygon.StippleFlag==GL_FALSE) {\r
switch (wmesa->pixelformat) {\r
extern points_func choose_points_function( GLcontext* ctx )\r
{\r
STARTPROFILE\r
- if (ctx->Point.Size==1.0 && !ctx->Point.SmoothFlag && ctx->RasterMask==0\r
- && !ctx->Texture.ReallyEnabled && ctx->Visual->RGBAflag) {\r
+ if (ctx->Point.Size==1.0 && !ctx->Point.SmoothFlag && ctx->_RasterMask==0\r
+ && !ctx->Texture._ReallyEnabled && ctx->Visual->RGBAflag) {\r
ENDPROFILE(choose_points_function)\r
return fast_rgb_points;\r
}\r
{\r
STARTPROFILE\r
if (ctx->Line.Width==1.0 && !ctx->Line.SmoothFlag && !ctx->Line.StippleFlag\r
- && ctx->Light.ShadeModel==GL_FLAT && ctx->RasterMask==0\r
- && !ctx->Texture.ReallyEnabled && Current->rgb_flag) {\r
+ && ctx->Light.ShadeModel==GL_FLAT && ctx->_RasterMask==0\r
+ && !ctx->Texture._ReallyEnabled && Current->rgb_flag) {\r
ENDPROFILE(choose_line_function)\r
return fast_flat_rgb_line;\r
}\r
{\r
if (ctx->Polygon.SmoothFlag) return NULL;\r
if (ctx->Polygon.StippleFlag) return NULL;\r
- if (ctx->Texture.ReallyEnabled) return NULL;\r
+ if (ctx->Texture._ReallyEnabled) return NULL;\r
\r
- if (ctx->RasterMask==DEPTH_BIT\r
+ if (ctx->_RasterMask==DEPTH_BIT\r
&& ctx->Depth.Func==GL_LESS\r
&& ctx->Depth.Mask==GL_TRUE\r
&& ctx->Visual->RGBAflag) {\r
{\r
STARTPROFILE\r
if (!ctx->Polygon.SmoothFlag && !ctx->Polygon.StippleFlag\r
- && ctx->Light.ShadeModel==GL_FLAT && ctx->RasterMask==0\r
- && !ctx->Texture.ReallyEnabled && Current->rgb_flag==GL_TRUE) {\r
+ && ctx->Light.ShadeModel==GL_FLAT && ctx->_RasterMask==0\r
+ && !ctx->Texture._ReallyEnabled && Current->rgb_flag==GL_TRUE) {\r
ENDPROFILE(choose_polygon_function)\r
return fast_flat_rgb_polygon;\r
}\r
-# $Id: Makefile.X11,v 1.27 2000/10/31 18:09:44 keithw Exp $
+# $Id: Makefile.X11,v 1.28 2000/11/05 18:40:57 keithw Exp $
# Mesa 3-D graphics library
# Version: 3.5
swrast/s_context.c \
swrast/s_depth.c \
swrast/s_drawpix.c \
+ swrast/s_feedback.c \
swrast/s_fog.c \
swrast/s_imaging.c \
swrast/s_lines.c \
swrast/s_stencil.c \
swrast/s_texture.c \
swrast/s_triangle.c \
- swrast/s_zoom.c
+ swrast/s_zoom.c \
+ swrast_setup/ss_context.c \
+ swrast_setup/ss_triangle.c \
+ swrast_setup/ss_vb.c
+
+
DRIVER_SOURCES = \
+ FX/fxapi.c \
+ FX/fxdd.c \
+ FX/fxddspan.c \
+ FX/fxddtex.c \
+ FX/fxfastpath.c \
+ FX/fxpipeline.c \
+ FX/fxsetup.c \
+ FX/fxtexman.c \
+ FX/fxtrifuncs.c \
+ FX/fxvsetup.c \
+ FX/fxglidew.c \
X/glxapi.c \
X/fakeglx.c \
X/xfonts.c \
SVGA/svgamesa16.c \
SVGA/svgamesa24.c \
SVGA/svgamesa32.c \
- FX/fxapi.c \
- FX/fxclip.c \
- FX/fxdd.c \
- FX/fxddspan.c \
- FX/fxddtex.c \
- FX/fxfastpath.c \
- FX/fxpipeline.c \
- FX/fxrender.c \
- FX/fxsanity.c \
- FX/fxsetup.c \
- FX/fxtexman.c \
- FX/fxtrifuncs.c \
- FX/fxvsetup.c \
- FX/fxglidew.c \
Trace/tr_2string.c \
Trace/tr_attrib.c \
Trace/tr_context.c \
ADDITIONAL_OBJ =
OBJECTS = $(ASM_SOURCES:.S=.o) \
- $(CORE_SOURCES:.c=.o) \
$(DRIVER_SOURCES:.c=.o) \
+ $(CORE_SOURCES:.c=.o) \
$(ADDITIONAL_OBJ)
-/* $Id: attrib.c,v 1.32 2000/10/30 16:32:42 brianp Exp $ */
+/* $Id: attrib.c,v 1.33 2000/11/05 18:40:57 keithw Exp $ */
/*
* Mesa 3-D graphics library
dest->MaxLod = src->MaxLod;
dest->BaseLevel = src->BaseLevel;
dest->MaxLevel = src->MaxLevel;
- dest->P = src->P;
- dest->M = src->M;
- dest->MinMagThresh = src->MinMagThresh;
+ dest->_P = src->_P;
+ dest->_M = src->_M;
dest->Palette = src->Palette;
dest->Complete = src->Complete;
- dest->SampleFunc = src->SampleFunc;
}
(*ctx->Driver.Fogfv)( ctx, GL_FOG_INDEX, &index );
(*ctx->Driver.Fogfv)( ctx, GL_FOG_COLOR, ctx->Fog.Color );
}
- ctx->Enabled &= ~ENABLE_FOG;
- if (ctx->Fog.Enabled) ctx->Enabled |= ENABLE_FOG;
+ ctx->_Enabled &= ~ENABLE_FOG;
+ if (ctx->Fog.Enabled) ctx->_Enabled |= ENABLE_FOG;
}
break;
case GL_HINT_BIT:
(*ctx->Driver.Enable)( ctx, GL_LIGHTING, ctx->Light.Enabled );
}
if (ctx->Light.ShadeModel == GL_FLAT)
- ctx->TriangleCaps |= DD_FLATSHADE;
+ ctx->_TriangleCaps |= DD_FLATSHADE;
else
- ctx->TriangleCaps &= ~DD_FLATSHADE;
+ ctx->_TriangleCaps &= ~DD_FLATSHADE;
if (ctx->Driver.ShadeModel)
(*ctx->Driver.ShadeModel)(ctx, ctx->Light.ShadeModel);
- ctx->Enabled &= ~ENABLE_LIGHT;
+ ctx->_Enabled &= ~ENABLE_LIGHT;
if (ctx->Light.Enabled && !is_empty_list(&ctx->Light.EnabledList))
- ctx->Enabled |= ENABLE_LIGHT;
+ ctx->_Enabled |= ENABLE_LIGHT;
break;
case GL_LINE_BIT:
MEMCPY( &ctx->Line, attr->data, sizeof(struct gl_line_attrib) );
(*ctx->Driver.ClearStencil)( ctx, ctx->Stencil.Clear );
if (ctx->Driver.Enable)
(*ctx->Driver.Enable)( ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled );
- ctx->TriangleCaps &= ~DD_STENCIL;
+ ctx->_TriangleCaps &= ~DD_STENCIL;
if (ctx->Stencil.Enabled)
- ctx->TriangleCaps |= DD_STENCIL;
+ ctx->_TriangleCaps |= DD_STENCIL;
break;
case GL_TRANSFORM_BIT:
(*ctx->Driver.Enable)( ctx, GL_NORMALIZE, ctx->Transform.Normalize );
(*ctx->Driver.Enable)( ctx, GL_RESCALE_NORMAL_EXT, ctx->Transform.RescaleNormals );
}
- ctx->Enabled &= ~(ENABLE_NORMALIZE|ENABLE_RESCALE);
- if (ctx->Transform.Normalize) ctx->Enabled |= ENABLE_NORMALIZE;
- if (ctx->Transform.RescaleNormals) ctx->Enabled |= ENABLE_RESCALE;
+ ctx->_Enabled &= ~(ENABLE_NORMALIZE|ENABLE_RESCALE);
+ if (ctx->Transform.Normalize) ctx->_Enabled |= ENABLE_NORMALIZE;
+ if (ctx->Transform.RescaleNormals) ctx->_Enabled |= ENABLE_RESCALE;
break;
case GL_TEXTURE_BIT:
/* Take care of texture object reference counters */
-/* $Id: blend.c,v 1.24 2000/10/31 18:09:44 keithw Exp $ */
+/* $Id: blend.c,v 1.25 2000/11/05 18:40:57 keithw Exp $ */
/*
* Mesa 3-D graphics library
(*ctx->Driver.BlendFunc)( ctx, sfactor, dfactor );
}
- ctx->Color.BlendFunc = NULL;
ctx->NewState |= _NEW_COLOR;
}
return;
}
- ctx->Color.BlendFunc = NULL;
ctx->NewState |= _NEW_COLOR;
if (ctx->Driver.BlendFuncSeparate) {
ctx->Color.ColorLogicOpEnabled = GL_FALSE;
}
- ctx->Color.BlendFunc = NULL;
ctx->NewState |= _NEW_COLOR;
if (ctx->Driver.BlendEquation)
-/* $Id: clip.c,v 1.12 2000/10/30 13:31:59 keithw Exp $ */
+/* $Id: clip.c,v 1.13 2000/11/05 18:40:57 keithw Exp $ */
/*
* Mesa 3-D graphics library
if (ctx->ProjectionMatrix.flags & MAT_DIRTY_ALL_OVER) {
gl_matrix_analyze( &ctx->ProjectionMatrix );
}
- gl_transform_vector( ctx->Transform.ClipUserPlane[p],
+ gl_transform_vector( ctx->Transform._ClipUserPlane[p],
ctx->Transform.EyeUserPlane[p],
ctx->ProjectionMatrix.inv );
}
for (p = 0 ; p < MAX_CLIP_PLANES ; p++) {
if (ctx->Transform.ClipEnabled[p]) {
- gl_transform_vector( ctx->Transform.ClipUserPlane[p],
+ gl_transform_vector( ctx->Transform._ClipUserPlane[p],
ctx->Transform.EyeUserPlane[p],
ctx->ProjectionMatrix.inv );
}
for (p=0;p<MAX_CLIP_PLANES;p++) {
if (ctx->Transform.ClipEnabled[p]) {
- GLfloat dot = v[0] * ctx->Transform.ClipUserPlane[p][0]
- + v[1] * ctx->Transform.ClipUserPlane[p][1]
- + v[2] * ctx->Transform.ClipUserPlane[p][2]
- + v[3] * ctx->Transform.ClipUserPlane[p][3];
+ GLfloat dot = v[0] * ctx->Transform._ClipUserPlane[p][0]
+ + v[1] * ctx->Transform._ClipUserPlane[p][1]
+ + v[2] * ctx->Transform._ClipUserPlane[p][2]
+ + v[3] * ctx->Transform._ClipUserPlane[p][3];
if (dot < 0.0F) {
return 0;
}
{
mask |= CLIP_RGBA0;
- if (ctx->TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_SEPERATE_SPECULAR))
+ if (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_SEPERATE_SPECULAR))
mask |= CLIP_RGBA1;
- if (ctx->Texture.ReallyEnabled & 0xf0)
+ if (ctx->Texture._ReallyEnabled & 0xf0)
mask |= CLIP_TEX1|CLIP_TEX0;
- if (ctx->Texture.ReallyEnabled & 0xf)
+ if (ctx->Texture._ReallyEnabled & 0xf)
mask |= CLIP_TEX0;
}
else if (ctx->Light.ShadeModel==GL_SMOOTH)
{
mask |= CLIP_INDEX0;
- if (ctx->TriangleCaps & DD_TRI_LIGHT_TWOSIDE)
+ if (ctx->_TriangleCaps & DD_TRI_LIGHT_TWOSIDE)
mask |= CLIP_INDEX1;
}
if (ctx->Fog.Enabled)
mask |= CLIP_FOG_COORD;
- ctx->ClipInterpFunc = clip_interp_tab[mask];
- ctx->poly_clip_tab = gl_poly_clip_tab[0];
- ctx->line_clip_tab = gl_line_clip_tab[0];
+ ctx->_ClipInterpFunc = clip_interp_tab[mask];
+ ctx->_poly_clip_tab = gl_poly_clip_tab[0];
+ ctx->_line_clip_tab = gl_line_clip_tab[0];
- if (ctx->TriangleCaps & DD_TRI_UNFILLED) {
- ctx->poly_clip_tab = gl_poly_clip_tab[1];
- ctx->line_clip_tab = gl_line_clip_tab[0];
+ if (ctx->_TriangleCaps & DD_TRI_UNFILLED) {
+ ctx->_poly_clip_tab = gl_poly_clip_tab[1];
+ ctx->_line_clip_tab = gl_line_clip_tab[0];
}
}
for (bit = 1, p = 0; p < MAX_CLIP_PLANES ; p++, bit *=2) \
if (ctx->Transform.ClipEnabled[p]) { \
GLuint nr = 0; \
- const GLfloat a = ctx->Transform.ClipUserPlane[p][0]; \
- const GLfloat b = ctx->Transform.ClipUserPlane[p][1]; \
- const GLfloat c = ctx->Transform.ClipUserPlane[p][2]; \
- const GLfloat d = ctx->Transform.ClipUserPlane[p][3]; \
+ const GLfloat a = ctx->Transform._ClipUserPlane[p][0]; \
+ const GLfloat b = ctx->Transform._ClipUserPlane[p][1]; \
+ const GLfloat c = ctx->Transform._ClipUserPlane[p][2]; \
+ const GLfloat d = ctx->Transform._ClipUserPlane[p][3]; \
GLfloat *coord = VB->ClipPtr->start; \
GLuint stride = VB->ClipPtr->stride; \
\
-/* $Id: context.c,v 1.102 2000/10/31 18:09:44 keithw Exp $ */
+/* $Id: context.c,v 1.103 2000/11/05 18:40:57 keithw Exp $ */
/*
* Mesa 3-D graphics library
#include "vbxform.h"
#include "vertices.h"
#include "xform.h"
-#include "swrast/swrast.h"
#endif
#if defined(MESA_TRACE)
l->SpotExponent = 0.0;
gl_compute_spot_exp_table( l );
l->SpotCutoff = 180.0;
- l->CosCutoff = 0.0; /* KW: -ve values not admitted */
+ l->_CosCutoff = 0.0; /* KW: -ve values not admitted */
l->ConstantAttenuation = 1.0;
l->LinearAttenuation = 0.0;
l->QuadraticAttenuation = 0.0;
texUnit->GenModeT = GL_EYE_LINEAR;
texUnit->GenModeR = GL_EYE_LINEAR;
texUnit->GenModeQ = GL_EYE_LINEAR;
- texUnit->GenBitS = TEXGEN_EYE_LINEAR;
- texUnit->GenBitT = TEXGEN_EYE_LINEAR;
- texUnit->GenBitR = TEXGEN_EYE_LINEAR;
- texUnit->GenBitQ = TEXGEN_EYE_LINEAR;
+ texUnit->_GenBitS = TEXGEN_EYE_LINEAR;
+ texUnit->_GenBitT = TEXGEN_EYE_LINEAR;
+ texUnit->_GenBitR = TEXGEN_EYE_LINEAR;
+ texUnit->_GenBitQ = TEXGEN_EYE_LINEAR;
/* Yes, these plane coefficients are correct! */
ASSIGN_4V( texUnit->ObjectPlaneS, 1.0, 0.0, 0.0, 0.0 );
gl_matrix_ctr( &ctx->ProjectionMatrix );
gl_matrix_alloc_inv( &ctx->ProjectionMatrix );
- gl_matrix_ctr( &ctx->ModelProjectMatrix );
+ gl_matrix_ctr( &ctx->_ModelProjectMatrix );
ctx->ProjectionStackDepth = 0;
ctx->NearFarStack[0][0] = 1.0; /* These values seem weird by make */
ctx->Color.BlendSrcA = GL_ONE;
ctx->Color.BlendDstA = GL_ZERO;
ctx->Color.BlendEquation = GL_FUNC_ADD_EXT;
- ctx->Color.BlendFunc = NULL; /* this pointer set only when needed */
ASSIGN_4V( ctx->Color.BlendColor, 0.0, 0.0, 0.0, 0.0 );
ctx->Color.IndexLogicOpEnabled = GL_FALSE;
ctx->Color.ColorLogicOpEnabled = GL_FALSE;
ctx->Light.ColorMaterialEnabled = GL_FALSE;
/* Lighting miscellaneous */
- ctx->ShineTabList = MALLOC_STRUCT( gl_shine_tab );
- make_empty_list( ctx->ShineTabList );
+ ctx->_ShineTabList = MALLOC_STRUCT( gl_shine_tab );
+ make_empty_list( ctx->_ShineTabList );
for (i = 0 ; i < 10 ; i++) {
struct gl_shine_tab *s = MALLOC_STRUCT( gl_shine_tab );
s->shininess = -1;
s->refcount = 0;
- insert_at_tail( ctx->ShineTabList, s );
+ insert_at_tail( ctx->_ShineTabList, s );
}
for (i = 0 ; i < 4 ; i++) {
- ctx->ShineTable[i] = ctx->ShineTabList->prev;
- ctx->ShineTable[i]->refcount++;
+ ctx->_ShineTable[i] = ctx->_ShineTabList->prev;
+ ctx->_ShineTable[i]->refcount++;
}
gl_compute_shine_table( ctx, 0, ctx->Light.Material[0].Shininess );
ctx->Point.Params[0] = 1.0;
ctx->Point.Params[1] = 0.0;
ctx->Point.Params[2] = 0.0;
- ctx->Point.Attenuated = GL_FALSE;
+ ctx->Point._Attenuated = GL_FALSE;
ctx->Point.MinSize = 0.0;
ctx->Point.MaxSize = (GLfloat) MAX_POINT_SIZE;
ctx->Point.Threshold = 1.0;
ctx->Polygon.FrontBit = 0;
ctx->Polygon.FrontMode = GL_FILL;
ctx->Polygon.BackMode = GL_FILL;
- ctx->Polygon.Unfilled = GL_FALSE;
+ ctx->Polygon._Unfilled = GL_FALSE;
ctx->Polygon.SmoothFlag = GL_FALSE;
ctx->Polygon.StippleFlag = GL_FALSE;
ctx->Polygon.OffsetFactor = 0.0F;
/* Texture group */
ctx->Texture.CurrentUnit = 0; /* multitexture */
ctx->Texture.CurrentTransformUnit = 0; /* multitexture */
- ctx->Texture.ReallyEnabled = 0;
+ ctx->Texture._ReallyEnabled = 0;
for (i=0; i<MAX_TEXTURE_UNITS; i++)
init_texture_unit( ctx, i );
ctx->Texture.SharedPalette = GL_FALSE;
ctx->Transform.ClipEnabled[i] = GL_FALSE;
ASSIGN_4V( ctx->Transform.EyeUserPlane[i], 0.0, 0.0, 0.0, 0.0 );
}
- ctx->Transform.AnyClip = GL_FALSE;
+ ctx->Transform._AnyClip = GL_FALSE;
/* Viewport group */
ctx->Viewport.X = 0;
ctx->Viewport.Height = 0;
ctx->Viewport.Near = 0.0;
ctx->Viewport.Far = 1.0;
- gl_matrix_ctr(&ctx->Viewport.WindowMap);
+ gl_matrix_ctr(&ctx->Viewport._WindowMap);
#define Sz 10
#define Tz 14
- ctx->Viewport.WindowMap.m[Sz] = 0.5 * ctx->Visual.DepthMaxF;
- ctx->Viewport.WindowMap.m[Tz] = 0.5 * ctx->Visual.DepthMaxF;
+ ctx->Viewport._WindowMap.m[Sz] = 0.5 * ctx->Visual.DepthMaxF;
+ ctx->Viewport._WindowMap.m[Tz] = 0.5 * ctx->Visual.DepthMaxF;
#undef Sz
#undef Tz
- ctx->Viewport.WindowMap.flags = MAT_FLAG_GENERAL_SCALE|MAT_FLAG_TRANSLATION;
- ctx->Viewport.WindowMap.type = MATRIX_3D_NO_ROT;
+ ctx->Viewport._WindowMap.flags = MAT_FLAG_GENERAL_SCALE|MAT_FLAG_TRANSLATION;
+ ctx->Viewport._WindowMap.type = MATRIX_3D_NO_ROT;
/* Vertex arrays */
ctx->Array.Vertex.Size = 4;
/* Miscellaneous */
ctx->NewState = _NEW_ALL;
ctx->RenderMode = GL_RENDER;
- ctx->StippleCounter = 0;
- ctx->NeedNormals = GL_FALSE;
- ctx->DoViewportMapping = GL_TRUE;
- ctx->ImageTransferState = 0;
+ ctx->_NeedNormals = GL_FALSE;
+ ctx->_ImageTransferState = 0;
- ctx->NeedEyeCoords = GL_FALSE;
- ctx->NeedEyeNormals = GL_FALSE;
- ctx->vb_proj_matrix = &ctx->ModelProjectMatrix;
+ ctx->_NeedEyeCoords = GL_FALSE;
+ ctx->_NeedEyeNormals = GL_FALSE;
+ ctx->_vb_proj_matrix = &ctx->_ModelProjectMatrix;
ctx->ErrorValue = (GLenum) GL_NO_ERROR;
}
ctx->input = ctx->VB->IM;
- if (!_swrast_create_context( ctx )) {
- ALIGN_FREE( ctx->VB );
- return GL_FALSE;
- }
-
if (share_list) {
/* share the group of display lists of another context */
ctx->Shared = share_list->Shared;
ctx->Shared = alloc_shared_state();
if (!ctx->Shared) {
ALIGN_FREE( ctx->VB );
- _swrast_destroy_context( ctx );
return GL_FALSE;
}
}
if (!alloc_proxy_textures(ctx)) {
free_shared_state(ctx, ctx->Shared);
ALIGN_FREE( ctx->VB );
- _swrast_destroy_context( ctx );
return GL_FALSE;
}
if (!ctx->Exec || !ctx->Save) {
free_shared_state(ctx, ctx->Shared);
ALIGN_FREE( ctx->VB );
- _swrast_destroy_context( ctx );
if (ctx->Exec)
FREE( ctx->Exec );
}
if (!(ctx->TraceCtx)) {
free_shared_state(ctx, ctx->Shared);
ALIGN_FREE( ctx->VB );
- _swrast_destroy_context( ctx );
FREE( ctx->Exec );
FREE( ctx->Save );
return GL_FALSE;
if (!(ctx->TraceCtx)) {
free_shared_state(ctx, ctx->Shared);
ALIGN_FREE( ctx->VB );
- _swrast_destroy_context( ctx );
FREE( ctx->Exec );
FREE( ctx->Save );
FREE( ctx->TraceCtx );
}
}
- _swrast_destroy_context( ctx );
-
if (ctx->input != ctx->VB->IM)
gl_immediate_free( ctx->input );
free_shared_state( ctx, ctx->Shared );
}
- foreach_s( s, tmps, ctx->ShineTabList ) {
+ foreach_s( s, tmps, ctx->_ShineTabList ) {
FREE( s );
}
- FREE( ctx->ShineTabList );
+ FREE( ctx->_ShineTabList );
/* Free proxy texture objects */
gl_free_texture_object( NULL, ctx->Texture.Proxy1D );
-/* $Id: dd.h,v 1.37 2000/10/31 18:09:44 keithw Exp $ */
+/* $Id: dd.h,v 1.38 2000/11/05 18:40:57 keithw Exp $ */
/*
* Mesa 3-D graphics library
-/* Used by the GetParameteri device driver function */
-#define DD_HAVE_HARDWARE_FOG 3
-
/* Mask bits sent to the driver Clear() function */
* uses this.
*/
- GLint (*GetParameteri)( const GLcontext *ctx, GLint param );
- /* Query the device driver to get an integer parameter.
- * Current parameters:
- * DD_MAX_TEXTURE_SIZE return maximum texture size
- *
- * DD_MAX_TEXTURES number of texture sets/stages, usually 1
- *
- * DD_HAVE_HARDWARE_FOG the driver should return 1 (0 otherwise)
- * when the hardware support per fragment
- * fog for free (like the Voodoo Graphics)
- * so the Mesa core will start to ever use
- * per fragment fog
- */
-
/***
*** For supporting hardware Z buffers:
* triangles and quads or triangles and polygons.
*/
- GLuint TriangleCaps;
- /* Holds a list of the reasons why we might normally want to call
- * render_triangle, but which are in fact implemented by the
- * driver. The FX driver sets this to DD_TRI_CULL, and will soon
- * implement DD_TRI_OFFSET.
- */
-
GLboolean (*MultipassFunc)( struct vertex_buffer *VB, GLuint passno );
/* Driver may request additional render passes by returning GL_TRUE
* when this function is called. This function will be called
-/* $Id: depth.c,v 1.22 2000/10/31 18:09:44 keithw Exp $ */
+/* $Id: depth.c,v 1.23 2000/11/05 18:40:57 keithw Exp $ */
/*
* Mesa 3-D graphics library
if (ctx->Depth.Func != func) {
ctx->Depth.Func = func;
ctx->NewState |= _NEW_DEPTH;
- ctx->TriangleCaps &= ~DD_Z_NEVER;
+ ctx->_TriangleCaps &= ~DD_Z_NEVER;
if (ctx->Driver.DepthFunc) {
(*ctx->Driver.DepthFunc)( ctx, func );
}
if (ctx->Depth.Func != func) {
ctx->Depth.Func = func;
ctx->NewState |= _NEW_DEPTH;
- ctx->TriangleCaps |= DD_Z_NEVER;
+ ctx->_TriangleCaps |= DD_Z_NEVER;
if (ctx->Driver.DepthFunc) {
(*ctx->Driver.DepthFunc)( ctx, func );
}
-/* $Id: enable.c,v 1.30 2000/10/30 16:32:43 brianp Exp $ */
+/* $Id: enable.c,v 1.31 2000/11/05 18:40:57 keithw Exp $ */
/*
* Mesa 3-D graphics library
ctx->NewState |= _NEW_TRANSFORM;
if (state) {
- ctx->Enabled |= ENABLE_USERCLIP;
- ctx->Transform.AnyClip++;
+ ctx->_Enabled |= ENABLE_USERCLIP;
+ ctx->Transform._AnyClip++;
if (ctx->ProjectionMatrix.flags & MAT_DIRTY_ALL_OVER) {
gl_matrix_analyze( &ctx->ProjectionMatrix );
}
- gl_transform_vector( ctx->Transform.ClipUserPlane[p],
+ gl_transform_vector( ctx->Transform._ClipUserPlane[p],
ctx->Transform.EyeUserPlane[p],
ctx->ProjectionMatrix.inv );
} else {
- if (--ctx->Transform.AnyClip == 0)
- ctx->Enabled &= ~ENABLE_USERCLIP;
+ if (--ctx->Transform._AnyClip == 0)
+ ctx->_Enabled &= ~ENABLE_USERCLIP;
}
}
break;
case GL_CULL_FACE:
if (ctx->Polygon.CullFlag!=state) {
ctx->Polygon.CullFlag = state;
- ctx->TriangleCaps ^= DD_TRI_CULL;
+/* ctx->_TriangleCaps ^= DD_TRI_CULL; */
ctx->NewState |= _NEW_POLYGON;
}
break;
case GL_FOG:
if (ctx->Fog.Enabled!=state) {
ctx->Fog.Enabled = state;
- ctx->Enabled ^= ENABLE_FOG;
+ ctx->_Enabled ^= ENABLE_FOG;
ctx->NewState |= _NEW_FOG;
}
break;
insert_at_tail(&ctx->Light.EnabledList,
&ctx->Light.Light[cap-GL_LIGHT0]);
if (ctx->Light.Enabled)
- ctx->Enabled |= ENABLE_LIGHT;
+ ctx->_Enabled |= ENABLE_LIGHT;
} else {
remove_from_list(&ctx->Light.Light[cap-GL_LIGHT0]);
if (is_empty_list(&ctx->Light.EnabledList))
- ctx->Enabled &= ~ENABLE_LIGHT;
+ ctx->_Enabled &= ~ENABLE_LIGHT;
}
ctx->NewState |= _NEW_LIGHT;
case GL_LIGHTING:
if (ctx->Light.Enabled!=state) {
ctx->Light.Enabled = state;
- ctx->Enabled &= ~ENABLE_LIGHT;
+ ctx->_Enabled &= ~ENABLE_LIGHT;
if (state)
- ctx->Enabled |= ENABLE_LIGHT;
+ ctx->_Enabled |= ENABLE_LIGHT;
ctx->NewState |= _NEW_LIGHT;
}
break;
case GL_LINE_SMOOTH:
if (ctx->Line.SmoothFlag!=state) {
ctx->Line.SmoothFlag = state;
- ctx->TriangleCaps ^= DD_LINE_SMOOTH;
+ ctx->_TriangleCaps ^= DD_LINE_SMOOTH;
ctx->NewState |= _NEW_LINE;
}
break;
case GL_LINE_STIPPLE:
if (ctx->Line.StippleFlag!=state) {
ctx->Line.StippleFlag = state;
- ctx->TriangleCaps ^= DD_LINE_STIPPLE;
+ ctx->_TriangleCaps ^= DD_LINE_STIPPLE;
ctx->NewState |= _NEW_LINE;
}
break;
if (ctx->Transform.Normalize != state) {
ctx->Transform.Normalize = state;
ctx->NewState |= _NEW_TRANSFORM;
- ctx->Enabled ^= ENABLE_NORMALIZE;
+ ctx->_Enabled ^= ENABLE_NORMALIZE;
}
break;
case GL_POINT_SMOOTH:
if (ctx->Point.SmoothFlag!=state) {
ctx->Point.SmoothFlag = state;
- ctx->TriangleCaps ^= DD_POINT_SMOOTH;
+ ctx->_TriangleCaps ^= DD_POINT_SMOOTH;
ctx->NewState |= _NEW_POINT;
}
break;
case GL_POLYGON_SMOOTH:
if (ctx->Polygon.SmoothFlag!=state) {
ctx->Polygon.SmoothFlag = state;
- ctx->TriangleCaps ^= DD_TRI_SMOOTH;
+ ctx->_TriangleCaps ^= DD_TRI_SMOOTH;
ctx->NewState |= _NEW_POLYGON;
}
break;
case GL_POLYGON_STIPPLE:
if (ctx->Polygon.StippleFlag!=state) {
ctx->Polygon.StippleFlag = state;
- ctx->TriangleCaps ^= DD_TRI_STIPPLE;
+ ctx->_TriangleCaps ^= DD_TRI_STIPPLE;
ctx->NewState |= _NEW_POLYGON;
}
break;
if (ctx->Transform.RescaleNormals != state) {
ctx->Transform.RescaleNormals = state;
ctx->NewState |= _NEW_TRANSFORM;
- ctx->Enabled ^= ENABLE_RESCALE;
+ ctx->_Enabled ^= ENABLE_RESCALE;
}
break;
case GL_SCISSOR_TEST:
if (ctx->Stencil.Enabled!=state) {
ctx->Stencil.Enabled = state;
ctx->NewState |= _NEW_STENCIL;
- ctx->TriangleCaps ^= DD_STENCIL;
+ ctx->_TriangleCaps ^= DD_STENCIL;
}
break;
case GL_TEXTURE_1D:
case GL_COLOR_SUM_EXT:
ctx->Fog.ColorSumEnabled = state;
if (state)
- SET_BITS(ctx->TriangleCaps, DD_SEPERATE_SPECULAR);
+ SET_BITS(ctx->_TriangleCaps, DD_SEPERATE_SPECULAR);
else if (ctx->Light.Model.ColorControl == GL_SINGLE_COLOR)
- CLEAR_BITS(ctx->TriangleCaps, DD_SEPERATE_SPECULAR);
+ CLEAR_BITS(ctx->_TriangleCaps, DD_SEPERATE_SPECULAR);
ctx->NewState |= _NEW_FOG;
break;
-/* $Id: feedback.c,v 1.15 2000/10/31 18:09:44 keithw Exp $ */
+/* $Id: feedback.c,v 1.16 2000/11/05 18:40:57 keithw Exp $ */
/*
* Mesa 3-D graphics library
}
}
-
-
-static void feedback_vertex( GLcontext *ctx, GLuint v, GLuint pv )
-{
- GLfloat win[4];
- GLfloat color[4];
- GLfloat tc[4];
- GLuint texUnit = ctx->Texture.CurrentTransformUnit;
- const struct vertex_buffer *VB = ctx->VB;
- GLuint index;
-
- win[0] = VB->Win.data[v][0];
- win[1] = VB->Win.data[v][1];
- win[2] = VB->Win.data[v][2] / ctx->Visual.DepthMaxF;
- win[3] = 1.0 / VB->Win.data[v][3];
-
- if (ctx->Light.ShadeModel == GL_SMOOTH)
- pv = v;
-
- color[0] = CHAN_TO_FLOAT(VB->ColorPtr->data[pv][0]);
- color[1] = CHAN_TO_FLOAT(VB->ColorPtr->data[pv][1]);
- color[2] = CHAN_TO_FLOAT(VB->ColorPtr->data[pv][2]);
- color[3] = CHAN_TO_FLOAT(VB->ColorPtr->data[pv][3]);
-
- if (VB->TexCoordPtr[texUnit]->size == 4 &&
- VB->TexCoordPtr[texUnit]->data[v][3] != 0.0) {
- GLfloat invq = 1.0F / VB->TexCoordPtr[texUnit]->data[v][3];
- tc[0] = VB->TexCoordPtr[texUnit]->data[v][0] * invq;
- tc[1] = VB->TexCoordPtr[texUnit]->data[v][1] * invq;
- tc[2] = VB->TexCoordPtr[texUnit]->data[v][2] * invq;
- tc[3] = VB->TexCoordPtr[texUnit]->data[v][3];
- }
- else {
- ASSIGN_4V(tc, 0,0,0,1);
- COPY_SZ_4V(tc,
- VB->TexCoordPtr[texUnit]->size,
- VB->TexCoordPtr[texUnit]->data[v]);
- }
-
- if (VB->IndexPtr)
- index = VB->IndexPtr->data[v];
- else
- index = 0;
-
- gl_feedback_vertex( ctx, win, color, index, tc );
-}
-
-
-static GLboolean cull_triangle( GLcontext *ctx,
- GLuint v0, GLuint v1, GLuint v2, GLuint pv )
-{
- struct vertex_buffer *VB = ctx->VB;
- GLfloat (*win)[4] = VB->Win.data;
- GLfloat ex = win[v1][0] - win[v0][0];
- GLfloat ey = win[v1][1] - win[v0][1];
- GLfloat fx = win[v2][0] - win[v0][0];
- GLfloat fy = win[v2][1] - win[v0][1];
- GLfloat c = ex*fy-ey*fx;
-
- if (c * ctx->backface_sign > 0)
- return 0;
-
- return 1;
-}
-
-
-
-/*
- * Put triangle in feedback buffer.
- */
-void gl_feedback_triangle( GLcontext *ctx,
- GLuint v0, GLuint v1, GLuint v2, GLuint pv )
-{
- if (cull_triangle( ctx, v0, v1, v2, 0 )) {
- FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_POLYGON_TOKEN );
- FEEDBACK_TOKEN( ctx, (GLfloat) 3 ); /* three vertices */
-
- feedback_vertex( ctx, v0, pv );
- feedback_vertex( ctx, v1, pv );
- feedback_vertex( ctx, v2, pv );
- }
-}
-
-
-void gl_feedback_line( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv )
-{
- GLenum token = GL_LINE_TOKEN;
-
- if (ctx->StippleCounter==0)
- token = GL_LINE_RESET_TOKEN;
-
- FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) token );
-
- feedback_vertex( ctx, v1, pv );
- feedback_vertex( ctx, v2, pv );
-
- ctx->StippleCounter++;
-}
-
-
-void gl_feedback_points( GLcontext *ctx, GLuint first, GLuint last )
-{
- const struct vertex_buffer *VB = ctx->VB;
- GLuint i;
-
- for (i=first;i<=last;i++) {
- if (VB->ClipMask[i]==0) {
- FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_POINT_TOKEN );
- feedback_vertex( ctx, i, i );
- }
- }
-}
-
-
-
-
-
/**********************************************************************/
/* Selection */
/**********************************************************************/
}
}
-void gl_select_triangle( GLcontext *ctx,
- GLuint v0, GLuint v1, GLuint v2, GLuint pv )
-{
- const struct vertex_buffer *VB = ctx->VB;
-
- if (cull_triangle( ctx, v0, v1, v2, 0 )) {
- const GLfloat zs = 1.0F / ctx->Visual.DepthMaxF;
- gl_update_hitflag( ctx, VB->Win.data[v0][2] * zs );
- gl_update_hitflag( ctx, VB->Win.data[v1][2] * zs );
- gl_update_hitflag( ctx, VB->Win.data[v2][2] * zs );
- }
-}
-
-
-void gl_select_line( GLcontext *ctx,
- GLuint v0, GLuint v1, GLuint pv )
-{
- const struct vertex_buffer *VB = ctx->VB;
- const GLfloat zs = 1.0F / ctx->Visual.DepthMaxF;
- gl_update_hitflag( ctx, VB->Win.data[v0][2] * zs );
- gl_update_hitflag( ctx, VB->Win.data[v1][2] * zs );
-}
-
-
-void gl_select_points( GLcontext *ctx, GLuint first, GLuint last )
-{
- struct vertex_buffer *VB = ctx->VB;
- const GLfloat zs = 1.0F / ctx->Visual.DepthMaxF;
- GLuint i;
-
- for (i=first;i<=last;i++) {
- if (VB->ClipMask[i]==0) {
- gl_update_hitflag( ctx, VB->Win.data[i][2] * zs );
- }
- }
-}
-
static void write_hit_record( GLcontext *ctx )
{
if (MESA_VERBOSE & VERBOSE_API)
fprintf(stderr, "glRenderMode %s\n", gl_lookup_enum_by_nr(mode));
- ctx->TriangleCaps &= ~(DD_FEEDBACK|DD_SELECT);
+ ctx->_TriangleCaps &= ~(DD_FEEDBACK|DD_SELECT);
switch (ctx->RenderMode) {
case GL_RENDER:
case GL_RENDER:
break;
case GL_SELECT:
- ctx->TriangleCaps |= DD_SELECT;
+ ctx->_TriangleCaps |= DD_SELECT;
if (ctx->Select.BufferSize==0) {
/* haven't called glSelectBuffer yet */
gl_error( ctx, GL_INVALID_OPERATION, "glRenderMode" );
}
break;
case GL_FEEDBACK:
- ctx->TriangleCaps |= DD_FEEDBACK;
+ ctx->_TriangleCaps |= DD_FEEDBACK;
if (ctx->Feedback.BufferSize==0) {
/* haven't called glFeedbackBuffer yet */
gl_error( ctx, GL_INVALID_OPERATION, "glRenderMode" );
-/* $Id: feedback.h,v 1.3 1999/11/11 01:22:26 brianp Exp $ */
+/* $Id: feedback.h,v 1.4 2000/11/05 18:40:58 keithw Exp $ */
/*
* Mesa 3-D graphics library
_mesa_RenderMode( GLenum mode );
-extern void gl_feedback_points( GLcontext *ctx, GLuint first, GLuint last );
-extern void gl_feedback_line( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv );
-extern void gl_feedback_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
- GLuint v2, GLuint pv );
-
-extern void gl_select_points( GLcontext *ctx, GLuint first, GLuint last );
-extern void gl_select_line( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv );
-extern void gl_select_triangle( GLcontext *ctx, GLuint v0, GLuint v1,
- GLuint v2, GLuint pv );
-
#endif
-/* $Id: fog.c,v 1.27 2000/10/31 18:09:44 keithw Exp $ */
+/* $Id: fog.c,v 1.28 2000/11/05 18:40:58 keithw Exp $ */
/*
* Mesa 3-D graphics library
struct vertex_buffer *VB = ctx->VB;
if (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT) {
- if (!ctx->NeedEyeCoords) {
+ if (!ctx->_NeedEyeCoords) {
GLfloat *m = ctx->ModelView.m;
GLfloat plane[4];
-/* $Id: light.c,v 1.22 2000/10/30 13:32:00 keithw Exp $ */
+/* $Id: light.c,v 1.23 2000/11/05 18:40:58 keithw Exp $ */
/*
* Mesa 3-D graphics library
if (ctx->Light.ShadeModel != mode) {
ctx->Light.ShadeModel = mode;
if (ctx->Light.ShadeModel == GL_FLAT)
- SET_BITS(ctx->TriangleCaps, DD_FLATSHADE);
+ SET_BITS(ctx->_TriangleCaps, DD_FLATSHADE);
else
- CLEAR_BITS(ctx->TriangleCaps, DD_FLATSHADE);
+ CLEAR_BITS(ctx->_TriangleCaps, DD_FLATSHADE);
ctx->NewState |= _NEW_LIGHT;
return;
}
ctx->Light.Light[l].SpotCutoff = params[0];
- ctx->Light.Light[l].CosCutoff = cos(params[0]*DEG2RAD);
- if (ctx->Light.Light[l].CosCutoff < 0)
- ctx->Light.Light[l].CosCutoff = 0;
+ ctx->Light.Light[l]._CosCutoff = cos(params[0]*DEG2RAD);
+ if (ctx->Light.Light[l]._CosCutoff < 0)
+ ctx->Light.Light[l]._CosCutoff = 0;
nParams = 1;
break;
case GL_CONSTANT_ATTENUATION:
if (params[0] == (GLfloat) GL_SINGLE_COLOR) {
ctx->Light.Model.ColorControl = GL_SINGLE_COLOR;
if (!ctx->Fog.ColorSumEnabled)
- CLEAR_BITS(ctx->TriangleCaps, DD_SEPERATE_SPECULAR);
+ CLEAR_BITS(ctx->_TriangleCaps, DD_SEPERATE_SPECULAR);
}
else if (params[0] == (GLfloat) GL_SEPARATE_SPECULAR_COLOR) {
ctx->Light.Model.ColorControl = GL_SEPARATE_SPECULAR_COLOR;
- SET_BITS(ctx->TriangleCaps, DD_SEPERATE_SPECULAR);
+ SET_BITS(ctx->_TriangleCaps, DD_SEPERATE_SPECULAR);
}
else {
gl_error( ctx, GL_INVALID_ENUM, "glLightModel(param)" );
struct gl_material *mat = &ctx->Light.Material[0];
COPY_4FV( mat->Ambient, src[0].Ambient );
foreach (light, list) {
- SCALE_3V( light->MatAmbient[0], light->Ambient, src[0].Ambient);
+ SCALE_3V( light->_MatAmbient[0], light->Ambient, src[0].Ambient);
}
}
if (bitmask & BACK_AMBIENT_BIT) {
struct gl_material *mat = &ctx->Light.Material[1];
COPY_4FV( mat->Ambient, src[1].Ambient );
foreach (light, list) {
- SCALE_3V( light->MatAmbient[1], light->Ambient, src[1].Ambient);
+ SCALE_3V( light->_MatAmbient[1], light->Ambient, src[1].Ambient);
}
}
/* update BaseColor = emission + scene's ambience * material's ambience */
if (bitmask & (FRONT_EMISSION_BIT | FRONT_AMBIENT_BIT)) {
struct gl_material *mat = &ctx->Light.Material[0];
- COPY_3V( ctx->Light.BaseColor[0], mat->Emission );
- ACC_SCALE_3V( ctx->Light.BaseColor[0], mat->Ambient, ctx->Light.Model.Ambient );
+ COPY_3V( ctx->Light._BaseColor[0], mat->Emission );
+ ACC_SCALE_3V( ctx->Light._BaseColor[0], mat->Ambient, ctx->Light.Model.Ambient );
}
if (bitmask & (BACK_EMISSION_BIT | BACK_AMBIENT_BIT)) {
struct gl_material *mat = &ctx->Light.Material[1];
- COPY_3V( ctx->Light.BaseColor[1], mat->Emission );
- ACC_SCALE_3V( ctx->Light.BaseColor[1], mat->Ambient, ctx->Light.Model.Ambient );
+ COPY_3V( ctx->Light._BaseColor[1], mat->Emission );
+ ACC_SCALE_3V( ctx->Light._BaseColor[1], mat->Ambient, ctx->Light.Model.Ambient );
}
/* update material diffuse values */
GLfloat tmp[4];
SUB_3V( tmp, src[0].Diffuse, mat->Diffuse );
foreach (light, list) {
- ACC_SCALE_3V( light->MatDiffuse[0], light->Diffuse, tmp );
+ ACC_SCALE_3V( light->_MatDiffuse[0], light->Diffuse, tmp );
}
COPY_4FV( mat->Diffuse, src[0].Diffuse );
- FLOAT_COLOR_TO_CHAN(ctx->Light.BaseAlpha[0], mat->Diffuse[3]);
+ FLOAT_COLOR_TO_CHAN(ctx->Light._BaseAlpha[0], mat->Diffuse[3]);
}
if (bitmask & BACK_DIFFUSE_BIT) {
struct gl_material *mat = &ctx->Light.Material[1];
GLfloat tmp[4];
SUB_3V( tmp, src[1].Diffuse, mat->Diffuse );
foreach (light, list) {
- ACC_SCALE_3V( light->MatDiffuse[1], light->Diffuse, tmp );
+ ACC_SCALE_3V( light->_MatDiffuse[1], light->Diffuse, tmp );
}
COPY_4FV( mat->Diffuse, src[1].Diffuse );
- FLOAT_COLOR_TO_CHAN(ctx->Light.BaseAlpha[1], mat->Diffuse[3]);
+ FLOAT_COLOR_TO_CHAN(ctx->Light._BaseAlpha[1], mat->Diffuse[3]);
}
/* update material specular values */
GLfloat tmp[4];
SUB_3V( tmp, src[0].Specular, mat->Specular );
foreach (light, list) {
- if (light->Flags & LIGHT_SPECULAR) {
- ACC_SCALE_3V( light->MatSpecular[0], light->Specular, tmp );
- light->IsMatSpecular[0] =
- (LEN_SQUARED_3FV(light->MatSpecular[0]) > 1e-16);
+ if (light->_Flags & LIGHT_SPECULAR) {
+ ACC_SCALE_3V( light->_MatSpecular[0], light->Specular, tmp );
+ light->_IsMatSpecular[0] =
+ (LEN_SQUARED_3FV(light->_MatSpecular[0]) > 1e-16);
}
}
COPY_4FV( mat->Specular, src[0].Specular );
GLfloat tmp[4];
SUB_3V( tmp, src[1].Specular, mat->Specular );
foreach (light, list) {
- if (light->Flags & LIGHT_SPECULAR) {
- ACC_SCALE_3V( light->MatSpecular[1], light->Specular, tmp );
- light->IsMatSpecular[1] =
- (LEN_SQUARED_3FV(light->MatSpecular[1]) > 1e-16);
+ if (light->_Flags & LIGHT_SPECULAR) {
+ ACC_SCALE_3V( light->_MatSpecular[1], light->Specular, tmp );
+ light->_IsMatSpecular[1] =
+ (LEN_SQUARED_3FV(light->_MatSpecular[1]) > 1e-16);
}
}
COPY_4FV( mat->Specular, src[1].Specular );
COPY_4FV( mat->Emission, color );
}
- /* update light->MatAmbient = light's ambient * material's ambient */
+ /* update light->_MatAmbient = light's ambient * material's ambient */
if (bitmask & FRONT_AMBIENT_BIT) {
struct gl_material *mat = &ctx->Light.Material[0];
foreach (light, list) {
- SCALE_3V( light->MatAmbient[0], light->Ambient, color);
+ SCALE_3V( light->_MatAmbient[0], light->Ambient, color);
}
COPY_4FV( mat->Ambient, color );
}
if (bitmask & BACK_AMBIENT_BIT) {
struct gl_material *mat = &ctx->Light.Material[1];
foreach (light, list) {
- SCALE_3V( light->MatAmbient[1], light->Ambient, color);
+ SCALE_3V( light->_MatAmbient[1], light->Ambient, color);
}
COPY_4FV( mat->Ambient, color );
}
/* update BaseColor = emission + scene's ambience * material's ambience */
if (bitmask & (FRONT_EMISSION_BIT | FRONT_AMBIENT_BIT)) {
struct gl_material *mat = &ctx->Light.Material[0];
- COPY_3V( ctx->Light.BaseColor[0], mat->Emission );
- ACC_SCALE_3V( ctx->Light.BaseColor[0], mat->Ambient, ctx->Light.Model.Ambient );
+ COPY_3V( ctx->Light._BaseColor[0], mat->Emission );
+ ACC_SCALE_3V( ctx->Light._BaseColor[0], mat->Ambient, ctx->Light.Model.Ambient );
}
if (bitmask & (BACK_EMISSION_BIT | BACK_AMBIENT_BIT)) {
struct gl_material *mat = &ctx->Light.Material[1];
- COPY_3V( ctx->Light.BaseColor[1], mat->Emission );
- ACC_SCALE_3V( ctx->Light.BaseColor[1], mat->Ambient, ctx->Light.Model.Ambient );
+ COPY_3V( ctx->Light._BaseColor[1], mat->Emission );
+ ACC_SCALE_3V( ctx->Light._BaseColor[1], mat->Ambient, ctx->Light.Model.Ambient );
}
- /* update light->MatDiffuse = light's diffuse * material's diffuse */
+ /* update light->_MatDiffuse = light's diffuse * material's diffuse */
if (bitmask & FRONT_DIFFUSE_BIT) {
struct gl_material *mat = &ctx->Light.Material[0];
GLfloat tmp[4];
SUB_3V( tmp, color, mat->Diffuse );
foreach (light, list) {
- ACC_SCALE_3V( light->MatDiffuse[0], light->Diffuse, tmp );
+ ACC_SCALE_3V( light->_MatDiffuse[0], light->Diffuse, tmp );
}
COPY_4FV( mat->Diffuse, color );
- FLOAT_COLOR_TO_CHAN(ctx->Light.BaseAlpha[0], mat->Diffuse[3]);
+ FLOAT_COLOR_TO_CHAN(ctx->Light._BaseAlpha[0], mat->Diffuse[3]);
}
if (bitmask & BACK_DIFFUSE_BIT) {
GLfloat tmp[4];
SUB_3V( tmp, color, mat->Diffuse );
foreach (light, list) {
- ACC_SCALE_3V( light->MatDiffuse[1], light->Diffuse, tmp );
+ ACC_SCALE_3V( light->_MatDiffuse[1], light->Diffuse, tmp );
}
COPY_4FV( mat->Diffuse, color );
- FLOAT_COLOR_TO_CHAN(ctx->Light.BaseAlpha[1], mat->Diffuse[3]);
+ FLOAT_COLOR_TO_CHAN(ctx->Light._BaseAlpha[1], mat->Diffuse[3]);
}
- /* update light->MatSpecular = light's specular * material's specular */
+ /* update light->_MatSpecular = light's specular * material's specular */
if (bitmask & FRONT_SPECULAR_BIT) {
struct gl_material *mat = &ctx->Light.Material[0];
GLfloat tmp[4];
SUB_3V( tmp, color, mat->Specular );
foreach (light, list) {
- if (light->Flags & LIGHT_SPECULAR) {
- ACC_SCALE_3V( light->MatSpecular[0], light->Specular, tmp );
- light->IsMatSpecular[0] =
- (LEN_SQUARED_3FV(light->MatSpecular[0]) > 1e-16);
+ if (light->_Flags & LIGHT_SPECULAR) {
+ ACC_SCALE_3V( light->_MatSpecular[0], light->Specular, tmp );
+ light->_IsMatSpecular[0] =
+ (LEN_SQUARED_3FV(light->_MatSpecular[0]) > 1e-16);
}
}
COPY_4FV( mat->Specular, color );
GLfloat tmp[4];
SUB_3V( tmp, color, mat->Specular );
foreach (light, list) {
- if (light->Flags & LIGHT_SPECULAR) {
- ACC_SCALE_3V( light->MatSpecular[1], light->Specular, tmp );
- light->IsMatSpecular[1] =
- (LEN_SQUARED_3FV(light->MatSpecular[1]) > 1e-16);
+ if (light->_Flags & LIGHT_SPECULAR) {
+ ACC_SCALE_3V( light->_MatSpecular[1], light->Specular, tmp );
+ light->_IsMatSpecular[1] =
+ (LEN_SQUARED_3FV(light->_MatSpecular[1]) > 1e-16);
}
}
COPY_4FV( mat->Specular, color );
* IF P[3]==0 THEN
* // light at infinity
* IF local_viewer THEN
- * VP_inf_norm = unit vector from V to P // Precompute
+ * _VP_inf_norm = unit vector from V to P // Precompute
* ELSE
* // eye at infinity
- * h_inf_norm = Normalize( VP + <0,0,1> ) // Precompute
+ * _h_inf_norm = Normalize( VP + <0,0,1> ) // Precompute
* ENDIF
* ENDIF
*
GLdouble tmp = 0;
GLint clamp = 0;
- l->SpotExpTable[0][0] = 0.0;
+ l->_SpotExpTable[0][0] = 0.0;
for (i = EXP_TABLE_SIZE - 1; i > 0 ;i--) {
if (clamp == 0) {
clamp = 1;
}
}
- l->SpotExpTable[i][0] = tmp;
+ l->_SpotExpTable[i][0] = tmp;
}
for (i = 0; i < EXP_TABLE_SIZE - 1; i++) {
- l->SpotExpTable[i][1] = l->SpotExpTable[i+1][0] - l->SpotExpTable[i][0];
+ l->_SpotExpTable[i][1] = l->_SpotExpTable[i+1][0] - l->_SpotExpTable[i][0];
}
- l->SpotExpTable[EXP_TABLE_SIZE-1][1] = 0.0;
+ l->_SpotExpTable[EXP_TABLE_SIZE-1][1] = 0.0;
}
gl_compute_shine_table( GLcontext *ctx, GLuint i, GLfloat shininess )
{
#define DISTSQR(a,b) ((a-b)*(a-b))
- struct gl_shine_tab *list = ctx->ShineTabList;
+ struct gl_shine_tab *list = ctx->_ShineTabList;
struct gl_shine_tab *s;
foreach(s, list)
compute_shine_table( s, shininess );
}
- ctx->ShineTable[i]->refcount--;
- ctx->ShineTable[i] = s;
+ ctx->_ShineTable[i]->refcount--;
+ ctx->_ShineTable[i] = s;
move_to_tail( list, s );
s->refcount++;
#undef DISTSQR
{
struct gl_light *light;
- ctx->Light.Flags = 0;
+ ctx->Light._Flags = 0;
foreach(light, &ctx->Light.EnabledList) {
- light->Flags = 0;
+ light->_Flags = 0;
if (light->EyePosition[3] != 0.0F)
- light->Flags |= LIGHT_POSITIONAL;
+ light->_Flags |= LIGHT_POSITIONAL;
if (LEN_SQUARED_3FV(light->Specular) > 1e-16)
- light->Flags |= LIGHT_SPECULAR;
+ light->_Flags |= LIGHT_SPECULAR;
if (light->SpotCutoff != 180.0F)
- light->Flags |= LIGHT_SPOT;
+ light->_Flags |= LIGHT_SPOT;
- ctx->Light.Flags |= light->Flags;
+ ctx->Light._Flags |= light->_Flags;
}
- ctx->Light.NeedVertices =
- ((ctx->Light.Flags & (LIGHT_POSITIONAL|LIGHT_SPOT)) ||
+ ctx->Light._NeedVertices =
+ ((ctx->Light._Flags & (LIGHT_POSITIONAL|LIGHT_SPOT)) ||
(ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) ||
- (ctx->Light.Model.LocalViewer && (ctx->Light.Flags & LIGHT_SPECULAR)));
+ (ctx->Light.Model.LocalViewer && (ctx->Light._Flags & LIGHT_SPECULAR)));
/* Precompute some shading values.
*/
if (ctx->Visual.RGBAflag) {
- GLuint sides = ((ctx->TriangleCaps & DD_TRI_LIGHT_TWOSIDE) ? 2 : 1);
+ GLuint sides = ((ctx->_TriangleCaps & DD_TRI_LIGHT_TWOSIDE) ? 2 : 1);
GLuint side;
for (side=0; side < sides; side++) {
struct gl_material *mat = &ctx->Light.Material[side];
- COPY_3V(ctx->Light.BaseColor[side], mat->Emission);
- ACC_SCALE_3V(ctx->Light.BaseColor[side],
+ COPY_3V(ctx->Light._BaseColor[side], mat->Emission);
+ ACC_SCALE_3V(ctx->Light._BaseColor[side],
ctx->Light.Model.Ambient,
mat->Ambient);
- FLOAT_COLOR_TO_CHAN(ctx->Light.BaseAlpha[side],
+ FLOAT_COLOR_TO_CHAN(ctx->Light._BaseAlpha[side],
ctx->Light.Material[side].Diffuse[3] );
}
foreach (light, &ctx->Light.EnabledList) {
for (side=0; side< sides; side++) {
const struct gl_material *mat = &ctx->Light.Material[side];
- SCALE_3V( light->MatDiffuse[side], light->Diffuse, mat->Diffuse );
- SCALE_3V( light->MatAmbient[side], light->Ambient, mat->Ambient );
- if (light->Flags & LIGHT_SPECULAR) {
- SCALE_3V( light->MatSpecular[side], light->Specular,
+ SCALE_3V( light->_MatDiffuse[side], light->Diffuse, mat->Diffuse );
+ SCALE_3V( light->_MatAmbient[side], light->Ambient, mat->Ambient );
+ if (light->_Flags & LIGHT_SPECULAR) {
+ SCALE_3V( light->_MatSpecular[side], light->Specular,
mat->Specular);
- light->IsMatSpecular[side] =
- (LEN_SQUARED_3FV(light->MatSpecular[side]) > 1e-16);
+ light->_IsMatSpecular[side] =
+ (LEN_SQUARED_3FV(light->_MatSpecular[side]) > 1e-16);
}
else
- light->IsMatSpecular[side] = 0;
+ light->_IsMatSpecular[side] = 0;
}
}
}
else {
static const GLfloat ci[3] = { .30, .59, .11 };
foreach(light, &ctx->Light.EnabledList) {
- light->dli = DOT3(ci, light->Diffuse);
- light->sli = DOT3(ci, light->Specular);
+ light->_dli = DOT3(ci, light->Diffuse);
+ light->_sli = DOT3(ci, light->Specular);
}
}
}
if (1 /*ctx->Light.NeedVertices && !ctx->Light.Model.LocalViewer*/) {
static const GLfloat eye_z[3] = { 0, 0, 1 };
- if (ctx->NeedEyeCoords) {
- COPY_3V( ctx->EyeZDir, eye_z );
+ if (ctx->_NeedEyeCoords) {
+ COPY_3V( ctx->_EyeZDir, eye_z );
}
else {
- TRANSFORM_NORMAL( ctx->EyeZDir, eye_z, ctx->ModelView.m );
+ TRANSFORM_NORMAL( ctx->_EyeZDir, eye_z, ctx->ModelView.m );
}
}
foreach (light, &ctx->Light.EnabledList) {
- if (ctx->NeedEyeCoords) {
- COPY_4FV( light->Position, light->EyePosition );
+ if (ctx->_NeedEyeCoords) {
+ COPY_4FV( light->_Position, light->EyePosition );
}
else {
- TRANSFORM_POINT( light->Position, ctx->ModelView.inv,
+ TRANSFORM_POINT( light->_Position, ctx->ModelView.inv,
light->EyePosition );
}
- if (!(light->Flags & LIGHT_POSITIONAL)) {
+ if (!(light->_Flags & LIGHT_POSITIONAL)) {
/* VP (VP) = Normalize( Position ) */
- COPY_3V( light->VP_inf_norm, light->Position );
- NORMALIZE_3FV( light->VP_inf_norm );
+ COPY_3V( light->_VP_inf_norm, light->_Position );
+ NORMALIZE_3FV( light->_VP_inf_norm );
if (!ctx->Light.Model.LocalViewer) {
- /* h_inf_norm = Normalize( V_to_P + <0,0,1> ) */
- ADD_3V( light->h_inf_norm, light->VP_inf_norm, ctx->EyeZDir);
- NORMALIZE_3FV( light->h_inf_norm );
+ /* _h_inf_norm = Normalize( V_to_P + <0,0,1> ) */
+ ADD_3V( light->_h_inf_norm, light->_VP_inf_norm, ctx->_EyeZDir);
+ NORMALIZE_3FV( light->_h_inf_norm );
}
- light->VP_inf_spot_attenuation = 1.0;
+ light->_VP_inf_spot_attenuation = 1.0;
}
- if (light->Flags & LIGHT_SPOT) {
- if (ctx->NeedEyeNormals) {
- COPY_3V( light->NormDirection, light->EyeDirection );
+ if (light->_Flags & LIGHT_SPOT) {
+ if (ctx->_NeedEyeNormals) {
+ COPY_3V( light->_NormDirection, light->EyeDirection );
}
else {
- TRANSFORM_NORMAL( light->NormDirection,
+ TRANSFORM_NORMAL( light->_NormDirection,
light->EyeDirection,
ctx->ModelView.m);
}
- NORMALIZE_3FV( light->NormDirection );
+ NORMALIZE_3FV( light->_NormDirection );
/* Unlikely occurrance?
*/
- if (!(light->Flags & LIGHT_POSITIONAL)) {
- GLfloat PV_dot_dir = - DOT3(light->VP_inf_norm,
- light->NormDirection);
+ if (!(light->_Flags & LIGHT_POSITIONAL)) {
+ GLfloat PV_dot_dir = - DOT3(light->_VP_inf_norm,
+ light->_NormDirection);
- if (PV_dot_dir > light->CosCutoff) {
+ if (PV_dot_dir > light->_CosCutoff) {
double x = PV_dot_dir * (EXP_TABLE_SIZE-1);
int k = (int) x;
- light->VP_inf_spot_attenuation =
- (light->SpotExpTable[k][0] +
- (x-k)*light->SpotExpTable[k][1]);
+ light->_VP_inf_spot_attenuation =
+ (light->_SpotExpTable[k][0] +
+ (x-k)*light->_SpotExpTable[k][1]);
}
else {
- light->VP_inf_spot_attenuation = 0;
+ light->_VP_inf_spot_attenuation = 0;
}
}
}
void
gl_update_normal_transform( GLcontext *ctx )
{
- ctx->vb_rescale_factor = 1.0;
+ ctx->_vb_rescale_factor = 1.0;
- if (ctx->NeedEyeCoords) {
- if (ctx->NeedNormals) {
+ if (ctx->_NeedEyeCoords) {
+ if (ctx->_NeedNormals) {
GLuint transform = NORM_TRANSFORM_NO_ROT;
if (ctx->ModelView.flags & (MAT_FLAG_GENERAL |
MAT_FLAG_PERSPECTIVE))
transform = NORM_TRANSFORM;
- ctx->vb_rescale_factor = ctx->rescale_factor;
+ ctx->_vb_rescale_factor = ctx->_rescale_factor;
if (ctx->Transform.Normalize) {
- ctx->NormalTransform = gl_normal_tab[transform | NORM_NORMALIZE];
+ ctx->_NormalTransform = gl_normal_tab[transform | NORM_NORMALIZE];
}
else if (ctx->Transform.RescaleNormals &&
- ctx->rescale_factor != 1.0) {
- ctx->NormalTransform = gl_normal_tab[transform | NORM_RESCALE];
+ ctx->_rescale_factor != 1.0) {
+ ctx->_NormalTransform = gl_normal_tab[transform | NORM_RESCALE];
}
else {
- ctx->NormalTransform = gl_normal_tab[transform];
+ ctx->_NormalTransform = gl_normal_tab[transform];
}
}
else {
- ctx->NormalTransform = 0;
+ ctx->_NormalTransform = 0;
}
}
else {
- if (ctx->NeedNormals) {
- ctx->vb_rescale_factor = 1.0/ctx->rescale_factor;
+ if (ctx->_NeedNormals) {
+ ctx->_vb_rescale_factor = 1.0/ctx->_rescale_factor;
if (ctx->Transform.Normalize) {
- ctx->NormalTransform = gl_normal_tab[NORM_NORMALIZE];
+ ctx->_NormalTransform = gl_normal_tab[NORM_NORMALIZE];
}
else if (!ctx->Transform.RescaleNormals &&
- ctx->rescale_factor != 1.0) {
- ctx->NormalTransform = gl_normal_tab[NORM_RESCALE];
+ ctx->_rescale_factor != 1.0) {
+ ctx->_NormalTransform = gl_normal_tab[NORM_RESCALE];
}
else {
- ctx->NormalTransform = 0;
+ ctx->_NormalTransform = 0;
}
}
else {
- ctx->NormalTransform = 0;
+ ctx->_NormalTransform = 0;
}
}
}
-/* $Id: lines.c,v 1.20 2000/10/31 18:09:44 keithw Exp $ */
+/* $Id: lines.c,v 1.21 2000/11/05 18:40:58 keithw Exp $ */
/*
* Mesa 3-D graphics library
if (ctx->Line.Width != width) {
ctx->Line.Width = width;
- ctx->TriangleCaps &= ~DD_LINE_WIDTH;
- if (width != 1.0) ctx->TriangleCaps |= DD_LINE_WIDTH;
+ ctx->_TriangleCaps &= ~DD_LINE_WIDTH;
+ if (width != 1.0) ctx->_TriangleCaps |= DD_LINE_WIDTH;
ctx->NewState |= _NEW_LINE;
-/* $Id: macros.h,v 1.12 2000/10/29 18:23:16 brianp Exp $ */
+/* $Id: macros.h,v 1.13 2000/11/05 18:40:58 keithw Exp $ */
/*
* Mesa 3-D graphics library
} \
} while(0)
+#define COPY_CLEAN_4V(DST, SZ, SRC) \
+do { \
+ ASSIGN_4V( DST, 0, 0, 0, 1 ); \
+ COPY_SZ_4V( DST, SZ, SRC ); \
+} while (0)
+
#define SUB_4V( DST, SRCA, SRCB ) \
do { \
(DST)[0] = (SRCA)[0] - (SRCB)[0]; \
-/* $Id: matrix.c,v 1.23 2000/10/30 13:32:00 keithw Exp $ */
+/* $Id: matrix.c,v 1.24 2000/11/05 18:40:58 keithw Exp $ */
/*
* Mesa 3-D graphics library
static GLboolean matrix_invert( GLmatrix *mat )
{
if (inv_mat_tab[mat->type](mat)) {
+ mat->flags &= ~MAT_FLAG_SINGULAR;
return GL_TRUE;
} else {
+ mat->flags |= MAT_FLAG_SINGULAR;
MEMCPY( mat->inv, Identity, sizeof(Identity) );
return GL_FALSE;
}
void gl_calculate_model_project_matrix( GLcontext *ctx )
{
- gl_matrix_mul( &ctx->ModelProjectMatrix,
+ gl_matrix_mul( &ctx->_ModelProjectMatrix,
&ctx->ProjectionMatrix,
&ctx->ModelView );
- gl_matrix_analyze( &ctx->ModelProjectMatrix );
+ gl_matrix_analyze( &ctx->_ModelProjectMatrix );
}
ctx->Viewport.Height = height;
/* compute scale and bias values */
- ctx->Viewport.WindowMap.m[MAT_SX] = (GLfloat) width / 2.0F;
- ctx->Viewport.WindowMap.m[MAT_TX] = ctx->Viewport.WindowMap.m[MAT_SX] + x;
- ctx->Viewport.WindowMap.m[MAT_SY] = (GLfloat) height / 2.0F;
- ctx->Viewport.WindowMap.m[MAT_TY] = ctx->Viewport.WindowMap.m[MAT_SY] + y;
- ctx->Viewport.WindowMap.m[MAT_SZ] = 0.5 * ctx->Visual.DepthMaxF;
- ctx->Viewport.WindowMap.m[MAT_TZ] = 0.5 * ctx->Visual.DepthMaxF;
-
- ctx->Viewport.WindowMap.flags = MAT_FLAG_GENERAL_SCALE|MAT_FLAG_TRANSLATION;
- ctx->Viewport.WindowMap.type = MATRIX_3D_NO_ROT;
+ ctx->Viewport._WindowMap.m[MAT_SX] = (GLfloat) width / 2.0F;
+ ctx->Viewport._WindowMap.m[MAT_TX] = ctx->Viewport._WindowMap.m[MAT_SX] + x;
+ ctx->Viewport._WindowMap.m[MAT_SY] = (GLfloat) height / 2.0F;
+ ctx->Viewport._WindowMap.m[MAT_TY] = ctx->Viewport._WindowMap.m[MAT_SY] + y;
+ ctx->Viewport._WindowMap.m[MAT_SZ] = 0.5 * ctx->Visual.DepthMaxF;
+ ctx->Viewport._WindowMap.m[MAT_TZ] = 0.5 * ctx->Visual.DepthMaxF;
+
+ ctx->Viewport._WindowMap.flags = MAT_FLAG_GENERAL_SCALE|MAT_FLAG_TRANSLATION;
+ ctx->Viewport._WindowMap.type = MATRIX_3D_NO_ROT;
ctx->NewState |= _NEW_VIEWPORT;
/* Check if window/buffer has been resized and if so, reallocate the
*/
_mesa_ResizeBuffersMESA();
-
- ctx->RasterMask &= ~WINCLIP_BIT;
-
- if ( ctx->Viewport.X<0
- || ctx->Viewport.X + ctx->Viewport.Width > ctx->DrawBuffer->Width
- || ctx->Viewport.Y<0
- || ctx->Viewport.Y + ctx->Viewport.Height > ctx->DrawBuffer->Height) {
- ctx->RasterMask |= WINCLIP_BIT;
- }
-
-
if (ctx->Driver.Viewport) {
(*ctx->Driver.Viewport)( ctx, x, y, width, height );
}
ctx->Viewport.Near = n;
ctx->Viewport.Far = f;
- ctx->Viewport.WindowMap.m[MAT_SZ] = ctx->Visual.DepthMaxF * ((f - n) / 2.0);
- ctx->Viewport.WindowMap.m[MAT_TZ] = ctx->Visual.DepthMaxF * ((f - n) / 2.0 + n);
+ ctx->Viewport._WindowMap.m[MAT_SZ] = ctx->Visual.DepthMaxF * ((f - n) / 2.0);
+ ctx->Viewport._WindowMap.m[MAT_TZ] = ctx->Visual.DepthMaxF * ((f - n) / 2.0 + n);
ctx->NewState |= _NEW_VIEWPORT;
if (ctx->Driver.DepthRange) {
-/* $Id: points.c,v 1.19 2000/10/31 18:09:44 keithw Exp $ */
+/* $Id: points.c,v 1.20 2000/11/05 18:40:58 keithw Exp $ */
/*
* Mesa 3-D graphics library
if (ctx->Point.UserSize != size) {
ctx->Point.UserSize = size;
ctx->Point.Size = CLAMP(size, ctx->Const.MinPointSize, ctx->Const.MaxPointSize);
- ctx->TriangleCaps &= ~DD_POINT_SIZE;
+ ctx->_TriangleCaps &= ~DD_POINT_SIZE;
if (size != 1.0)
- ctx->TriangleCaps |= DD_POINT_SIZE;
+ ctx->_TriangleCaps |= DD_POINT_SIZE;
ctx->NewState |= _NEW_POINT;
}
}
switch (pname) {
case GL_DISTANCE_ATTENUATION_EXT:
{
- const GLboolean tmp = ctx->Point.Attenuated;
+ const GLboolean tmp = ctx->Point._Attenuated;
COPY_3V(ctx->Point.Params, params);
- ctx->Point.Attenuated = (params[0] != 1.0 ||
- params[1] != 0.0 ||
- params[2] != 0.0);
+ ctx->Point._Attenuated = (params[0] != 1.0 ||
+ params[1] != 0.0 ||
+ params[2] != 0.0);
- if (tmp != ctx->Point.Attenuated) {
- ctx->Enabled ^= ENABLE_POINT_ATTEN;
- ctx->TriangleCaps ^= DD_POINT_ATTEN;
+ if (tmp != ctx->Point._Attenuated) {
+ ctx->_Enabled ^= ENABLE_POINT_ATTEN;
+ ctx->_TriangleCaps ^= DD_POINT_ATTEN;
}
}
break;
-/* $Id: polygon.c,v 1.14 2000/10/30 13:32:01 keithw Exp $ */
+/* $Id: polygon.c,v 1.15 2000/11/05 18:40:58 keithw Exp $ */
/*
* Mesa 3-D graphics library
}
/* Compute a handy "shortcut" value: */
- ctx->TriangleCaps &= ~DD_TRI_UNFILLED;
- ctx->Polygon.Unfilled = GL_FALSE;
+ ctx->_TriangleCaps &= ~DD_TRI_UNFILLED;
+ ctx->Polygon._Unfilled = GL_FALSE;
if (ctx->Polygon.FrontMode!=GL_FILL || ctx->Polygon.BackMode!=GL_FILL) {
- ctx->Polygon.Unfilled = GL_TRUE;
- ctx->TriangleCaps |= DD_TRI_UNFILLED;
+ ctx->Polygon._Unfilled = GL_TRUE;
+ ctx->_TriangleCaps |= DD_TRI_UNFILLED;
}
ctx->NewState |= _NEW_POLYGON;
-/* $Id: rastpos.c,v 1.11 2000/10/29 19:02:23 brianp Exp $ */
+/* $Id: rastpos.c,v 1.12 2000/11/05 18:40:58 keithw Exp $ */
/*
* Mesa 3-D graphics library
GLfloat *objnorm = ctx->Current.Normal;
/* Not needed???
- vert = (ctx->NeedEyeCoords ? eye : v);
+ vert = (ctx->_NeedEyeCoords ? eye : v);
*/
- if (ctx->NeedEyeNormals) {
+ if (ctx->_NeedEyeNormals) {
GLfloat *inv = ctx->ModelView.inv;
TRANSFORM_NORMAL( eyenorm, objnorm, inv );
norm = eyenorm;
}
/* clip to user clipping planes */
- if ( ctx->Transform.AnyClip &&
+ if ( ctx->Transform._AnyClip &&
gl_userclip_point(ctx, clip) == 0)
{
ctx->Current.RasterPosValid = GL_FALSE;
ndc[1] = clip[1] * d;
ndc[2] = clip[2] * d;
- ctx->Current.RasterPos[0] = (ndc[0] * ctx->Viewport.WindowMap.m[MAT_SX] +
- ctx->Viewport.WindowMap.m[MAT_TX]);
- ctx->Current.RasterPos[1] = (ndc[1] * ctx->Viewport.WindowMap.m[MAT_SY] +
- ctx->Viewport.WindowMap.m[MAT_TY]);
- ctx->Current.RasterPos[2] = (ndc[2] * ctx->Viewport.WindowMap.m[MAT_SZ] +
- ctx->Viewport.WindowMap.m[MAT_TZ]) / ctx->Visual.DepthMaxF;
+ ctx->Current.RasterPos[0] = (ndc[0] * ctx->Viewport._WindowMap.m[MAT_SX] +
+ ctx->Viewport._WindowMap.m[MAT_TX]);
+ ctx->Current.RasterPos[1] = (ndc[1] * ctx->Viewport._WindowMap.m[MAT_SY] +
+ ctx->Viewport._WindowMap.m[MAT_TY]);
+ ctx->Current.RasterPos[2] = (ndc[2] * ctx->Viewport._WindowMap.m[MAT_SZ] +
+ ctx->Viewport._WindowMap.m[MAT_TZ]) / ctx->Visual.DepthMaxF;
ctx->Current.RasterPos[3] = clip[3];
ctx->Current.RasterPosValid = GL_TRUE;
-/* $Id: state.c,v 1.39 2000/10/31 18:09:45 keithw Exp $ */
+/* $Id: state.c,v 1.40 2000/11/05 18:40:58 keithw Exp $ */
/*
* Mesa 3-D graphics library
-/*
- * Recompute the value of ctx->RasterMask, etc. according to
- * the current context.
- */
-static void update_rasterflags( GLcontext *ctx )
-{
- ctx->RasterMask = 0;
-
- if (ctx->Color.AlphaEnabled) ctx->RasterMask |= ALPHATEST_BIT;
- if (ctx->Color.BlendEnabled) ctx->RasterMask |= BLEND_BIT;
- if (ctx->Depth.Test) ctx->RasterMask |= DEPTH_BIT;
- if (ctx->Fog.Enabled) ctx->RasterMask |= FOG_BIT;
- if (ctx->Scissor.Enabled) ctx->RasterMask |= SCISSOR_BIT;
- if (ctx->Stencil.Enabled) ctx->RasterMask |= STENCIL_BIT;
- if (ctx->Visual.RGBAflag) {
- const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask);
- if (colorMask != 0xffffffff) ctx->RasterMask |= MASKING_BIT;
- if (ctx->Color.ColorLogicOpEnabled) ctx->RasterMask |= LOGIC_OP_BIT;
- if (ctx->Texture.ReallyEnabled) ctx->RasterMask |= TEXTURE_BIT;
- }
- else {
- if (ctx->Color.IndexMask != 0xffffffff) ctx->RasterMask |= MASKING_BIT;
- if (ctx->Color.IndexLogicOpEnabled) ctx->RasterMask |= LOGIC_OP_BIT;
- }
-
- if (ctx->DrawBuffer->UseSoftwareAlphaBuffers
- && ctx->Color.ColorMask[ACOMP]
- && ctx->Color.DrawBuffer != GL_NONE)
- ctx->RasterMask |= ALPHABUF_BIT;
-
- if ( ctx->Viewport.X < 0
- || ctx->Viewport.X + ctx->Viewport.Width > ctx->DrawBuffer->Width
- || ctx->Viewport.Y < 0
- || ctx->Viewport.Y + ctx->Viewport.Height > ctx->DrawBuffer->Height) {
- ctx->RasterMask |= WINCLIP_BIT;
- }
-
- if (ctx->Depth.OcclusionTest)
- ctx->RasterMask |= OCCLUSION_BIT;
-
-
- /* If we're not drawing to exactly one color buffer set the
- * MULTI_DRAW_BIT flag. Also set it if we're drawing to no
- * buffers or the RGBA or CI mask disables all writes.
- */
- ctx->TriangleCaps &= ~DD_MULTIDRAW;
-
- if (ctx->Color.MultiDrawBuffer) {
- ctx->RasterMask |= MULTI_DRAW_BIT;
- ctx->TriangleCaps |= DD_MULTIDRAW;
- }
- else if (ctx->Color.DrawBuffer==GL_NONE) {
- ctx->RasterMask |= MULTI_DRAW_BIT;
- ctx->TriangleCaps |= DD_MULTIDRAW;
- }
- else if (ctx->Visual.RGBAflag && *((GLuint *) ctx->Color.ColorMask) == 0) {
- /* all RGBA channels disabled */
- ctx->RasterMask |= MULTI_DRAW_BIT;
- ctx->TriangleCaps |= DD_MULTIDRAW;
- }
- else if (!ctx->Visual.RGBAflag && ctx->Color.IndexMask==0) {
- /* all color index bits disabled */
- ctx->RasterMask |= MULTI_DRAW_BIT;
- ctx->TriangleCaps |= DD_MULTIDRAW;
- }
-}
void gl_print_state( const char *msg, GLuint state )
if (MESA_VERBOSE & VERBOSE_STATE)
gl_print_state("", ctx->NewState);
- if (ctx->NewState & _NEW_PIXEL)
+ if (ctx->NewState & (_NEW_PIXEL|_NEW_COLOR_MATRIX))
_mesa_update_image_transfer_state(ctx);
if (ctx->NewState & _NEW_ARRAY)
gl_update_client_state( ctx );
if (ctx->NewState & _NEW_TEXTURE_MATRIX) {
- ctx->Enabled &= ~(ENABLE_TEXMAT0 | ENABLE_TEXMAT1 | ENABLE_TEXMAT2);
+ ctx->_Enabled &= ~(ENABLE_TEXMAT0 | ENABLE_TEXMAT1 | ENABLE_TEXMAT2);
for (i=0; i < ctx->Const.MaxTextureUnits; i++) {
if (ctx->TextureMatrix[i].flags & MAT_DIRTY_ALL_OVER) {
if (ctx->Texture.Unit[i].Enabled &&
ctx->TextureMatrix[i].type != MATRIX_IDENTITY)
- ctx->Enabled |= ENABLE_TEXMAT0 << i;
+ ctx->_Enabled |= ENABLE_TEXMAT0 << i;
}
}
}
if (ctx->NewState & _NEW_TEXTURE) {
- ctx->Texture.MultiTextureEnabled = GL_FALSE;
- ctx->Texture.NeedNormals = GL_FALSE;
+ ctx->Texture._MultiTextureEnabled = GL_FALSE;
+ ctx->Texture._NeedNormals = GL_FALSE;
gl_update_dirty_texobjs(ctx);
- ctx->Enabled &= ~(ENABLE_TEXGEN0 | ENABLE_TEXGEN1 | ENABLE_TEXGEN2);
- ctx->Texture.ReallyEnabled = 0;
+ ctx->_Enabled &= ~(ENABLE_TEXGEN0 | ENABLE_TEXGEN1 | ENABLE_TEXGEN2);
+ ctx->Texture._ReallyEnabled = 0;
for (i=0; i < ctx->Const.MaxTextureUnits; i++) {
if (ctx->Texture.Unit[i].Enabled) {
gl_update_texture_unit( ctx, &ctx->Texture.Unit[i] );
- ctx->Texture.ReallyEnabled |=
- ctx->Texture.Unit[i].ReallyEnabled << (i * 4);
+ ctx->Texture._ReallyEnabled |=
+ ctx->Texture.Unit[i]._ReallyEnabled << (i * 4);
- if (ctx->Texture.Unit[i].GenFlags != 0) {
- ctx->Enabled |= ENABLE_TEXGEN0 << i;
+ if (ctx->Texture.Unit[i]._GenFlags != 0) {
+ ctx->_Enabled |= ENABLE_TEXGEN0 << i;
- if (ctx->Texture.Unit[i].GenFlags & TEXGEN_NEED_NORMALS) {
- ctx->Texture.NeedNormals = GL_TRUE;
- ctx->Texture.NeedEyeCoords = GL_TRUE;
+ if (ctx->Texture.Unit[i]._GenFlags & TEXGEN_NEED_NORMALS) {
+ ctx->Texture._NeedNormals = GL_TRUE;
+ ctx->Texture._NeedEyeCoords = GL_TRUE;
}
- if (ctx->Texture.Unit[i].GenFlags & TEXGEN_NEED_EYE_COORD) {
- ctx->Texture.NeedEyeCoords = GL_TRUE;
+ if (ctx->Texture.Unit[i]._GenFlags & TEXGEN_NEED_EYE_COORD) {
+ ctx->Texture._NeedEyeCoords = GL_TRUE;
}
}
- if (i > 0 && ctx->Texture.Unit[i].ReallyEnabled) {
- ctx->Texture.MultiTextureEnabled = GL_TRUE;
+ if (i > 0 && ctx->Texture.Unit[i]._ReallyEnabled) {
+ ctx->Texture._MultiTextureEnabled = GL_TRUE;
}
}
else {
- ctx->Texture.Unit[i].ReallyEnabled = 0;
+ ctx->Texture.Unit[i]._ReallyEnabled = 0;
}
}
- ctx->Enabled = (ctx->Enabled & ~ENABLE_TEX_ANY) | ctx->Texture.ReallyEnabled;
- ctx->NeedNormals = (ctx->Light.Enabled || ctx->Texture.NeedNormals);
+ ctx->_Enabled = ((ctx->_Enabled & ~ENABLE_TEX_ANY) |
+ ctx->Texture._ReallyEnabled);
+ ctx->_NeedNormals = (ctx->Light.Enabled || ctx->Texture._NeedNormals);
}
- if (ctx->NewState & _SWRAST_NEW_RASTERMASK)
- update_rasterflags(ctx);
-
if (ctx->NewState & (_NEW_BUFFERS|_NEW_SCISSOR)) {
/* update scissor region */
ctx->DrawBuffer->Xmin = 0;
}
if (ctx->NewState & _NEW_LIGHT) {
- ctx->TriangleCaps &= ~(DD_TRI_LIGHT_TWOSIDE|DD_LIGHTING_CULL);
+ ctx->_TriangleCaps &= ~(DD_TRI_LIGHT_TWOSIDE|DD_LIGHTING_CULL);
if (ctx->Light.Enabled) {
if (ctx->Light.Model.TwoSide)
- ctx->TriangleCaps |= (DD_TRI_LIGHT_TWOSIDE|DD_LIGHTING_CULL);
+ ctx->_TriangleCaps |= (DD_TRI_LIGHT_TWOSIDE|DD_LIGHTING_CULL);
gl_update_lighting(ctx);
}
}
if (ctx->NewState & (_NEW_POLYGON | _NEW_LIGHT)) {
- ctx->TriangleCaps &= ~DD_TRI_CULL_FRONT_BACK;
if (ctx->NewState & _NEW_POLYGON) {
+ ctx->_TriangleCaps &= ~DD_TRI_CULL_FRONT_BACK;
+
/* Setup CullBits bitmask */
if (ctx->Polygon.CullFlag) {
- ctx->backface_sign = 1;
+ ctx->_backface_sign = 1;
switch(ctx->Polygon.CullFaceMode) {
case GL_BACK:
if(ctx->Polygon.FrontFace==GL_CCW)
- ctx->backface_sign = -1;
- ctx->Polygon.CullBits = 1;
+ ctx->_backface_sign = -1;
+ ctx->Polygon._CullBits = 1;
break;
case GL_FRONT:
if(ctx->Polygon.FrontFace!=GL_CCW)
- ctx->backface_sign = -1;
- ctx->Polygon.CullBits = 2;
+ ctx->_backface_sign = -1;
+ ctx->Polygon._CullBits = 2;
break;
default:
case GL_FRONT_AND_BACK:
- ctx->backface_sign = 0;
- ctx->Polygon.CullBits = 0;
- ctx->TriangleCaps |= DD_TRI_CULL_FRONT_BACK;
+ ctx->_backface_sign = 0;
+ ctx->Polygon._CullBits = 0;
+ ctx->_TriangleCaps |= DD_TRI_CULL_FRONT_BACK;
break;
}
}
else {
- ctx->Polygon.CullBits = 3;
- ctx->backface_sign = 0;
+ ctx->Polygon._CullBits = 3;
+ ctx->_backface_sign = 0;
}
/* Any Polygon offsets enabled? */
- ctx->TriangleCaps &= ~DD_TRI_OFFSET;
+ ctx->_TriangleCaps &= ~DD_TRI_OFFSET;
if (ctx->Polygon.OffsetPoint ||
ctx->Polygon.OffsetLine ||
ctx->Polygon.OffsetFill)
- ctx->TriangleCaps |= DD_TRI_OFFSET;
+ ctx->_TriangleCaps |= DD_TRI_OFFSET;
}
}
if (ctx->NewState & ctx->Driver.UpdateStateNotify)
{
- ctx->IndirectTriangles = ctx->TriangleCaps & ~ctx->Driver.TriangleCaps;
- ctx->IndirectTriangles |= DD_SW_RASTERIZE;
-
- if (MESA_VERBOSE&VERBOSE_CULL)
- gl_print_tri_caps("initial indirect tris", ctx->IndirectTriangles);
-
- ctx->Driver.PointsFunc = NULL;
- ctx->Driver.LineFunc = NULL;
- ctx->Driver.TriangleFunc = NULL;
- ctx->Driver.QuadFunc = NULL;
- ctx->Driver.RectFunc = NULL;
- ctx->Driver.RenderVBClippedTab = NULL;
- ctx->Driver.RenderVBCulledTab = NULL;
- ctx->Driver.RenderVBRawTab = NULL;
-
/*
* Here the driver sets up all the ctx->Driver function pointers to
* it's specific, private functions.
*/
ctx->Driver.UpdateState(ctx);
-
- if (MESA_VERBOSE&VERBOSE_CULL)
- gl_print_tri_caps("indirect tris", ctx->IndirectTriangles);
-
- /*
- * In case the driver didn't hook in an optimized point, line or
- * triangle function we'll now select "core/fallback" point, line
- * and triangle functions.
- */
- if (ctx->IndirectTriangles & DD_SW_RASTERIZE) {
- _swrast_set_point_function(ctx);
- _swrast_set_line_function(ctx);
- _swrast_set_triangle_function(ctx);
- _swrast_set_quad_function(ctx);
-
- if ((ctx->IndirectTriangles &
- (DD_TRI_SW_RASTERIZE|DD_QUAD_SW_RASTERIZE|DD_TRI_CULL)) ==
- (DD_TRI_SW_RASTERIZE|DD_QUAD_SW_RASTERIZE|DD_TRI_CULL))
- ctx->IndirectTriangles &= ~DD_TRI_CULL;
- }
-
- if (MESA_VERBOSE&VERBOSE_CULL)
- gl_print_tri_caps("indirect tris 2", ctx->IndirectTriangles);
-
- gl_set_render_vb_function(ctx);
+ gl_set_render_vb_function(ctx); /* fix me */
}
/* Should only be calc'd when !need_eye_coords and not culling.
gl_matrix_analyze( &ctx->ProjectionMatrix );
ctx->ProjectionMatrix.flags &= ~MAT_DIRTY_DEPENDENTS;
- if (ctx->Transform.AnyClip) {
+ if (ctx->Transform._AnyClip) {
gl_update_userclip( ctx );
}
}
/* Figure out whether we can light in object space or not. If we
* can, find the current positions of the lights in object space
*/
- if ((ctx->Enabled & (ENABLE_POINT_ATTEN | ENABLE_LIGHT | ENABLE_FOG |
+ if ((ctx->_Enabled & (ENABLE_POINT_ATTEN | ENABLE_LIGHT | ENABLE_FOG |
ENABLE_TEXGEN0 | ENABLE_TEXGEN1 | ENABLE_TEXGEN2)) &&
(ctx->NewState & (_NEW_LIGHT |
_NEW_TEXTURE |
{
GLboolean oldcoord, oldnorm;
- oldcoord = ctx->NeedEyeCoords;
- oldnorm = ctx->NeedEyeNormals;
+ oldcoord = ctx->_NeedEyeCoords;
+ oldnorm = ctx->_NeedEyeNormals;
- ctx->NeedNormals = (ctx->Light.Enabled || ctx->Texture.NeedNormals);
- ctx->NeedEyeCoords = (ctx->Fog.Enabled || ctx->Point.Attenuated);
- ctx->NeedEyeNormals = GL_FALSE;
+ ctx->_NeedNormals = (ctx->Light.Enabled || ctx->Texture._NeedNormals);
+ ctx->_NeedEyeCoords = (ctx->Fog.Enabled || ctx->Point._Attenuated);
+ ctx->_NeedEyeNormals = GL_FALSE;
if (ctx->Light.Enabled) {
- if ((ctx->Light.Flags & LIGHT_POSITIONAL) ||
- ctx->Light.NeedVertices ||
+ if ((ctx->Light._Flags & LIGHT_POSITIONAL) ||
+ ctx->Light._NeedVertices ||
!TEST_MAT_FLAGS( &ctx->ModelView, MAT_FLAGS_LENGTH_PRESERVING)) {
/* Need length for attenuation or need angle for spotlights
* or non-uniform scale matrix
*/
- ctx->NeedEyeCoords = GL_TRUE;
+ ctx->_NeedEyeCoords = GL_TRUE;
}
- ctx->NeedEyeNormals = ctx->NeedEyeCoords;
+ ctx->_NeedEyeNormals = ctx->_NeedEyeCoords;
}
- if (ctx->Texture.ReallyEnabled || ctx->RenderMode==GL_FEEDBACK) {
- if (ctx->Texture.NeedEyeCoords) ctx->NeedEyeCoords = GL_TRUE;
- if (ctx->Texture.NeedNormals)
- ctx->NeedNormals = ctx->NeedEyeNormals = GL_TRUE;
+ if (ctx->Texture._ReallyEnabled || ctx->RenderMode==GL_FEEDBACK) {
+ if (ctx->Texture._NeedEyeCoords) ctx->_NeedEyeCoords = GL_TRUE;
+ if (ctx->Texture._NeedNormals)
+ ctx->_NeedNormals = ctx->_NeedEyeNormals = GL_TRUE;
}
- ctx->vb_proj_matrix = &ctx->ModelProjectMatrix;
-
- if (ctx->NeedEyeCoords)
- ctx->vb_proj_matrix = &ctx->ProjectionMatrix;
+ if (ctx->_NeedEyeCoords)
+ ctx->_vb_proj_matrix = &ctx->ProjectionMatrix;
+ else
+ ctx->_vb_proj_matrix = &ctx->_ModelProjectMatrix;
if (ctx->Light.Enabled) {
gl_update_lighting_function(ctx);
if ( (ctx->NewState & _NEW_LIGHT) ||
((ctx->NewState & (_NEW_MODELVIEW|_NEW_PROJECTION)) &&
- !ctx->NeedEyeCoords) ||
- oldcoord != ctx->NeedEyeCoords ||
- oldnorm != ctx->NeedEyeNormals) {
+ !ctx->_NeedEyeCoords) ||
+ oldcoord != ctx->_NeedEyeCoords ||
+ oldnorm != ctx->_NeedEyeNormals) {
gl_compute_light_positions(ctx);
}
- ctx->rescale_factor = 1.0F;
+ ctx->_rescale_factor = 1.0F;
if (ctx->ModelView.flags & (MAT_FLAG_UNIFORM_SCALE |
MAT_FLAG_GENERAL_SCALE |
MAT_FLAG_GENERAL_3D |
const GLfloat *m = ctx->ModelView.inv;
const GLfloat f = m[2] * m[2] + m[6] * m[6] + m[10] * m[10];
if (f > 1e-12 && (f - 1.0) * (f - 1.0) > 1e-12)
- ctx->rescale_factor = 1.0 / GL_SQRT(f);
+ ctx->_rescale_factor = 1.0 / GL_SQRT(f);
}
}
if (ctx->Pixel.MinMaxEnabled)
mask |= IMAGE_MIN_MAX_BIT;
- ctx->ImageTransferState = mask;
+ ctx->_ImageTransferState = mask;
}
-/* $Id: teximage.c,v 1.58 2000/10/31 18:09:45 keithw Exp $ */
+/* $Id: teximage.c,v 1.59 2000/11/05 18:40:58 keithw Exp $ */
/*
* Mesa 3-D graphics library
texComponents = components_in_intformat(texFormat);
/* try common 2D texture cases first */
- if (!ctx->ImageTransferState && dimensions == 2
+ if (!ctx->_ImageTransferState && dimensions == 2
&& srcType == GL_UNSIGNED_BYTE) {
if (srcFormat == texFormat) {
srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, row, 0);
_mesa_unpack_index_span(ctx, srcWidth, texType, destRow,
srcType, src, srcPacking,
- ctx->ImageTransferState);
+ ctx->_ImageTransferState);
destRow += dstRowStride;
}
dest += dstImageStride;
srcFormat, srcType, img, row, 0);
_mesa_unpack_float_color_span(ctx, srcWidth, GL_RGBA, dstf,
srcFormat, srcType, src, srcPacking,
- ctx->ImageTransferState & IMAGE_PRE_CONVOLUTION_BITS,
+ ctx->_ImageTransferState & IMAGE_PRE_CONVOLUTION_BITS,
GL_TRUE);
dstf += srcWidth * 4;
}
(const GLfloat (*)[4]) srcf,
texFormat, GL_UNSIGNED_BYTE,
dest, &_mesa_native_packing,
- ctx->ImageTransferState
+ ctx->_ImageTransferState
& IMAGE_POST_CONVOLUTION_BITS);
srcf += convWidth * 4;
dest += dstRowStride;
srcFormat, srcType, img, row, 0);
_mesa_unpack_chan_color_span(ctx, srcWidth, texFormat, destRow,
srcFormat, srcType, srcRow, srcPacking,
- ctx->ImageTransferState);
+ ctx->_ImageTransferState);
destRow += dstRowStride;
}
dest += dstImageStride;
if (ctx->NewState & _NEW_PIXEL)
gl_update_state(ctx);
- if (ctx->ImageTransferState & IMAGE_CONVOLUTION_BIT) {
+ if (ctx->_ImageTransferState & IMAGE_CONVOLUTION_BIT) {
adjust_texture_size_for_convolution(ctx, dimensions,
&convWidth, &convHeight);
}
if (pixels) {
GLboolean retain = GL_TRUE;
GLboolean success = GL_FALSE;
- if (!ctx->ImageTransferState && ctx->Driver.TexImage1D) {
+ if (!ctx->_ImageTransferState && ctx->Driver.TexImage1D) {
/* let device driver try to use raw image */
success = (*ctx->Driver.TexImage1D)( ctx, target, level, format,
type, pixels, &ctx->Unpack,
if (pixels) {
GLboolean retain = GL_TRUE;
GLboolean success = GL_FALSE;
- if (!ctx->ImageTransferState && ctx->Driver.TexImage2D) {
+ if (!ctx->_ImageTransferState && ctx->Driver.TexImage2D) {
/* let device driver try to use raw image */
success = (*ctx->Driver.TexImage2D)( ctx, target, level, format,
type, pixels, &ctx->Unpack,
if (pixels) {
GLboolean retain = GL_TRUE;
GLboolean success = GL_FALSE;
- if (!ctx->ImageTransferState && ctx->Driver.TexImage3D) {
+ if (!ctx->_ImageTransferState && ctx->Driver.TexImage3D) {
/* let device driver try to use raw image */
success = (*ctx->Driver.TexImage3D)( ctx, target, level, format,
type, pixels, &ctx->Unpack,
* all but this is easier. We're on a (slow) software path
* anyway.
*/
- for (level = 0; level <= texObj->P; level++) {
+ for (level = 0; level <= texObj->_P; level++) {
struct gl_texture_image *texImg = texObj->Image[level];
if (texImg && !texImg->Data) {
_mesa_get_teximage_from_driver(ctx, target, level, texObj);
if (ctx->NewState & _NEW_PIXEL)
gl_update_state(ctx);
- if (ctx->ImageTransferState & IMAGE_CONVOLUTION_BIT) {
+ if (ctx->_ImageTransferState & IMAGE_CONVOLUTION_BIT) {
/* convert texture image to GL_RGBA, GL_FLOAT */
GLfloat *tmpImage, *convImage;
const GLint comps = components_in_intformat(texImage->Format);
_mesa_unpack_float_color_span(ctx, width, GL_RGBA, dst,
texImage->Format, GL_UNSIGNED_BYTE,
src, &_mesa_native_packing,
- ctx->ImageTransferState & IMAGE_PRE_CONVOLUTION_BITS,
+ ctx->_ImageTransferState & IMAGE_PRE_CONVOLUTION_BITS,
GL_FALSE);
}
_mesa_pack_float_rgba_span(ctx, convWidth,
(const GLfloat(*)[4]) src,
format, type, dest, &ctx->Pack,
- ctx->ImageTransferState & IMAGE_POST_CONVOLUTION_BITS);
+ ctx->_ImageTransferState & IMAGE_POST_CONVOLUTION_BITS);
}
}
+ (img * height + row ) * width * 4;
_mesa_pack_rgba_span( ctx, width, (CONST GLchan (*)[4]) src,
format, type, dest, &ctx->Pack,
- ctx->ImageTransferState );
+ ctx->_ImageTransferState );
}
else {
/* general case: convert row to RGBA format */
}
_mesa_pack_rgba_span( ctx, width, (const GLchan (*)[4])rgba,
format, type, dest, &ctx->Pack,
- ctx->ImageTransferState );
+ ctx->_ImageTransferState );
} /* format */
} /* row */
} /* img */
if (ctx->NewState & _NEW_PIXEL)
gl_update_state(ctx);
- if (!ctx->ImageTransferState && ctx->Driver.TexSubImage1D) {
+ if (!ctx->_ImageTransferState && ctx->Driver.TexSubImage1D) {
success = (*ctx->Driver.TexSubImage1D)( ctx, target, level, xoffset,
width, format, type, pixels,
&ctx->Unpack, texObj, texImage );
if (ctx->NewState & _NEW_PIXEL)
gl_update_state(ctx);
- if (!ctx->ImageTransferState && ctx->Driver.TexSubImage2D) {
+ if (!ctx->_ImageTransferState && ctx->Driver.TexSubImage2D) {
success = (*ctx->Driver.TexSubImage2D)( ctx, target, level, xoffset,
yoffset, width, height, format, type,
pixels, &ctx->Unpack, texObj, texImage );
if (ctx->NewState & _NEW_PIXEL)
gl_update_state(ctx);
- if (!ctx->ImageTransferState && ctx->Driver.TexSubImage3D) {
+ if (!ctx->_ImageTransferState && ctx->Driver.TexSubImage3D) {
success = (*ctx->Driver.TexSubImage3D)( ctx, target, level, xoffset,
yoffset, zoffset, width, height, depth, format,
type, pixels, &ctx->Unpack, texObj, texImage );
if (ctx->NewState & _NEW_PIXEL)
gl_update_state(ctx);
- if (ctx->ImageTransferState || !ctx->Driver.CopyTexImage1D
+ if (ctx->_ImageTransferState || !ctx->Driver.CopyTexImage1D
|| !(*ctx->Driver.CopyTexImage1D)(ctx, target, level,
internalFormat, x, y, width, border)) {
struct gl_pixelstore_attrib unpackSave;
if (ctx->NewState & _NEW_PIXEL)
gl_update_state(ctx);
- if (ctx->ImageTransferState || !ctx->Driver.CopyTexImage2D
+ if (ctx->_ImageTransferState || !ctx->Driver.CopyTexImage2D
|| !(*ctx->Driver.CopyTexImage2D)(ctx, target, level,
internalFormat, x, y, width, height, border)) {
struct gl_pixelstore_attrib unpackSave;
if (ctx->NewState & _NEW_PIXEL)
gl_update_state(ctx);
- if (ctx->ImageTransferState || !ctx->Driver.CopyTexSubImage1D
+ if (ctx->_ImageTransferState || !ctx->Driver.CopyTexSubImage1D
|| !(*ctx->Driver.CopyTexSubImage1D)(ctx, target, level,
xoffset, x, y, width)) {
struct gl_texture_unit *texUnit;
if (ctx->NewState & _NEW_PIXEL)
gl_update_state(ctx);
- if (ctx->ImageTransferState || !ctx->Driver.CopyTexSubImage2D
+ if (ctx->_ImageTransferState || !ctx->Driver.CopyTexSubImage2D
|| !(*ctx->Driver.CopyTexSubImage2D)(ctx, target, level,
xoffset, yoffset, x, y, width, height )) {
struct gl_texture_unit *texUnit;
if (ctx->NewState & _NEW_PIXEL)
gl_update_state(ctx);
- if (ctx->ImageTransferState || !ctx->Driver.CopyTexSubImage3D
+ if (ctx->_ImageTransferState || !ctx->Driver.CopyTexSubImage3D
|| !(*ctx->Driver.CopyTexSubImage3D)(ctx, target, level,
xoffset, yoffset, zoffset, x, y, width, height )) {
struct gl_texture_unit *texUnit;
-/* $Id: texobj.c,v 1.31 2000/10/30 13:32:01 keithw Exp $ */
+/* $Id: texobj.c,v 1.32 2000/11/05 18:40:58 keithw Exp $ */
/*
* Mesa 3-D graphics library
obj->MaxLod = 1000.0;
obj->BaseLevel = 0;
obj->MaxLevel = 1000;
- obj->MinMagThresh = 0.0F;
_mesa_init_colortable(&obj->Palette);
/* insert into linked list */
/* Compute number of mipmap levels */
if (t->Dimensions == 1) {
- t->P = t->Image[baseLevel]->WidthLog2;
+ t->_P = t->Image[baseLevel]->WidthLog2;
}
else if (t->Dimensions == 2 || t->Dimensions == 6) {
- t->P = MAX2(t->Image[baseLevel]->WidthLog2,
- t->Image[baseLevel]->HeightLog2);
+ t->_P = MAX2(t->Image[baseLevel]->WidthLog2,
+ t->Image[baseLevel]->HeightLog2);
}
else if (t->Dimensions == 3) {
GLint max = MAX2(t->Image[baseLevel]->WidthLog2,
t->Image[baseLevel]->HeightLog2);
max = MAX2(max, (GLint)(t->Image[baseLevel]->DepthLog2));
- t->P = max;
+ t->_P = max;
}
/* Compute M (see the 1.2 spec) used during mipmapping */
- t->M = (GLfloat) (MIN2(t->MaxLevel, t->P) - t->BaseLevel);
+ t->_M = (GLfloat) (MIN2(t->MaxLevel, t->_P) - t->BaseLevel);
if (t->Dimensions == 6) {
*/
GLint i;
GLint minLevel = baseLevel;
- GLint maxLevel = MIN2(t->P, ctx->Const.MaxTextureLevels-1);
+ GLint maxLevel = MIN2(t->_P, ctx->Const.MaxTextureLevels-1);
maxLevel = MIN2(maxLevel, t->MaxLevel);
if (minLevel > maxLevel) {
/* If we've changed the CurrentD[123] texture object then update the
* ctx->Texture.Current pointer to point to the new texture object.
*/
- texUnit->Current = texUnit->CurrentD[texUnit->CurrentDimension];
+ texUnit->_Current = texUnit->CurrentD[texUnit->_CurrentDimension];
ctx->NewState |= _NEW_TEXTURE;
-/* $Id: texstate.c,v 1.20 2000/10/31 18:09:45 keithw Exp $ */
+/* $Id: texstate.c,v 1.21 2000/11/05 18:40:58 keithw Exp $ */
/*
* Mesa 3-D graphics library
switch (mode) {
case GL_OBJECT_LINEAR:
texUnit->GenModeS = mode;
- texUnit->GenBitS = TEXGEN_OBJ_LINEAR;
+ texUnit->_GenBitS = TEXGEN_OBJ_LINEAR;
break;
case GL_EYE_LINEAR:
texUnit->GenModeS = mode;
- texUnit->GenBitS = TEXGEN_EYE_LINEAR;
+ texUnit->_GenBitS = TEXGEN_EYE_LINEAR;
break;
case GL_REFLECTION_MAP_NV:
texUnit->GenModeS = mode;
- texUnit->GenBitS = TEXGEN_REFLECTION_MAP_NV;
+ texUnit->_GenBitS = TEXGEN_REFLECTION_MAP_NV;
break;
case GL_NORMAL_MAP_NV:
texUnit->GenModeS = mode;
- texUnit->GenBitS = TEXGEN_NORMAL_MAP_NV;
+ texUnit->_GenBitS = TEXGEN_NORMAL_MAP_NV;
break;
case GL_SPHERE_MAP:
texUnit->GenModeS = mode;
- texUnit->GenBitS = TEXGEN_SPHERE_MAP;
+ texUnit->_GenBitS = TEXGEN_SPHERE_MAP;
break;
default:
gl_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" );
switch (mode) {
case GL_OBJECT_LINEAR:
texUnit->GenModeT = GL_OBJECT_LINEAR;
- texUnit->GenBitT = TEXGEN_OBJ_LINEAR;
+ texUnit->_GenBitT = TEXGEN_OBJ_LINEAR;
break;
case GL_EYE_LINEAR:
texUnit->GenModeT = GL_EYE_LINEAR;
- texUnit->GenBitT = TEXGEN_EYE_LINEAR;
+ texUnit->_GenBitT = TEXGEN_EYE_LINEAR;
break;
case GL_REFLECTION_MAP_NV:
texUnit->GenModeT = GL_REFLECTION_MAP_NV;
- texUnit->GenBitT = TEXGEN_REFLECTION_MAP_NV;
+ texUnit->_GenBitT = TEXGEN_REFLECTION_MAP_NV;
break;
case GL_NORMAL_MAP_NV:
texUnit->GenModeT = GL_NORMAL_MAP_NV;
- texUnit->GenBitT = TEXGEN_NORMAL_MAP_NV;
+ texUnit->_GenBitT = TEXGEN_NORMAL_MAP_NV;
break;
case GL_SPHERE_MAP:
texUnit->GenModeT = GL_SPHERE_MAP;
- texUnit->GenBitT = TEXGEN_SPHERE_MAP;
+ texUnit->_GenBitT = TEXGEN_SPHERE_MAP;
break;
default:
gl_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" );
switch (mode) {
case GL_OBJECT_LINEAR:
texUnit->GenModeR = GL_OBJECT_LINEAR;
- texUnit->GenBitR = TEXGEN_OBJ_LINEAR;
+ texUnit->_GenBitR = TEXGEN_OBJ_LINEAR;
break;
case GL_REFLECTION_MAP_NV:
texUnit->GenModeR = GL_REFLECTION_MAP_NV;
- texUnit->GenBitR = TEXGEN_REFLECTION_MAP_NV;
+ texUnit->_GenBitR = TEXGEN_REFLECTION_MAP_NV;
break;
case GL_NORMAL_MAP_NV:
texUnit->GenModeR = GL_NORMAL_MAP_NV;
- texUnit->GenBitR = TEXGEN_NORMAL_MAP_NV;
+ texUnit->_GenBitR = TEXGEN_NORMAL_MAP_NV;
break;
case GL_EYE_LINEAR:
texUnit->GenModeR = GL_EYE_LINEAR;
- texUnit->GenBitR = TEXGEN_EYE_LINEAR;
+ texUnit->_GenBitR = TEXGEN_EYE_LINEAR;
break;
default:
gl_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" );
switch (mode) {
case GL_OBJECT_LINEAR:
texUnit->GenModeQ = GL_OBJECT_LINEAR;
- texUnit->GenBitQ = TEXGEN_OBJ_LINEAR;
+ texUnit->_GenBitQ = TEXGEN_OBJ_LINEAR;
break;
case GL_EYE_LINEAR:
texUnit->GenModeQ = GL_EYE_LINEAR;
- texUnit->GenBitQ = TEXGEN_EYE_LINEAR;
+ texUnit->_GenBitQ = TEXGEN_EYE_LINEAR;
break;
default:
gl_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" );
for (t = ctx->Shared->DirtyTexObjList; t; t = next) {
next = t->NextDirty;
_mesa_test_texobj_completeness(ctx, t);
- _swrast_set_texture_sampler(t); /* swrast should do this internally */
t->NextDirty = NULL;
t->Dirty = GL_FALSE;
}
-/* $Id: varray.c,v 1.29 2000/10/30 18:50:42 keithw Exp $ */
+/* $Id: varray.c,v 1.30 2000/11/05 18:40:59 keithw Exp $ */
/*
* Mesa 3-D graphics library
ctx->Array.Vertex.Type = type;
ctx->Array.Vertex.Stride = stride;
ctx->Array.Vertex.Ptr = (void *) ptr;
- ctx->Array.VertexFunc = gl_trans_4f_tab[size][TYPE_IDX(type)];
- ctx->Array.VertexEltFunc = gl_trans_elt_4f_tab[size][TYPE_IDX(type)];
- ctx->Array.NewArrayState |= VERT_OBJ_ANY;
+ ctx->Array._VertexFunc = gl_trans_4f_tab[size][TYPE_IDX(type)];
+ ctx->Array._VertexEltFunc = gl_trans_elt_4f_tab[size][TYPE_IDX(type)];
+ ctx->Array._NewArrayState |= VERT_OBJ_ANY;
ctx->NewState |= _NEW_ARRAY;
}
ctx->Array.Normal.Type = type;
ctx->Array.Normal.Stride = stride;
ctx->Array.Normal.Ptr = (void *) ptr;
- ctx->Array.NormalFunc = gl_trans_3f_tab[TYPE_IDX(type)];
- ctx->Array.NormalEltFunc = gl_trans_elt_3f_tab[TYPE_IDX(type)];
- ctx->Array.NewArrayState |= VERT_NORM;
+ ctx->Array._NormalFunc = gl_trans_3f_tab[TYPE_IDX(type)];
+ ctx->Array._NormalEltFunc = gl_trans_elt_3f_tab[TYPE_IDX(type)];
+ ctx->Array._NewArrayState |= VERT_NORM;
ctx->NewState |= _NEW_ARRAY;
}
ctx->Array.Color.Type = type;
ctx->Array.Color.Stride = stride;
ctx->Array.Color.Ptr = (void *) ptr;
- ctx->Array.ColorFunc = gl_trans_4ub_tab[size][TYPE_IDX(type)];
- ctx->Array.ColorEltFunc = gl_trans_elt_4ub_tab[size][TYPE_IDX(type)];
- ctx->Array.NewArrayState |= VERT_RGBA;
+ ctx->Array._ColorFunc = gl_trans_4ub_tab[size][TYPE_IDX(type)];
+ ctx->Array._ColorEltFunc = gl_trans_elt_4ub_tab[size][TYPE_IDX(type)];
+ ctx->Array._NewArrayState |= VERT_RGBA;
ctx->NewState |= _NEW_ARRAY;
}
ctx->Array.FogCoord.Type = type;
ctx->Array.FogCoord.Stride = stride;
ctx->Array.FogCoord.Ptr = (void *) ptr;
- ctx->Array.FogCoordFunc = gl_trans_1f_tab[TYPE_IDX(type)];
- ctx->Array.FogCoordEltFunc = gl_trans_elt_1f_tab[TYPE_IDX(type)];
- ctx->Array.NewArrayState |= VERT_FOG_COORD;
+ ctx->Array._FogCoordFunc = gl_trans_1f_tab[TYPE_IDX(type)];
+ ctx->Array._FogCoordEltFunc = gl_trans_elt_1f_tab[TYPE_IDX(type)];
+ ctx->Array._NewArrayState |= VERT_FOG_COORD;
ctx->NewState |= _NEW_ARRAY;
}
ctx->Array.Index.Type = type;
ctx->Array.Index.Stride = stride;
ctx->Array.Index.Ptr = (void *) ptr;
- ctx->Array.IndexFunc = gl_trans_1ui_tab[TYPE_IDX(type)];
- ctx->Array.IndexEltFunc = gl_trans_elt_1ui_tab[TYPE_IDX(type)];
- ctx->Array.NewArrayState |= VERT_INDEX;
+ ctx->Array._IndexFunc = gl_trans_1ui_tab[TYPE_IDX(type)];
+ ctx->Array._IndexEltFunc = gl_trans_elt_1ui_tab[TYPE_IDX(type)];
+ ctx->Array._NewArrayState |= VERT_INDEX;
ctx->NewState |= _NEW_ARRAY;
}
ctx->Array.SecondaryColor.Type = type;
ctx->Array.SecondaryColor.Stride = stride;
ctx->Array.SecondaryColor.Ptr = (void *) ptr;
- ctx->Array.SecondaryColorFunc = gl_trans_4ub_tab[size][TYPE_IDX(type)];
- ctx->Array.SecondaryColorEltFunc = gl_trans_elt_4ub_tab[size][TYPE_IDX(type)];
- ctx->Array.NewArrayState |= VERT_SPEC_RGB;
+ ctx->Array._SecondaryColorFunc = gl_trans_4ub_tab[size][TYPE_IDX(type)];
+ ctx->Array._SecondaryColorEltFunc = gl_trans_elt_4ub_tab[size][TYPE_IDX(type)];
+ ctx->Array._NewArrayState |= VERT_SPEC_RGB;
ctx->NewState |= _NEW_ARRAY;
}
ctx->Array.TexCoord[texUnit].Stride = stride;
ctx->Array.TexCoord[texUnit].Ptr = (void *) ptr;
- ctx->Array.TexCoordFunc[texUnit] = gl_trans_4f_tab[size][TYPE_IDX(type)];
- ctx->Array.TexCoordEltFunc[texUnit] = gl_trans_elt_4f_tab[size][TYPE_IDX(type)];
- ctx->Array.NewArrayState |= VERT_TEX_ANY(texUnit);
+ ctx->Array._TexCoordFunc[texUnit] = gl_trans_4f_tab[size][TYPE_IDX(type)];
+ ctx->Array._TexCoordEltFunc[texUnit] = gl_trans_elt_4f_tab[size][TYPE_IDX(type)];
+ ctx->Array._NewArrayState |= VERT_TEX_ANY(texUnit);
ctx->NewState |= _NEW_ARRAY;
}
ctx->Array.EdgeFlag.StrideB = stride ? stride : sizeof(GLboolean);
ctx->Array.EdgeFlag.Ptr = (GLboolean *) ptr;
if (stride != sizeof(GLboolean)) {
- ctx->Array.EdgeFlagFunc = gl_trans_1ub_tab[TYPE_IDX(GL_UNSIGNED_BYTE)];
+ ctx->Array._EdgeFlagFunc = gl_trans_1ub_tab[TYPE_IDX(GL_UNSIGNED_BYTE)];
} else {
- ctx->Array.EdgeFlagFunc = 0;
+ ctx->Array._EdgeFlagFunc = 0;
}
- ctx->Array.EdgeFlagEltFunc = gl_trans_elt_1ub_tab[TYPE_IDX(GL_UNSIGNED_BYTE)];
- ctx->Array.NewArrayState |= VERT_EDGE;
+ ctx->Array._EdgeFlagEltFunc = gl_trans_elt_1ub_tab[TYPE_IDX(GL_UNSIGNED_BYTE)];
+ ctx->Array._NewArrayState |= VERT_EDGE;
ctx->NewState |= _NEW_ARRAY;
}
{
GLuint *flags = IM->Flag;
GLuint *elts = IM->Elt;
- GLuint translate = ctx->Array.Flags;
+ GLuint translate = ctx->Array._Flags;
GLuint i;
if (MESA_VERBOSE&VERBOSE_IMMEDIATE)
fprintf(stderr, "exec_array_elements %d .. %d\n", start, count);
if (translate & VERT_OBJ_ANY)
- (ctx->Array.VertexEltFunc)( IM->Obj,
+ (ctx->Array._VertexEltFunc)( IM->Obj,
&ctx->Array.Vertex,
flags, elts, (VERT_ELT|VERT_OBJ_ANY),
start, count);
if (translate & VERT_NORM)
- (ctx->Array.NormalEltFunc)( IM->Normal,
+ (ctx->Array._NormalEltFunc)( IM->Normal,
&ctx->Array.Normal,
flags, elts, (VERT_ELT|VERT_NORM),
start, count);
if (translate & VERT_EDGE)
- (ctx->Array.EdgeFlagEltFunc)( IM->EdgeFlag,
+ (ctx->Array._EdgeFlagEltFunc)( IM->EdgeFlag,
&ctx->Array.EdgeFlag,
flags, elts, (VERT_ELT|VERT_EDGE),
start, count);
if (translate & VERT_RGBA)
- (ctx->Array.ColorEltFunc)( IM->Color,
+ (ctx->Array._ColorEltFunc)( IM->Color,
&ctx->Array.Color,
flags, elts, (VERT_ELT|VERT_RGBA),
start, count);
if (translate & VERT_SPEC_RGB)
- (ctx->Array.SecondaryColorEltFunc)( IM->SecondaryColor,
+ (ctx->Array._SecondaryColorEltFunc)( IM->SecondaryColor,
&ctx->Array.SecondaryColor,
flags, elts, (VERT_ELT|VERT_SPEC_RGB),
start, count);
if (translate & VERT_FOG_COORD)
- (ctx->Array.FogCoordEltFunc)( IM->FogCoord,
+ (ctx->Array._FogCoordEltFunc)( IM->FogCoord,
&ctx->Array.FogCoord,
flags, elts, (VERT_ELT|VERT_FOG_COORD),
start, count);
if (translate & VERT_INDEX)
- (ctx->Array.IndexEltFunc)( IM->Index,
+ (ctx->Array._IndexEltFunc)( IM->Index,
&ctx->Array.Index,
flags, elts, (VERT_ELT|VERT_INDEX),
start, count);
if (translate & VERT_TEX0_ANY)
- (ctx->Array.TexCoordEltFunc[0])( IM->TexCoord[0],
+ (ctx->Array._TexCoordEltFunc[0])( IM->TexCoord[0],
&ctx->Array.TexCoord[0],
flags, elts, (VERT_ELT|VERT_TEX0_ANY),
start, count);
if (translate & VERT_TEX1_ANY)
- (ctx->Array.TexCoordEltFunc[1])( IM->TexCoord[1],
+ (ctx->Array._TexCoordEltFunc[1])( IM->TexCoord[1],
&ctx->Array.TexCoord[1],
flags, elts, (VERT_ELT|VERT_TEX1_ANY),
start, count);
#if MAX_TEXTURE_UNITS > 2
if (translate & VERT_TEX2_ANY)
- (ctx->Array.TexCoordEltFunc[2])( IM->TexCoord[2],
+ (ctx->Array._TexCoordEltFunc[2])( IM->TexCoord[2],
&ctx->Array.TexCoord[2],
flags, elts, (VERT_ELT|VERT_TEX2_ANY),
start, count);
#endif
#if MAX_TEXTURE_UNITS > 3
if (translate & VERT_TEX3_ANY)
- (ctx->Array.TexCoordEltFunc[3])( IM->TexCoord[3],
+ (ctx->Array._TexCoordEltFunc[3])( IM->TexCoord[3],
&ctx->Array.TexCoord[3],
flags, elts, (VERT_ELT|VERT_TEX3_ANY),
start, count);
gl_build_immediate_pipeline( ctx );
required = elt->inputs;
- fallback = (elt->inputs & ~ctx->Array.Summary);
+ fallback = (elt->inputs & ~ctx->Array._Summary);
/* The translate function doesn't do anything about size. It
* just ensures that type and stride come out right.
Color = &ctx->Array.Color;
if (fallback & VERT_RGBA) {
Color = &ctx->Fallback.Color;
- ctx->Array.ColorFunc =
+ ctx->Array._ColorFunc =
gl_trans_4ub_tab[4][TYPE_IDX(GL_UNSIGNED_BYTE)];
}
}
SecondaryColor = &ctx->Array.SecondaryColor;
if (fallback & VERT_SPEC_RGB) {
SecondaryColor = &ctx->Fallback.SecondaryColor;
- ctx->Array.SecondaryColorFunc =
+ ctx->Array._SecondaryColorFunc =
gl_trans_4ub_tab[4][TYPE_IDX(GL_UNSIGNED_BYTE)];
}
}
FogCoord = &ctx->Array.FogCoord;
if (fallback & VERT_FOG_COORD) {
FogCoord = &ctx->Fallback.FogCoord;
- ctx->Array.FogCoordFunc =
+ ctx->Array._FogCoordFunc =
gl_trans_1f_tab[TYPE_IDX(GL_FLOAT)];
}
}
Index = &ctx->Array.Index;
if (fallback & VERT_INDEX) {
Index = &ctx->Fallback.Index;
- ctx->Array.IndexFunc = gl_trans_1ui_tab[TYPE_IDX(GL_UNSIGNED_INT)];
+ ctx->Array._IndexFunc = gl_trans_1ui_tab[TYPE_IDX(GL_UNSIGNED_INT)];
}
}
TexCoord[i] = &ctx->Fallback.TexCoord[i];
TexCoord[i]->Size = gl_texcoord_size( ctx->Current.Flag, i );
- ctx->Array.TexCoordFunc[i] =
+ ctx->Array._TexCoordFunc[i] =
gl_trans_4f_tab[TexCoord[i]->Size][TYPE_IDX(GL_FLOAT)];
}
}
}
- if (ctx->Array.Flags != ctx->Array.Flag[0]) {
+ if (ctx->Array._Flags != ctx->Array._Flag[0]) {
for (i = 0 ; i < VB_MAX ; i++)
- ctx->Array.Flag[i] = ctx->Array.Flags;
+ ctx->Array._Flag[i] = ctx->Array._Flags;
}
if (required & VERT_NORM) {
Normal = &ctx->Array.Normal;
if (fallback & VERT_NORM) {
Normal = &ctx->Fallback.Normal;
- ctx->Array.NormalFunc = gl_trans_3f_tab[TYPE_IDX(GL_FLOAT)];
+ ctx->Array._NormalFunc = gl_trans_3f_tab[TYPE_IDX(GL_FLOAT)];
}
}
EdgeFlag = &ctx->Array.EdgeFlag;
if (fallback & VERT_EDGE) {
EdgeFlag = &ctx->Fallback.EdgeFlag;
- ctx->Array.EdgeFlagFunc =
+ ctx->Array._EdgeFlagFunc =
gl_trans_1ub_tab[TYPE_IDX(GL_UNSIGNED_BYTE)];
}
}
VB->CullMode = 0;
- ctx->Array.VertexFunc( IM->Obj + VB_START,
+ ctx->Array._VertexFunc( IM->Obj + VB_START,
&ctx->Array.Vertex, start, n );
if (required & VERT_NORM) {
- ctx->Array.NormalFunc( IM->Normal + VB_START,
+ ctx->Array._NormalFunc( IM->Normal + VB_START,
Normal, start, n );
}
if (required & VERT_EDGE) {
- ctx->Array.EdgeFlagFunc( IM->EdgeFlag + VB_START,
+ ctx->Array._EdgeFlagFunc( IM->EdgeFlag + VB_START,
EdgeFlag, start, n );
}
if (required & VERT_RGBA) {
- ctx->Array.ColorFunc( IM->Color + VB_START,
+ ctx->Array._ColorFunc( IM->Color + VB_START,
Color, start, n );
}
if (required & VERT_SPEC_RGB) {
- ctx->Array.SecondaryColorFunc( IM->SecondaryColor + VB_START,
+ ctx->Array._SecondaryColorFunc( IM->SecondaryColor + VB_START,
SecondaryColor, start, n );
}
if (required & VERT_FOG_COORD) {
- ctx->Array.FogCoordFunc( IM->FogCoord + VB_START,
+ ctx->Array._FogCoordFunc( IM->FogCoord + VB_START,
FogCoord, start, n );
}
if (required & VERT_INDEX) {
- ctx->Array.IndexFunc( IM->Index + VB_START,
+ ctx->Array._IndexFunc( IM->Index + VB_START,
Index, start, n );
}
if (required & VERT_TEX0_ANY) {
IM->v.TexCoord[0].size = TexCoord[0]->Size;
- ctx->Array.TexCoordFunc[0]( IM->TexCoord[0] + VB_START,
+ ctx->Array._TexCoordFunc[0]( IM->TexCoord[0] + VB_START,
TexCoord[0], start, n );
}
if (required & VERT_TEX1_ANY) {
IM->v.TexCoord[1].size = TexCoord[1]->Size;
- ctx->Array.TexCoordFunc[1]( IM->TexCoord[1] + VB_START,
+ ctx->Array._TexCoordFunc[1]( IM->TexCoord[1] + VB_START,
TexCoord[1], start, n );
}
#if MAX_TEXTURE_UNITS > 2
if (required & VERT_TEX2_ANY) {
IM->v.TexCoord[2].size = TexCoord[2]->Size;
- ctx->Array.TexCoordFunc[2]( IM->TexCoord[2] + VB_START,
+ ctx->Array._TexCoordFunc[2]( IM->TexCoord[2] + VB_START,
TexCoord[2], start, n );
}
#endif
#if MAX_TEXTURE_UNITS > 3
if (required & VERT_TEX3_ANY) {
IM->v.TexCoord[3].size = TexCoord[3]->Size;
- ctx->Array.TexCoordFunc[3]( IM->TexCoord[3] + VB_START,
+ ctx->Array._TexCoordFunc[3]( IM->TexCoord[3] + VB_START,
TexCoord[3], start, n );
}
#endif
VB->TexCoordPtr[i] = &IM->v.TexCoord[i];
}
- VB->Flag = ctx->Array.Flag;
- VB->OrFlag = ctx->Array.Flags;
+ VB->Flag = ctx->Array._Flag;
+ VB->OrFlag = ctx->Array._Flags;
VB->Start = IM->Start = VB_START;
count = VB->Count = IM->Count = VB_START + n;
VB->NextPrimitive[VB->CopyStart] = VB->Count;
VB->Primitive[VB->CopyStart] = mode;
- ctx->Array.Flag[count] |= VERT_END_VB;
+ ctx->Array._Flag[count] |= VERT_END_VB;
/* Transform and render.
*/
gl_run_pipeline( VB );
gl_reset_vb( VB );
- ctx->Array.Flag[count] = ctx->Array.Flags;
- ctx->Array.Flag[VB_START] = ctx->Array.Flags;
+ /* Restore values:
+ */
+ ctx->Array._Flag[count] = ctx->Array._Flags;
+ ctx->Array._Flag[VB_START] = ctx->Array._Flags;
start += n;
remaining -= n;
{
/* Treat VERT_ELT like a special client array.
*/
- ctx->Array.NewArrayState |= VERT_ELT;
- ctx->Array.Summary |= VERT_ELT;
- ctx->Array.Flags |= VERT_ELT;
+ ctx->Array._NewArrayState |= VERT_ELT;
+ ctx->Array._Summary |= VERT_ELT;
+ ctx->Array._Flags |= VERT_ELT;
cva->elt_mode = mode;
cva->elt_count = count;
/* Did we 'precalculate' the render op?
*/
if (ctx->CVA.pre.ops & PIPE_OP_RENDER) {
- ctx->Array.NewArrayState |= VERT_ELT;
- ctx->Array.Summary &= ~VERT_ELT;
- ctx->Array.Flags &= ~VERT_ELT;
+ ctx->Array._NewArrayState |= VERT_ELT;
+ ctx->Array._Summary &= ~VERT_ELT;
+ ctx->Array._Flags &= ~VERT_ELT;
return;
}
case GL_UNSIGNED_BYTE:
{
GLubyte *ub_indices = (GLubyte *) indices;
- if (ctx->Array.Summary & VERT_OBJ_ANY) {
+ if (ctx->Array._Summary & VERT_OBJ_ANY) {
draw_elt_ubyte( ctx, mode, ub_indices, count );
} else {
gl_ArrayElement( ctx, (GLuint) ub_indices[count-1] );
case GL_UNSIGNED_SHORT:
{
GLushort *us_indices = (GLushort *) indices;
- if (ctx->Array.Summary & VERT_OBJ_ANY) {
+ if (ctx->Array._Summary & VERT_OBJ_ANY) {
draw_elt_ushort( ctx, mode, us_indices, count );
} else {
gl_ArrayElement( ctx, (GLuint) us_indices[count-1] );
case GL_UNSIGNED_INT:
{
GLuint *ui_indices = (GLuint *) indices;
- if (ctx->Array.Summary & VERT_OBJ_ANY) {
+ if (ctx->Array._Summary & VERT_OBJ_ANY) {
draw_elt_uint( ctx, mode, ui_indices, count );
} else {
gl_ArrayElement( ctx, ui_indices[count-1] );
}
if (ctx->CompileCVAFlag) {
- ctx->Array.NewArrayState |= VERT_ELT;
- ctx->Array.Summary &= ~VERT_ELT;
+ ctx->Array._NewArrayState |= VERT_ELT;
+ ctx->Array._Summary &= ~VERT_ELT;
}
}
};
GLint i;
- ctx->Array.Flags = 0;
- ctx->Array.Summary = 0;
+ ctx->Array._Flags = 0;
+ ctx->Array._Summary = 0;
ctx->input->ArrayIncr = 0;
- if (ctx->Array.Normal.Enabled) ctx->Array.Flags |= VERT_NORM;
- if (ctx->Array.Color.Enabled) ctx->Array.Flags |= VERT_RGBA;
- if (ctx->Array.SecondaryColor.Enabled) ctx->Array.Flags |= VERT_SPEC_RGB;
- if (ctx->Array.FogCoord.Enabled) ctx->Array.Flags |= VERT_FOG_COORD;
- if (ctx->Array.Index.Enabled) ctx->Array.Flags |= VERT_INDEX;
- if (ctx->Array.EdgeFlag.Enabled) ctx->Array.Flags |= VERT_EDGE;
+ if (ctx->Array.Normal.Enabled) ctx->Array._Flags |= VERT_NORM;
+ if (ctx->Array.Color.Enabled) ctx->Array._Flags |= VERT_RGBA;
+ if (ctx->Array.SecondaryColor.Enabled) ctx->Array._Flags |= VERT_SPEC_RGB;
+ if (ctx->Array.FogCoord.Enabled) ctx->Array._Flags |= VERT_FOG_COORD;
+ if (ctx->Array.Index.Enabled) ctx->Array._Flags |= VERT_INDEX;
+ if (ctx->Array.EdgeFlag.Enabled) ctx->Array._Flags |= VERT_EDGE;
if (ctx->Array.Vertex.Enabled) {
- ctx->Array.Flags |= sz_flags[ctx->Array.Vertex.Size];
+ ctx->Array._Flags |= sz_flags[ctx->Array.Vertex.Size];
ctx->input->ArrayIncr = 1;
}
for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
if (ctx->Array.TexCoord[i].Enabled) {
- ctx->Array.Flags |= (tc_flags[ctx->Array.TexCoord[i].Size] << (i * NR_TEXSIZE_BITS));
+ ctx->Array._Flags |= (tc_flags[ctx->Array.TexCoord[i].Size] << (i * NR_TEXSIZE_BITS));
}
}
/* Not really important any more:
*/
- ctx->Array.Summary = ctx->Array.Flags & VERT_DATA;
- ctx->input->ArrayAndFlags = ~ctx->Array.Flags;
+ ctx->Array._Summary = ctx->Array._Flags & VERT_DATA;
+ ctx->input->ArrayAndFlags = ~ctx->Array._Flags;
ctx->input->ArrayEltFlush = !(ctx->CompileCVAFlag);
}
-/* $Id: mmx.h,v 1.3 2000/10/23 00:16:28 gareth Exp $ */
+/* $Id: mmx.h,v 1.4 2000/11/05 18:41:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
GLubyte rgba[][4], const GLubyte dest[][4] );
-void gl_mmx_set_blend_function( GLcontext *ctx )
-{
- const GLenum eq = ctx->Color.BlendEquation;
- const GLenum srcRGB = ctx->Color.BlendSrcRGB;
- const GLenum dstRGB = ctx->Color.BlendDstRGB;
- const GLenum srcA = ctx->Color.BlendSrcA;
- const GLenum dstA = ctx->Color.BlendDstA;
-
-
- if (srcRGB != srcA || dstRGB != dstA) {
- ctx->Color.BlendFunc = blend_general;
- }
- else if (eq==GL_FUNC_ADD_EXT && srcRGB==GL_SRC_ALPHA
- && dstRGB==GL_ONE_MINUS_SRC_ALPHA) {
- ctx->Color.BlendFunc = gl_mmx_blend_transparency;
- }
- else if (eq==GL_FUNC_ADD_EXT && srcRGB==GL_ONE && dstRGB==GL_ONE) {
- ctx->Color.BlendFunc = blend_add;
- }
- else if (((eq==GL_FUNC_ADD_EXT || eq==GL_FUNC_REVERSE_SUBTRACT_EXT)
- && (srcRGB==GL_ZERO && dstRGB==GL_SRC_COLOR))
- ||
- ((eq==GL_FUNC_ADD_EXT || eq==GL_FUNC_SUBTRACT_EXT)
- && (srcRGB==GL_DST_COLOR && dstRGB==GL_ZERO))) {
- ctx->Color.BlendFunc = blend_modulate;
- }
- else if (eq==GL_MIN_EXT) {
- ctx->Color.BlendFunc = blend_min;
- }
- else if (eq==GL_MAX_EXT) {
- ctx->Color.BlendFunc = blend_max;
- }
- else {
- ctx->Color.BlendFunc = blend_general;
- }
-}
-
#endif