Add love.graphics.getQuadIndexBuffer.

love's pre-generated quad index buffer is useful when combined with drawShaderVertices. Note that it uses 16 bit indices so it can only draw up to 16k quads in a single call.
This commit is contained in:
Alex Szpakowski
2022-01-03 16:22:08 -04:00
parent 42e8df1489
commit ecbc5ca7f6
6 changed files with 25 additions and 2 deletions
+7
View File
@@ -242,6 +242,12 @@ int w_getDPIScale(lua_State *L)
return 1;
}
int w_getQuadIndexBuffer(lua_State *L)
{
luax_pushtype(L, instance()->getQuadIndexBuffer());
return 1;
}
static Graphics::RenderTarget checkRenderTarget(lua_State *L, int idx)
{
lua_rawgeti(L, idx, 1);
@@ -3671,6 +3677,7 @@ static const luaL_Reg functions[] =
{ "getPixelHeight", w_getPixelHeight },
{ "getPixelDimensions", w_getPixelDimensions },
{ "getDPIScale", w_getDPIScale },
{ "getQuadIndexBuffer", w_getQuadIndexBuffer },
{ "setScissor", w_setScissor },
{ "intersectScissor", w_intersectScissor },