Cleanup: remove legacy OpenGL viewport clipping code

This commit is contained in:
Campbell Barton 2020-02-08 00:38:40 +11:00
parent 91c64b5ca3
commit 80415ee203
1 changed files with 4 additions and 26 deletions

View File

@ -1947,45 +1947,23 @@ bool ED_view3d_clipping_test(const RegionView3D *rv3d, const float co[3], const
return view3d_clipping_test(co, is_local ? rv3d->clip_local : rv3d->clip);
}
/* Legacy 2.7x, now use shaders that use clip distance instead.
* Remove once clipping is working properly. */
#define USE_CLIP_PLANES
void ED_view3d_clipping_set(RegionView3D *rv3d)
void ED_view3d_clipping_set(RegionView3D *UNUSED(rv3d))
{
#ifdef USE_CLIP_PLANES
double plane[4];
const uint tot = (rv3d->viewlock & RV3D_BOXCLIP) ? 4 : 6;
for (unsigned a = 0; a < tot; a++) {
copy_v4db_v4fl(plane, rv3d->clip[a]);
glClipPlane(GL_CLIP_PLANE0 + a, plane);
glEnable(GL_CLIP_PLANE0 + a);
for (uint a = 0; a < 6; a++) {
glEnable(GL_CLIP_DISTANCE0 + a);
}
#else
for (unsigned a = 0; a < 6; a++) {
glEnable(GL_CLIP_DISTANCE0 + a);
}
#endif
}
/* Use these to temp disable/enable clipping when 'rv3d->rflag & RV3D_CLIPPING' is set. */
void ED_view3d_clipping_disable(void)
{
for (unsigned a = 0; a < 6; a++) {
#ifdef USE_CLIP_PLANES
glDisable(GL_CLIP_PLANE0 + a);
#endif
for (uint a = 0; a < 6; a++) {
glDisable(GL_CLIP_DISTANCE0 + a);
}
}
void ED_view3d_clipping_enable(void)
{
for (unsigned a = 0; a < 6; a++) {
#ifdef USE_CLIP_PLANES
glEnable(GL_CLIP_PLANE0 + a);
#endif
for (uint a = 0; a < 6; a++) {
glEnable(GL_CLIP_DISTANCE0 + a);
}
}