mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Fix state saving to handle any blend/colormode
This commit is contained in:
@@ -69,16 +69,9 @@ namespace opengl
|
||||
|
||||
s.color = getColor();
|
||||
s.backgroundColor = getBackgroundColor();
|
||||
|
||||
//store modes here
|
||||
GLint mode;
|
||||
//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;
|
||||
|
||||
s.blendMode = getBlendMode();
|
||||
s.colorMode = getColorMode();
|
||||
//get line style
|
||||
s.lineStyle = lineStyle;
|
||||
//get the point size
|
||||
|
||||
Reference in New Issue
Block a user