diff --git a/main.cu b/main.cu index 28f19ac..7afa51a 100644 --- a/main.cu +++ b/main.cu @@ -182,21 +182,21 @@ void glut_render(void) { glut_render_modelview(); //set up the modelview matrix with camera details glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen GT.glCenterline0(); //render the GT network (the only one loaded) + glDisable(GL_DEPTH_TEST); } if (num_nets == 2) { //if two networks are loaded - glEnable(GL_DEPTH_TEST); //enable depth - glut_render_left_projection(); //set up a projection for the left half of the window - glut_render_modelview(); //set up the modelview matrix using camera details - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen - glEnable(GL_TEXTURE_1D); //enable texture mapping - if(light_fac == 0) + if (light_fac == 0) glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); //texture map will be used as the network color else glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - glBindTexture(GL_TEXTURE_1D, cmap_tex); //bind the Brewer texture map + + glEnable(GL_DEPTH_TEST); //enable depth + glut_render_left_projection(); //set up a projection for the left half of the window + glut_render_modelview(); //set up the modelview matrix using camera details + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen GT.glCylinder(sigma, radius); //render the GT network if (adjoint_fac == 1) { @@ -229,17 +229,17 @@ void glut_render(void) { } if (num_nets == 2) { //if two networks are loaded if (compareMode) { - glEnable(GL_DEPTH_TEST); //enable depth - glut_render_left_projection(); //set up a projection for the left half of the window - glut_render_modelview(); //set up the modelview matrix using camera details - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen - glEnable(GL_TEXTURE_1D); //enable texture mapping if (light_fac == 0) glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); //texture map will be used as the network color else glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);//map light to texture glBindTexture(GL_TEXTURE_1D, cmap_tex); //bind the Brewer texture map + + glEnable(GL_DEPTH_TEST); //enable depth + glut_render_left_projection(); //set up a projection for the left half of the window + glut_render_modelview(); //set up the modelview matrix using camera details + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen _GT.glCylinder(sigma, radius); //render the GT network if (adjoint_fac == 1) { @@ -279,6 +279,8 @@ void glut_render(void) { } } } + glDisable(GL_DEPTH_TEST); + glDisable(GL_TEXTURE_1D); if (num_nets == 2) { // works only with two networks std::ostringstream ss; @@ -287,7 +289,6 @@ void glut_render(void) { else ss << "Compare Mode"; // default mode is compare mode - glDisable(GL_TEXTURE_1D); if (light_fac == 1) glDisable(GL_LIGHTING); glMatrixMode(GL_PROJECTION); // set up the 2d viewport for mode text printing -- libgit2 0.21.4