mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +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.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
|
||||||
|
|||||||
Reference in New Issue
Block a user