SilverTiger / lwjgl3-tutorial

Tutorial for the Lightweight Java Game Library (LWJGL) 3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug in Renderer.drawTextureRegion() with vertices size

TheChocolateOre opened this issue · comments

In line 352 you check if the space in vertices buffer is not enought and if so you flush it.

if (vertices.remaining() < 7 * 6) {
    /* We need more space in the buffer, so flush it */
    flush();
}

But, the threshold is 7 * 6. Shouldn't it be 8 * 6 or vertices.remaining() <= 7 * 6?

You're right... I overlooked it when adding the alpha color support. Thanks!