mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Merged default into minor
--HG-- branch : minor
This commit is contained in:
@@ -593,7 +593,9 @@ bool Canvas::loadVolatile()
|
||||
|
||||
if (glGetError() != GL_NO_ERROR)
|
||||
{
|
||||
status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
|
||||
gl.deleteTexture(texture);
|
||||
texture = 0;
|
||||
status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -617,7 +619,14 @@ bool Canvas::loadVolatile()
|
||||
status = strategy->createFBO(fbo, texture);
|
||||
|
||||
if (status != GL_FRAMEBUFFER_COMPLETE)
|
||||
{
|
||||
if (fbo != 0)
|
||||
{
|
||||
strategy->deleteFBO(fbo, 0, 0);
|
||||
fbo = 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
clear(Color(0, 0, 0, 0));
|
||||
|
||||
|
||||
@@ -50,6 +50,8 @@ Graphics::Graphics()
|
||||
, created(false)
|
||||
, writingToStencil(false)
|
||||
{
|
||||
gl = OpenGL();
|
||||
|
||||
states.reserve(10);
|
||||
states.push_back(DisplayState());
|
||||
|
||||
|
||||
@@ -218,6 +218,10 @@ void Shader::mapActiveUniforms()
|
||||
|
||||
bool Shader::loadVolatile()
|
||||
{
|
||||
// Recreating the shader program will invalidate uniforms that rely on these.
|
||||
lastCanvas = (Canvas *) -1;
|
||||
lastViewport = OpenGL::Viewport();
|
||||
|
||||
// zero out active texture list
|
||||
activeTexUnits.clear();
|
||||
activeTexUnits.insert(activeTexUnits.begin(), maxTexUnits, 0);
|
||||
@@ -306,6 +310,7 @@ bool Shader::loadVolatile()
|
||||
// make sure glUseProgram gets called.
|
||||
current = nullptr;
|
||||
attach();
|
||||
checkSetScreenParams();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user