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/clip.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'src/mesa/main/clip.c') diff --git a/src/mesa/main/clip.c b/src/mesa/main/clip.c index 31e6af91bd..a1eda32ebf 100644 --- a/src/mesa/main/clip.c +++ b/src/mesa/main/clip.c @@ -117,3 +117,45 @@ _mesa_GetClipPlane( GLenum plane, GLdouble *equation ) equation[3] = (GLdouble) ctx->Transform.EyeUserPlane[p][3]; } +void GLAPIENTRY +_mesa_CullParameterfvEXT (GLenum cap, GLfloat *v) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + switch (cap) { + case GL_CULL_VERTEX_EYE_POSITION_EXT: + FLUSH_VERTICES(ctx, _NEW_TRANSFORM); + COPY_4FV(ctx->Transform.CullEyePos, v); + + _mesa_transform_vector( ctx->Transform.CullObjPos, + ctx->Transform.CullEyePos, + ctx->ModelviewMatrixStack.Top->inv ); + break; + + case GL_CULL_VERTEX_OBJECT_POSITION_EXT: + FLUSH_VERTICES(ctx, _NEW_TRANSFORM); + COPY_4FV(ctx->Transform.CullObjPos, v); + + _mesa_transform_vector( ctx->Transform.CullEyePos, + ctx->Transform.CullObjPos, + ctx->ModelviewMatrixStack.Top->m ); + break; + default: + _mesa_error( ctx, GL_INVALID_ENUM, "glCullParameterfvEXT" ); + } +} + +void GLAPIENTRY +_mesa_CullParameterdvEXT (GLenum cap, GLdouble *v) +{ + GLfloat f[4]; + + f[0] = (GLfloat)v[0]; + f[1] = (GLfloat)v[1]; + f[2] = (GLfloat)v[2]; + f[3] = (GLfloat)v[3]; + + _mesa_CullParameterfvEXT(cap, f); +} + -- cgit v1.2.3