Fix #435 (for real this time). Unfixes #324.

Add a extern vec2 love_ScreenSize to the pixel effects that will
be (re)set upon PixelEffect::loadVolatile() and is used to flip
the fragment coordinate.

Unfixes #324 because canvases can have different dimensions than
the screen.
This commit is contained in:
vrld
2012-08-05 16:08:22 +02:00
parent 1fd12e4596
commit 87c6646705
7 changed files with 22 additions and 59 deletions
@@ -20,6 +20,7 @@
#include "PixelEffect.h"
#include "GLee.h"
#include "Graphics.h"
namespace
{
@@ -134,6 +135,11 @@ bool PixelEffect::loadVolatile()
}
glDeleteShader(shader);
Graphics *instance = (Graphics*)Module::getInstance("love.graphics.opengl");
GLfloat screenSize[2] = {(float)instance->getWidth(), (float)instance->getHeight()};
sendFloat("love_ScreenSize", 2, screenSize, 1);
return true;
}