16 #ifndef vtkVolumeStateRAII_h
17 #define vtkVolumeStateRAII_h
27 this->DepthTestEnabled = (glIsEnabled(GL_DEPTH_TEST) != 0);
29 this->BlendEnabled = (glIsEnabled(GL_BLEND) != 0);
31 this->CullFaceEnabled = (glIsEnabled(GL_CULL_FACE) != 0);
34 if (!this->DepthTestEnabled)
36 std::cerr <<
"enabling depth test" << std::endl;
37 glEnable(GL_DEPTH_TEST);
43 glBlendFunc(GL_ONE,GL_ONE_MINUS_SRC_ALPHA);
45 if (!this->BlendEnabled)
51 if (!this->CullFaceEnabled)
53 glEnable(GL_CULL_FACE);
62 glBindBuffer(GL_ARRAY_BUFFER, 0);
63 glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
65 if (!this->CullFaceEnabled)
67 glDisable(GL_CULL_FACE);
70 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
72 if (!this->BlendEnabled)
77 if (!this->DepthTestEnabled)
79 glDisable(GL_DEPTH_TEST);
84 bool DepthTestEnabled;
89 #endif // vtkVolumeStateRAII_h