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
+2 -2
View File
@@ -166,7 +166,7 @@ bool Buffer::supportsOrphan() const
void *Buffer::map(MapType /*map*/, size_t offset, size_t size)
{
if (size == 0)
if (size == 0 || isImmutable())
return nullptr;
Range r(offset, size);
@@ -229,7 +229,7 @@ void Buffer::unmap(size_t usedoffset, size_t usedsize)
void Buffer::fill(size_t offset, size_t size, const void *data)
{
if (size == 0)
if (size == 0 || isImmutable())
return;
size_t buffersize = getSize();