Skip to content

Commit

Permalink
Fix stale buffers being referenced by a SpriteBatch after resizing.
Browse files Browse the repository at this point in the history
Fixes #2117.
  • Loading branch information
slime73 committed Nov 10, 2024
1 parent 43a295a commit 383fec4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/modules/graphics/SpriteBatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ void SpriteBatch::setBufferSize(int newsize)

size = newsize;
next = new_next;

attributesID.invalidate();
}

int SpriteBatch::getBufferSize() const
Expand Down Expand Up @@ -293,8 +295,7 @@ void SpriteBatch::attachAttribute(const std::string &name, Buffer *buffer, Mesh

attached_attributes[name] = newattrib;

// Invalidate attributes ID.
attributesID = VertexAttributesID();
attributesID.invalidate();
}

void SpriteBatch::setDrawRange(int start, int count)
Expand Down

0 comments on commit 383fec4

Please sign in to comment.