Cleaned up some love.graphics code.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2016-12-10 23:46:00 -04:00
parent 1e24a19bea
commit 0a8c6f3ee6
10 changed files with 68 additions and 89 deletions
+7 -18
View File
@@ -24,6 +24,7 @@
// LOVE
#include "common/config.h"
#include "common/int.h"
#include "common/math.h"
#include "graphics/Color.h"
#include "graphics/Texture.h"
#include "common/Matrix.h"
@@ -111,18 +112,6 @@ public:
FRAMEBUFFER_ALL = (FRAMEBUFFER_READ | FRAMEBUFFER_DRAW),
};
// A rectangle representing an OpenGL viewport or a scissor box.
struct Viewport
{
int x, y;
int w, h;
bool operator == (const Viewport &rhs) const
{
return x == rhs.x && y == rhs.y && w == rhs.w && h == rhs.h;
}
};
struct TextureFormat
{
GLenum internalformat = 0;
@@ -295,23 +284,23 @@ public:
* Sets the OpenGL rendering viewport to the specified rectangle.
* The y-coordinate starts at the top.
**/
void setViewport(const Viewport &v, bool canvasActive);
void setViewport(const Rect &v, bool canvasActive);
/**
* Gets the current OpenGL rendering viewport rectangle.
**/
Viewport getViewport() const;
Rect getViewport() const;
/**
* Sets the scissor box to the specified rectangle.
* The y-coordinate starts at the top and is flipped internally.
**/
void setScissor(const Viewport &v, bool canvasActive);
void setScissor(const Rect &v, bool canvasActive);
/**
* Gets the current scissor box (regardless of whether scissoring is enabled.)
**/
Viewport getScissor() const;
Rect getScissor() const;
/**
* Sets the global point size.
@@ -479,8 +468,8 @@ private:
uint32 enabledAttribArrays;
Viewport viewport;
Viewport scissor;
Rect viewport;
Rect scissor;
float pointSize;