Fix state saving to handle any blend/colormode

This commit is contained in:
Bill Meltsner
2012-01-26 14:46:59 -05:00
parent ecb2e566f3
commit a0be14869f
+3 -10
View File
@@ -69,16 +69,9 @@ namespace opengl
s.color = getColor(); s.color = getColor();
s.backgroundColor = getBackgroundColor(); s.backgroundColor = getBackgroundColor();
//store modes here s.blendMode = getBlendMode();
GLint mode; s.colorMode = getColorMode();
//get blend mode
glGetIntegerv(GL_BLEND_DST, &mode);
//following syntax seems better than if-else every time
s.blendMode = (mode == GL_ONE) ? Graphics::BLEND_ADDITIVE : Graphics::BLEND_ALPHA;
//get color mode
glGetTexEnviv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, &mode);
s.colorMode = (mode == GL_MODULATE) ? Graphics::COLOR_MODULATE : Graphics::COLOR_REPLACE;
//get line style //get line style
s.lineStyle = lineStyle; s.lineStyle = lineStyle;
//get the point size //get the point size