mirror of
https://github.com/love2d/love.git
synced 2026-08-15 07:41:11 +02:00
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:
@@ -53,6 +53,13 @@ void gammaCorrectColor(Colorf &c)
|
||||
}
|
||||
}
|
||||
|
||||
Colorf gammaCorrectColor(const Colorf &c)
|
||||
{
|
||||
Colorf r = c;
|
||||
gammaCorrectColor(r);
|
||||
return r;
|
||||
}
|
||||
|
||||
void unGammaCorrectColor(Colorf &c)
|
||||
{
|
||||
if (isGammaCorrect())
|
||||
@@ -63,6 +70,13 @@ void unGammaCorrectColor(Colorf &c)
|
||||
}
|
||||
}
|
||||
|
||||
Colorf unGammaCorrectColor(const Colorf &c)
|
||||
{
|
||||
Colorf r = c;
|
||||
unGammaCorrectColor(r);
|
||||
return r;
|
||||
}
|
||||
|
||||
love::Type Graphics::type("graphics", &Module::type);
|
||||
|
||||
Graphics::Graphics()
|
||||
@@ -92,7 +106,7 @@ Graphics::StreamVertexData Graphics::requestStreamDraw(const StreamDrawRequest &
|
||||
if (req.primitiveMode != state.primitiveMode
|
||||
|| req.formats[0] != state.formats[0] || req.formats[1] != state.formats[1]
|
||||
|| ((req.indexMode != TriangleIndexMode::NONE) != (state.indexCount > 0))
|
||||
|| req.texture != state.texture)
|
||||
|| req.texture != state.texture || req.textureHandle != state.textureHandle)
|
||||
{
|
||||
shouldflush = true;
|
||||
}
|
||||
@@ -156,6 +170,7 @@ Graphics::StreamVertexData Graphics::requestStreamDraw(const StreamDrawRequest &
|
||||
state.formats[0] = req.formats[0];
|
||||
state.formats[1] = req.formats[1];
|
||||
state.texture = req.texture;
|
||||
state.textureHandle = req.textureHandle;
|
||||
}
|
||||
|
||||
if (shouldresize)
|
||||
|
||||
Reference in New Issue
Block a user