Don’t call unnecessary OpenGL APIs in love.graphics.setColor

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2017-01-02 01:02:15 -04:00
parent 66749e874f
commit 548293e100
4 changed files with 35 additions and 20 deletions
+10 -12
View File
@@ -226,10 +226,6 @@ public:
* The y-coordinate starts at the top.
**/
void setViewport(const Rect &v);
/**
* Gets the current OpenGL rendering viewport rectangle.
**/
Rect getViewport() const;
/**
@@ -238,24 +234,23 @@ public:
**/
void setScissor(const Rect &v, bool canvasActive);
/**
* Sets the constant color (vertex attribute). This may be applied
* internally at draw-time.
**/
void setConstantColor(const Colorf &color);
const Colorf &getConstantColor() const;
/**
* Sets the global point size.
**/
void setPointSize(float size);
/**
* Gets the global point size.
**/
float getPointSize() const;
/**
* Calls glEnable/glDisable(GL_FRAMEBUFFER_SRGB).
**/
void setFramebufferSRGB(bool enable);
/**
* Equivalent to glIsEnabled(GL_FRAMEBUFFER_SRGB).
**/
bool hasFramebufferSRGB() const;
/**
@@ -405,6 +400,9 @@ private:
uint32 enabledAttribArrays;
Colorf constantColor;
Colorf lastConstantColor;
Rect viewport;
Rect scissor;