Skip to content
Snippets Groups Projects
Commit ecf662ad authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

Corrected handling of Clip Planes

parent 7beaba0e
No related branches found
No related tags found
No related merge requests found
/* $Id: Draw.cpp,v 1.10 2000-12-10 00:06:50 geuzaine Exp $ */ /* $Id: Draw.cpp,v 1.11 2000-12-10 23:31:45 geuzaine Exp $ */
#include "Gmsh.h" #include "Gmsh.h"
#include "GmshUI.h" #include "GmshUI.h"
...@@ -26,6 +26,8 @@ extern List_T *Post_ViewList; ...@@ -26,6 +26,8 @@ extern List_T *Post_ViewList;
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
void Draw3d(void){ void Draw3d(void){
int i;
if(CTX.alpha){ if(CTX.alpha){
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND); glEnable(GL_BLEND);
...@@ -37,12 +39,8 @@ void Draw3d(void){ ...@@ -37,12 +39,8 @@ void Draw3d(void){
} }
glPolygonOffset(1.0, 1); glPolygonOffset(1.0, 1);
if(CTX.clip[0]) glEnable(GL_CLIP_PLANE0); for(i = 0 ; i < 6 ; i++)
if(CTX.clip[1]) glEnable(GL_CLIP_PLANE1); if(CTX.clip[i]) glEnable((GLenum)(GL_CLIP_PLANE0 + i));
if(CTX.clip[2]) glEnable(GL_CLIP_PLANE2);
if(CTX.clip[3]) glEnable(GL_CLIP_PLANE3);
if(CTX.clip[4]) glEnable(GL_CLIP_PLANE4);
if(CTX.clip[5]) glEnable(GL_CLIP_PLANE5);
/* This is sufficient, since we NEVER give different normals to nodes of one polygon */ /* This is sufficient, since we NEVER give different normals to nodes of one polygon */
glShadeModel(GL_FLAT); //glShadeModel(GL_SMOOTH); glShadeModel(GL_FLAT); //glShadeModel(GL_SMOOTH);
...@@ -57,17 +55,15 @@ void Draw3d(void){ ...@@ -57,17 +55,15 @@ void Draw3d(void){
} }
void Draw2d(void){ void Draw2d(void){
glEnable(GL_CLIP_PLANE0); int i;
glEnable(GL_CLIP_PLANE1);
glEnable(GL_CLIP_PLANE2);
glEnable(GL_CLIP_PLANE3);
glEnable(GL_CLIP_PLANE4);
glEnable(GL_CLIP_PLANE5);
glDisable(GL_DEPTH_TEST); glDisable(GL_DEPTH_TEST);
glDisable(GL_LIGHTING); glDisable(GL_LIGHTING);
glShadeModel(GL_FLAT); glShadeModel(GL_FLAT);
for(i = 0 ; i < 6 ; i++)
glDisable((GLenum)(GL_CLIP_PLANE0 + i));
glMatrixMode(GL_PROJECTION); glMatrixMode(GL_PROJECTION);
glLoadIdentity(); glLoadIdentity();
/* to draw directly in screen coords */ /* to draw directly in screen coords */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment