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/clip.c | |
parent | 39fe9a7fe38081d6f40c4bf388a132c583330912 (diff) |
Add EXT_vertex_cull support to mesa
Diffstat (limited to 'src/mesa/main/clip.c')
-rw-r--r-- | src/mesa/main/clip.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/mesa/main/clip.c b/src/mesa/main/clip.c index 31e6af91bd1..a1eda32ebf7 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); +} + |