Added a built-in variable readable in shaders: ‘love_ScreenSize’. Its x and y components contain the width and height of the current viewport. Resolves issue #841.

This commit is contained in:
Alex Szpakowski
2014-01-27 02:58:34 -04:00
parent 3a24e73891
commit c5c788e976
5 changed files with 35 additions and 21 deletions
+2 -1
View File
@@ -59,7 +59,7 @@ public:
// Built-in extern (uniform) variables.
enum BuiltinExtern
{
BUILTIN_SCREEN_PARAMS,
BUILTIN_SCREEN_SIZE,
BUILTIN_MAX_ENUM
};
@@ -216,6 +216,7 @@ private:
// Pointer to the active Canvas when the screen params were last checked.
Canvas *lastCanvas;
OpenGL::Viewport lastViewport;
// Max GPU texture units available for sent images
static GLint maxTexUnits;