Use automatic batching for love.graphics.print/printf.

This doesn’t actually improve performance at all in most cases, but it does remove some OpenGL-specific code from the Font files, and reduces the amount of duplicated rendering code. This makes it slightly easier to add support for Core Profile OpenGL 3.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2016-12-29 00:25:14 -04:00
parent 52b7b0f80d
commit 4a3889ae48
8 changed files with 116 additions and 113 deletions
+8
View File
@@ -66,6 +66,9 @@ void gammaCorrectColor(Colorf &c);
**/
void unGammaCorrectColor(Colorf &c);
Colorf gammaCorrectColor(const Colorf &c);
Colorf unGammaCorrectColor(const Colorf &c);
class Graphics : public Module
{
public:
@@ -236,6 +239,10 @@ public:
int vertexCount = 0;
Texture *texture = nullptr;
// FIXME: This is only needed for fonts. We should just change fonts to
// use love.graphics Images instead of raw OpenGL textures.
ptrdiff_t textureHandle = 0;
StreamDrawRequest()
{
// VS2013 can't initialize arrays in the above manner...
@@ -455,6 +462,7 @@ protected:
vertex::PrimitiveMode primitiveMode;
vertex::CommonFormat formats[2];
StrongRef<Texture> texture;
ptrdiff_t textureHandle = 0;
int vertexCount;
int indexCount;
};