diff options
author | Keith Whitwell <[email protected]> | 2004-05-10 18:16:03 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2004-05-10 18:16:03 +0000 |
commit | 352d4dbfb24c65f327759c00c7db7d30a9482e35 (patch) | |
tree | cabc4ec120d77e991ec7fcb3e21baa3b26b0c282 /src/mesa/main/matrix.c | |
parent | 39fe9a7fe38081d6f40c4bf388a132c583330912 (diff) |
Add EXT_vertex_cull support to mesa
Diffstat (limited to 'src/mesa/main/matrix.c')
-rw-r--r-- | src/mesa/main/matrix.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c index 19e8dc3a5a0..1e6b9dd3947 100644 --- a/src/mesa/main/matrix.c +++ b/src/mesa/main/matrix.c @@ -745,8 +745,16 @@ calculate_model_project_matrix( GLcontext *ctx ) */ void _mesa_update_modelview_project( GLcontext *ctx, GLuint new_state ) { - if (new_state & _NEW_MODELVIEW) + if (new_state & _NEW_MODELVIEW) { _math_matrix_analyse( ctx->ModelviewMatrixStack.Top ); + + /* Bring cull position uptodate. + */ + TRANSFORM_POINT3( ctx->Transform.CullObjPos, + ctx->ModelviewMatrixStack.Top->inv, + ctx->Transform.CullEyePos ); + } + if (new_state & _NEW_PROJECTION) update_projection( ctx ); @@ -898,6 +906,9 @@ void _mesa_init_transform( GLcontext *ctx ) ASSIGN_4V( ctx->Transform.EyeUserPlane[i], 0.0, 0.0, 0.0, 0.0 ); } ctx->Transform.ClipPlanesEnabled = 0; + + ASSIGN_4V( ctx->Transform.CullObjPos, 0.0, 0.0, 1.0, 0.0 ); + ASSIGN_4V( ctx->Transform.CullEyePos, 0.0, 0.0, 1.0, 0.0 ); } |