From 352d4dbfb24c65f327759c00c7db7d30a9482e35 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 10 May 2004 18:16:03 +0000 Subject: Add EXT_vertex_cull support to mesa --- src/mesa/main/matrix.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/mesa/main/matrix.c') diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c index 19e8dc3a5a..1e6b9dd394 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 ); } -- cgit v1.2.3