mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Merged default into minor
--HG-- branch : minor
This commit is contained in:
@@ -265,15 +265,19 @@ bool Graphics::setMode(int width, int height, bool &sRGB)
|
||||
|
||||
void Graphics::unSetMode()
|
||||
{
|
||||
if (!isCreated())
|
||||
return;
|
||||
|
||||
// Window re-creation may destroy the GL context, so we must save the state.
|
||||
if (isCreated())
|
||||
savedState = saveState();
|
||||
savedState = saveState();
|
||||
|
||||
// Unload all volatile objects. These must be reloaded after the display
|
||||
// mode change.
|
||||
Volatile::unloadAll();
|
||||
|
||||
gl.deInitContext();
|
||||
|
||||
created = false;
|
||||
}
|
||||
|
||||
static void APIENTRY debugCB(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei /*len*/, const GLchar *msg, GLvoid* /*usr*/)
|
||||
@@ -649,6 +653,10 @@ void Graphics::setBlendMode(Graphics::BlendMode mode)
|
||||
state.srcRGB = state.srcA = GL_SRC_ALPHA;
|
||||
state.dstRGB = state.dstA = GL_ONE;
|
||||
break;
|
||||
case BLEND_SCREEN:
|
||||
state.srcRGB = state.srcA = GL_ONE;
|
||||
state.dstRGB = state.dstA = GL_ONE_MINUS_SRC_COLOR;
|
||||
break;
|
||||
case BLEND_REPLACE:
|
||||
default:
|
||||
state.srcRGB = state.srcA = GL_ONE;
|
||||
@@ -676,6 +684,8 @@ Graphics::BlendMode Graphics::getBlendMode() const
|
||||
return BLEND_MULTIPLICATIVE;
|
||||
else if (state.srcRGB == GL_ONE && state.dstRGB == GL_ONE_MINUS_SRC_ALPHA)
|
||||
return BLEND_PREMULTIPLIED;
|
||||
else if (state.srcRGB == GL_ONE && state.dstRGB == GL_ONE_MINUS_SRC_COLOR)
|
||||
return BLEND_SCREEN;
|
||||
else if (state.srcRGB == GL_ONE && state.dstRGB == GL_ZERO)
|
||||
return BLEND_REPLACE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user