From 23caf20169ac38436ee9c13914f1d6aa7cf6bb5e Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 16 Nov 2000 21:05:34 +0000 Subject: Move the transform and lighting code to two new directories math: Provides basic matrix and vector functionality that might be useful to multiple software t&l implementations, and is used by core mesa to manage the Model, Project, etc matrices. tnl: The real transform & lighting code from core mesa, including everything from glVertex3f through vertex buffer handling, transformation, clipping, lighting and handoff to a driver for rasterization. The interfaces of these can be further tightened up, but the basic splitting up of state and code move is done. --- src/mesa/main/enable.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'src/mesa/main/enable.c') diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 3d21f95bea..afcb916fe8 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -1,4 +1,4 @@ -/* $Id: enable.c,v 1.31 2000/11/05 18:40:57 keithw Exp $ */ +/* $Id: enable.c,v 1.32 2000/11/16 21:05:35 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -33,13 +33,14 @@ #include "enable.h" #include "light.h" #include "macros.h" -#include "matrix.h" #include "mmath.h" #include "simple_list.h" #include "types.h" -#include "vbfill.h" -#include "xform.h" #include "enums.h" + +#include "math/m_matrix.h" +#include "math/m_xform.h" + #endif @@ -98,10 +99,14 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) ctx->_Enabled |= ENABLE_USERCLIP; ctx->Transform._AnyClip++; - if (ctx->ProjectionMatrix.flags & MAT_DIRTY_ALL_OVER) { - gl_matrix_analyze( &ctx->ProjectionMatrix ); + if (ctx->ProjectionMatrix.flags & MAT_DIRTY) { + _math_matrix_analyze( &ctx->ProjectionMatrix ); } + /* This derived state also calculated in clip.c and + * from gl_update_state() on changes to EyeUserPlane + * and ctx->ProjectionMatrix respectively. + */ gl_transform_vector( ctx->Transform._ClipUserPlane[p], ctx->Transform.EyeUserPlane[p], ctx->ProjectionMatrix.inv ); @@ -113,10 +118,13 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) break; case GL_COLOR_MATERIAL: if (ctx->Light.ColorMaterialEnabled!=state) { - ctx->Light.ColorMaterialEnabled = state; + ctx->Light.ColorMaterialEnabled = state; ctx->NewState |= _NEW_LIGHT; - if (state) + + if (state) { + FLUSH_TNL( ctx, FLUSH_UPDATE_CURRENT ); gl_update_color_material( ctx, ctx->Current.Color ); + } } break; case GL_CULL_FACE: -- cgit v1.2.3