mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Simplify quad drawing code, and use glDrawElementsBaseVertex when available.
This commit is contained in:
@@ -34,7 +34,6 @@ Text::Text(Graphics *gfx, Font *font, const std::vector<Font::ColoredString> &te
|
||||
: font(font)
|
||||
, vertexAttributes(Font::vertexFormat, 0)
|
||||
, vbo(nullptr)
|
||||
, quadIndices(gfx)
|
||||
, vert_offset(0)
|
||||
, texture_cache_id((uint32) -1)
|
||||
{
|
||||
@@ -264,7 +263,7 @@ void Text::draw(Graphics *gfx, const Matrix4 &m)
|
||||
Graphics::TempTransform transform(gfx, m);
|
||||
|
||||
for (const Font::DrawCommand &cmd : draw_commands)
|
||||
quadIndices.draw(gfx, cmd.startvertex / 4, cmd.vertexcount / 4, vertexAttributes, vertexBuffers, cmd.texture);
|
||||
gfx->drawQuads(cmd.startvertex / 4, cmd.vertexcount / 4, vertexAttributes, vertexBuffers, cmd.texture);
|
||||
}
|
||||
|
||||
} // graphics
|
||||
|
||||
Reference in New Issue
Block a user